/* ================================================================
   FleetTrack Pro / GPSFleetTracker Pro — Auth Pages CSS
   Location: /assets/css/login.css
   ================================================================
   PHASE 2.5 — Split-column glass redesign with slide-out modal.

   Layout (desktop ≥ 900px):
     • Left column   — 40vw, white glass surface, login form + logo.
     • Right column  — 60vw, ocean bg image + dark overlay + clock +
                        floating bubbles + announcement banner.
     • Slide-out     — anchored to form-column's right edge, slides
                        rightward to ~55vw width, covering most of
                        the showcase. Used for recover & register.

   Layout (mobile < 900px):
     • Single column, centered card, no bg images, no bubbles, no
       slide-out. Card-swap fade between login/register/recover.
     • Clock removed entirely (OS status bar already shows it).

   Class-name contracts preserved from earlier phases:
     .btn-login .spinner .btn-text .ft-alert .toggle-password
     .ft-input .input-group-icon .form-label .login-card
     .login-options .ft-check .forgot-link
   ================================================================ */

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* ── Tokens ─────────────────────────────────────────────────────── */
:root {
  --ft-primary: #1a73e8;
  --ft-primary-dark: #1557b0;
  --ft-accent: #00c9a7;

  --auth-text: #0f1c2e;
  --auth-text-muted: #5b6478;
  --auth-text-soft: #8c93a3;

  --auth-surface: #ffffff;
  --auth-surface-alt: #f5f8fc;
  --auth-border: rgba(15, 28, 46, 0.1);
  --auth-input-bg: #f5f8fc;
  --auth-input-bg-foc: #ffffff;
  --auth-input-border: rgba(15, 28, 46, 0.14);

  --auth-overlay: linear-gradient(
    180deg,
    rgba(15, 28, 46, 0.5) 0%,
    rgba(15, 28, 46, 0.28) 45%,
    rgba(15, 28, 46, 0.6) 100%
  );

  --auth-clock-color: rgba(255, 255, 255, 0.98);
  --auth-clock-shadow: 0 2px 18px rgba(0, 0, 0, 0.55);

  --auth-radius: 16px;
  --auth-radius-sm: 10px;
  --auth-radius-pill: 999px;

  --auth-font: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --auth-font-mono: "SF Mono", "JetBrains Mono", "Menlo", monospace;

  --auth-shadow-lg:
    0 24px 60px rgba(15, 28, 46, 0.18), 0 4px 16px rgba(15, 28, 46, 0.08);
  --auth-shadow-md: 0 8px 24px rgba(15, 28, 46, 0.1);

  /* Banner type tints */
  --auth-tint-info: #1a73e8;
  --auth-tint-warn: #d97706;
  --auth-tint-ok: #16a34a;
  --auth-tint-up: #7c3aed;
  --auth-tint-danger: #dc2626;

  /* Layout */
  --col-form-width: 40vw;
  --modal-width: 55vw;
  --modal-anim: cubic-bezier(0.22, 1, 0.36, 1);
}

html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body.auth-page {
  font-family: var(--auth-font);
  color: var(--auth-text);
  background: linear-gradient(135deg, #4a90e2 0%, #87ceeb 60%, #fef3c7 100%);
  min-height: 100vh;
  overflow: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Page shell — split layout ─────────────────────────────────── */
.auth-shell {
  display: flex;
  min-height: 100vh;
  width: 100%;
  position: relative;
}

/* ── LEFT COLUMN — form side ────────────────────────────────────── */
.auth-form-col {
  width: var(--col-form-width);
  min-width: 380px;
  background: var(--auth-surface);
  box-shadow: 4px 0 28px rgba(15, 28, 46, 0.12);
  display: flex;
  flex-direction: column;
  padding: 2rem 2rem 1.5rem;
  position: relative;
  z-index: 3;
  overflow-y: auto;
  transition: filter 0.35s var(--modal-anim);
}

.auth-shell.modal-open .auth-form-col {
  filter: blur(6px) brightness(0.95);
  pointer-events: none;
  user-select: none;
}

/* Subtle right-edge gradient seam (visible at all times, becomes
   the modal's anchor edge when slide-out is open) */
.auth-form-col::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(
    180deg,
    rgba(15, 28, 46, 0) 0%,
    rgba(15, 28, 46, 0.12) 18%,
    rgba(15, 28, 46, 0.12) 82%,
    rgba(15, 28, 46, 0) 100%
  );
  pointer-events: none;
}

/* ── Brand mark (top of form column) ────────────────────────────── */
.auth-brand {
  display: inline-flex;
  align-items: center;
  align-self: center; /* match card-body horizontal centering */
  width: 100%;
  max-width: 460px;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--auth-text);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.2px;
  margin-bottom: 1.6rem;
  transition: opacity 0.2s;
}

