/* =========================================================
   WEALTH NEXUS — FOUNDING COHORT APPLICATION
   Design tokens locked 2026-05-30 (carried over from preview.html,
   the approved design). Shared system for the lander later.
   ========================================================= */
:root {
  --bg:          #0B0B0D;   /* near-black base */
  --bg-elev:     #141417;   /* raised surface */
  --text:        #F4F2ED;   /* warm off-white */
  --text-dim:    #95949A;   /* muted grey */
  --line:        rgba(244,242,237,0.10);
  --line-strong: rgba(244,242,237,0.24);

  --red:         #A51C30;   /* primary crimson */
  --red-deep:    #7E1521;   /* oxblood */
  --red-bright:  #C42032;   /* hover / glow */
  --red-tint:    rgba(165,28,48,0.10);

  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --sans:  'Montserrat', system-ui, -apple-system, sans-serif;

  --radius: 12px;
  --maxw:   660px;
  --ease:   cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { height: 100%; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100%;
  overflow-x: hidden;       /* never scroll sideways */
  position: relative;
}

/* =========================================================
   BACKGROUND LAYERS — subtle (locked for the FORM).
   Gradient/aurora is reserved for the lander, so it's not here.
   ========================================================= */
.bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; }

.bg-base { background: var(--bg); }

/* Soft red glow — drifts slowly. Transform-only animation (compositor-cheap). */
.bg-glow {
  opacity: 0;
  transition: opacity 1.2s var(--ease);
  background:
    radial-gradient(60% 55% at 30% 35%, rgba(165,28,48,0.20), transparent 70%),
    radial-gradient(50% 50% at 75% 70%, rgba(126,21,33,0.16), transparent 70%);
  animation: drift 26s ease-in-out infinite alternate;
  will-change: transform;
}

/* Edge vignette, always on — focuses the centre */
.bg-vignette {
  background: radial-gradient(120% 120% at 50% 45%, transparent 55%, rgba(0,0,0,0.55) 100%);
}

/* Film grain — STATIC baked SVG noise (not animated). The premium texture. */
.bg-grain {
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

body.bg-subtle .bg-glow { opacity: 1; }

@keyframes drift {
  from { transform: translate3d(-3%, -2%, 0) scale(1.05); }
  to   { transform: translate3d(3%, 2%, 0) scale(1.15); }
}

/* Pause the drift when the tab is hidden (battery), and respect reduced-motion. */
.bg.paused { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) {
  .bg-glow { animation: none; }
}

/* =========================================================
   LAYOUT
   ========================================================= */
.shell {
  position: relative; z-index: 1;
  min-height: 100vh;        /* fills short screens, grows + scrolls when tall */
  display: flex; flex-direction: column;
  padding: 28px clamp(20px, 5vw, 56px) 40px;
}

/* Top bar */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%;
}
.wordmark {
  font-weight: 600; font-size: 13px; letter-spacing: 0.34em;
  color: var(--text); text-transform: uppercase;
}
.wordmark span { color: var(--red-bright); }
.stepcount {
  font-size: 12px; letter-spacing: 0.18em; color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

/* Progress bar */
.progress {
  margin-top: 18px; height: 2px; width: 100%;
  background: var(--line); border-radius: 2px; overflow: hidden;
}
.progress > i {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--red-deep), var(--red-bright));
  box-shadow: 0 0 12px rgba(196,32,50,0.55);
  border-radius: 2px;
  transition: width 0.5s var(--ease);
}

/* Centre stage */
.stage {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  width: 100%; max-width: var(--maxw); margin: 0 auto;
  padding: 32px 0;
}

.eyebrow {
  font-size: 11px; letter-spacing: 0.32em; text-transform: uppercase;
  color: var(--red-bright); opacity: 0.85; margin-bottom: 22px;
  animation: rise 0.7s var(--ease) both;
}

.question {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2rem, 4.6vw, 3rem);
  line-height: 1.12;
  letter-spacing: -0.01em;
  color: var(--text);
  margin-bottom: 14px;
  animation: rise 0.7s var(--ease) 0.06s both;
}

/* Helper / sub text under a question (confidential notes on Q3, Q8, etc.) */
.helper {
  font-size: 14px; line-height: 1.55; color: var(--text-dim);
  max-width: 52ch; margin: 0 auto 30px;
  animation: rise 0.7s var(--ease) 0.1s both;
}
.question + .helper { margin-top: 4px; }
.question.tight { margin-bottom: 30px; }

/* =========================================================
   OPTIONS (single + multi select)
   ========================================================= */
