/* =====================================================
   LOGIN MODAL — Slides down from top of viewport
   Color palette mirrors auth.css / Legal modal
   ===================================================== */

/* ── BACKDROP ────────────────────────────────── */

.login-drop-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.52);
  backdrop-filter: blur(3px);
  z-index: 2900;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.login-drop-backdrop.active {
  opacity: 1;
  pointer-events: all;
}

/* ── SLIDING WRAPPER (anchored to top-center) ─── */

.login-drop-wrap {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  margin: 0 auto;
  transform: translateY(calc(-100% - 24px));
  z-index: 2901;
  width: min(560px, 94vw);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    transform 0.48s cubic-bezier(0.22, 0.9, 0.26, 1),
    opacity 0.28s ease,
    visibility 0s linear 0.48s;
}
.login-drop-wrap.active {
  transform: none;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition:
    transform 0.48s cubic-bezier(0.22, 0.9, 0.26, 1),
    opacity 0.28s ease,
    visibility 0s linear 0s;
}

/* ── CARD ────────────────────────────────────── */

.login-drop {
  width: 100%;
  box-sizing: border-box;
  background: linear-gradient(160deg, #f2f2f2 0%, #f2f1e6 100%);
  border: 1px solid rgba(87, 115, 179, 0.2);
  border-top: none;
  border-radius: 0 0 20px 20px;
  box-shadow:
    0 20px 52px rgba(15, 23, 42, 0.28),
    0 4px 14px rgba(209, 40, 71, 0.1);
  padding: 28px 32px 32px;
  position: relative;
}

/* Tiny red top-bar accent */
.login-drop::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #d12847, #473954);
  border-radius: 0 0 2px 2px;
}

/* ── HEADER ROW ──────────────────────────────── */

.login-drop-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.login-drop-back {
  padding: 6px 12px;
  border: 1px solid rgba(87, 115, 179, 0.25);
  border-radius: 0;
  background: rgba(242, 242, 242, 0.9);
  color: #4a5568;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  font-family: inherit;
  line-height: 1;
  white-space: nowrap;
}
.login-drop-back:hover {
  border-color: #d12847;
  color: #d12847;
  background: rgba(209, 40, 71, 0.05);
}

.login-drop-brand {
  display: flex;
  align-items: center;
  gap: 8px;
}
.login-drop-brand-icon {
  font-size: 1.55rem;
  color: #d12847;
  line-height: 1;
  filter: drop-shadow(0 2px 5px rgba(209, 40, 71, 0.3));
}
.login-drop-brand-name {
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: #473954;
}

