/* ============================================================
   FLEXING DATA — Typeform-style sign-up flow
   One question at a time · data-analytics theme · matches homepage.
   Loaded AFTER styles.css so it wins. New classes (tf-*) avoid the
   legacy !important war; where we reuse legacy hooks (.role-card,
   .role-fields, .otp-input) we override with matched specificity.
   ============================================================ */
@property --p{ syntax:'<number>'; inherits:false; initial-value:0; }

/* ── Definitive warm-light background (beats every legacy dark rule) ── */
html, body{ background:#fffaf4 !important; }
.quiz-page{ background:linear-gradient(180deg,#fff3e9 0%,#fffaf4 60%) !important; min-height:100vh; }

.tf-scope{
  --b:#0a96c7; --bd:#0a7ba6; --bsoft:#e4f4fb;
  --coral:#ff7a59; --coral2:#ff8a63; --coral-soft:#fff0eb;
  --amber:#f5a623; --mint:#18a37b; --violet:#7c5cff;
  --ink:#18222f; --ink2:#44515f; --muted:#6c7785;
  --white:#fff; --panel:#f6f9fb;
  --line:rgba(24,34,47,.10); --line2:rgba(24,34,47,.06);
  --ok:#18a37b; --bad:#c0392b;
  --r:20px; --rs:13px;
  font-family:'Inter',system-ui,-apple-system,'Segoe UI',Roboto,sans-serif;
  color:var(--ink2);
  position:relative;
}

/* Let the intro breathe into a wider 2-column card; other screens stay 880. */
.quiz-page:has(#intro.active) .card{ max-width:1060px; }
@media(max-width:920px){ .quiz-page:has(#intro.active) .card{ max-width:560px; } }

/* ── Warm-light card background during intro (matches homepage) ── */
.quiz-page:has(#intro.active) .card{
  background:#fff !important;
  box-shadow:0 4px 40px rgba(24,34,47,.07), 0 0 0 1px rgba(24,34,47,.05) !important;
}

/* ── Returning user popup modal ── */
#returning-modal{ background:rgba(15,42,64,.55) !important; }
.rm-card{ text-align:center; }
.rm-avatar{ font-size:42px; margin-bottom:10px; }
.rm-card h2{ color:#18222f !important; font-size:24px; font-weight:800; margin:0 0 6px; }
.rm-sub{ font-size:15px; color:#44515f; margin:0 0 18px; }
.rm-err{ font-size:13px; color:#c0392b; min-height:18px; margin:-8px 0 8px; }
.rm-stats{ display:flex; gap:10px; margin:0 0 20px; }
.rm-stat{ flex:1; background:#f0f8fc; border:1px solid #cce8f4; border-radius:10px; padding:12px 8px; }
.rm-stat .rm-v{ display:block; font-size:22px; font-weight:800; color:#0a96c7; }
.rm-stat .rm-l{ display:block; font-size:11px; color:#6c7785; text-transform:uppercase; letter-spacing:.5px; margin-top:3px; }
.rm-btn-primary{
  display:flex; align-items:center; justify-content:center;
  width:100%; padding:14px 20px; margin-bottom:10px;
  background:linear-gradient(135deg,#0a96c7,#0a7ba6);
  color:#fff !important; border:none; border-radius:12px;
  font-size:15px; font-weight:700; cursor:pointer; text-decoration:none;
  box-shadow:0 6px 18px -6px rgba(10,150,199,.55); transition:transform .15s;
}
.rm-btn-primary:hover{ transform:translateY(-1px); color:#fff !important; }
.rm-btn-secondary{
  display:block; width:100%; padding:14px 20px; margin-bottom:10px;
  background:#fff; color:#18222f !important; border:1.5px solid rgba(24,34,47,.15);
  border-radius:12px; font-size:15px; font-weight:700; cursor:pointer;
  transition:border-color .15s;
}
.rm-btn-secondary:hover{ border-color:#0a96c7; color:#0a7ba6 !important; }
.rm-btn-ghost{
  display:block; width:100%; padding:11px 20px;
  background:transparent; color:#6c7785 !important; border:none;
  font-size:14px; font-weight:600; cursor:pointer;
}
.rm-btn-ghost:hover{ color:#18222f !important; }

/* Ambient data-grid behind the card (echoes the homepage hero) */
.quiz-page{ position:relative; }
.quiz-page::before{
  content:""; position:fixed; inset:0; z-index:0; pointer-events:none;
  background-image:radial-gradient(rgba(10,150,199,.10) 1.2px, transparent 1.2px);
  background-size:30px 30px; animation:tfGrid 22s linear infinite; opacity:.5;
}
.quiz-page > .card{ position:relative; z-index:1; }
@keyframes tfGrid{ from{ background-position:0 0; } to{ background-position:30px 30px; } }

/* ---------- shell: question stage + live data panel ---------- */
.tf-shell{ display:grid; grid-template-columns:1fr 290px; gap:34px; align-items:stretch; }
@media(max-width:920px){ .tf-shell{ grid-template-columns:1fr; gap:0; } }

.tf-stage{ min-width:0; display:flex; flex-direction:column; }

/* ---------- progress ---------- */
.tf-progress{ height:6px; border-radius:99px; background:var(--bsoft); overflow:hidden; }
.tf-progress-bar{ display:block; height:100%; width:8%; border-radius:99px;
  background:linear-gradient(90deg,var(--b),var(--coral)); transition:width .5s cubic-bezier(.22,1,.36,1); }
.tf-step-count{ font-size:12px; font-weight:700; letter-spacing:.04em; color:var(--muted);
  text-transform:uppercase; margin:10px 2px 4px; font-family:'Plus Jakarta Sans',sans-serif; }

/* ---------- steps (one visible at a time) ---------- */
.tf-step{ display:none; padding:14px 2px 4px; }
.tf-step.active{ display:block; animation:tfIn .45s cubic-bezier(.22,1,.36,1) both; }
.tf-step.leaving{ animation:tfOut .28s ease both; }
@keyframes tfIn{ from{ opacity:0; transform:translateY(22px); } to{ opacity:1; transform:none; } }
@keyframes tfOut{ from{ opacity:1; transform:none; } to{ opacity:0; transform:translateY(-14px); } }

/* ---------- step typography ---------- */
.tf-kbd{ display:inline-flex; align-items:center; justify-content:center; width:46px; height:46px;
  border-radius:13px; font-size:24px; margin-bottom:16px;
  background:linear-gradient(135deg,var(--bsoft),#fff); border:1px solid var(--line);
  box-shadow:0 6px 16px -8px rgba(10,150,199,.45); }
.tf-scope .tf-eyebrow{ display:inline-flex; align-items:center; gap:7px; font-family:'Plus Jakarta Sans',sans-serif;
  font-weight:700; font-size:12px; letter-spacing:.06em; text-transform:uppercase;
  color:var(--bd); background:var(--bsoft); padding:7px 14px; border-radius:99px; margin-bottom:18px; }
.tf-scope .tf-q{ font-family:'Plus Jakarta Sans',sans-serif; color:var(--ink);
  font-weight:800; letter-spacing:-.02em; line-height:1.12; font-size:clamp(25px,3.6vw,38px);
  margin:0 0 12px; text-shadow:none; }
.tf-scope .tf-q .hl{ color:var(--bd); position:relative; white-space:nowrap; }
.tf-scope .tf-q .hl::after{ content:""; position:absolute; left:0; right:0; bottom:.05em; height:.34em;
  background:linear-gradient(90deg,rgba(255,122,89,.45),rgba(245,166,35,.4)); border-radius:6px; z-index:-1; }
.tf-scope .tf-help{ font-size:clamp(15.5px,1.7vw,17px); color:var(--ink2); line-height:1.6; margin:0 0 22px; max-width:143ch; }
.tf-scope .tf-help a{ color:var(--bd); font-weight:600; text-decoration:underline; cursor:pointer; }
.tf-fineprint{ font-size:12.5px; color:var(--muted); margin:18px 0 0; }

/* ---------- inputs (Typeform feel: big, calm, brand focus) ---------- */
.tf-scope .tf-input, .tf-scope .tf-select{
  width:100%; font-family:inherit; font-size:20px; font-weight:600; color:var(--ink);
  background:#fff; border:0; border-bottom:2px solid var(--line); border-radius:0;
  padding:12px 2px; margin:0; -webkit-appearance:none; appearance:none; transition:border-color .2s, box-shadow .2s;
  -webkit-text-fill-color:var(--ink);
}
.tf-scope .tf-input::placeholder{ color:#aab2bd; font-weight:500; -webkit-text-fill-color:#aab2bd; }
.tf-scope .tf-input:focus, .tf-scope .tf-select:focus{ outline:none; border-bottom-color:var(--b); box-shadow:0 2px 0 0 var(--b); }
.tf-scope .tf-input.bad, .tf-scope .tf-select.bad{ border-bottom-color:var(--bad); box-shadow:0 2px 0 0 var(--bad); }
.tf-scope .tf-select{
  cursor:pointer; padding-right:30px;
  background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='%230a7ba6' d='M0 0l6 8 6-8z'/></svg>");
  background-repeat:no-repeat; background-position:right 4px center;
}
.tf-scope .tf-select option{ font-size:15px; color:var(--ink); background:#fff; }
/* kill Chrome autofill yellow */
.tf-scope .tf-input:-webkit-autofill,
.tf-scope .tf-input:-webkit-autofill:focus{
  -webkit-text-fill-color:var(--ink) !important;
  -webkit-box-shadow:0 0 0 40px #fff inset !important;
  transition:background-color 9999s ease-in-out 0s;
}
.tf-phone{ display:flex; gap:14px; align-items:flex-end; }
.tf-phone .tf-select{ flex:0 0 116px; font-size:17px; }
.tf-phone .tf-input{ flex:1; }

/* ---------- choice cards (role) ---------- */
.tf-choices{ display:grid; grid-template-columns:1fr 1fr 1fr; gap:12px; margin:4px 0 4px; }
@media(max-width:560px){ .tf-choices{ grid-template-columns:1fr; } }
.tf-scope .tf-choice.role-card{
  cursor:pointer; text-align:left; padding:18px 16px; border-radius:var(--rs) !important;
  background:#fff !important; border:1.5px solid var(--line) !important; color:var(--ink) !important;
  display:flex; flex-direction:column; gap:3px; transition:transform .15s, border-color .15s, box-shadow .15s;
  box-shadow:0 1px 0 rgba(24,34,47,.02);
}
.tf-scope .tf-choice.role-card:hover{ border-color:var(--b) !important; transform:translateY(-2px); box-shadow:0 16px 30px -18px rgba(10,150,199,.5); }
.tf-scope .tf-choice.role-card.active{
  background:linear-gradient(135deg,var(--bsoft),#fff) !important;
  border-color:var(--b) !important; color:var(--ink) !important;
  box-shadow:0 0 0 2px var(--b) inset, 0 16px 30px -18px rgba(10,150,199,.55);
}
.tf-scope .tf-choice .emoji{ font-size:26px; }
.tf-scope .tf-choice .name{ font-family:'Plus Jakarta Sans',sans-serif; font-weight:800; font-size:16px; color:var(--ink); }
.tf-scope .tf-choice .desc{ font-size:12.5px; color:var(--muted); }
.tf-scope .tf-choice .tick{ position:absolute; }

/* role-detail sub-panel */
.tf-scope .role-fields{ background:var(--panel) !important; border:1px solid var(--line) !important;
  border-radius:var(--rs); padding:18px; margin:0; }
.tf-scope .role-fields .tf-label{ display:block; font-size:13px; font-weight:700; color:var(--ink2);
  margin:14px 0 6px; font-family:'Plus Jakarta Sans',sans-serif; }
.tf-scope .role-fields .tf-label:first-child{ margin-top:0; }
.tf-scope .role-fields .tf-input, .tf-scope .role-fields .tf-select{ font-size:16px; }

/* ---------- consent + review ---------- */
.tf-review{ display:flex; flex-wrap:wrap; gap:8px; margin:0 0 18px; }
.tf-chiprow{ display:inline-flex; align-items:center; gap:7px; background:var(--panel);
  border:1px solid var(--line); border-radius:99px; padding:8px 14px; font-size:13.5px; font-weight:600; color:var(--ink); }
.tf-chiprow b{ color:var(--bd); font-weight:700; }
.tf-chiprow .ic{ font-size:15px; }
.tf-consent{ display:flex; align-items:flex-start; gap:12px; padding:14px 16px; cursor:pointer;
  background:var(--panel); border:2px solid var(--line); border-radius:var(--rs); margin-bottom:6px;
  transition:border-color .15s, background .15s; user-select:none; }
.tf-consent:hover{ border-color:var(--b); background:rgba(10,150,199,.04); }
.tf-consent:has(input:checked){ border-color:var(--b); background:rgba(10,150,199,.06); }
.tf-consent input[type=checkbox]{ position:absolute; opacity:0; width:0; height:0; pointer-events:none; }
.tf-consent .cb-box{
  flex-shrink:0; width:22px; height:22px; border:2px solid #bcc5ce; border-radius:6px;
  background:#fff; margin-top:1px; transition:background .15s, border-color .15s;
  display:flex; align-items:center; justify-content:center; }
.tf-consent input[type=checkbox]:checked + .cb-box{ background:var(--b); border-color:var(--b); }
.tf-consent .cb-box::after{
  content:""; display:block; width:5px; height:10px;
  border:2.5px solid transparent; border-top:none; border-left:none;
  transform:rotate(45deg) translateY(-1px); }
.tf-consent input[type=checkbox]:checked + .cb-box::after{ border-color:#fff; }
.tf-consent span:not(.cb-box){ font-size:14.5px; color:var(--ink2); line-height:1.5; }

/* ---------- acknowledgement + error (.card prefix beats the legacy text guard) ---------- */
.tf-ack{ display:none; align-items:center; gap:9px; margin:16px 0 0; padding:11px 14px;
  background:linear-gradient(135deg,#eafaf3,#f3fbf7); border:1px solid #bfead4; border-radius:12px;
  font-size:14.5px; font-weight:600; }
.card .tf-ack{ color:#0c7a5a; }
.tf-ack.show{ display:inline-flex; animation:tfPop .4s cubic-bezier(.22,1.4,.4,1) both; }
.card .tf-ack .dot{ width:22px; height:22px; border-radius:50%; background:#18a37b; color:#fff;
  display:inline-flex; align-items:center; justify-content:center; font-size:13px; flex-shrink:0; }
@keyframes tfPop{ from{ opacity:0; transform:scale(.92) translateY(6px); } to{ opacity:1; transform:none; } }
.card .tf-err{ color:#c0392b; font-size:13.5px; font-weight:600; margin-top:12px; min-height:18px; }

/* ---------- buttons + nav ---------- */
.tf-actions{ display:flex; align-items:center; gap:12px; flex-wrap:wrap; margin-top:24px; }
.tf-scope .tf-btn{ display:inline-flex; align-items:center; justify-content:center; gap:9px;
  font-family:'Plus Jakarta Sans',sans-serif; font-weight:700; font-size:16px; cursor:pointer;
  padding:14px 26px; border-radius:13px; border:1.5px solid transparent; min-height:52px; white-space:nowrap;
  transition:transform .16s, box-shadow .16s, background .16s, color .16s, border-color .16s; }
.tf-scope .tf-btn-primary{ background:linear-gradient(135deg,var(--coral2),var(--coral)); color:#fff;
  box-shadow:0 12px 26px -10px rgba(255,122,89,.6); }
.tf-scope .tf-btn-primary:hover{ transform:translateY(-2px); box-shadow:0 18px 34px -10px rgba(255,122,89,.72); color:#fff; }
.tf-scope .tf-btn-primary:disabled{ background:#e7e2d9; color:#9aa1a8; box-shadow:none; cursor:not-allowed; transform:none; }
.tf-scope .tf-btn-ghost{ background:#fff; color:var(--ink); border-color:var(--line); }
.tf-scope .tf-btn-ghost:hover{ border-color:var(--b); color:var(--bd); transform:translateY(-2px); }
.tf-scope .tf-btn-lg{ padding:16px 30px; font-size:17px; min-height:58px; }
.tf-enter-hint{ font-size:12.5px; color:var(--muted); }
.tf-enter-hint b{ color:var(--ink2); font-weight:700; }
@media(max-width:560px){ .tf-enter-hint{ display:none; } }

/* welcome step stat tiles */
.tf-stats{ display:flex; flex-wrap:wrap; gap:10px; margin:6px 0 26px; }
.tf-stat{ flex:1 1 110px; background:var(--panel); border:1px solid var(--line); border-radius:var(--rs); padding:14px 12px; text-align:center; }
.tf-stat .v{ font-family:'Plus Jakarta Sans',sans-serif; font-size:24px; font-weight:800; color:var(--bd); line-height:1; }
.tf-stat .l{ font-size:11.5px; color:var(--muted); letter-spacing:.03em; margin-top:5px; }

/* ============================================================
   LIVE DATA PROFILE PANEL (right column · data-analytics centrepiece)
   ============================================================ */
/* NOTE: every text rule below is .tf-scope-prefixed so it outranks the
   legacy .card span/div/li colour guards (which are non-important (0,1,1)). */
.tf-scope .tf-aside{ display:flex; }
@media(max-width:920px){ .tf-scope .tf-aside{ display:none; } }
.tf-scope .tf-dash{ position:relative; flex:1; display:flex; flex-direction:column; gap:16px;
  background:linear-gradient(180deg,#0d2233,#0a1b29); color:#cfe0ee; border-radius:var(--r);
  padding:22px 20px; overflow:hidden; box-shadow:0 30px 60px -30px rgba(10,27,41,.6); }
.tf-scope .tf-dash::before{ content:""; position:absolute; inset:0;
  background-image:radial-gradient(rgba(120,190,230,.12) 1px, transparent 1px); background-size:18px 18px; opacity:.6; }
.tf-scope .tf-dash > *{ position:relative; z-index:1; }
.tf-scope .tf-dash-head{ display:flex; align-items:center; justify-content:space-between;
  font-family:'Plus Jakarta Sans',sans-serif; font-weight:800; font-size:14px; color:#fff; }
.tf-scope .tf-dash-head > span:first-child{ color:#fff; }
.tf-scope .tf-live{ font-size:11px; font-weight:700; color:#7fe0c1; display:inline-flex; align-items:center; gap:6px; }
.tf-scope .tf-live::before{ content:""; width:7px; height:7px; border-radius:50%; background:#2ecc71; box-shadow:0 0 0 0 rgba(46,204,113,.6); animation:tfPulse 1.8s infinite; }
@keyframes tfPulse{ 0%{ box-shadow:0 0 0 0 rgba(46,204,113,.55);} 70%{ box-shadow:0 0 0 8px rgba(46,204,113,0);} 100%{ box-shadow:0 0 0 0 rgba(46,204,113,0);} }

.tf-scope .tf-ring-wrap{ display:flex; align-items:center; gap:16px; }
.tf-scope .tf-ring{ --p:0; width:96px; height:96px; border-radius:50%; flex-shrink:0;
  background:conic-gradient(var(--b) calc(var(--p)*1%), rgba(255,255,255,.10) 0);
  display:flex; align-items:center; justify-content:center; transition:--p .6s ease;
  position:relative; }
.tf-scope .tf-ring::before{ content:""; position:absolute; inset:9px; border-radius:50%; background:#0c2030; }
.tf-scope .tf-ring .pct{ position:relative; font-family:'Plus Jakarta Sans',sans-serif; font-weight:800; font-size:22px; color:#fff; }
.tf-scope .tf-ring-cap{ font-size:12.5px; color:#9fb6c9; line-height:1.45; }
.tf-scope .tf-ring-cap b{ color:#fff; display:block; font-family:'Plus Jakarta Sans',sans-serif; font-size:14px; }

.tf-scope .tf-rows{ list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:9px; }
.tf-scope .tf-rows li{ display:flex; align-items:center; gap:10px; font-size:13px; color:#9fb6c9;
  padding:9px 11px; border-radius:10px; background:rgba(255,255,255,.04); border:1px solid rgba(255,255,255,.06);
  transition:background .3s, border-color .3s, color .3s; }
.tf-scope .tf-rows li .ic{ font-size:15px; width:18px; text-align:center; color:inherit; }
.tf-scope .tf-rows li .k{ flex:1; color:inherit; }
.tf-scope .tf-rows li .v{ font-weight:700; color:#cfe0ee; max-width:46%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; text-align:right; }
.tf-scope .tf-rows li.filled{ background:rgba(46,204,113,.12); border-color:rgba(46,204,113,.32); color:#cfe0ee; }
.tf-scope .tf-rows li.filled .v{ color:#7fe0c1; }

.tf-scope .tf-dash-bars{ margin-top:2px; }
.tf-scope .tf-dash-bars .lab{ font-size:11px; color:#7e95a8; text-transform:uppercase; letter-spacing:.06em; margin-bottom:8px; font-weight:700; }
.tf-scope .tf-bars{ display:flex; align-items:flex-end; gap:7px; height:60px; }
.tf-scope .tf-bars i{ flex:1; border-radius:5px 5px 3px 3px; transform-origin:bottom;
  animation:tfGrow 1.3s ease both, tfPulseBar 3.2s ease-in-out infinite; opacity:.92; }
.tf-scope .tf-bars i:nth-child(1){ background:linear-gradient(180deg,var(--b),#7fd0ea); height:55%; }
.tf-scope .tf-bars i:nth-child(2){ background:linear-gradient(180deg,var(--coral),#ffb59f); height:78%; animation-delay:.08s,.4s; }
.tf-scope .tf-bars i:nth-child(3){ background:linear-gradient(180deg,var(--amber),#ffd98a); height:62%; animation-delay:.16s,.8s; }
.tf-scope .tf-bars i:nth-child(4){ background:linear-gradient(180deg,var(--mint),#7fe0c1); height:90%; animation-delay:.24s,1.2s; }
.tf-scope .tf-bars i:nth-child(5){ background:linear-gradient(180deg,var(--violet),#bcacff); height:70%; animation-delay:.32s,1.6s; }
@keyframes tfGrow{ from{ transform:scaleY(.05); opacity:0; } to{ transform:scaleY(1); opacity:.92; } }
@keyframes tfPulseBar{ 0%,100%{ transform:scaleY(1); } 50%{ transform:scaleY(.88); } }
.tf-scope .tf-dash-foot{ font-size:11.5px; color:#7e95a8; border-top:1px solid rgba(255,255,255,.08); padding-top:12px; margin-top:auto; }
.tf-scope .tf-dash-foot b{ color:#cfe0ee; }

/* ============================================================
   OTP screen — refined + acknowledgement (keeps .otp-input hook)
   ============================================================ */
#otp-screen .tf-otp-emoji{ font-size:44px; margin-bottom:6px; }
#otp-screen .tf-ack{ margin:0 auto 6px; }

/* ============================================================
   Reduced motion
   ============================================================ */
@media(prefers-reduced-motion:reduce){
  .quiz-page::before, .tf-bars i, .tf-live::before{ animation:none !important; }
  .tf-step.active, .tf-step.leaving{ animation:none !important; }
  .tf-ack.show{ animation:none !important; }
}