.options {
  display: flex; flex-direction: column; gap: 12px; width: 100%;
}
.option {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  text-align: left;
  padding: 17px 22px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.015);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--sans); font-size: 15.5px; font-weight: 400; line-height: 1.4;
  cursor: pointer;
  transition: border-color 0.22s var(--ease), background 0.22s var(--ease), transform 0.22s var(--ease);
  animation: rise 0.6s var(--ease) both;
}
.option:hover {
  border-color: var(--line-strong);
  background: rgba(255,255,255,0.035);
  transform: translateY(-1px);
}
.option:focus-visible {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 2px var(--red-tint);
}
.option .dot {
  flex: 0 0 auto; width: 16px; height: 16px; border-radius: 50%;
  border: 1px solid var(--line-strong);
  transition: all 0.22s var(--ease); position: relative;
}
.option.selected {
  border-color: var(--red);
  background: var(--red-tint);
  box-shadow: inset 0 0 0 1px var(--red), 0 8px 30px rgba(126,21,33,0.18);
}
.option.selected .dot {
  border-color: var(--red-bright);
  background: var(--red);
  box-shadow: 0 0 10px rgba(196,32,50,0.7);
}
.option.selected .dot::after {
  content: ''; position: absolute; inset: 4px; border-radius: 50%; background: var(--text);
}
/* Small grey sub-line under an option label (e.g. the Q8 "Less than $1,000" nudge) */
.opt-note {
  display: block; margin-top: 6px;
  font-size: 13px; line-height: 1.45; color: var(--text-dim);
}

/* Multi-select uses a square indicator (checkbox affordance) */
.options.multi .option .dot { border-radius: 4px; }
.options.multi .option.selected .dot::after { border-radius: 1px; }
/* When the 2-pick cap is reached, unselected rows dim to signal "full" */
.options.multi.capped .option:not(.selected) { opacity: 0.4; }
.options.multi.capped .option:not(.selected):hover { transform: none; }

/* stagger option entrance */
.option:nth-child(1){animation-delay:.08s}
.option:nth-child(2){animation-delay:.13s}
.option:nth-child(3){animation-delay:.18s}
.option:nth-child(4){animation-delay:.23s}
.option:nth-child(5){animation-delay:.28s}
.option:nth-child(6){animation-delay:.33s}
.option:nth-child(7){animation-delay:.38s}
.option:nth-child(8){animation-delay:.43s}
.option:nth-child(9){animation-delay:.48s}
.option:nth-child(10){animation-delay:.53s}

/* =========================================================
   TEXT FIELDS (contact step + open-text questions)
   ========================================================= */
.fields {
  display: flex; flex-direction: column; gap: 16px; width: 100%; text-align: left;
}
.field { display: flex; flex-direction: column; gap: 7px; animation: rise 0.6s var(--ease) both; }
.field label {
  font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-dim);
}
.field input,
.field textarea {
  width: 100%;
  font-family: var(--sans); font-size: 16px; color: var(--text);
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 15px 18px;
  transition: border-color 0.22s var(--ease), background 0.22s var(--ease), box-shadow 0.22s var(--ease);
}
.field textarea { resize: vertical; min-height: 116px; line-height: 1.5; }
.field input::placeholder,
.field textarea::placeholder { color: var(--text-dim); opacity: 0.6; }
.field input:hover,
.field textarea:hover { border-color: var(--line-strong); }
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--red);
  background: rgba(255,255,255,0.04);
  box-shadow: 0 0 0 2px var(--red-tint);
}
.field.invalid input,
.field.invalid textarea { border-color: var(--red-bright); }
.field .field-error {
  font-size: 12.5px; color: var(--red-bright); min-height: 1em;
}

/* Single open-text question (Q6/Q7) gets one centered field block */
.fields.single-text { max-width: 560px; margin: 0 auto; }

/* Optional follow-up text under a single-select (Q2) */
.followup { width: 100%; margin-top: 14px; text-align: left; animation: rise 0.6s var(--ease) 0.2s both; }
.followup textarea {
  width: 100%; font-family: var(--sans); font-size: 15px; color: var(--text);
  background: rgba(255,255,255,0.02); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 13px 16px; min-height: 70px; resize: vertical; line-height: 1.5;
  transition: border-color 0.22s var(--ease), box-shadow 0.22s var(--ease);
}
.followup textarea:focus {
  outline: none; border-color: var(--red); box-shadow: 0 0 0 2px var(--red-tint);
}

/* =========================================================
   ACTIONS (Back / Continue)
   ========================================================= */
