/* ============================================================
   Eddys Development — Auth screen
   VIOLET AURORA GLASS — deep indigo-to-black canvas, slow violet/
   magenta aurora drift, frosted glass card, cursor-tracking glow
   + card spotlight sheen. Plain CSS, no build step.
   ============================================================ */

:root {
  /* ---- Warm premium palette ------------------------------ */
  --bg-0: #15100C;               /* espresso black base */
  --bg-1: #1C150F;               /* warm dark canvas */
  --bg-2: #271D15;               /* raised warm panels */

  /* Amber / ember / gold accents.
     Legacy --violet-* names are kept (now mapped to warm) so existing
     rules re-skin automatically; use the --amber/--gold/etc. aliases for new work. */
  --violet: #F5A524;             /* primary accent (amber, readable on dark) */
  --violet-bright: #FBD68A;
  --violet-600: #F5A524;
  --violet-700: #EC7A2E;
  --magenta: #E2552B;            /* ember */
  --indigo: #C77B47;             /* copper */

  --amber: #F5A524;
  --amber-bright: #FBC55E;
  --gold: #E8C98A;
  --copper: #C77B47;
  --ember: #E2552B;

  /* Text on warm dark glass — tuned for WCAG AA */
  --text: #F6EFE6;               /* warm cream */
  --muted: #CBBBA6;              /* warm tan — body/labels */
  --faint: #94836C;              /* hints/placeholders */

  /* Borders / lines (gold-tinted) */
  --border: rgba(232, 201, 138, .14);
  --border-strong: rgba(232, 201, 138, .28);
  --border-hover: rgba(232, 201, 138, .44);

  /* Status (kept readable on dark) */
  --success: #34D399;
  --warn: #FBBF24;
  --info: #60A5FA;
  --danger: #FB7185;

  --ring: rgba(245, 165, 36, .45);

  /* Frosted card surface (warm) */
  --glass-fill: rgba(39, 29, 21, .58);
  --glass-fill-solid: #1C150F;   /* @supports fallback */
  --glass-border: rgba(232, 201, 138, .20);
  --glass-inset: rgba(255, 240, 220, .14);

  /* Field surfaces */
  --field-bg: rgba(30, 20, 12, .55);
  --field-bg-focus: rgba(42, 28, 16, .8);

  /* Layered depth + soft outer ember glow */
  --shadow:
    0 1px 2px rgba(0, 0, 0, .5),
    0 18px 50px rgba(0, 0, 0, .55),
    0 36px 90px rgba(0, 0, 0, .45),
    0 0 80px rgba(226, 85, 43, .18);

  --radius-card: 18px;
  --radius-field: 12px;
  --grid: 48px;

  --ease-spring: cubic-bezier(.4, 1.2, .4, 1);
  --ease-soft: cubic-bezier(.22, .61, .36, 1);

  --font-display: "Playfair Display", Georgia, serif;
  --font-ui: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  /* Cursor-glow positions (set by glow.js; safe defaults = centered) */
  --mx: 50vw;
  --my: 40vh;
  --spot-x: 50%;
  --spot-y: 0%;

  color-scheme: dark;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font-ui);
  color: var(--text);
  background: var(--bg-0);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* ---------- Cursor glow (large soft violet halo) --------- */

.cursor-glow {
  position: fixed;
  inset: 0;
  z-index: 0;               /* above bg layers, behind the stage/card */
  pointer-events: none;
  mix-blend-mode: screen;
  background:
    radial-gradient(
      560px 560px at var(--mx) var(--my),
      rgba(245, 165, 36, .12),
      rgba(226, 85, 43, .06) 34%,
      rgba(199, 123, 71, .03) 58%,
      transparent 72%
    );
  transition: background .12s linear;
  will-change: background;
}

/* ---------- Background layers ---------------------------- */

.bg-aurora,
.bg-grid,
.bg-grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