.auth-brand:hover {
  opacity: 0.8;
  color: var(--auth-text);
}

.auth-brand img {
  max-height: 36px;
  max-width: 140px;
  object-fit: contain;
}

.auth-brand .logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--ft-primary), var(--ft-accent));
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  color: #fff;
  box-shadow: 0 6px 16px rgba(26, 115, 232, 0.3);
}

/* ── Form card body ─────────────────────────────────────────────── */
.auth-card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-self: center; /* horizontally center within form column */
  max-width: 460px;
  width: 100%;
}

.auth-heading {
  margin: 0 0 0.4rem;
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--auth-text);
}

.auth-subheading {
  margin: 0 0 1.6rem;
  font-size: 0.9rem;
  color: var(--auth-text-muted);
  line-height: 1.5;
}

/* ── Form ───────────────────────────────────────────────────────── */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.form-label {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--auth-text-muted);
  margin-bottom: 0.35rem;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  display: block;
}

.input-group-icon {
  position: relative;
}

/* When the input-group has a toggle-password sibling button, reserve
   right padding so typed text never runs under the eye icon. Uses :has()
   which is supported in all current browsers. The !important matches
   .ft-input's own !important on padding so this rule actually wins. */
.input-group-icon:has(.toggle-password) .ft-input {
  padding-right: 2.8rem !important;
}

.input-group-icon .bi {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--auth-text-soft);
  font-size: 0.95rem;
  z-index: 2;
  pointer-events: none;
  transition: color 0.2s;
}

.input-group-icon:focus-within .bi {
  color: var(--ft-primary);
}

.ft-input {
  width: 100%;
  background: var(--auth-input-bg) !important;
  border: 1px solid var(--auth-input-border) !important;
  border-radius: var(--auth-radius-sm) !important;
  color: var(--auth-text) !important;
  padding: 0.85rem 1rem 0.85rem 2.6rem !important;
  font-size: 0.92rem;
  font-family: inherit;
  transition:
    border-color 0.2s,
    box-shadow 0.2s,
    background 0.2s;
}

.ft-input::placeholder {
  color: var(--auth-text-soft);
}
.ft-input:hover {
  background: var(--auth-input-bg-foc) !important;
}
.ft-input:focus {
  outline: none !important;
  border-color: var(--ft-primary) !important;
  background: var(--auth-input-bg-foc) !important;
  box-shadow: 0 0 0 4px rgba(26, 115, 232, 0.12) !important;
}

.toggle-password {
  position: absolute;
  right: 0.55rem;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--auth-text-soft);
  cursor: pointer;
  padding: 0;
  font-size: 1rem;
  line-height: 1;
  z-index: 2;
  transition:
    color 0.2s,
    background 0.2s;
  border-radius: 6px;
}

.toggle-password:hover {
  color: var(--ft-primary);
  background: rgba(15, 28, 46, 0.04);
}

.toggle-password:focus-visible {
  outline: 2px solid var(--ft-primary);
  outline-offset: 1px;
}

/* ── Remember + Forgot row ──────────────────────────────────────── */
.login-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0.15rem 0 0.25rem;
}

.ft-check {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  color: var(--auth-text-muted);
  cursor: pointer;
  user-select: none;
}

