/* ══════════════════════════════════════════════════════════════════════════════
   UNICORN TRACK — Login lobby (dark + restrained moving glows)
   Brand register: private wealth, indigo/violet on near-black.
   Reference: linear.app/login + the deep-violet treatment of premium dark heroes.
   ══════════════════════════════════════════════════════════════════════════════ */

:root {
  --bg-near-black:   #080808;
  --cream:           #f6f3f1;
  --indigo:          #6366f1;
  --indigo-hover:    #4f46e5;
  --violet:          #7c3aed;
  --deep-purple:     #312e81;
  --warn-orange:     #f97316;
  --font-d:          'Cormorant Garamond', Georgia, serif;
  --font-b:          'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg-near-black);
  color: var(--cream);
  font-family: var(--font-b);
  min-height: 100vh;
  overflow: hidden;
}

/* ── GLOW LAYER ─────────────────────────────────────────────────────────────
   Three pure radial-gradients, composited additively on the near-black base.
   Strong purple/blue palette — indigo anchor, violet drift, deep-purple bloom.
   prefers-reduced-motion freezes A and B without removing them.
*/
.glow-stage {
  position: fixed; inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(140px);
  will-change: transform;
}

.glow-a {
  width: 60vw; height: 60vw;
  left: -18vw; bottom: -22vw;
  background: radial-gradient(circle at center, rgba(99, 102, 241, 0.32) 0%, rgba(99, 102, 241, 0) 70%);
  animation: glow-a-drift 18s ease-in-out infinite;
}

.glow-b {
  width: 50vw; height: 50vw;
  right: -12vw; top: -16vw;
  background: radial-gradient(circle at center, rgba(124, 58, 237, 0.42) 0%, rgba(124, 58, 237, 0) 70%);
  filter: blur(180px);
  animation: glow-b-drift 24s ease-in-out infinite;
  animation-delay: -8s;
}

.glow-c {
  width: 26vw; height: 26vw;
  right: 16vw; top: 36vh;
  background: radial-gradient(circle at center, rgba(49, 46, 129, 0.40) 0%, rgba(49, 46, 129, 0) 70%);
  filter: blur(120px);
  animation: glow-c-pulse 28s ease-in-out infinite;
  animation-delay: -14s;
}

@keyframes glow-a-drift {
  0%, 100% { transform: translate(0, 0); }
  50%      { transform: translate(12px, -10px); }
}
@keyframes glow-b-drift {
  0%, 100% { transform: translate(0, 0); }
  50%      { transform: translate(-14px, 10px); }
}
@keyframes glow-c-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(1.08); opacity: 0.75; }
}

@media (prefers-reduced-motion: reduce) {
  .glow-a, .glow-b, .glow-c { animation: none; }
}

/* ── GRAIN OVERLAY ─────────────────────────────────────────────────────────
   3% opacity SVG noise. Non-negotiable — breaks banding on cheap monitors.
*/
.grain {
  position: fixed; inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-size: 200px 200px;
}

/* ── CONTENT LAYER ─────────────────────────────────────────────────────────*/
.lobby {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px 8vw;
  max-width: 540px;
  margin: 0 auto;
}

/* Mascot + Wordmark + subtitle */
.brand-lockup { margin-bottom: 56px; }

.brand-mascot {
  width: 96px; height: 96px;
  margin-bottom: 22px;
  /* Full-colour princess unicorn — purple/violet mane, pearls, fur stole.
     No inversion; the artwork is brand-coloured. A faint indigo glow ties it
     to the lobby's overall lighting. */
  filter: drop-shadow(0 8px 28px rgba(99, 102, 241, 0.45));
}

.wordmark {
  font-family: var(--font-d);
  font-weight: 600;
  font-size: 38px;
  letter-spacing: 0.18em;
  color: var(--cream);
  text-transform: uppercase;
  line-height: 1;
  margin: 0 0 10px 0;
}

.subtitle {
  font-family: var(--font-b);
  font-weight: 300;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(246, 243, 241, 0.55);
  margin: 0 0 18px 0;
}

.rule {
  width: 100%;
  max-width: 360px;
  height: 1px;
  background: rgba(99, 102, 241, 0.50);
  border: none;
  margin: 0;
}

/* Form — no card. Floats on the background. */
.lobby-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.lobby-form[hidden] { display: none; }

.lobby-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lobby-label {
  font-family: var(--font-b);
  font-weight: 400;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(246, 243, 241, 0.55);
}

.lobby-field input {
  background: rgba(246, 243, 241, 0.03);
  border: 1px solid rgba(246, 243, 241, 0.16);
  border-radius: 4px;
  color: var(--cream);
  font-family: var(--font-b);
  font-size: 15px;
  font-weight: 300;
  padding: 14px 18px;
  outline: none;
  width: 100%;
  height: 50px;
  letter-spacing: 0.02em;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.lobby-field input::placeholder {
  color: rgba(246, 243, 241, 0.32);
  font-weight: 300;
}

.lobby-field input:hover {
  border-color: rgba(246, 243, 241, 0.28);
}

.lobby-field input:focus {
  border-color: var(--indigo);
  background: rgba(99, 102, 241, 0.06);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18);
}

/* Forgot-password row — replaces the old footer line. */
.lobby-forgot-row {
  display: flex;
  justify-content: flex-end;
  margin-top: -8px;
}

