/* Aurora signup — direction 2c "Orrery".
 *
 * Arrival + tour are 2c (the dial, the instrument). The form, status and
 * review screens carry over from 1b "Observatory" unchanged, which is what
 * turn 2 of the design specifies.
 *
 * Every colour here is a Nocturne token or a service accent from the
 * catalogue in app/services.py. Page background is #0f111c — the design's
 * screen ground, one step under --color-bg, applied per-screen rather than
 * as a token override so Nocturne's own components stay on their surface.
 */

:root {
  --ground: #0f111c;
  --ground-lift: #12141f;
  --ground-card: #171a29;
  --hairline: #23252f;
  --hairline-2: #2d3040;
  --banner: var(--color-section); /* #262a60 */
}

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

body.aurora {
  background: var(--ground);
  color: var(--color-text);
  min-height: 100vh;
  min-height: 100dvh;
}

/* Phone-first: the design is drawn at 390px wide. Above that the column
 * simply centres — the layout is intentionally one column at every size. */
.screen {
  max-width: 430px;
  margin: 0 auto;
  position: relative;
}
@media (min-width: 760px) {
  .screen { max-width: 468px; }
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.kicker {
  font-size: 10.5px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--color-neutral-600);
}
.kicker-accent { color: var(--color-accent-500); }

.lede   { font-size: 16px; line-height: 1.6; color: var(--color-neutral-300); margin: 0 0 12px; }
.lede-2 { font-size: 15px; line-height: 1.6; color: var(--color-neutral-500); margin: 0 0 30px; }

/* ── @keyframes ─────────────────────────────────────────────────────────
 * 2c · motion:  ring       spin 60s linear ∞
 *               node select 200ms cubic-bezier(.2,.8,.3,1), mark cross-fades
 *               banner dot  twinkle 3.4s
 *               reduced motion → ring static, select instant
 * ──────────────────────────────────────────────────────────────────────── */
@keyframes aur-spin    { to { transform: rotate(360deg); } }
@keyframes aur-twinkle { 0%, 100% { opacity: 0.25; } 50% { opacity: 0.9; } }
@keyframes aur-fade    { from { opacity: 0; } to { opacity: 1; } }

/* ═══════════════════════════════════════════════════════════════════════
   1 · Arrival — the orrery
   ═══════════════════════════════════════════════════════════════════════ */

.arrival { padding: 34px 24px 40px; }
.arrival .kicker { display: block; margin-bottom: 22px; }

.orrery {
  position: relative;
  height: 300px;
  margin: 0 -24px 22px;
}
.orrery svg { display: block; }
.orrery-ring {
  transform-origin: 160px 150px;
  animation: aur-spin 60s linear infinite;
}

.wordmark {
  font-size: 54px;
  line-height: 0.9;
  letter-spacing: -0.05em;
  margin: 0 0 6px;
  font-weight: 500;
}
.tagline {
  font-size: 11.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--color-accent-500);
  margin-bottom: 24px;
}

/* The one call to action. Nocturne outlines primary actions rather than
 * filling them; 2c gives it an 8px radius and pushes the arrow right. */
.cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
  padding: 0 22px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-accent);
  color: var(--color-accent-400);
  text-decoration: none;
  font-size: 16.5px;
}
.cta:hover  { background: color-mix(in srgb, var(--color-accent) 12%, transparent); }
.cta:active { background: color-mix(in srgb, var(--color-accent) 22%, transparent); }
.cta-arrow { font-size: 18px; }

.cta-note {
  text-align: center;
  font-size: 12.5px;
  color: var(--color-neutral-600);
  margin: 13px 0 0;
}

/* ═══════════════════════════════════════════════════════════════════════
   2 · The form (/join) — carried over from 1b
   ═══════════════════════════════════════════════════════════════════════ */

.join-wrap { padding: 26px 20px 44px; }

.join-card {
  border-radius: 18px;
  background: var(--ground-card);
  box-shadow: 0 0 0 1px var(--hairline-2), 0 18px 44px rgba(0, 0, 0, 0.5);
  padding: 26px 20px 24px;
}
.join-card .kicker { display: block; margin-bottom: 10px; }
.join-title {
  font-size: 27px;
  letter-spacing: -0.025em;
  margin: 0 0 24px;
  font-weight: 500;
}