.ft-check input[type="checkbox"] {
  accent-color: var(--ft-primary);
  width: 15px;
  height: 15px;
  cursor: pointer;
}

.forgot-link {
  font-size: 0.82rem;
  color: var(--ft-primary);
  text-decoration: none;
  font-weight: 600;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
}

.forgot-link:hover {
  color: var(--ft-primary-dark);
  text-decoration: underline;
}

/* ── Primary button ─────────────────────────────────────────────── */
.btn-login {
  width: 100%;
  background: linear-gradient(
    135deg,
    var(--ft-primary),
    var(--ft-primary-dark)
  );
  color: #fff;
  border: none;
  border-radius: var(--auth-radius-sm);
  padding: 0.92rem 1rem;
  font-size: 0.94rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition:
    transform 0.15s,
    box-shadow 0.2s,
    filter 0.2s;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 22px rgba(26, 115, 232, 0.28);
  margin-top: 0.5rem;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
}

.btn-login:hover {
  filter: brightness(1.06);
  box-shadow: 0 12px 28px rgba(26, 115, 232, 0.38);
}
.btn-login:active {
  transform: scale(0.99);
}
.btn-login:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-login .spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.btn-login.loading .spinner {
  display: inline-block;
}
.btn-login.loading .btn-text {
  opacity: 0.75;
}

/* ── Inline alert ───────────────────────────────────────────────── */
.ft-alert {
  padding: 0.7rem 0.9rem;
  border-radius: var(--auth-radius-sm);
  font-size: 0.82rem;
  margin-bottom: 0.6rem;
  display: none;
  align-items: flex-start;
  gap: 0.55rem;
  line-height: 1.45;
}

.ft-alert.error {
  background: rgba(220, 53, 69, 0.08);
  border: 1px solid rgba(220, 53, 69, 0.25);
  color: #b3142d;
}
.ft-alert.success {
  background: rgba(22, 163, 74, 0.08);
  border: 1px solid rgba(22, 163, 74, 0.25);
  color: #15803d;
}
.ft-alert .bi {
  flex-shrink: 0;
  margin-top: 0.1rem;
}
.ft-alert.show {
  display: flex;
}

/* ── Divider + CTA below form ───────────────────────────────────── */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.4rem 0 1rem;
  color: var(--auth-text-soft);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 1.3px;
  font-weight: 600;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--auth-input-border);
}

.auth-cta {
  text-align: center;
  margin: 0;
  font-size: 0.85rem;
  color: var(--auth-text-muted);
}

.auth-cta button,
.auth-cta a {
  background: none;
  border: none;
  padding: 0;
  color: var(--ft-primary);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  margin-left: 0.25rem;
  font-family: inherit;
  font-size: inherit;
}

.auth-cta button:hover,
.auth-cta a:hover {
  text-decoration: underline;
  color: var(--ft-primary-dark);
}

/* ── Footer ─────────────────────────────────────────────────────── */
.auth-footer {
  margin-top: auto;
  padding-top: 1.5rem;
  text-align: center;
  font-size: 0.72rem;
  color: var(--auth-text-soft);
  line-height: 1.6;
  align-self: center; /* match card-body horizontal centering */
  max-width: 460px;
  width: 100%;
}

.auth-footer a {
  color: var(--ft-primary);
  text-decoration: none;
}
.auth-footer a:hover {
  text-decoration: underline;
}

/* ════════════════════════════════════════════════════════════════
   RIGHT COLUMN — showcase
   ═══════════════════════════════════════════════════════════════ */
.auth-showcase {
  flex: 1;
  position: relative;
  overflow: hidden;
  color: #fff;
  display: flex;
  flex-direction: column;
}

.auth-showcase-bg {
  position: absolute;
  inset: 0;
  background-image: var(--auth-bg-image, none);
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  z-index: 1;
  will-change: transform;
  animation: authBgDrift 90s ease-in-out infinite alternate;
}

