/* =====================================================================
   NRL Automations — AI Scan funnel
   ---------------------------------------------------------------------
   BRAND THEME — swap these for the exact NRL brand colours/logo and the
   whole funnel + PDF restyle automatically. (See README "Branding".)
   ===================================================================== */
:root {
  /* ---- NRL Automations brand palette (matched to nrlautomations.com) ---- */
  --navy-950: #0A1020;
  --navy-900: #0F1B35;
  --navy-800: #13234A;
  --navy-700: #1A2E5C;
  --blue-800: #1E3A8A;
  --blue-700: #1D4ED8;
  --blue-600: #2563EB;
  --blue-500: #3B82F6;
  --blue-400: #60A5FA;
  --blue-300: #93C5FD;
  --ink-100:  #E6ECFF;
  --ink-200:  #CFD8F2;
  --ink-300:  #B8C3E0;
  --ink-400:  #8995B8;

  /* Core brand (mapped onto NRL palette) */
  --brand:            var(--blue-500);
  --brand-2:          var(--blue-300);
  --brand-grad:       linear-gradient(135deg, #1D4ED8 0%, #3B82F6 55%, #60A5FA 100%);
  --brand-grad-soft:  linear-gradient(135deg, rgba(59,130,246,.16), rgba(147,197,253,.14));

  /* Surfaces (deep navy, cinematic) */
  --bg:               var(--navy-950);
  --bg-2:             var(--navy-900);
  --surface:          #122146;
  --surface-2:        #1A2E5C;
  --border:           rgba(230,236,255,.10);
  --border-strong:    rgba(230,236,255,.22);

  /* Text */
  --text:             var(--ink-100);
  --text-soft:        var(--ink-200);
  --text-mute:        var(--ink-400);

  /* Feedback (semantic, brand-aligned high end) */
  --good:             var(--blue-400);
  --mid:              #F5C451;
  --low:              #FF6B6B;

  /* Shape */
  --radius:           16px;
  --radius-lg:        24px;
  --radius-pill:      999px;
  --shadow:           0 20px 60px -20px rgba(0,0,0,.7);
  --shadow-glow:      0 0 0 1px var(--border), 0 18px 50px -16px rgba(59,130,246,.5);

  --maxw:             640px;
  --font:             'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display:     'Anton', 'Archivo', var(--font);
  --font-head:        'Archivo', var(--font);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(37,99,235,.28), transparent 60%),
    radial-gradient(1000px 520px at -10% 110%, rgba(59,130,246,.18), transparent 55%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
  overflow-x: hidden;
}

/* Layout shell */
.app { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; }
.topbar {
  width: 100%; max-width: var(--maxw); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px clamp(16px, 5vw, 28px);
}
.brand-logo { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: .2px; }
.brand-logo img, .brand-logo svg { height: 46px; width: auto; display: block; filter: drop-shadow(0 0 12px rgba(59,130,246,.35)); }
.brand-logo .brand-name { font-size: 15px; }
.brand-logo .brand-name b { color: var(--text); }
.brand-logo .brand-name span { color: var(--text-mute); font-weight: 500; }
.topbar .hint { color: var(--text-mute); font-size: 13px; }

.stage {
  width: 100%; max-width: var(--maxw);
  padding: 8px clamp(16px, 5vw, 28px) 48px;
  flex: 1; display: flex; flex-direction: column; justify-content: center;
}

/* Screen transitions */
.screen { display: none; animation: rise .45s cubic-bezier(.2,.7,.2,1); }
.screen.active { display: block; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }

/* Progress bar */
.progress-wrap { width: 100%; max-width: var(--maxw); padding: 0 clamp(16px,5vw,28px); margin-bottom: 18px; }
.progress-meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-mute); margin-bottom: 8px; }
.progress-track { height: 8px; background: var(--surface-2); border-radius: var(--radius-pill); overflow: hidden; }
.progress-fill { height: 100%; width: 0%; background: var(--brand-grad); border-radius: inherit; transition: width .5s cubic-bezier(.2,.7,.2,1); }
.progress-wrap.hidden { display: none; }

