/* ============================================================
   Auth Modal
   ============================================================ */

/* Full-screen fixed wrapper — IS the backdrop; click outside card closes modal */
.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(20, 16, 8, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
}
.auth-modal[hidden] { display: none; }

/* Card — white, stops click propagation to backdrop */
.auth-modal-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: #FFFFFF;
  border: 1px solid rgba(200, 169, 110, 0.18);
  border-radius: 16px;
  padding: 34px 36px 36px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  animation: modal-in 220ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
  cursor: default;
}
@keyframes modal-in {
  from { opacity: 0; transform: translateY(10px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Close × */
.auth-modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: none;
  border: none;
  color: rgba(22, 27, 10, 0.25);
  font-size: 1.4rem;
  line-height: 1;
  padding: 5px 9px;
  border-radius: 6px;
  cursor: pointer;
  transition: color 180ms, background 180ms;
}
.auth-modal-close:hover {
  color: #161B0A;
  background: rgba(22, 27, 10, 0.06);
}

/* ── Tabs ────────────────────────────────────────────────── */
.auth-modal-tabs {
  display: flex;
  border-bottom: 1px solid rgba(22, 27, 10, 0.1);
  margin-bottom: 24px;
}
.auth-tab-btn {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  padding: 0 2px 12px;
  margin-right: 22px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: rgba(22, 27, 10, 0.28);
  cursor: pointer;
  transition: color 180ms, border-color 180ms;
}
.auth-tab-btn:hover:not(.active) { color: rgba(22, 27, 10, 0.6); }
.auth-tab-btn.active {
  color: #161B0A;
  border-bottom-color: #C8A96E;
}
.auth-tab-panel[hidden] { display: none; }

/* ── Form ────────────────────────────────────────────────── */
.auth-modal .form-group {
  margin-bottom: 15px;
}

.auth-modal .form-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #4A5C2A;
  margin-bottom: 6px;
}

.auth-modal .forgot-link {
  display: block;
  margin-top: 5px;
  font-size: 0.74rem;
  color: rgba(22, 27, 10, 0.38);
  text-decoration: none;
  transition: color 180ms;
}
.auth-modal .forgot-link:hover { color: #4A5C2A; }

.auth-modal .form-input {
  width: 100%;
  padding: 10px 13px;
  background: #F7F4EE;
  border: 1px solid rgba(22, 27, 10, 0.12);
  border-radius: 6px;
  color: #161B0A;
  font-family: 'Outfit', sans-serif;
  font-size: 0.9rem;
  outline: none;
  box-sizing: border-box;
  transition: border-color 180ms, box-shadow 180ms;
}
.auth-modal .form-input::placeholder { color: rgba(22, 27, 10, 0.25); }
.auth-modal .form-input:focus {
  border-color: #C8A96E;
  box-shadow: 0 0 0 3px rgba(200, 169, 110, 0.15);
}
.auth-modal .form-input.is-error { border-color: #c0392b; }

/* Submit */
.auth-modal .btn-primary {
  width: 100%;
  justify-content: center;
  padding: 12px;
  margin-top: 6px;
  font-size: 0.95rem;
}
.auth-modal .btn-primary.is-loading {
  opacity: 0.6;
  pointer-events: none;
}

/* Alerts */
.auth-modal .alert {
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 0.84rem;
  margin-bottom: 16px;
  line-height: 1.55;
}
.auth-modal .alert-error {
  background: rgba(192, 57, 43, 0.08);
  border: 1px solid rgba(192, 57, 43, 0.25);
  color: #a93226;
}
.auth-modal .alert-success {
  background: rgba(74, 92, 42, 0.08);
  border: 1px solid rgba(74, 92, 42, 0.25);
  color: #4A5C2A;
}

/* Password strength */
.pw-strength {
  height: 3px;
  border-radius: 2px;
  background: rgba(22, 27, 10, 0.08);
  margin-top: 6px;
  overflow: hidden;
}
.pw-strength-bar {
  height: 100%;
  border-radius: 2px;
  width: 0;
  transition: width 250ms ease, background 250ms ease;
}

.auth-modal .form-hint {
  font-size: 0.72rem;
  color: rgba(22, 27, 10, 0.35);
  margin-top: 4px;
}

/* Footer switch-tab row */
.auth-modal-footer {
  text-align: center;
  margin-top: 18px;
  font-size: 0.82rem;
  color: rgba(22, 27, 10, 0.4);
}
.auth-modal-footer .link-btn {
  background: none;
  border: none;
  padding: 0;
  font-family: 'Outfit', sans-serif;
  font-size: inherit;
  font-weight: 600;
  color: #C8A96E;
  cursor: pointer;
  transition: color 180ms;
}
.auth-modal-footer .link-btn:hover { color: #4A5C2A; }

@media (max-width: 480px) {
  .auth-modal-card { padding: 26px 18px 28px; }
}