@keyframes authBgDrift {
  from {
    transform: scale(1) translate(0, 0);
  }
  to {
    transform: scale(1.06) translate(-1.5%, -1%);
  }
}

.auth-showcase-overlay {
  position: absolute;
  inset: 0;
  background: var(--auth-overlay);
  z-index: 2;
  pointer-events: none;
}

/* ── Bubbles (pure CSS, GPU-accelerated transforms) ─────────────── */
.auth-bubbles {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  overflow: hidden;
}

.auth-bubbles span {
  position: absolute;
  bottom: -120px;
  border-radius: 50%;
  background: radial-gradient(
    circle at 30% 30%,
    rgba(255, 255, 255, 0.55),
    rgba(255, 255, 255, 0.12) 55%,
    rgba(255, 255, 255, 0) 80%
  );
  border: 1px solid rgba(255, 255, 255, 0.2);
  animation: bubbleRise linear infinite;
  will-change: transform, opacity;
}

@keyframes bubbleRise {
  0% {
    transform: translate(0, 0) scale(0.8);
    opacity: 0;
  }
  8% {
    opacity: 0.85;
  }
  50% {
    transform: translate(40px, -55vh) scale(1);
  }
  92% {
    opacity: 0.5;
  }
  100% {
    transform: translate(-30px, -110vh) scale(1.1);
    opacity: 0;
  }
}

/* 12 bubbles, varied size/position/duration/delay */
.auth-bubbles span:nth-child(1) {
  left: 8%;
  width: 26px;
  height: 26px;
  animation-duration: 18s;
  animation-delay: 0s;
}
.auth-bubbles span:nth-child(2) {
  left: 18%;
  width: 14px;
  height: 14px;
  animation-duration: 14s;
  animation-delay: -3s;
}
.auth-bubbles span:nth-child(3) {
  left: 28%;
  width: 38px;
  height: 38px;
  animation-duration: 22s;
  animation-delay: -7s;
}
.auth-bubbles span:nth-child(4) {
  left: 38%;
  width: 18px;
  height: 18px;
  animation-duration: 16s;
  animation-delay: -1s;
}
.auth-bubbles span:nth-child(5) {
  left: 48%;
  width: 30px;
  height: 30px;
  animation-duration: 20s;
  animation-delay: -11s;
}
.auth-bubbles span:nth-child(6) {
  left: 56%;
  width: 12px;
  height: 12px;
  animation-duration: 13s;
  animation-delay: -5s;
}
.auth-bubbles span:nth-child(7) {
  left: 64%;
  width: 32px;
  height: 32px;
  animation-duration: 24s;
  animation-delay: -9s;
}
.auth-bubbles span:nth-child(8) {
  left: 72%;
  width: 16px;
  height: 16px;
  animation-duration: 17s;
  animation-delay: -2s;
}
.auth-bubbles span:nth-child(9) {
  left: 80%;
  width: 24px;
  height: 24px;
  animation-duration: 19s;
  animation-delay: -13s;
}
.auth-bubbles span:nth-child(10) {
  left: 86%;
  width: 20px;
  height: 20px;
  animation-duration: 15s;
  animation-delay: -6s;
}
.auth-bubbles span:nth-child(11) {
  left: 94%;
  width: 28px;
  height: 28px;
  animation-duration: 21s;
  animation-delay: -10s;
}
.auth-bubbles span:nth-child(12) {
  left: 13%;
  width: 22px;
  height: 22px;
  animation-duration: 23s;
  animation-delay: -14s;
}

/* ── Showcase top-right: clock ──────────────────────────────────── */
.auth-clock {
  position: absolute;
  top: 1.6rem;
  right: 2rem;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.05;
  color: var(--auth-clock-color);
  text-shadow: var(--auth-clock-shadow);
}

.auth-clock-time {
  font-family: var(--auth-font-mono);
  font-size: 2.1rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  font-variant-numeric: tabular-nums;
}

.auth-clock-date {
  font-size: 0.85rem;
  font-weight: 500;
  margin-top: 0.2rem;
  opacity: 0.92;
  letter-spacing: 0.25px;
}