.f { margin-bottom: 18px; }
.f-pass { margin-bottom: 22px; }

.f label {
  display: block;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-neutral-500);
  margin-bottom: 8px;
}

/* Underlined fields, not boxes — 1b overrides Nocturne's .input surface. */
.f input.input {
  min-height: 48px;
  font-size: 16px; /* 16px keeps iOS from zooming on focus */
  border-radius: 0;
  border: 0;
  border-bottom: 1px solid var(--color-neutral-800);
  background: transparent;
  padding: 0 2px;
}
.f input.input:hover { border-bottom-color: color-mix(in srgb, var(--color-text) 45%, transparent); }
.f input.input:focus-visible {
  border-bottom-color: var(--color-accent);
  outline: none;
  box-shadow: 0 1px 0 0 var(--color-accent);
}
.f input.input[aria-invalid="true"] { border-bottom-color: var(--color-accent-300); }

.f-hint { font-size: 12px; color: var(--color-neutral-600); margin-top: 7px; }
.f-err  { font-size: 12.5px; color: var(--color-accent-300); margin-top: 8px; }
.f-pass .f-err { margin-top: 10px; }

/* Password rules, shown before you type and ticked as you go. */
.pwrules {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
  padding: 0;
  list-style: none;
}
.pwrule {
  font-size: 11.5px;
  padding: 5px 11px;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px currentColor;
  color: var(--color-neutral-600);
}
.pwrule[data-met="1"] { color: var(--color-accent-400); }
.pwrule-mark::after { content: "·"; }
.pwrule[data-met="1"] .pwrule-mark::after { content: "✓"; }

/* Turnstile occupies a fixed 300×65 slot. Reserve it so the button never
 * jumps when the widget mounts; the placeholder shows if JS is off. */
.turnstile-slot {
  width: 300px;
  max-width: 100%;
  min-height: 65px;
  margin-bottom: 22px;
}
.turnstile-ph {
  width: 100%;
  height: 65px;
  border-radius: var(--radius-md);
  background: var(--color-surface);
  box-shadow: 0 0 0 1px var(--color-neutral-800);
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 14px;
  font-size: 12.5px;
  color: var(--color-neutral-400);
}
.turnstile-ph-box {
  width: 20px; height: 20px;
  border-radius: 3px;
  border: 1.5px solid var(--color-neutral-600);
  flex: none;
}
.turnstile-ph-brand {
  margin-left: auto;
  font-size: 9px;
  letter-spacing: 0.06em;
  color: var(--color-neutral-700);
  text-align: right;
  line-height: 1.2;
}

.btn-pill { border-radius: 999px; }
.join-submit { min-height: 54px; font-size: 16px; margin: 0; }

.submitting-row {
  display: flex;
  align-items: center;
  gap: 9px;
  justify-content: center;
  margin-top: 12px;
  font-size: 12.5px;
  color: var(--color-neutral-500);
}
.spinner {
  width: 12px; height: 12px;
  border-radius: 50%;
  border: 1.5px solid var(--hairline-2);
  border-top-color: var(--color-accent);
  display: block;
  animation: aur-spin 1s linear infinite;
}

.join-foot {
  font-size: 12px;
  line-height: 1.6;
  color: var(--color-neutral-600);
  margin: 16px 6px 0;
  text-align: center;
}

/* A server-side error that isn't about one field. */
.form-error {
  border-radius: var(--radius-md);
  background: var(--color-accent-900);
  box-shadow: inset 0 0 0 1px var(--color-accent-700);
  padding: 12px 14px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--color-accent-200);
  margin: 0 0 20px;
}

/* ═══════════════════════════════════════════════════════════════════════
   3 · The tour (/welcome) — 2c, the dial
   ═══════════════════════════════════════════════════════════════════════ */

.pending-banner {
  position: sticky;
  top: 0;
  z-index: 6;
  background: var(--banner);
  padding: 14px 20px;
  display: flex;
  gap: 12px;
  align-items: center;
}
.pending-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--color-accent-400);
  flex: none;
  animation: aur-twinkle 3.4s ease-in-out infinite;
}
.pending-copy { font-size: 13.5px; line-height: 1.4; }
.pending-copy strong { color: var(--color-accent-300); font-weight: 400; }

