/* ===========================================================
   Leading Social, Growth Score quiz
   Built on the core tokens in styles.css (ink / paper / brand / Hanken).
   =========================================================== */

.quiz-wrap {
  position: relative;
  min-height: 100vh;
  background: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(96px, 12vh, 160px) var(--gutter) clamp(64px, 9vh, 120px);
  overflow: hidden;
  isolation: isolate;
}

/* Reactive glow behind the card, intensity/position driven by --prog (0..1) */
.quiz-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(60% 50% at 50% calc(8% + var(--prog, 0) * 30%),
      rgba(51, 153, 255, calc(0.05 + var(--prog, 0) * 0.13)), transparent 70%),
    radial-gradient(40% 40% at 85% 90%, rgba(51, 153, 255, 0.05), transparent 70%);
  transition: background .8s var(--ease-out);
}
.quiz-bg::after {
  /* faint grid */
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(70% 70% at 50% 40%, #000, transparent 80%);
          mask-image: radial-gradient(70% 70% at 50% 40%, #000, transparent 80%);
}

/* The card */
.quiz {
  position: relative;
  width: 100%;
  max-width: 920px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0.008));
  box-shadow:
    0 40px 120px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  padding: clamp(28px, 4vw, 56px);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  min-height: clamp(560px, 78vh, 760px);
  display: flex;
  flex-direction: column;
}

/* ---- Panels (only one active) ---- */
.q-panel { display: none; flex-direction: column; flex: 1; }
.q-panel.is-active { display: flex; opacity: 1; }
.quiz-animate .q-panel.is-active { animation: panelIn .5s var(--ease-out); }
@keyframes panelIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============ INTRO ============ */
.q-intro { justify-content: center; text-align: left; gap: 28px; }
.q-kicker {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  align-self: flex-start;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brand);
  padding: 8px 16px;
  border: 1px solid rgba(51, 153, 255, 0.3);
  border-radius: 999px;
  background: rgba(51, 153, 255, 0.06);
}
.q-kicker .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 0 rgba(51, 153, 255, 0.6);
  animation: pulse 2.4s var(--ease-out) infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(51, 153, 255, 0.5); }
  70%  { box-shadow: 0 0 0 8px rgba(51, 153, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(51, 153, 255, 0); }
}
.q-intro h1 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(40px, 6vw, 84px);
  line-height: 0.94;
  letter-spacing: -0.03em;
  text-wrap: balance;
  max-width: 16ch;
}
.q-intro h1 em { font-style: italic; color: var(--brand); }
.q-intro .q-lede {
  font-size: clamp(15px, 1.3vw, 18px);
  color: var(--mute);
  max-width: 52ch;
  line-height: 1.55;
}
.q-intro-meta {
  display: flex;
  gap: 0;
  flex-wrap: wrap;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  align-self: flex-start;
}
.q-intro-meta .m {
  padding: 18px 26px 18px 24px;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.q-intro-meta .m:last-child { border-right: 0; }
.q-intro-meta .m b {
  font-family: var(--display);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--paper);
}
.q-intro-meta .m span {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mute);
}
.q-start { align-self: flex-start; margin-top: 4px; }
.q-reassure {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mute);
  display: flex;
  align-items: center;
  gap: 8px;
}
.q-reassure svg { width: 13px; height: 13px; stroke: var(--brand); }

/* ============ PROGRESS HEADER ============ */
.q-prog-head { margin-bottom: clamp(28px, 4vw, 44px); }
.q-bar {
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  position: relative;
}
.q-bar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand-deep), var(--brand) 70%, var(--brand-soft));
  box-shadow: 0 0 16px rgba(51, 153, 255, 0.5);
  transition: width .55s var(--ease-out);
}
.q-prog-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 14px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mute);
}
.q-prog-meta .pct { color: var(--paper); font-weight: 600; }

/* ============ QUESTION STAGE ============ */
.q-stage {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
}
.q-inner {
  display: flex;
  flex-direction: column;
  flex: 1;
  transition: opacity .26s ease, transform .32s var(--ease-out);
}
.quiz-animate .q-inner.is-out-next { opacity: 0; transform: translateX(-36px); }
.quiz-animate .q-inner.is-out-back { opacity: 0; transform: translateX(36px); }
.quiz-animate .q-inner.is-in-next  { opacity: 0; transform: translateX(36px); }
.quiz-animate .q-inner.is-in-back  { opacity: 0; transform: translateX(-36px); }

.q-number {
  font-family: var(--display);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(44px, 6vw, 76px);
  line-height: 1;
  color: var(--brand);
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}
.q-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(26px, 3.4vw, 46px);
  line-height: 1.04;
  letter-spacing: -0.025em;
  color: var(--paper);
  text-wrap: balance;
  max-width: 24ch;
}
.q-help {
  margin-top: 14px;
  font-size: clamp(14px, 1.1vw, 16px);
  color: var(--mute);
  line-height: 1.5;
  max-width: 56ch;
}

