/* ============================================
   AUTH MODAL
   ============================================ */
.auth-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 300;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.auth-backdrop.open {
  display: flex;
  align-items: center;
  justify-content: center;
}
.auth-backdrop.visible {
  opacity: 1;
}

.auth-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  margin: 20px;
  background: var(--parchment);
  border: 1px solid var(--stone);
  padding: 40px 36px 36px;
  transform: translateY(12px);
  opacity: 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.auth-backdrop.visible .auth-card {
  transform: translateY(0);
  opacity: 1;
}

.auth-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--taupe);
  transition: color 0.2s;
  font-size: 18px;
  line-height: 1;
}
.auth-close:hover {
  color: var(--walnut);
}

.auth-logo {
  display: block;
  height: 60px;
  width: auto;
  margin: 0 auto 28px;
}

/* Views */
.auth-view {
  display: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.auth-view.active {
  display: block;
}
.auth-view.visible {
  opacity: 1;
}

/* Form elements */
.auth-label {
  display: block;
  font-family: 'Spectral', Georgia, serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--taupe);
  margin-bottom: 6px;
}

.auth-input {
  display: block;
  width: 100%;
  border: 1px solid var(--stone);
  background: var(--parchment-deep);
  color: var(--ink);
  font-family: 'Spectral', Georgia, serif;
  font-size: 15px;
  padding: 10px 14px;
  margin-bottom: 18px;
  outline: none;
  transition: border-color 0.2s;
}
.auth-input:focus {
  border-color: var(--walnut);
}
.auth-input::placeholder {
  color: var(--taupe-light);
}

.auth-hint {
  display: block;
  font-family: 'Spectral', Georgia, serif;
  font-size: 12px;
  color: var(--taupe-light);
  margin-top: -14px;
  margin-bottom: 18px;
}

/* Primary button */
.auth-btn {
  display: block;
  width: 100%;
  font-family: 'Spectral', Georgia, serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 10px 16px;
  border: 1px solid var(--walnut);
  background: var(--walnut);
  color: var(--parchment);
  cursor: pointer;
  transition: all 0.25s;
  margin-top: 6px;
}
.auth-btn:hover {
  background: transparent;
  color: var(--walnut);
}
.auth-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.auth-btn:disabled:hover {
  background: var(--walnut);
  color: var(--parchment);
}

/* Links */
.auth-link {
  font-family: 'Spectral', Georgia, serif;
  font-size: 13px;
  color: var(--clay);
  text-decoration: none;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  transition: color 0.2s;
}
.auth-link:hover {
  color: var(--walnut);
}

.auth-forgot {
  display: block;
  text-align: right;
  margin-top: 10px;
}

/* Divider */
.auth-divider {
  display: flex;
  align-items: center;
  margin: 22px 0;
  gap: 14px;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--stone);
}
.auth-divider span {
  font-family: 'Spectral', Georgia, serif;
  font-size: 12px;
  color: var(--taupe-light);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.auth-switch {
  text-align: center;
}

/* Messages */
.auth-error {
  color: #a01a1a;
  font-family: 'Spectral', Georgia, serif;
  font-size: 13px;
  margin-bottom: 14px;
  display: none;
}
.auth-error.show {
  display: block;
}

.auth-success {
  color: #2d6a2e;
  font-family: 'Spectral', Georgia, serif;
  font-size: 13px;
  margin-bottom: 14px;
  display: none;
}
.auth-success.show {
  display: block;
}

.auth-info {
  font-family: 'Spectral', Georgia, serif;
  font-size: 14px;
  color: var(--ink-soft);
  margin-bottom: 20px;
  line-height: 1.5;
}

/* Loading spinner */
.auth-btn.loading {
  position: relative;
  color: transparent !important;
}
.auth-btn.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border: 2px solid var(--parchment);
  border-top-color: transparent;
  border-radius: 50%;
  animation: auth-spin 0.6s linear infinite;
}
.auth-btn.loading:hover::after {
  border-color: var(--walnut);
  border-top-color: transparent;
}
@keyframes auth-spin {
  to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 480px) {
  .auth-card {
    padding: 32px 24px 28px;
    margin: 16px;
  }
  .auth-logo {
    height: 48px;
    margin-bottom: 22px;
  }
}