/* ── Showcase bottom: marketing tagline ─────────────────────────── */
.auth-showcase-tagline {
  position: absolute;
  bottom: 2.5rem;
  left: 2.5rem;
  right: 2.5rem;
  z-index: 5;
  color: #fff;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.55);
  pointer-events: none;
}

.auth-showcase-tagline h2 {
  font-size: 2.1rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  letter-spacing: -0.6px;
  line-height: 1.15;
}

.auth-showcase-tagline p {
  font-size: 1rem;
  margin: 0;
  opacity: 0.92;
  max-width: 540px;
  line-height: 1.5;
}

/* ── Announcement banner (top of showcase) ──────────────────────── */
.auth-announce {
  position: absolute;
  top: 1.6rem;
  left: 2rem;
  right: 14rem; /* leave room for the clock on the right */
  z-index: 6;
  max-width: 540px;
  overflow: hidden;
  max-height: 0;
  transition:
    max-height 0.35s ease,
    opacity 0.25s ease;
  opacity: 0;
}

.auth-announce[data-active="true"] {
  max-height: 200px;
  opacity: 1;
}

.auth-announce-inner {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 0.8rem 1rem;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px) saturate(160%);
  -webkit-backdrop-filter: blur(10px) saturate(160%);
  border-left: 4px solid var(--auth-tint-info);
  border-radius: var(--auth-radius-sm);
  color: var(--auth-text);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.25);
}

.auth-announce[data-type="warning"] .auth-announce-inner {
  border-left-color: var(--auth-tint-warn);
}
.auth-announce[data-type="success"] .auth-announce-inner {
  border-left-color: var(--auth-tint-ok);
}
.auth-announce[data-type="upgrade"] .auth-announce-inner {
  border-left-color: var(--auth-tint-up);
}
.auth-announce[data-type="danger"] .auth-announce-inner {
  border-left-color: var(--auth-tint-danger);
}

.auth-announce-inner > .bi {
  font-size: 1.1rem;
  margin-top: 0.1rem;
  color: var(--auth-tint-info);
  flex-shrink: 0;
}
.auth-announce[data-type="warning"] .auth-announce-inner > .bi {
  color: var(--auth-tint-warn);
}
.auth-announce[data-type="success"] .auth-announce-inner > .bi {
  color: var(--auth-tint-ok);
}
.auth-announce[data-type="upgrade"] .auth-announce-inner > .bi {
  color: var(--auth-tint-up);
}
.auth-announce[data-type="danger"] .auth-announce-inner > .bi {
  color: var(--auth-tint-danger);
}

.auth-announce-content {
  flex: 1;
  font-size: 0.82rem;
  line-height: 1.45;
  min-width: 0;
}
.auth-announce-content strong {
  display: block;
  font-weight: 700;
  font-size: 0.87rem;
  margin-bottom: 0.12rem;
}

.auth-announce-dismiss {
  background: transparent;
  border: none;
  color: var(--auth-text-muted);
  padding: 0.25rem 0.4rem;
  cursor: pointer;
  border-radius: var(--auth-radius-sm);
  font-size: 0.85rem;
  transition:
    background 0.2s,
    color 0.2s;
  flex-shrink: 0;
}

.auth-announce-dismiss:hover {
  background: rgba(15, 28, 46, 0.07);
  color: var(--auth-text);
}

/* ════════════════════════════════════════════════════════════════
   SLIDE-OUT MODAL PANEL (recover & register)
   Anchored to form-column right edge, slides rightward.
   ═══════════════════════════════════════════════════════════════ */