/* Espresso base + slow-drifting amber/ember/copper warm-light blobs */
.bg-aurora {
  background:
    radial-gradient(60% 50% at 18% 12%, rgba(245, 165, 36, .20), transparent 60%),
    radial-gradient(55% 50% at 86% 18%, rgba(226, 85, 43, .15), transparent 58%),
    radial-gradient(70% 60% at 78% 96%, rgba(199, 123, 71, .17), transparent 62%),
    radial-gradient(60% 55% at 8% 90%, rgba(245, 165, 36, .12), transparent 60%),
    linear-gradient(160deg, var(--bg-1) 0%, var(--bg-0) 55%, #0C0907 100%);
  background-size: 200% 200%, 200% 200%, 220% 220%, 200% 200%, 100% 100%;
  background-repeat: no-repeat;
  animation: aurora 40s ease-in-out infinite alternate, bgBreathe 12s ease-in-out infinite;
}

@keyframes aurora {
  0% {
    background-position: 10% 6%, 92% 12%, 78% 96%, 6% 92%, 0 0;
  }
  50% {
    background-position: 26% 22%, 70% 28%, 62% 78%, 22% 74%, 0 0;
  }
  100% {
    background-position: 4% 0%, 100% 4%, 88% 100%, 0% 100%, 0 0;
  }
}

/* Slow "breathing" — the whole glow layer gently swells and settles */
@keyframes bgBreathe {
  0%, 100% { opacity: .72; }
  50% { opacity: 1; }
}

/* Masked grid that dissolves at the edges + slow drift */
.bg-grid {
  background-image:
    linear-gradient(rgba(232, 201, 138, .08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(232, 201, 138, .08) 1px, transparent 1px);
  background-size: var(--grid) var(--grid);
  opacity: .6;
  animation: drift 30s linear infinite;
  -webkit-mask-image: radial-gradient(900px 620px at 50% 36%, #000, transparent 76%);
  mask-image: radial-gradient(900px 620px at 50% 36%, #000, transparent 76%);
}

@keyframes drift {
  to { background-position: var(--grid) var(--grid), var(--grid) var(--grid); }
}

/* Anti-banding grain over the gradients */
.bg-grain {
  background-image: radial-gradient(rgba(255, 255, 255, .55) .5px, transparent .5px);
  background-size: 4px 4px;
  opacity: .035;
  mix-blend-mode: screen;
}

/* ---------- Stage / layout ------------------------------ */

.stage {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: clamp(16px, 4vw, 40px);
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -48px;
  z-index: 10;
  background: var(--bg-2);
  color: var(--violet-bright);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: top .2s var(--ease-soft);
}
.skip-link:focus { top: 16px; }

/* ---------- Card (real frosted glass) ------------------- */

.card {
  position: relative;
  isolation: isolate;
  width: min(440px, 100%);
  background: var(--glass-fill);
  -webkit-backdrop-filter: blur(28px) saturate(150%);
  backdrop-filter: blur(28px) saturate(150%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
  padding: clamp(22px, 5vw, 32px);
}

/* Moving spotlight/sheen — brightens the surface near the cursor.
   Uses --spot-x / --spot-y set by glow.js relative to the card. */
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  pointer-events: none;
  background:
    radial-gradient(
      340px 340px at var(--spot-x) var(--spot-y),
      rgba(245, 165, 36, .20),
      rgba(232, 201, 138, .08) 45%,
      transparent 70%
    );
  opacity: .9;
  transition: opacity .3s var(--ease-soft);
}

/* Glass edge: 1px gradient border + inner top highlight + border glow
   that tracks the cursor (border-brightening spotlight). */
.card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
  pointer-events: none;
  padding: 1px;
  background:
    radial-gradient(
      260px 260px at var(--spot-x) var(--spot-y),
      rgba(232, 200, 255, .85),
      rgba(245, 165, 36, .35) 40%,
      rgba(245, 165, 36, .14) 100%
    );
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  mask-composite: exclude;
  box-shadow:
    inset 0 1px 0 var(--glass-inset),
    inset 0 0 0 1px rgba(255, 255, 255, .03);
}

/* All card content sits above the ::before sheen */
.card > * { position: relative; z-index: 1; }

/* Fallback for browsers without backdrop-filter */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .card {
    background: var(--glass-fill-solid);
    border-color: var(--border-strong);
  }
}

/* ---------- Brand --------------------------------------- */

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 22px;
}

.mark {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  color: #fff;
  flex: none;
  background: linear-gradient(135deg, var(--violet-600), var(--magenta));
  box-shadow:
    0 6px 18px rgba(245, 165, 36, .5),
    inset 0 1px 0 rgba(255, 255, 255, .45);
}

.wordmark {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -.02em;
  line-height: 1.1;
  color: var(--text);
}
.wordmark small {
  display: block;
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0;
  color: var(--faint);
  margin-top: 2px;
}

/* ---------- Segmented control --------------------------- */

.seg {
  position: relative;
  display: flex;
  background: rgba(8, 6, 20, .5);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 4px;
  margin: 0 0 22px;
}

.seg-btn {
  flex: 1;
  position: relative;
  z-index: 1;
  border: 0;
  background: transparent;
  font: inherit;
  font-weight: 600;
  font-size: 13.5px;
  color: var(--muted);
  padding: 9px 0;
  min-height: 38px;
  border-radius: 9px;
  cursor: pointer;
  transition: color .25s var(--ease-soft);
}
.seg-btn.is-active { color: var(--text); }
.seg-btn:focus-visible {
  outline: 2px solid var(--violet);
  outline-offset: 2px;
}

.thumb {
  position: absolute;
  top: 4px;
  left: 4px;
  width: calc(50% - 4px);
  height: calc(100% - 8px);
  background: linear-gradient(180deg, rgba(226, 85, 43, .55), rgba(226, 85, 43, .32));
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  box-shadow:
    0 2px 10px rgba(226, 85, 43, .4),
    inset 0 1px 0 rgba(255, 255, 255, .18);
  transition: transform .32s var(--ease-spring);
}
.card[data-mode="up"] .thumb { transform: translateX(100%); }

/* ---------- Titles -------------------------------------- */

.title {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 600;
  font-size: 22px;
  letter-spacing: -.02em;
  line-height: 1.15;
  margin: 0 0 5px;
  color: var(--text);
}
.sub {
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.5;
  margin: 0 0 20px;
}

/* Crossfade applied by JS during mode swap */
.copy-fade { opacity: 0; transform: translateY(3px); }
.title, .sub, .btn-label, .foot-alt {
  transition: opacity .18s var(--ease-soft), transform .18s var(--ease-soft);
}

/* ---------- Fields -------------------------------------- */

.field { margin-bottom: 14px; }

.label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.opt { color: var(--faint); font-weight: 500; }

.ctrl { position: relative; }

.lead-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  color: var(--faint);
  pointer-events: none;
  transition: color .18s var(--ease-soft);
  z-index: 2;
}