/* Distinct styling for the historic year 1475 */
.login-drop-brand-name .login-drop-year {
  font-family: 'Georgia', 'Times New Roman', serif;
  font-weight: 700;
  font-style: italic;
  background: linear-gradient(135deg, #d4af37 0%, #f0e68c 50%, #d4af37 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 0.02em;
}

.login-drop-close {
  width: 30px;
  height: 30px;
  border: 1px solid rgba(87, 115, 179, 0.25);
  border-radius: 999px;
  background: rgba(242, 242, 242, 0.9);
  color: #4a5568;
  font-size: 0.88rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s, color 0.15s;
  font-family: inherit;
  line-height: 1;
  padding: 0;
}
.login-drop-close:hover {
  border-color: #d12847;
  color: #d12847;
}

/* ── HEADING ─────────────────────────────────── */

.login-drop-heading {
  margin: 0 0 18px;
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: #d12847;
  line-height: 1.1;
  text-shadow: 0 2px 10px rgba(209, 40, 71, 0.1);
}

/* ── FORM ────────────────────────────────────── */

.login-drop-form {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.login-drop-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.login-drop-label {
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #473954;
}

.login-drop-password-requirements {
  display: inline;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.3;
  text-transform: none;
}

.login-drop-password-token {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #6b7280;
  transition: color 0.18s ease;
}

.login-drop-password-token-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(107, 114, 128, 0.45);
  box-shadow: inset 0 0 0 1px rgba(71, 57, 84, 0.12);
  transition: background-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.login-drop-password-token.is-met {
  color: #166534;
}

.login-drop-password-token.is-met .login-drop-password-token-dot {
  background: #22c55e;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.18);
  transform: scale(1.05);
}

.login-drop-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.login-drop-input {
  width: 100%;
  padding: 10px 13px;
  border: 1.5px solid rgba(87, 115, 179, 0.32);
  border-radius: 10px;
  background: #ffffff;
  color: #4a5568;
  font-size: 0.93rem;
  font-weight: 500;
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
  font-family: inherit;
  -webkit-appearance: none;
}
.login-drop-input:focus {
  border-color: #d12847;
  box-shadow: 0 0 0 3px rgba(209, 40, 71, 0.1);
}
.login-drop-input::placeholder { opacity: 0.38; }
.login-drop-input-wrap .login-drop-input { padding-right: 40px; }

.login-drop-eye {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  opacity: 0.38;
  padding: 4px;
  line-height: 1;
  transition: opacity 0.15s;
  font-family: inherit;
}
.login-drop-eye:hover { opacity: 0.7; }

/* ── FORGOT ROW ──────────────────────────────── */

.login-drop-forgot-row {
  display: flex;
  justify-content: flex-end;
  margin-top: -5px;
}
.login-drop-forgot {
  font-size: 0.8rem;
  color: #0077cc;
  font-weight: 700;
  text-decoration: none;
  text-underline-offset: 2px;
}
.login-drop-forgot:hover { color: #d12847; text-decoration: underline; }

.login-drop-recovery-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 2px;
  padding: 12px;
  border: 1px solid rgba(87, 115, 179, 0.2);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.6);
}

.login-drop-recovery-panel.hidden {
  display: none;
}

.login-drop-recovery-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.login-drop-recovery-caption {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #473954;
}

.login-drop-recovery-policy {
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.45;
  color: rgba(71, 57, 84, 0.88);
  font-weight: 700;
}

.login-drop-recovery-question {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.45;
  color: #4a5568;
  font-weight: 700;
}

.login-drop-recovery-close {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid rgba(87, 115, 179, 0.25);
  background: rgba(255, 255, 255, 0.8);
  color: #4a5568;
  font-size: 0.9rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.login-drop-recovery-close:hover {
  border-color: rgba(209, 40, 71, 0.45);
  color: #d12847;
}

.login-drop-recovery-step.hidden {
  display: none;
}

.login-drop-recovery-submit {
  margin-top: 0;
}

/* ── ERROR ───────────────────────────────────── */

.login-drop-error {
  font-size: 0.8rem;
  color: #d12847;
  font-weight: 700;
  min-height: 0;
}
.login-drop-error:not(:empty) { min-height: 16px; }

.login-drop-error.is-success {
  color: #16a34a;
}

.login-drop-status-secondary {
  font-size: 0.78rem;
  color: #475569;
  font-weight: 700;
  min-height: 0;
}

.login-drop-status-secondary:not(:empty) {
  min-height: 16px;
}

/* ── SUBMIT BUTTON ───────────────────────────── */

.login-drop-submit {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 10px;
  background: #d12847;
  color: #ffffff;
  font-size: 0.97rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.18s, transform 0.12s, box-shadow 0.18s;
  box-shadow: 0 4px 16px rgba(209, 40, 71, 0.3);
  margin-top: 10px;
  font-family: inherit;
  -webkit-appearance: none;
}
.login-drop-submit:hover {
  background: #b81e3b;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(209, 40, 71, 0.38);
}
.login-drop-submit:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(209, 40, 71, 0.18);
}

/* ── FOOTER LINK ─────────────────────────────── */

.login-drop-footer {
  margin: 16px 0 0;
  text-align: center;
  font-size: 0.84rem;
  color: #4a5568;
}
.login-drop-signup-link {
  color: #0077cc;
  font-weight: 700;
  text-decoration: none;
}
.login-drop-signup-link:hover { color: #d12847; text-decoration: underline; }

/* ── DARK MODE — keep light palette like other modals ─ */

body[data-mode="dark"] .login-drop {
  background: linear-gradient(160deg, #f2f2f2 0%, #f2f1e6 100%);
  border-color: rgba(87, 115, 179, 0.2);
}
body[data-mode="dark"] .login-drop-close {
  background: rgba(242, 242, 242, 0.9);
  border-color: rgba(87, 115, 179, 0.25);
  color: #4a5568;
}
body[data-mode="dark"] .login-drop-input {
  background: #ffffff;
  color: #4a5568;
}

/* ── AUTH OVERLAY (SPA SIGNUP/LOGIN) ───────────────────── */

.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 13050;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s ease;
}

.auth-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.auth-overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.58);
  backdrop-filter: blur(4px);
}

.auth-overlay-shell {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(1080px, calc(100vw - 64px));
  height: min(760px, calc(100vh - 64px));
  transform: translate(-50%, -50%);
  background: #0f172a;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.38);
}

.auth-overlay-shell.is-loading {
  background:
    radial-gradient(circle at 18% 24%, rgba(148, 163, 184, 0.18) 0%, rgba(15, 23, 42, 0) 48%),
    linear-gradient(160deg, #0f172a 0%, #1e293b 52%, #0b1220 100%);
}

.auth-overlay-close {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 3;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(87, 115, 179, 0.25);
  border-radius: 999px;
  background: rgba(242, 242, 242, 0.95);
  color: #4a5568;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.18);
}

.auth-overlay-close:hover {
  border-color: #d12847;
  color: #d12847;
}

.auth-overlay-frame {
  width: 100%;
  height: 100%;
  border: none;
  display: none;
  background: transparent;
  opacity: 0;
  visibility: hidden;
  transition: opacity 180ms ease;
}

.auth-overlay-frame.active {
  display: block;
}

.auth-overlay-frame.active.is-ready {
  opacity: 1;
  visibility: visible;
}

body.auth-overlay-open {
  overflow: hidden;
}

@media (max-width: 720px) {
  .auth-overlay-shell {
    width: calc(100vw - 24px);
    height: calc(100vh - 24px);
  }

  .auth-overlay-close {
    top: 14px;
    right: 14px;
  }
}