.auth-modal {
  position: fixed;
  top: 0;
  left: var(--col-form-width); /* anchored to form-col right edge */
  height: 100vh;
  width: var(--modal-width);
  background: var(--auth-surface);
  box-shadow:
    -8px 0 60px rgba(15, 28, 46, 0.35),
    inset 1px 0 0 rgba(15, 28, 46, 0.04);
  /* Hidden state — shift modal left by its own width PLUS the form-column
       offset so its right edge lands exactly at viewport x=0 (fully hidden).
       translateX(-105%) alone leaves the modal's right portion on top of the
       form column, which causes the closed modal to bleed over the login. */
  transform: translateX(calc(-100% - var(--col-form-width)));
  visibility: hidden;
  transition:
    transform 0.45s var(--modal-anim),
    visibility 0s linear 0.45s;
  z-index: 50;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  /* Subtle vertical gradient seam at left edge */
  border-left: 0;
}

.auth-modal::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 6px;
  background: linear-gradient(
    180deg,
    rgba(15, 28, 46, 0) 0%,
    rgba(15, 28, 46, 0.08) 30%,
    rgba(15, 28, 46, 0.14) 50%,
    rgba(15, 28, 46, 0.08) 70%,
    rgba(15, 28, 46, 0) 100%
  );
  pointer-events: none;
}

.auth-modal[data-open="true"] {
  transform: translateX(0);
  visibility: visible;
  transition:
    transform 0.45s var(--modal-anim),
    visibility 0s linear 0s;
}

.auth-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.4rem 2rem 0;
  flex-shrink: 0;
}

.auth-modal-back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: none;
  border: 1px solid var(--auth-border);
  border-radius: var(--auth-radius-pill);
  padding: 0.45rem 0.9rem;
  font-size: 0.8rem;
  color: var(--auth-text-muted);
  cursor: pointer;
  font-family: inherit;
  font-weight: 500;
  transition: all 0.2s;
}

.auth-modal-back:hover {
  background: var(--auth-input-bg);
  color: var(--auth-text);
  border-color: var(--auth-input-border);
}

.auth-modal-close {
  background: none;
  border: none;
  color: var(--auth-text-muted);
  cursor: pointer;
  padding: 0.55rem;
  border-radius: 50%;
  font-size: 1.05rem;
  transition:
    background 0.2s,
    color 0.2s;
  line-height: 1;
}

.auth-modal-close:hover {
  background: var(--auth-input-bg);
  color: var(--auth-text);
}

.auth-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem 2rem 2.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.auth-modal-card {
  width: 100%;
  max-width: 480px;
  margin: auto 0;
}

.auth-modal-card .auth-heading {
  font-size: 1.85rem;
}
.auth-modal-card .auth-subheading {
  font-size: 0.92rem;
  margin-bottom: 1.8rem;
}

/* OTP-input grid (used by recover form Step 2) */
.otp-grid {
  display: flex;
  gap: 0.55rem;
  justify-content: center;
  margin: 0.25rem 0 1.2rem;
}

.otp-grid input {
  width: 48px;
  height: 56px;
  text-align: center;
  font-size: 1.4rem;
  font-weight: 700;
  font-family: var(--auth-font-mono);
  background: var(--auth-input-bg);
  border: 1px solid var(--auth-input-border);
  border-radius: var(--auth-radius-sm);
  color: var(--auth-text);
  transition:
    border-color 0.2s,
    box-shadow 0.2s,
    background 0.2s;
}

.otp-grid input:focus {
  outline: none;
  background: var(--auth-input-bg-foc);
  border-color: var(--ft-primary);
  box-shadow: 0 0 0 4px rgba(26, 115, 232, 0.12);
}

/* OTP step toggle — Step 1 visible, Step 2 hidden by default */
.recover-step {
  display: none;
}
.recover-step.active {
  display: block;
}

/* Resend OTP cooldown */
.otp-resend {
  text-align: center;
  margin-top: 1rem;
  font-size: 0.82rem;
  color: var(--auth-text-muted);
}

.otp-resend button {
  background: none;
  border: none;
  color: var(--ft-primary);
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
  font-size: inherit;
}

.otp-resend button:disabled {
  color: var(--auth-text-soft);
  cursor: not-allowed;
}
.otp-resend button:hover:not(:disabled) {
  text-decoration: underline;
}

/* Password strength bar (register form) */
.pwd-strength {
  margin-top: 0.35rem;
  height: 4px;
  border-radius: 2px;
  background: var(--auth-input-border);
  overflow: hidden;
  position: relative;
}