input[type="text"],
input[type="email"],
input[type="password"] {
  width: 100%;
  font: inherit;
  font-size: 14px;
  color: var(--text);
  background: var(--field-bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-field);
  padding: 12px 13px 12px 40px;
  min-height: 46px;
  transition: border-color .18s, box-shadow .18s, background .18s;
  outline: none;
}
input::placeholder { color: var(--faint); opacity: 1; }
input:hover { border-color: var(--border-hover); }

input:focus,
input:focus-visible {
  border-color: var(--violet);
  box-shadow: 0 0 0 4px var(--ring), 0 0 22px rgba(245, 165, 36, .28);
  background: var(--field-bg-focus);
}
.ctrl:focus-within .lead-icon { color: var(--violet-bright); }

/* Autofill — keep dark glass instead of browser white */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text);
  caret-color: var(--text);
  -webkit-box-shadow: 0 0 0 1000px var(--field-bg-focus) inset;
  transition: background-color 9999s ease-in-out 0s;
}

/* room for the eye toggle (and the match icon on confirm) */
.pw input { padding-right: 46px; }
#confirm { padding-right: 72px; }

/* Invalid state */
input[aria-invalid="true"] {
  border-color: var(--danger);
}
input[aria-invalid="true"]:focus {
  box-shadow: 0 0 0 4px rgba(251, 113, 133, .28);
}