.lobby-forgot-link {
  font-family: var(--font-b);
  font-weight: 400;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: rgba(246, 243, 241, 0.55);
  text-decoration: none;
  padding: 4px 2px;
  transition: color 0.15s ease;
  cursor: pointer;
  background: none;
  border: none;
}

.lobby-forgot-link:hover {
  color: var(--indigo);
}

/* Forgot-password modal */
.lobby-forgot-modal {
  position: fixed; inset: 0;
  z-index: 50;
  background: rgba(8, 8, 8, 0.78);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}

.lobby-forgot-modal[hidden] { display: none; }

.lobby-forgot-card {
  background: #0d0d0d;
  border: 1px solid rgba(246, 243, 241, 0.12);
  border-radius: 8px;
  padding: 32px 28px;
  width: 100%;
  max-width: 420px;
  color: var(--cream);
}

.lobby-forgot-card h2 {
  font-family: var(--font-d);
  font-weight: 500;
  font-size: 22px;
  letter-spacing: 0.05em;
  margin: 0 0 8px 0;
}

.lobby-forgot-card p {
  font-family: var(--font-b);
  font-weight: 300;
  font-size: 13px;
  line-height: 1.55;
  color: rgba(246, 243, 241, 0.65);
  margin: 0 0 22px 0;
}

.lobby-forgot-card .lobby-field { margin-bottom: 18px; }

.lobby-forgot-actions {
  display: flex; gap: 10px; justify-content: flex-end;
}

.lobby-forgot-actions button {
  font-family: var(--font-b);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 12px 18px;
  border-radius: 4px;
  cursor: pointer;
  border: 1px solid transparent;
}

.lobby-forgot-cancel {
  background: transparent;
  color: rgba(246, 243, 241, 0.55);
  border-color: rgba(246, 243, 241, 0.16);
}

.lobby-forgot-cancel:hover { color: var(--cream); border-color: rgba(246, 243, 241, 0.32); }

.lobby-forgot-submit {
  background: var(--indigo);
  color: var(--cream);
  box-shadow: 0 4px 22px rgba(99, 102, 241, 0.28);
}

.lobby-forgot-submit:hover { background: var(--indigo-hover); }
.lobby-forgot-submit:disabled { opacity: 0.4; cursor: not-allowed; }

.lobby-forgot-status {
  font-family: var(--font-b);
  font-weight: 300;
  font-size: 12px;
  font-style: italic;
  color: rgba(246, 243, 241, 0.65);
  margin: 14px 0 0 0;
  min-height: 1em;
}

.lobby-forgot-status.success { color: #34d399; font-style: normal; }
.lobby-forgot-status.error   { color: var(--warn-orange); }

/* ── Password-reset view (ticket flow) ────────────────────────────────── */
/* In reset mode, suppress the wordmark + subtitle so the reset H2 is primary. */
body.reset-mode .wordmark,
body.reset-mode .subtitle,
body.reset-mode .rule {
  display: none;
}
body.reset-mode .brand-lockup {
  margin-bottom: 28px;
}
body.reset-mode .brand-mascot {
  margin-bottom: 0;
}

.lobby-reset-view {
  width: 100%;
  max-width: 360px;
  text-align: center;
}

.lobby-reset-view[hidden] { display: none; }

.lobby-reset-title {
  font-family: var(--font-d);
  font-weight: 500;
  font-size: 30px;
  color: var(--cream);
  letter-spacing: 0.02em;
  line-height: 1.15;
  margin: 0 0 10px 0;
}

.lobby-reset-subtitle {
  font-family: var(--font-b);
  font-weight: 300;
  font-size: 13px;
  color: rgba(246, 243, 241, 0.65);
  margin: 0 auto 28px auto;
  max-width: 300px;
  line-height: 1.55;
}

.lobby-reset-form {
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.lobby-reset-form[hidden] { display: none; }

.lobby-reset-status {
  font-family: var(--font-b);
  font-weight: 300;
  font-size: 12px;
  font-style: italic;
  color: rgba(246, 243, 241, 0.65);
  margin: 14px 0 0 0;
  min-height: 1em;
  text-align: center;
}

.lobby-reset-status.success { color: #34d399; font-style: normal; }
.lobby-reset-status.error   { color: var(--warn-orange); }

.lobby-submit {
  background: var(--indigo);
  color: var(--cream);
  border: none;
  padding: 14px 0;
  font-family: var(--font-b);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  width: 100%;
  box-shadow: 0 4px 30px rgba(99, 102, 241, 0.25);
}

.lobby-submit:hover {
  background: var(--indigo-hover);
  box-shadow: 0 4px 36px rgba(99, 102, 241, 0.40);
}

.lobby-submit:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
}

.lobby-error {
  margin-top: 4px;
  font-family: var(--font-b);
  font-weight: 300;
  font-style: italic;
  font-size: 13px;
  color: var(--warn-orange);
  min-height: 1em;
}

/* Responsive — mobile */
@media (max-width: 600px) {
  .lobby { padding: 40px 28px; }
  .wordmark { font-size: 30px; }
  .brand-mascot { width: 72px; height: 72px; margin-bottom: 18px; }
  .brand-lockup { margin-bottom: 44px; }
  .lobby-field input { height: 48px; padding: 12px 16px; font-size: 14px; }
  .lobby-forgot-card { padding: 24px 20px; }
}

/* Print — degrade to plain */
@media print {
  .glow-stage, .grain { display: none; }
  html, body { background: white; color: black; }
}