.pwd-strength-bar {
  height: 100%;
  width: 0%;
  background: var(--auth-tint-warn);
  transition:
    width 0.25s,
    background 0.25s;
}

.pwd-strength-bar[data-level="1"] {
  width: 25%;
  background: #ef4444;
}
.pwd-strength-bar[data-level="2"] {
  width: 50%;
  background: var(--auth-tint-warn);
}
.pwd-strength-bar[data-level="3"] {
  width: 75%;
  background: #facc15;
}
.pwd-strength-bar[data-level="4"] {
  width: 100%;
  background: var(--auth-tint-ok);
}

.pwd-strength-label {
  margin-top: 0.3rem;
  font-size: 0.72rem;
  color: var(--auth-text-muted);
  height: 1rem;
}

/* ════════════════════════════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════════════════════════ */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes authCardEnter {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-card-body {
  animation: authCardEnter 0.45s ease both;
}

/* ════════════════════════════════════════════════════════════════
   MOBILE — single-column, no bg images, no bubbles, no slide-out
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  body.auth-page {
    background: linear-gradient(135deg, #e0f2fe 0%, #f5f3ff 60%, #fef3c7 100%);
    overflow-y: auto;
  }

  .auth-shell {
    flex-direction: column;
    min-height: 100vh;
  }

  /* Showcase: hide entirely on mobile */
  .auth-showcase {
    display: none !important;
  }

  /* Form column: full width, transparent, centered */
  .auth-form-col {
    width: 100%;
    min-width: 0;
    background: transparent;
    box-shadow: none;
    padding: 1.5rem 1.2rem 2rem;
    align-items: center;
  }

  .auth-form-col::after {
    display: none;
  }

  .auth-shell.modal-open .auth-form-col {
    filter: none;
    pointer-events: auto;
  }

  /* Wrap the form in an actual card on mobile */
  .auth-card-body {
    background: var(--auth-surface);
    border-radius: var(--auth-radius);
    box-shadow: var(--auth-shadow-lg);
    padding: 1.8rem 1.4rem;
    max-width: 460px;
    width: 100%;
    margin: 0 auto;
  }

  .auth-brand {
    margin: 0.4rem auto 1.2rem;
    justify-content: center;
    width: 100%;
    max-width: 460px;
  }

  .auth-heading {
    font-size: 1.4rem;
  }
  .auth-subheading {
    font-size: 0.87rem;
    margin-bottom: 1.2rem;
  }
  .ft-input {
    padding: 0.9rem 1rem 0.9rem 2.6rem !important;
    font-size: 16px; /* prevent iOS zoom */
  }
  .btn-login {
    padding: 0.95rem 1rem;
    font-size: 0.95rem;
  }

  /* Modal becomes a full card-swap, not a slide-out */
  .auth-modal {
    position: static;
    left: auto;
    width: 100%;
    max-width: 460px;
    height: auto;
    margin: 0 auto;
    background: transparent;
    box-shadow: none;
    transform: none !important;
    display: none;
    animation: none;
  }

  .auth-modal::before {
    display: none;
  }

  .auth-modal[data-open="true"] {
    display: flex;
    animation: authCardEnter 0.35s ease;
  }

  /* When modal is open on mobile, hide the underlying login card */
  .auth-shell.modal-open .auth-card-body {
    display: none;
  }
  .auth-shell.modal-open .auth-brand {
    display: none;
  }

  .auth-modal-header {
    padding: 0.4rem 0 0;
  }

  .auth-modal-body {
    padding: 1.2rem 0 0;
    overflow: visible;
  }

  .auth-modal-card {
    background: var(--auth-surface);
    border-radius: var(--auth-radius);
    box-shadow: var(--auth-shadow-lg);
    padding: 1.6rem 1.3rem;
    margin: 0;
  }

  .auth-modal-card .auth-heading {
    font-size: 1.4rem;
  }
  .auth-modal-card .auth-subheading {
    font-size: 0.87rem;
  }

  /* Footer floats below card with light text */
  .auth-footer {
    color: var(--auth-text-muted);
    max-width: 460px;
    margin-left: auto;
    margin-right: auto;
  }

  .otp-grid input {
    width: 42px;
    height: 50px;
    font-size: 1.2rem;
  }
}