/* ---------- Show / hide toggle -------------------------- */

.toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--muted);
  cursor: pointer;
  transition: background .15s, color .15s;
  z-index: 2;
}
.toggle:hover { background: rgba(245, 165, 36, .14); color: var(--text); }
.toggle:focus-visible {
  outline: 2px solid var(--violet);
  outline-offset: 2px;
}

/* Eye icon drawn via CSS borders so we can flip open/closed without extra SVG */
.eye {
  position: relative;
  width: 18px;
  height: 18px;
  display: block;
}
.eye::before {
  content: "";
  position: absolute;
  inset: 4px 0;
  border: 2px solid currentColor;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
}
.eye::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 5px;
  height: 5px;
  border: 2px solid currentColor;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}
/* When pressed (password visible) draw a slash */
.toggle[aria-pressed="true"] .eye::after {
  width: 22px;
  height: 0;
  border: 0;
  border-top: 2px solid currentColor;
  border-radius: 0;
  transform: translate(-50%, -50%) rotate(-45deg);
}

/* ---------- Strength meter ------------------------------ */

.meter-wrap { margin-top: 10px; }

.meter {
  display: flex;
  gap: 5px;
}
.meter i {
  height: 5px;
  flex: 1;
  border-radius: 99px;
  background: rgba(245, 165, 36, .18);
  transition: background .3s var(--ease-soft), box-shadow .3s var(--ease-soft);
}
.meter[data-score="1"] i:nth-child(1) {
  background: var(--danger);
  box-shadow: 0 0 10px rgba(251, 113, 133, .5);
}
.meter[data-score="2"] i:nth-child(-n+2) {
  background: var(--warn);
  box-shadow: 0 0 10px rgba(251, 191, 36, .45);
}
.meter[data-score="3"] i:nth-child(-n+3) {
  background: var(--info);
  box-shadow: 0 0 10px rgba(96, 165, 250, .45);
}
.meter[data-score="4"] i {
  background: var(--success);
  box-shadow: 0 0 10px rgba(52, 211, 153, .45);
}

.meter-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-top: 7px;
}
.meter-hint {
  font-size: 11.5px;
  line-height: 1.4;
  color: var(--faint);
}
.meter-label {
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  color: var(--faint);
}
.meter-label[data-score="1"] { color: var(--danger); }
.meter-label[data-score="2"] { color: var(--warn); }
.meter-label[data-score="3"] { color: var(--info); }
.meter-label[data-score="4"] { color: var(--success); }

/* ---------- Confirm match ------------------------------- */

.match-icon {
  position: absolute;
  right: 44px;
  top: 50%;
  transform: translateY(-50%) scale(.7);
  width: 18px;
  height: 18px;
  opacity: 0;
  transition: opacity .2s var(--ease-soft), transform .2s var(--ease-spring);
  z-index: 2;
}
.match-icon[data-state="match"],
.match-icon[data-state="nomatch"] {
  opacity: 1;
  transform: translateY(-50%) scale(1);
}
.match-icon[data-state="match"]::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 1px;
  width: 6px;
  height: 11px;
  border: solid var(--success);
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
}
.match-icon[data-state="nomatch"]::before,
.match-icon[data-state="nomatch"]::after {
  content: "";
  position: absolute;
  left: 8px;
  top: 2px;
  width: 2.5px;
  height: 14px;
  background: var(--danger);
  border-radius: 2px;
}
.match-icon[data-state="nomatch"]::before { transform: rotate(45deg); }
.match-icon[data-state="nomatch"]::after { transform: rotate(-45deg); }

/* ---------- Inline messages ----------------------------- */

.msg {
  font-size: 11.5px;
  line-height: 1.4;
  margin: 7px 0 0;
  min-height: 0;
  transition: min-height .15s;
}
.msg:empty { margin: 0; }
.msg-error { color: var(--danger); }
.msg.is-ok { color: var(--success); }
.msg.is-bad { color: var(--danger); }