/* Intro / hero */
.hero { text-align: center; padding: 8px 0; animation: pop .5s ease; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--brand-grad-soft); border: 1px solid var(--border-strong);
  color: var(--blue-300); font-family: var(--font-head); font-size: 12px; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase;
  padding: 8px 15px; border-radius: var(--radius-pill); margin-bottom: 22px;
}
.eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brand-2); box-shadow: 0 0 0 4px rgba(0,209,178,.18); }
h1 { font-family: var(--font-display); font-weight: 400; font-size: clamp(34px, 8vw, 56px); line-height: .96; letter-spacing: .005em; text-transform: uppercase; margin-bottom: 18px; }
h1 .grad { background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { color: var(--text-soft); font-size: clamp(16px, 4.2vw, 19px); max-width: 30ch; margin: 0 auto 30px; }
.hero-meta { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; margin-top: 26px; color: var(--text-mute); font-size: 13px; }
.hero-meta span { display: inline-flex; align-items: center; gap: 7px; }

/* Buttons */
.btn {
  appearance: none; border: 0; cursor: pointer; font-family: inherit; font-weight: 700;
  font-size: 16px; color: #0b0e16; background: var(--brand-grad);
  padding: 16px 28px; border-radius: var(--radius-pill);
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  transition: transform .15s ease, box-shadow .25s ease, opacity .2s;
  box-shadow: 0 10px 30px -8px rgba(108,92,231,.6);
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 16px 40px -10px rgba(108,92,231,.7); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-lg { width: 100%; max-width: 340px; padding: 18px 28px; font-size: 17px; }
.btn-ghost { background: transparent; color: var(--text-soft); box-shadow: none; border: 1px solid var(--border-strong); }
.btn-ghost:hover { background: var(--surface); box-shadow: none; color: var(--text); }
.center { display: flex; flex-direction: column; align-items: center; gap: 14px; }

/* Question */
.q-head { margin-bottom: 22px; }
.q-kicker { color: var(--blue-300); font-family: var(--font-head); font-weight: 700; font-size: 12px; letter-spacing: .18em; text-transform: uppercase; margin-bottom: 10px; }
.q-title { font-family: var(--font-head); font-size: clamp(22px, 5.4vw, 29px); font-weight: 800; letter-spacing: -.005em; line-height: 1.18; }
.q-sub { color: var(--text-soft); font-size: 15px; margin-top: 8px; }

.options { display: flex; flex-direction: column; gap: 12px; margin-top: 6px; }
.option {
  display: flex; align-items: center; gap: 14px; text-align: left; width: 100%;
  background: var(--surface); border: 1.5px solid var(--border); color: var(--text);
  padding: 16px 18px; border-radius: var(--radius); cursor: pointer;
  font-size: 15.5px; font-weight: 500; font-family: inherit; line-height: 1.35;
  transition: border-color .18s, background .18s, transform .12s;
}
.option:hover { border-color: var(--border-strong); background: var(--surface-2); transform: translateY(-1px); }
.option.selected { border-color: var(--brand); background: linear-gradient(var(--surface-2), var(--surface-2)) padding-box, var(--brand-grad) border-box; box-shadow: var(--shadow-glow); }
.option .emoji { font-size: 22px; line-height: 1; flex-shrink: 0; width: 30px; text-align: center; }
.option .check {
  margin-left: auto; flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid var(--border-strong); display: grid; place-items: center; transition: .18s;
}
.option.selected .check { background: var(--brand-grad); border-color: transparent; }
.option .check svg { opacity: 0; transition: .18s; }
.option.selected .check svg { opacity: 1; }

.q-foot { margin-top: 24px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.q-foot.single-mode { justify-content: flex-start; }
.back-link { background: none; border: 0; color: var(--text-mute); font: inherit; font-size: 14px; cursor: pointer; padding: 8px 4px; display: inline-flex; align-items: center; gap: 6px; }
.back-link:hover { color: var(--text-soft); }
.back-link.hidden { visibility: hidden; }

/* Lead capture */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: clamp(22px, 6vw, 36px);
  box-shadow: var(--shadow);
}
.lead-title { font-family: var(--font-head); font-weight: 800; font-size: clamp(24px,6vw,33px); line-height: 1.12; letter-spacing: -.005em; margin-bottom: 12px; }
.lock-badge {
  display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600;
  color: var(--brand-2); background: var(--brand-grad-soft); border: 1px solid var(--border-strong);
  padding: 6px 12px; border-radius: var(--radius-pill); margin-bottom: 18px;
}
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13.5px; font-weight: 600; color: var(--text-soft); margin-bottom: 7px; }
.field input {
  width: 100%; font: inherit; font-size: 16px; color: var(--text);
  background: var(--bg-2); border: 1.5px solid var(--border); border-radius: 12px; padding: 14px 16px;
  transition: border-color .18s, box-shadow .18s;
}
.field input::placeholder { color: var(--text-mute); }
.field input:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(108,92,231,.22); }
.field input.invalid { border-color: var(--low); }
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: 12.5px; color: var(--text-mute); margin: 6px 0 20px; }
.consent input { margin-top: 2px; accent-color: var(--brand); }
.form-error { color: var(--low); font-size: 13px; margin-bottom: 12px; min-height: 18px; }
.privacy-note { color: var(--text-mute); font-size: 12px; text-align: center; margin-top: 14px; }