/* ---- Options ---- */
.q-options {
  margin-top: clamp(24px, 3.5vw, 38px);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.q-opt {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  text-align: left;
  padding: 18px 20px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
  color: var(--paper);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: border-color .22s ease, background .22s ease, transform .22s var(--ease-out);
}
.q-opt:hover {
  border-color: rgba(51, 153, 255, 0.5);
  background: rgba(51, 153, 255, 0.05);
  transform: translateX(4px);
}
.q-opt-key {
  flex-shrink: 0;
  width: 30px; height: 30px;
  border-radius: 8px;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--mute);
  background: rgba(255, 255, 255, 0.03);
  transition: all .22s ease;
}
.q-opt:hover .q-opt-key { color: var(--brand); border-color: rgba(51, 153, 255, 0.5); }
.q-opt-label {
  flex: 1;
  font-size: clamp(15px, 1.3vw, 17px);
  font-weight: 500;
  letter-spacing: -0.01em;
}
.q-opt-note {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--mute);
  white-space: nowrap;
}
.q-opt-tick {
  flex-shrink: 0;
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  color: transparent;
  transition: all .22s ease;
}
/* selected state */
.q-opt.is-selected {
  border-color: var(--brand);
  background: rgba(51, 153, 255, 0.1);
}
.q-opt.is-selected .q-opt-key {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.q-opt.is-selected .q-opt-tick {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
/* sweep highlight on selection */
.q-opt.is-selected::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(51, 153, 255, 0.18), transparent);
  transform: translateX(-100%);
  animation: sweep .6s var(--ease-out) forwards;
}
@keyframes sweep { to { transform: translateX(100%); } }

/* ---- Footer nav row ---- */
.q-foot {
  margin-top: clamp(22px, 3vw, 34px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.q-back {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mute);
  padding: 10px 4px;
  transition: color .2s ease, transform .2s ease;
}
.q-back:hover { color: var(--paper); transform: translateX(-3px); }
.q-back[hidden] { visibility: hidden; }
.q-hint {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mute);
}
.q-hint kbd {
  font-family: var(--mono);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 2px 6px;
  margin: 0 1px;
  color: var(--paper);
}

/* ============ CALCULATING ============ */
.q-calc { align-items: center; justify-content: center; text-align: center; gap: 26px; }
.q-calc .ring-spin {
  width: 64px; height: 64px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--brand);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.q-calc h2 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(28px, 3.6vw, 48px);
  letter-spacing: -0.02em;
}
.q-calc .step-line {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brand);
  min-height: 18px;
}

/* ============ RESULT ============ */
.q-result { gap: clamp(28px, 4vw, 44px); }
.q-result-top {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: clamp(28px, 5vw, 56px);
  align-items: center;
}
.gauge {
  position: relative;
  width: clamp(180px, 22vw, 240px);
  aspect-ratio: 1;
  flex-shrink: 0;
}
.gauge svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.gauge .track { fill: none; stroke: rgba(255, 255, 255, 0.08); }
.gauge .meter {
  fill: none;
  stroke: var(--brand);
  stroke-linecap: round;
  filter: drop-shadow(0 0 8px rgba(51, 153, 255, 0.55));
  transition: stroke-dashoffset 1.6s var(--ease-out);
}
.gauge-center {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
}
.gauge-num {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(48px, 6vw, 76px);
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--paper);
}
.gauge-num .slash { color: var(--mute); font-size: 0.42em; font-weight: 500; }
.gauge-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mute);
  margin-top: 6px;
}
.q-verdict .band {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand);
  padding: 7px 14px;
  border: 1px solid rgba(51, 153, 255, 0.35);
  border-radius: 999px;
  background: rgba(51, 153, 255, 0.07);
  margin-bottom: 16px;
}
.q-verdict h2 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(28px, 3.6vw, 50px);
  line-height: 1;
  letter-spacing: -0.025em;
  margin-bottom: 14px;
  text-wrap: balance;
}
.q-verdict h2 em { font-style: italic; color: var(--brand); }
.q-verdict p {
  font-size: clamp(14px, 1.2vw, 16px);
  color: var(--mute);
  line-height: 1.55;
  max-width: 46ch;
}

