/* PrimeTDAP — auth pages (login + verify). Two-pane: hero left, form right.
 *
 * Design discipline (per memory ui_design_preferences): "Beautiful and
 * sophisticated, not loud." H1 ≤1.2rem, weight 500 not bold, refined
 * typography. Single accent color (deep blue — matches the app shell
 * --accent so the brand reads identically from login through to home).
 *
 * Layout: both panes share a warm off-white background. A thin vertical
 * rule separates them. The form CARD on the right is white with shadow,
 * which gives it visual focus without needing a contrasting pane color.
 */

:root {
  --bg-page:        #fafaf7;     /* warm off-white — both panes */
  --bg-card:        #ffffff;
  --fg:             #0f172a;     /* slate-900 */
  --fg-muted:       #64748b;     /* slate-500 */
  --fg-faint:       #94a3b8;     /* slate-400 */
  --rule:           #e5e7eb;     /* gray-200 */
  --rule-soft:      #eef0f3;

  --accent:         #1e40af;     /* blue-800 — matches base.css */
  --accent-deep:    #1e3a8a;     /* blue-900 — hover */
  --accent-faint:   rgba(30, 64, 175, 0.08);
  --accent-rule:    rgba(30, 64, 175, 0.18);

  --err-bg:         #fef2f2;
  --err-fg:         #991b1b;
  --err-rule:       #fecaca;
  --ok-bg:          #f0fdf4;
  --ok-fg:          #166534;
  --ok-rule:        #bbf7d0;
}

/* ───────────────────────────────────────────────────────── reset / base */

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }

.auth-body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-feature-settings: "cv11", "ss01", "ss03";
  color: var(--fg);
  /* Soft diagonal gradient across the whole page — warmer top-left, cooler
     bottom-right. Subtle but visible. Both panes inherit it; the vertical
     rule between them is the only structural divider. */
  background:
    radial-gradient(1200px 700px at 0% 0%,   rgba(30, 64, 175, 0.06), transparent 55%),
    radial-gradient(1100px 700px at 100% 100%, rgba(15, 118, 110, 0.05), transparent 55%),
    linear-gradient(135deg, #fbfaf6 0%, #f5f6f9 100%);
  background-attachment: fixed;
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ───────────────────────────────────────────────────────── split shell */

.auth-split {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  min-height: 100vh;
}

@media (max-width: 880px) {
  .auth-split { grid-template-columns: 1fr; }
}

/* ───────────────────────────────────────────────────────── HERO (left) */

.auth-hero {
  /* Bg inherited from body gradient. Just the vertical rule. */
  background: transparent;
  color: var(--fg);
  padding: 3rem 3.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 2rem;
  min-height: 100vh;
  border-right: 1px solid var(--rule);
}

@media (max-width: 880px) {
  .auth-hero {
    min-height: auto;
    padding: 2rem 1.5rem;
    border-right: none;
    border-bottom: 1px solid var(--rule);
  }
}

/* wordmark — mirrors base.css .app-title for visual continuity */
.hero-mark {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  white-space: nowrap;
}
.hero-mark-glyph {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  flex: 0 0 auto;
  box-shadow: 0 2px 6px rgba(30, 64, 175, 0.22);
}
.hero-mark-glyph svg { width: 19px; height: 19px; }

.hero-mark-text { display: inline-flex; flex-direction: column; line-height: 1.15; }
.hero-mark-name { font-size: 1.12rem; letter-spacing: 0; line-height: 1.1; }
.hero-mark-prime { font-weight: 400; color: var(--fg-muted); }
.hero-mark-tdap  { font-weight: 600; color: var(--accent); }
.hero-mark-sub {
  color: var(--fg-muted);
  font-size: 0.78rem;
  font-weight: 400;
  margin-top: 2px;
}

/* center column: rotating hero slide.
   Structure: <hero-stage> contains <hero-slides> (relative, sized to tallest)
   then <hero-dots> as a SIBLING below — so dots never sit under the slide
   content. */
.hero-stage {
  max-width: 520px;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.hero-slides {
  position: relative;
  min-height: 11rem;     /* room for the tallest slide (3-line headline + sub) */
}

.hero-slide {
  position: absolute; inset: 0;
  opacity: 0;
  visibility: hidden;
  /* Outgoing slide: fade fast + then hide. */
  transition: opacity 0.25s ease, visibility 0s linear 0.25s;
  pointer-events: none;
}
.hero-slide.is-active {
  opacity: 1;
  visibility: visible;
  /* Incoming slide: small delay so the outgoing one has already faded —
     no visible "two slides on screen" overlap. */
  transition: opacity 0.35s ease 0.25s, visibility 0s linear 0.25s;
  pointer-events: auto;
}
@media (prefers-reduced-motion: reduce) {
  .hero-slide                  { display: none; }
  .hero-slide.is-active        { display: block; opacity: 1; }
}

.hero-slide-eyebrow {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 0.85rem;
  padding: 0.25rem 0.55rem;
  background: var(--accent-faint);
  border-radius: 999px;
  border: 1px solid var(--accent-rule);
}
.hero-slide-headline {
  font-size: 1.65rem;
  font-weight: 500;
  line-height: 1.22;
  letter-spacing: -0.01em;
  margin: 0 0 0.75rem;
  color: var(--fg);
}
.hero-slide-sub {
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--fg-muted);
  margin: 0;
}

@media (max-width: 880px) {
  .hero-slide-headline { font-size: 1.3rem; }
  .hero-stage          { min-height: 7rem; }
}

/* slide dots — sibling under .hero-slides, never overlaps slide content */
.hero-dots {
  display: flex; gap: 0.5rem;
  margin-top: 0;          /* gap is owned by .hero-stage flex layout */
}
.hero-dot {
  width: 22px; height: 4px;
  background: var(--rule);
  border: none; padding: 0;
  border-radius: 2px;
  cursor: pointer;
  transition: background 0.2s;
}
.hero-dot:hover { background: #cbd5e1; }
.hero-dot.is-active { background: var(--accent); }
.hero-dot:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* bottom column: privilege framing + footer */
.hero-bottom { display: flex; flex-direction: column; gap: 1.25rem; }

.hero-privilege {
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--fg-muted);
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  max-width: 520px;
}
.hero-privilege strong {
  color: var(--fg);
  font-weight: 500;
}

.hero-footer {
  font-size: 0.72rem;
  color: var(--fg-faint);
  letter-spacing: 0.01em;
}

/* ───────────────────────────────────────────────────────── FORM (right) */

.auth-form-pane {
  background: var(--bg-page);
  padding: 3rem 3.25rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  gap: 1.5rem;
}

@media (max-width: 880px) {
  .auth-form-pane { min-height: auto; padding: 2rem 1.5rem; }
}

.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 12px 32px rgba(15, 23, 42, 0.06);
  padding: 2rem 2rem 1.75rem;
  position: relative;
}