.actions {
  margin-top: 34px; display: flex; align-items: center; justify-content: center; gap: 22px;
  animation: rise 0.7s var(--ease) 0.42s both;
}
.back {
  background: none; border: none; color: var(--text-dim); cursor: pointer;
  font-family: var(--sans); font-size: 13px; letter-spacing: 0.04em;
  transition: color 0.2s var(--ease);
}
.back:hover { color: var(--text); }
.back:focus-visible { outline: none; color: var(--text); text-decoration: underline; }
.continue {
  position: relative;
  font-family: var(--sans); font-weight: 600; font-size: 15px; letter-spacing: 0.04em;
  color: #fff; cursor: pointer;
  padding: 15px 46px; border: none; border-radius: 100px;
  background: linear-gradient(180deg, var(--red), var(--red-deep));
  box-shadow: 0 8px 26px rgba(126,21,33,0.30);
  opacity: 0.45; pointer-events: none;
  transition: opacity 0.3s var(--ease), filter 0.2s var(--ease), box-shadow 0.3s var(--ease), transform 0.15s var(--ease);
}
.continue.ready { opacity: 1; pointer-events: auto; }
.continue.ready:hover { filter: brightness(1.10); box-shadow: 0 10px 34px rgba(196,32,50,0.42); transform: translateY(-1px); }
.continue.ready:active { transform: translateY(0); }
.continue:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--red-tint), 0 8px 26px rgba(126,21,33,0.30); }
.continue.busy { pointer-events: none; opacity: 0.8; }
.continue.busy .label { opacity: 0; }
.continue.busy::after {
  content: ''; position: absolute; top: 50%; left: 50%;
  width: 18px; height: 18px; margin: -9px 0 0 -9px;
  border: 2px solid rgba(255,255,255,0.35); border-top-color: #fff; border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Submit error + mailto fallback */
.submit-error {
  margin-top: 18px; font-size: 14px; line-height: 1.55; color: var(--text);
  background: var(--red-tint); border: 1px solid var(--red);
  border-radius: var(--radius); padding: 14px 18px; max-width: 460px;
  animation: rise 0.4s var(--ease) both;
}
.submit-error a { color: var(--red-bright); font-weight: 600; }

/* Cap hint for the multi-select ("pick up to 2") */
.cap-hint {
  font-size: 12.5px; letter-spacing: 0.04em; color: var(--text-dim);
  margin-top: 14px; min-height: 1em; transition: color 0.2s var(--ease);
}
.cap-hint.flash { color: var(--red-bright); }

/* =========================================================
   WELCOME + OUTCOME SCREENS
   ========================================================= */
.intro-copy {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(1.05rem, 2.3vw, 1.3rem); line-height: 1.62;
  color: var(--text); opacity: 0.92; max-width: 54ch; margin: 0 auto 36px;
  animation: rise 0.8s var(--ease) 0.12s both;
}
.outcome-icon {
  width: 46px; height: 46px; margin: 0 auto 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--red); color: var(--red-bright);
  box-shadow: 0 0 26px rgba(196,32,50,0.25), inset 0 0 0 1px var(--red-tint);
  animation: rise 0.7s var(--ease) both;
}
.outcome-body {
  font-size: 16px; line-height: 1.62; color: var(--text-dim);
  max-width: 50ch; margin: 0 auto 30px;
  animation: rise 0.7s var(--ease) 0.12s both;
}
.outcome-body strong { color: var(--text); font-weight: 500; }

/* Calendly inline embed container (success screen) */
.calendly-embed {
  width: 100%; min-width: 320px; height: 680px; margin-top: 8px;
  border-radius: var(--radius); overflow: hidden;
  animation: rise 0.7s var(--ease) 0.2s both;
}
.booking-fallback {
  margin-top: 6px; font-size: 15px; line-height: 1.6; color: var(--text-dim);
  border: 1px dashed var(--line-strong); border-radius: var(--radius);
  padding: 22px 24px; max-width: 460px; animation: rise 0.7s var(--ease) 0.2s both;
}

/* Telegram close — the primary action on both end screens */
.outcome-actions { margin-top: 8px; animation: rise 0.7s var(--ease) 0.2s both; }
a.continue {                       /* the CTA is an <a>, not a <button> */
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  text-decoration: none;
}
.cta-telegram svg { flex: 0 0 auto; }
.booking-or {
  margin: 32px 0 16px; font-size: 12px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--text-dim);
  animation: rise 0.7s var(--ease) 0.26s both;
}

@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

/* =========================================================
   UTILITY
   ========================================================= */
.visually-hidden {
  position: absolute !important; left: -9999px !important;
  width: 1px; height: 1px; overflow: hidden;
}
.noscript {
  position: relative; z-index: 1; max-width: 560px; margin: 18vh auto; padding: 0 24px;
  text-align: center;
}
.noscript h1 { font-family: var(--serif); font-weight: 500; font-size: 1.8rem; margin-bottom: 16px; }
.noscript p { color: var(--text-dim); line-height: 1.6; }
.noscript a { color: var(--red-bright); }

/* =========================================================
   MOBILE — equally designed, not a shrunk desktop (hard requirement)
   ========================================================= */
@media (max-width: 600px) {
  .shell { padding: 22px 20px 40px; }
  .eyebrow { margin-bottom: 16px; }
  .question { font-size: clamp(1.6rem, 7.4vw, 2.1rem); }
  .helper { font-size: 13.5px; margin-bottom: 24px; }
  .options { gap: 10px; }
  .option { padding: 15px 18px; font-size: 14.5px; }
  .field input, .field textarea { font-size: 16px; }   /* 16px avoids iOS zoom-on-focus */
  .actions { margin-top: 28px; gap: 16px; }
  .continue { padding: 15px 40px; }
  .wordmark { font-size: 11.5px; letter-spacing: 0.26em; }
  .stepcount { font-size: 11px; }
  .intro-copy { font-size: 1.08rem; }
  .calendly-embed { height: 620px; }
}