.tour-head { padding: 30px 22px 16px; }
.tour-head .kicker { display: block; margin-bottom: 12px; }
.tour-title {
  font-size: 32px;
  line-height: 1.02;
  letter-spacing: -0.04em;
  margin: 0 0 10px;
  font-weight: 500;
}
.tour-sub { font-size: 14.5px; line-height: 1.55; color: var(--color-neutral-500); margin: 0; }

/* The dial: five positions. Radio inputs so it works without JS and
 * arrow-keys move between them for free. */
.dial {
  display: flex;
  gap: 8px;
  padding: 8px 22px 20px;
  border: 0;
  margin: 0;
  min-width: 0;
}
.dial legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

.dial-node {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  padding: 12px 0 10px;
  border: 0;
  border-radius: 10px;
  background: var(--ground-lift);
  box-shadow: 0 0 0 1px var(--hairline);
  cursor: pointer;
  color: var(--color-neutral-600);
  font-family: inherit;
  transition: box-shadow 200ms cubic-bezier(0.2, 0.8, 0.3, 1),
              color 200ms cubic-bezier(0.2, 0.8, 0.3, 1);
}
.dial-node input { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }
.dial-node svg { display: block; }
.dial-node-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--color-neutral-800);
  display: block;
  transition: background 200ms cubic-bezier(0.2, 0.8, 0.3, 1);
}
.dial-node:hover { box-shadow: 0 0 0 1px var(--color-neutral-700); }
.dial-node:has(input:checked) {
  color: var(--svc);
  box-shadow: 0 0 0 1px var(--svc);
}
.dial-node:has(input:checked) .dial-node-dot { background: var(--svc); }
.dial-node:has(input:focus-visible) { outline: 2px solid var(--color-accent); outline-offset: 2px; }

/* The read-out. One panel per service; the checked node reveals its own. */
.readout {
  margin: 0 22px 22px;
  border-radius: 16px;
  background: var(--ground-lift);
  box-shadow: 0 0 0 1px var(--hairline);
  overflow: hidden;
}
/* Hidden by default; welcome.html generates one :has() rule per dial
 * position to reveal the matching panel. The cross-fade (no slide) is the
 * 2c spec — 200ms cubic-bezier(.2,.8,.3,1). */
.readout-panel { display: none; }
.readout-panel { animation: aur-fade 200ms cubic-bezier(0.2, 0.8, 0.3, 1); }

.readout-stage {
  position: relative;
  height: 190px;
  background: radial-gradient(90% 120% at 50% 0%, #1a1d30, var(--ground-lift));
}
.readout-halo {
  position: absolute;
  top: 34px; left: 50%;
  transform: translateX(-50%);
  width: 124px; height: 124px;
  border-radius: 50%;
  background: var(--svc);
  opacity: 0.1;
}
.readout-mark {
  position: absolute;
  top: 66px; left: 50%;
  transform: translateX(-50%);
  color: var(--svc);
}
.readout-idx {
  position: absolute;
  left: 16px; top: 14px;
  font-size: 10.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-neutral-600);
}
.readout-body { padding: 22px 20px 24px; border-top: 1px solid var(--hairline); }
.readout-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.readout-key { font-size: 28px; letter-spacing: -0.03em; color: var(--svc); }
.readout-app {
  font-size: 10.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-neutral-600);
}
.readout-short { font-size: 16.5px; line-height: 1.45; color: var(--color-text); margin-bottom: 9px; }
.readout-blurb { font-size: 14.5px; line-height: 1.6; color: var(--color-neutral-500); }

.tour-foot { padding: 0 22px 40px; }
.onekey {
  display: flex;
  gap: 13px;
  align-items: flex-start;
  padding: 20px 0;
  border-top: 1px solid var(--color-divider);
}
.onekey svg { flex: none; color: var(--color-accent-400); margin-top: 2px; }
.onekey-title { font-size: 16.5px; margin-bottom: 6px; }
.onekey p { font-size: 14.5px; line-height: 1.6; color: var(--color-neutral-500); margin: 0; }

.tour-foot .btn-block { min-height: 50px; font-size: 15px; border-radius: var(--radius-md); margin-top: 8px; }

/* ═══════════════════════════════════════════════════════════════════════
   4 · Status (/status/…) — 1b
   ═══════════════════════════════════════════════════════════════════════ */