/* Loading */
.loader { display: flex; flex-direction: column; align-items: center; gap: 22px; text-align: center; padding: 40px 0; }
.spinner { width: 56px; height: 56px; border-radius: 50%; border: 4px solid var(--surface-2); border-top-color: var(--brand); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loader-text { color: var(--text-soft); font-size: 16px; font-weight: 600; }
.loader-steps { color: var(--text-mute); font-size: 13.5px; min-height: 20px; }

/* ===== Results portal ===== */
.results { animation: rise .5s ease; }
.result-hero { text-align: center; margin-bottom: 8px; }
.persona-emoji { font-size: 46px; line-height: 1; }
.persona-name { font-family: var(--font-display); font-weight: 400; font-size: clamp(30px, 7.5vw, 44px); letter-spacing: .01em; text-transform: uppercase; line-height: .98; margin-top: 8px; }
.persona-tag { color: var(--text-soft); font-size: 16px; max-width: 34ch; margin: 10px auto 0; }

.gauge-wrap { display: flex; justify-content: center; margin: 24px 0 8px; }
.gauge { position: relative; width: 240px; height: 150px; }
.gauge svg { width: 100%; height: 100%; overflow: visible; }
.gauge-value { position: absolute; left: 0; right: 0; bottom: 6px; text-align: center; }
.gauge-value .num { font-family: var(--font-display); font-weight: 400; font-size: 58px; line-height: 1; background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.gauge-value .of { color: var(--text-mute); font-size: 14px; font-weight: 600; margin-top: 2px; }

.section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: clamp(20px,5vw,30px); margin-top: 18px; box-shadow: var(--shadow); }
.section h2 { font-family: var(--font-head); font-size: 19px; font-weight: 800; margin-bottom: 4px; letter-spacing: .01em; }
.section .section-sub { color: var(--text-mute); font-size: 14px; margin-bottom: 18px; }

.summary-text { color: var(--text-soft); font-size: 15.5px; line-height: 1.6; }
.summary-headline { margin-top: 16px; font-weight: 700; color: var(--text); font-size: 16px; display: flex; gap: 10px; }
.summary-headline .bolt { color: var(--brand-2); }

/* category bars */
.bars { display: flex; flex-direction: column; gap: 16px; }
.bar-row .bar-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 7px; }
.bar-row .bar-label { font-size: 14.5px; font-weight: 600; display: inline-flex; gap: 8px; align-items: center; }
.bar-row .bar-num { font-size: 13.5px; font-weight: 700; color: var(--text-soft); }
.bar-track { height: 10px; background: var(--surface-2); border-radius: var(--radius-pill); overflow: hidden; }
.bar-fill { height: 100%; width: 0; border-radius: inherit; transition: width 1s cubic-bezier(.2,.7,.2,1); }

/* advice cards */
.advice-card { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 14px; }
.advice-card:last-child { margin-bottom: 0; }
.advice-level { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--brand-2); background: var(--brand-grad-soft); border: 1px solid var(--border-strong); padding: 5px 11px; border-radius: var(--radius-pill); margin-bottom: 12px; }
.advice-card h3 { font-family: var(--font-head); font-size: 17px; font-weight: 800; margin-bottom: 12px; letter-spacing: 0; }
.advice-now, .advice-next { display: flex; gap: 11px; font-size: 14.5px; line-height: 1.55; margin-bottom: 9px; }
.advice-now { color: var(--text-mute); }
.advice-next { color: var(--text-soft); }
.advice-now .tag, .advice-next .tag { flex-shrink: 0; font-weight: 700; font-size: 11px; padding: 2px 9px; border-radius: var(--radius-pill); height: fit-content; margin-top: 2px; }
.advice-now .tag { background: rgba(255,255,255,.06); color: var(--text-mute); }
.advice-next .tag { background: var(--brand-grad); color: #0b0e16; }

/* warning card */
.warn-card { background: linear-gradient(135deg, rgba(245,196,81,.10), rgba(255,107,129,.08)); border: 1px solid rgba(245,196,81,.32); border-radius: var(--radius); padding: 20px; margin-top: 14px; }
.warn-card h3 { font-size: 16px; font-weight: 800; margin-bottom: 8px; display: flex; gap: 9px; }
.warn-card p { color: var(--text-soft); font-size: 14.5px; line-height: 1.6; }

/* sent banner + CTA */
.sent-banner { display: flex; gap: 12px; align-items: center; background: var(--brand-grad-soft); border: 1px solid var(--border-strong); border-radius: var(--radius); padding: 16px 18px; margin-top: 18px; font-size: 14.5px; color: var(--text-soft); }
.sent-banner .ic { font-size: 22px; }
.sent-banner b { color: var(--text); }
.cta-final { text-align: center; padding: 30px 0 10px; }
.cta-final h2 { font-family: var(--font-display); font-weight: 400; font-size: clamp(22px,5vw,30px); text-transform: uppercase; letter-spacing: .01em; margin-bottom: 10px; }
.cta-final p { color: var(--text-soft); font-size: 15px; max-width: 36ch; margin: 0 auto 20px; }

.footer { text-align: center; color: var(--text-mute); font-size: 12.5px; padding: 26px 0 30px; }
.footer a { color: var(--text-soft); text-decoration: none; }

/* confetti */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 50; overflow: hidden; }
.confetti i { position: absolute; top: -12px; width: 9px; height: 14px; opacity: .9; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(105vh) rotate(540deg); opacity: 0; } }

@media (max-width: 480px) {
  .topbar .hint { display: none; }
  .option { padding: 14px 15px; font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  *, .screen { animation: none !important; transition: none !important; }
}