/* breakdown bars */
.q-breakdown {
  border-top: 1px solid var(--line);
  padding-top: clamp(24px, 3vw, 32px);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 40px;
}
.bd-row { display: flex; flex-direction: column; gap: 9px; }
.bd-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.bd-top .bd-name { color: var(--paper); }
.bd-top .bd-val { color: var(--brand); font-weight: 600; }
.bd-track {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.bd-meter {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand-deep), var(--brand));
  transition: width 1.1s var(--ease-out);
}
.bd-meter.low  { background: linear-gradient(90deg, #B82B53, var(--pink)); }
.bd-meter.mid  { background: linear-gradient(90deg, #C77828, var(--orange)); }

.q-result-cta {
  border-top: 1px solid var(--line);
  padding-top: clamp(24px, 3vw, 32px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.q-result-cta .rc-copy { flex: 1; min-width: 240px; }
.q-result-cta .rc-copy b {
  font-family: var(--display);
  font-size: clamp(18px, 1.6vw, 22px);
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--paper);
  display: block;
  margin-bottom: 4px;
}
.q-result-cta .rc-copy span { font-size: 14px; color: var(--mute); }

/* ============ LEAD FORM ============ */
.q-lead { gap: 0; }
.q-lead-head { text-align: center; margin-bottom: clamp(28px, 4vw, 40px); }
.q-lead-head .pill-mini {
  display: inline-block;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brand);
  padding: 7px 16px;
  border: 1px solid rgba(51, 153, 255, 0.3);
  border-radius: 999px;
  background: rgba(51, 153, 255, 0.06);
  margin-bottom: 22px;
}
.q-lead-head h2 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(28px, 4vw, 52px);
  line-height: 1;
  letter-spacing: -0.025em;
  margin-bottom: 14px;
}
.q-lead-head h2 em { font-style: italic; color: var(--brand); font-weight: 500; }
.q-lead-head p { color: var(--mute); max-width: 46ch; margin: 0 auto; line-height: 1.55; font-size: clamp(14px, 1.1vw, 16px); }

.q-lead-form { max-width: 600px; margin: 0 auto; width: 100%; display: flex; flex-direction: column; gap: 20px; }
.q-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.q-field { display: flex; flex-direction: column; gap: 8px; }
.q-field label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mute);
  font-weight: 500;
}
.q-field label .req { color: var(--brand); }
.q-field input {
  padding: 15px 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--paper);
  font-family: var(--sans);
  font-size: 15px;
  width: 100%;
  transition: border-color .2s ease, background .2s ease;
}
.q-field input::placeholder { color: rgba(242, 237, 227, 0.32); }
.q-field input:focus { outline: none; border-color: var(--brand); background: rgba(51, 153, 255, 0.05); }
.q-field .err {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--pink);
  display: none;
}
.q-field.has-err input { border-color: var(--pink); background: rgba(232, 68, 111, 0.05); }
.q-field.has-err .err { display: block; }
.q-field .note { font-family: var(--mono); font-size: 10px; letter-spacing: 0.06em; color: var(--mute); }

.q-check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  font-size: 14px;
  color: var(--mute);
  line-height: 1.45;
}
.q-check input { position: absolute; opacity: 0; pointer-events: none; }
.q-check .box {
  flex-shrink: 0;
  width: 22px; height: 22px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  display: grid;
  place-items: center;
  color: transparent;
  transition: all .2s ease;
  margin-top: 1px;
}
.q-check input:checked + .box { background: var(--brand); border-color: var(--brand); color: #fff; }
.q-check strong { color: var(--paper); font-weight: 600; }

.q-submit {
  width: 100%;
  justify-content: center;
  padding: 18px 24px;
  font-size: 15px;
  margin-top: 4px;
}
.q-lead-fine {
  text-align: center;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mute);
}
.q-lead-fine a { color: var(--brand); }

/* ============ SUCCESS ============ */
.q-success { align-items: center; justify-content: center; text-align: center; gap: 22px; }
.q-success .check-burst {
  width: 84px; height: 84px;
  border-radius: 50%;
  background: rgba(51, 153, 255, 0.12);
  border: 1px solid var(--brand);
  display: grid;
  place-items: center;
  color: var(--brand);
  animation: burst .6s var(--ease-out) both;
}
.q-success .check-burst svg { width: 38px; height: 38px; stroke: var(--brand); fill: none; stroke-width: 2.5; }
@keyframes burst {
  0% { transform: scale(0.4); opacity: 0; }
  60% { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 1; }
}
.q-success h2 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(30px, 4vw, 54px);
  line-height: 1;
  letter-spacing: -0.025em;
}
.q-success h2 em { font-style: italic; color: var(--brand); }
.q-success p { color: var(--mute); max-width: 44ch; line-height: 1.55; }
.q-success .ticket {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--brand);
  padding: 11px 20px;
  border: 1px dashed var(--brand);
  border-radius: 999px;
}
.q-success .q-success-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 6px; }

/* ============ RESPONSIVE ============ */
@media (max-width: 720px) {
  .quiz { padding: 24px 20px 28px; min-height: clamp(520px, 80vh, 720px); border-radius: 18px; }
  .q-result-top { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .q-verdict { text-align: center; }
  .q-verdict p { margin: 0 auto; }
  .q-breakdown { grid-template-columns: 1fr; gap: 16px; }
  .q-grid2 { grid-template-columns: 1fr; }
  .q-hint { display: none; }
  .q-intro-meta { width: 100%; }
  .q-intro-meta .m { flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .q-panel.is-active, .q-inner, .q-opt, .gauge .meter, .bd-meter, .q-bar-fill { animation: none !important; transition: none !important; }
}