.st-pending  { padding: 60px 24px 40px; }
.st-approved { padding: 60px 24px 44px; background: radial-gradient(110% 46% at 50% 10%, var(--color-section) 0%, var(--ground) 70%); }
.st-declined { padding: 150px 24px 40px; }
.st-approved, .st-declined { min-height: 100vh; min-height: 100dvh; }

.st-constellation { display: block; margin-bottom: 34px; }
.st-approved .st-constellation { margin-bottom: 30px; }

.st-pending .kicker, .st-approved .kicker, .st-declined .kicker { display: block; margin-bottom: 14px; }
.st-approved .kicker { color: var(--color-accent-400); }
.st-declined .kicker { color: var(--color-neutral-500); margin-bottom: 16px; }

.st-h {
  font-size: 32px;
  line-height: 1.06;
  letter-spacing: -0.035em;
  margin: 0 0 16px;
  font-weight: 500;
}
.st-approved .st-h { font-size: 42px; line-height: 0.98; letter-spacing: -0.04em; }
.st-declined .st-h { font-size: 31px; line-height: 1.08; letter-spacing: -0.03em; }

.st-p { font-size: 16px; line-height: 1.6; color: var(--color-neutral-400); margin: 0 0 28px; }
.st-approved .st-p { color: var(--color-neutral-300); margin-bottom: 30px; }
.st-declined .st-p { margin-bottom: 14px; }
.st-declined .st-p:last-of-type { margin-bottom: 28px; }

.st-facts {
  font-size: 14px;
  line-height: 2;
  color: var(--color-neutral-600);
  border-top: 1px solid var(--color-divider);
  padding-top: 14px;
}
.st-fact { display: flex; justify-content: space-between; gap: 12px; }
.st-fact span:last-child { color: var(--color-neutral-300); }

/* The approved screen is the one place the accent is allowed to be a fill:
 * the whole screen is a door. */
.st-door {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 58px;
  border-radius: 999px;
  background: var(--color-accent);
  color: var(--color-bg);
  text-decoration: none;
  font-size: 16.5px;
  font-weight: 500;
}
.st-door:hover  { background: var(--color-accent-400); }
.st-door:active { background: var(--color-accent-600); }

.st-declined .btn-block { min-height: 50px; font-size: 15px; border-radius: 999px; margin: 0; }

/* ═══════════════════════════════════════════════════════════════════════
   5 · Review (/review/…) — 1b, admin only
   ═══════════════════════════════════════════════════════════════════════ */

.rv { padding: 40px 24px 40px; }
.rv .kicker { display: block; margin-bottom: 16px; }
.rv-name {
  font-size: 34px;
  line-height: 1.04;
  letter-spacing: -0.035em;
  margin: 0 0 4px;
  font-weight: 500;
}
.rv-user { font-size: 18px; color: var(--color-accent-400); letter-spacing: 0.02em; margin-bottom: 26px; }

.rv-facts {
  border-radius: var(--radius-lg);
  background: var(--ground-card);
  box-shadow: 0 0 0 1px var(--hairline-2);
  padding: 16px 18px;
  font-size: 14.5px;
  line-height: 2;
  color: var(--color-neutral-500);
}
.rv-fact { display: flex; justify-content: space-between; gap: 12px; }
.rv-fact span:last-child { color: var(--color-text); text-align: right; }

.rv-slide-wrap { margin-top: 64px; }
.rv-slide-label {
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-neutral-600);
  margin-bottom: 12px;
  text-align: center;
}

/* Slide to approve. Deliberately not a button a thumb finds by accident. */
.rv-track {
  position: relative;
  height: 64px;
  border-radius: 999px;
  background: var(--ground-card);
  box-shadow: 0 0 0 1px var(--color-neutral-800);
  overflow: hidden;
  touch-action: none;
}
.rv-fill {
  position: absolute;
  inset: 0;
  width: 0%;
  background: linear-gradient(90deg, var(--color-accent-900), var(--color-accent-800));
}
.rv-track-label {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 15px;
  color: var(--color-neutral-500);
  pointer-events: none;
  letter-spacing: 0.04em;
}
.rv-knob {
  position: absolute;
  top: 6px; left: 6px;
  width: 52px; height: 52px;
  border: 0;
  border-radius: 50%;
  background: var(--color-accent);
  color: var(--color-bg);
  display: grid;
  place-items: center;
  font-size: 20px;
  cursor: grab;
  touch-action: none;
  transform: translateX(0);
}
.rv-knob:active { cursor: grabbing; }
.rv-fill, .rv-knob { transition: transform 160ms ease-out, width 160ms ease-out; }
.rv-track[data-dragging="1"] .rv-fill,
.rv-track[data-dragging="1"] .rv-knob { transition: none; }