.auth-h1 {
  margin: 0 0 0.35rem;
  font-size: 1.2rem;
  font-weight: 500;
  letter-spacing: -0.005em;
  color: var(--fg);
}
.auth-lede {
  margin: 0 0 1.4rem;
  color: var(--fg-muted);
  font-size: 0.86rem;
  line-height: 1.55;
}

.auth-alert {
  border-radius: 8px;
  padding: 0.55rem 0.75rem;
  font-size: 0.82rem;
  margin-bottom: 1rem;
  line-height: 1.45;
}
.auth-alert-err { background: var(--err-bg); color: var(--err-fg); border: 1px solid var(--err-rule); }
.auth-alert-ok  { background: var(--ok-bg);  color: var(--ok-fg);  border: 1px solid var(--ok-rule); }

.auth-form { display: flex; flex-direction: column; gap: 0.7rem; }
.auth-form label {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--fg-muted);
  letter-spacing: 0.01em;
}
.auth-form input[type="email"],
.auth-form input[type="text"] {
  font-family: inherit;
  font-size: 0.95rem;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--rule);
  border-radius: 8px;
  width: 100%;
  outline: none;
  background: #fff;
  color: var(--fg);
  transition: border-color 0.12s, box-shadow 0.12s;
}
.auth-form input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.12);
}

.auth-code-input {
  letter-spacing: 0.4em;
  text-align: center;
  font-size: 1.35rem !important;
  font-variant-numeric: tabular-nums;
  padding: 0.75rem 0.8rem !important;
}

.auth-btn {
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 500;
  padding: 0.65rem 1rem;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: background 0.12s, border-color 0.12s, opacity 0.12s;
  position: relative;
  text-decoration: none;
}
.auth-btn-primary {
  background: var(--accent);
  color: #fff;
}
.auth-btn-primary:hover  { background: var(--accent-deep); }
.auth-btn-primary:active { background: #172d6e; }
.auth-btn-primary:disabled {
  background: var(--accent);
  opacity: 0.78;
  cursor: progress;
}
.auth-btn-spinner {
  display: none;
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,0.45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: auth-spin 0.7s linear infinite;
}
.auth-btn.is-loading .auth-btn-spinner { display: inline-block; }
@keyframes auth-spin { to { transform: rotate(360deg); } }

.auth-hint {
  margin: 0.5rem 0 0;
  font-size: 0.76rem;
  color: var(--fg-muted);
  line-height: 1.5;
}

.auth-alt {
  margin: 1rem 0 0;
  text-align: center;
  font-size: 0.82rem;
  color: var(--fg-muted);
}
.auth-alt a {
  color: var(--accent);
  text-decoration: none;
}
.auth-alt a:hover { text-decoration: underline; }

/* card-level "busy" overlay — used during form submit so the click can't be
   missed. Preserves the matched pattern from the prior login design. */
.auth-card.is-submitting::after {
  content: attr(data-busy-caption);
  position: absolute; inset: 0;
  background: rgba(255, 255, 255, 0.92);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem; color: var(--fg);
  border-radius: 14px;
  font-weight: 500;
  padding-top: 1.5rem;
}
.auth-card.is-submitting::before {
  content: "";
  position: absolute;
  left: 50%; top: 42%;
  transform: translate(-50%, -50%);
  width: 28px; height: 28px;
  border: 3px solid rgba(15, 23, 42, 0.12);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: auth-spin 0.7s linear infinite;
  z-index: 1;
}

/* form-pane footer (under the card) */
.form-pane-footer {
  font-size: 0.72rem;
  color: var(--fg-muted);
  text-align: center;
  line-height: 1.5;
}
.form-pane-footer a {
  color: var(--fg-muted);
  text-decoration: none;
}
.form-pane-footer a:hover { text-decoration: underline; }