/* ---------- Checkboxes ---------------------------------- */

.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}
.check input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.check .box {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  border: 1.5px solid var(--border-strong);
  border-radius: 6px;
  background: var(--field-bg);
  position: relative;
  transition: background .15s var(--ease-soft), border-color .15s var(--ease-soft), box-shadow .15s var(--ease-soft);
}
.check .box::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 1.5px;
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0);
  transform-origin: center;
  transition: transform .15s var(--ease-spring);
}
.check input:checked + .box {
  background: linear-gradient(180deg, var(--violet-600), var(--violet-700));
  border-color: var(--violet);
  box-shadow: 0 0 12px rgba(245, 165, 36, .45);
}
.check input:checked + .box::after { transform: rotate(45deg) scale(1); }
.check input:focus-visible + .box {
  outline: 2px solid var(--violet);
  outline-offset: 2px;
}
.check-text { padding-top: 0; }

.context { margin-bottom: 18px; }
.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.agree { margin: 2px 0 18px; }

/* ---------- Links --------------------------------------- */

.link {
  color: var(--violet-bright);
  font-weight: 600;
  text-decoration: none;
  border-radius: 4px;
}
.check-text .link { font-weight: 600; }
.link:hover { color: #fff; text-decoration: underline; }
.link:focus-visible {
  outline: 2px solid var(--violet);
  outline-offset: 2px;
}
.forgot { font-size: 12.5px; }

/* ---------- Submit -------------------------------------- */

.btn {
  position: relative;
  width: 100%;
  border: 0;
  border-radius: 12px;
  font: inherit;
  font-weight: 600;
  font-size: 14.5px;
  color: #1B1308;
  padding: 14px;
  min-height: 50px;
  cursor: pointer;
  background: linear-gradient(135deg, var(--violet-600), var(--violet-700) 55%, var(--magenta));
  box-shadow:
    0 10px 26px rgba(226, 85, 43, .42),
    inset 0 1px 0 rgba(255, 255, 255, .35);
  transition: transform .12s, box-shadow .2s, filter .2s, opacity .15s, background .2s;
  overflow: hidden;
}
.btn:hover {
  filter: brightness(1.05);
  box-shadow: 0 16px 38px rgba(226, 85, 43, .5);
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible {
  outline: 2px solid var(--violet-bright);
  outline-offset: 3px;
}

/* Gated: visible but disabled (opacity, not hidden) */
.btn[aria-disabled="true"] {
  background: rgba(245, 165, 36, .14);
  color: var(--faint);
  box-shadow: none;
  filter: none;
  opacity: .6;
  cursor: not-allowed;
}
.btn[aria-disabled="true"]:hover { filter: none; box-shadow: none; }
.btn[aria-disabled="true"]:active { transform: none; }

/* Loading state */
.btn.is-loading .btn-label { opacity: 0; }
.btn-spinner {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border: 2px solid rgba(255, 255, 255, .4);
  border-top-color: #fff;
  border-radius: 50%;
  opacity: 0;
  animation: spin .7s linear infinite;
}
.btn.is-loading .btn-spinner { opacity: 1; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Demo status --------------------------------- */

.form-status {
  margin: 12px 0 0;
  padding: 11px 13px;
  font-size: 12.5px;
  line-height: 1.45;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(226, 85, 43, .1);
  color: var(--muted);
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.form-status[hidden] { display: none; }
.form-status strong { color: var(--text); font-weight: 600; }
.form-status .dot {
  flex: none;
  width: 7px;
  height: 7px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--magenta);
  box-shadow: 0 0 0 3px rgba(226, 85, 43, .22);
}

/* ---------- Footer -------------------------------------- */

.foot {
  display: flex;
  flex-direction: column;     /* stack so neither line ever wraps/cramps */
  align-items: center;        /* centered + symmetric at every width */
  gap: 8px;
  margin: 22px 0 0;
  font-size: 12px;
  text-align: center;
}
.foot-alt {
  order: 1;                   /* swap prompt sits on top (it's the action) */
  text-align: center;
}
.foot-alt .link { font-size: 13px; }
.mono {
  order: 2;                   /* studio credit underneath, quieter */
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: -.01em;
  color: var(--faint);
}

/* ============================================================
   Mode-driven reveal of conditional fields
   grid-template-rows 0fr -> 1fr (no JS pixel measuring)
   ============================================================ */

.reveal {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows .34s var(--ease-soft), opacity .26s var(--ease-soft);
}
.reveal-inner {
  overflow: hidden;
  min-height: 0;
}

/* Inline reveals (forgot link) collapse width, not rows */
.reveal-inline {
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s var(--ease-soft);
}

/* Sign-in mode: show data-reveal="in"; sign-up mode: show data-reveal="up" */
.card[data-mode="in"] .reveal[data-reveal="in"],
.card[data-mode="up"] .reveal[data-reveal="up"] {
  grid-template-rows: 1fr;
  opacity: 1;
}
.card[data-mode="in"] .reveal-inline[data-reveal="in"] {
  opacity: 1;
  pointer-events: auto;
}

/* Disable inputs inside collapsed reveals so they leave the tab order */
.reveal[aria-hidden="true"] input { visibility: hidden; }

/* ---------- Responsive ---------------------------------- */

@media (max-width: 480px) {
  .stage { padding: 14px; align-items: flex-start; }
  .card {
    border-radius: 20px;
    box-shadow:
      0 1px 2px rgba(0, 0, 0, .5),
      0 14px 40px rgba(0, 0, 0, .55),
      0 0 60px rgba(226, 85, 43, .2);
  }
}

@media (max-width: 360px) {
  .card { padding: 20px 18px; }
  .title { font-size: 20px; }
}

/* Larger viewports: a touch more presence */
@media (min-width: 1024px) {
  .card { width: 452px; }
}

/* ---------- Touch targets ------------------------------- */
@media (pointer: coarse) {
  .toggle { width: 40px; height: 40px; }
  .link, .forgot { padding: 2px 0; }
}

/* ---------- Touch / no-hover: static centered glow ------ */
@media (hover: none), (pointer: coarse) {
  .cursor-glow {
    background:
      radial-gradient(
        560px 560px at 50% 38%,
        rgba(245, 165, 36, .1),
        rgba(245, 165, 36, .05) 34%,
        transparent 70%
      );
    transition: none;
  }
  .card::before,
  .card::after { /* hold a gentle, fixed top-center sheen */
    --spot-x: 50%;
    --spot-y: -4%;
  }
}

/* ---------- Reduced motion ------------------------------ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .bg-grid { animation: none; }
  .bg-aurora { animation: none; }
  .reveal { transition: opacity .001ms; }
  /* Gentle static glow, no cursor jitter */
  .cursor-glow {
    background:
      radial-gradient(
        560px 560px at 50% 38%,
        rgba(245, 165, 36, .09),
        rgba(245, 165, 36, .045) 34%,
        transparent 70%
      );
    transition: none !important;
  }
}

/* ---------- Utility ------------------------------------- */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Print: just the card on white */
@media print {
  body { background: #fff; color: #000; }
  .cursor-glow, .bg-aurora, .bg-grid, .bg-grain { display: none; }
  .card {
    box-shadow: none;
    border: 1px solid #ccc;
    background: #fff;
    color: #000;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

/* ============================================================
   PREMIUM PASS (shared) — a soft light-sweep glides across
   primary buttons on hover. Pure visual; markup & JS untouched.
   The global reduced-motion guard above neutralizes it.
   ============================================================ */
.btn:not(.btn-ghost):not([aria-disabled="true"])::after {
  content: "";
  position: absolute;
  top: 0;
  left: -150%;
  width: 70%;
  height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .30), transparent);
  transform: skewX(-20deg);
  pointer-events: none;
  z-index: 1;
  transition: left .6s var(--ease-soft);
}
.btn:not(.btn-ghost):not([aria-disabled="true"]):hover::after { left: 160%; }
.btn-label { position: relative; z-index: 2; }
.btn-spinner { z-index: 2; }