.rv-divider {
  height: 1px;
  background: linear-gradient(to right, transparent, var(--color-divider), transparent);
  margin: 58px 0 18px;
}
.rv-decline-row { text-align: center; }
.rv-decline-row .btn { font-size: 13.5px; color: var(--color-neutral-600); }
.rv-decline-row .btn:hover { color: var(--color-accent-400); }

/* No-JS fallback: the slider can't work, so offer a plain two-step form. */
.rv-nojs { margin-top: 24px; }
.rv-nojs .btn-block { min-height: 50px; font-size: 15px; border-radius: 999px; }

.rv-done {
  padding: 170px 24px 40px;
  min-height: 100vh;
  min-height: 100dvh;
  background: radial-gradient(110% 40% at 50% 22%, var(--color-section) 0%, var(--ground) 68%);
  text-align: center;
}
.rv-done-declined { padding: 220px 24px 40px; background: none; }
.rv-done h2 { font-size: 32px; letter-spacing: -0.035em; margin: 0 0 12px; font-weight: 500; }
.rv-done-declined h2 { font-size: 31px; }
.rv-done p { font-size: 15.5px; line-height: 1.6; color: var(--color-neutral-400); margin: 0 0 6px; }
.rv-done p.dim { font-size: 14px; color: var(--color-neutral-600); margin-bottom: 22px; }
.rv-done p:last-of-type { margin-bottom: 22px; }
.rv-done-svg { display: block; margin-bottom: 26px; opacity: 0.9; }

/* The queue at /review — plain on purpose, audience of one. */
.q { padding: 40px 24px 60px; }
.q h1 { font-size: 30px; letter-spacing: -0.03em; margin: 0 0 24px; }
.q-empty { color: var(--color-neutral-500); font-size: 15px; }
.q-row {
  display: block;
  text-decoration: none;
  color: inherit;
  padding: 16px 0;
  border-top: 1px solid var(--color-divider);
}
.q-row:hover { background: color-mix(in srgb, var(--color-text) 4%, transparent); }
.q-row-top { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.q-row-name { font-size: 18px; }
.q-row-user { color: var(--color-accent-400); font-size: 14px; }
.q-row-meta { font-size: 13px; color: var(--color-neutral-600); margin-top: 4px; }

/* ── reduced motion ──────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .orrery-ring { animation: none; }
  .pending-dot { animation: none; opacity: 0.9; }
  .spinner { animation: none; }
  .readout-panel[data-on="1"] { animation: none; }
  .dial-node, .dial-node-dot, .rv-fill, .rv-knob { transition: none; }
  .st-constellation circle { animation: none !important; }
}

/* ═══════════════════════════════════════════════════════════════════════
   Signups closed (/join while SIGNUP_OPEN=0)
   The arrival screen with the lights down: same ring, same rhythm, drained
   of accent so it reads as "not yet" rather than "broken".
   ═══════════════════════════════════════════════════════════════════════ */

.orrery-dim { opacity: 0.45; }
.orrery-dim .orrery-ring { animation-duration: 150s; }

.closed-title {
  font-size: 40px;
  line-height: 1.02;
  letter-spacing: -0.04em;
  margin: 0 0 8px;
  font-weight: 500;
}
.tagline-dim { color: var(--color-neutral-600); }
.closed-back { min-height: 50px; font-size: 15px; margin-top: 22px; }

/* A decision that did not take. Loud on purpose — the previous version
 * re-rendered this page unchanged, which read as a slider that did nothing. */
.rv-error {
  border-radius: var(--radius-md);
  background: var(--color-accent-900);
  box-shadow: inset 0 0 0 1px var(--color-accent-600);
  padding: 14px 16px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--color-accent-200);
  margin: 0 0 22px;
}