@media (max-width: 380px) {
  .auth-card-body,
  .auth-modal-card {
    padding: 1.4rem 1.1rem;
  }
  .auth-heading {
    font-size: 1.25rem;
  }
  .otp-grid input {
    width: 38px;
    height: 46px;
    font-size: 1.05rem;
    gap: 0.35rem;
  }
}

/* ════════════════════════════════════════════════════════════════
   TOAST — top-right dismissible notifications (login.js)
   ═══════════════════════════════════════════════════════════════ */
#authToastRoot {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  pointer-events: none;
  max-width: calc(100vw - 2rem);
  width: 380px;
}

.auth-toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.85rem 1rem;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border-radius: var(--auth-radius-sm);
  border-left: 4px solid var(--auth-tint-info);
  box-shadow:
    0 10px 32px rgba(15, 28, 46, 0.25),
    0 2px 8px rgba(15, 28, 46, 0.12);
  color: var(--auth-text);
  transform: translateX(120%);
  opacity: 0;
  transition:
    transform 0.3s var(--modal-anim),
    opacity 0.3s ease;
}

.auth-toast[data-show="true"] {
  transform: translateX(0);
  opacity: 1;
}

.auth-toast[data-kind="warning"] {
  border-left-color: var(--auth-tint-warn);
}
.auth-toast[data-kind="danger"] {
  border-left-color: var(--auth-tint-danger);
}
.auth-toast[data-kind="success"] {
  border-left-color: var(--auth-tint-ok);
}

.auth-toast-icon {
  font-size: 1.15rem;
  line-height: 1.2;
  margin-top: 0.1rem;
  color: var(--auth-tint-info);
  flex-shrink: 0;
}
.auth-toast[data-kind="warning"] .auth-toast-icon {
  color: var(--auth-tint-warn);
}
.auth-toast[data-kind="danger"] .auth-toast-icon {
  color: var(--auth-tint-danger);
}
.auth-toast[data-kind="success"] .auth-toast-icon {
  color: var(--auth-tint-ok);
}

.auth-toast-body {
  flex: 1;
  font-size: 0.85rem;
  line-height: 1.45;
  min-width: 0;
}

.auth-toast-body strong {
  display: block;
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 0.15rem;
  color: var(--auth-text);
}

.auth-toast-close {
  background: transparent;
  border: none;
  color: var(--auth-text-muted);
  padding: 0.2rem 0.35rem;
  cursor: pointer;
  border-radius: 6px;
  font-size: 0.8rem;
  line-height: 1;
  transition:
    background 0.2s,
    color 0.2s;
  flex-shrink: 0;
  margin-top: -0.1rem;
}

.auth-toast-close:hover {
  background: rgba(15, 28, 46, 0.07);
  color: var(--auth-text);
}

@media (max-width: 640px) {
  #authToastRoot {
    top: 0.6rem;
    right: 0.6rem;
    left: 0.6rem;
    width: auto;
    max-width: none;
  }
  .auth-toast {
    padding: 0.75rem 0.85rem;
  }
}

/* ════════════════════════════════════════════════════════════════
   ACCESSIBILITY
   ═══════════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  .auth-showcase-bg {
    animation: none;
  }
  .auth-bubbles span {
    animation: none;
    opacity: 0;
  }
  .auth-card-body {
    animation: none;
  }
  .auth-modal {
    transition: none;
  }
  .ft-input,
  .btn-login {
    transition: none;
  }
  .auth-toast {
    transition: opacity 0.2s;
    transform: none;
  }
}

@supports not (backdrop-filter: blur(1px)) {
  .auth-announce-inner {
    background: rgba(255, 255, 255, 0.98);
  }
}
