/* LessCal quiz funnel. Self-contained: the engine (js/quiz-engine.js) is shared
   with Vitalis Men and themes itself off these custom properties. */
:root {
  --bg: #0a0f1c;
  --surface: #131c30;
  --border-strong: #1e2b45;
  --fg: #e8eef7;
  --muted: #8595b0;
  --primary: #37c8ff;
  --primary-600: #12a9e6;
  --primary-fg: #04121c;
  --primary-soft: rgba(55, 200, 255, 0.13);
  --primary-glow: rgba(18, 169, 230, 0.3);
  --good: #3ddc97;
  --danger: #ff6b6b;
  --font-head: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font-family: var(--font-head); line-height: 1.5;
}

.quiz-wrap {
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column;
  max-width: 560px; margin: 0 auto; padding: 20px;
  color: var(--fg);
}

/* ---- Top bar ---- */
.quiz-top { display: flex; align-items: center; gap: 14px; padding: 8px 0 22px; }
.quiz-back {
  background: none; border: 0; color: var(--muted); cursor: pointer;
  display: inline-flex; padding: 6px; border-radius: 8px;
}
.quiz-back:hover { color: var(--fg); background: var(--surface); }
.quiz-back[hidden] { visibility: hidden; display: inline-flex; }
.quiz-progress { flex: 1; height: 6px; border-radius: 999px; background: var(--surface); overflow: hidden; }
.quiz-progress-bar { height: 100%; background: linear-gradient(90deg, var(--primary), var(--primary-600)); border-radius: 999px; transition: width .35s ease; }
.quiz-step-count { font-size: 13px; color: var(--muted); min-width: 40px; text-align: right; }

/* ---- Body ---- */
.quiz-body { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 8px 0 22px; }
.quiz-eyebrow { color: var(--primary); font-weight: 700; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; }
.quiz-body h1 { font-size: clamp(24px, 4.6vw, 31px); font-weight: 800; letter-spacing: -.6px; margin: 10px 0 6px; }
.quiz-body .q-sub { color: var(--muted); margin-bottom: 22px; }
.q-chip { display: inline-block; background: var(--primary-soft); color: var(--primary); font-weight: 700; font-size: 12px; padding: 7px 14px; border-radius: 999px; margin-bottom: 14px; }

/* ---- Option grids (single / multi) ---- */
.q-options { display: grid; gap: 12px; grid-template-columns: 1fr; }
.q-card {
  position: relative; display: flex; align-items: center; gap: 14px; width: 100%;
  text-align: left; padding: 16px 18px; border-radius: 16px;
  border: 2px solid var(--border-strong); background: var(--surface); color: var(--fg);
  cursor: pointer; transition: border-color .15s, background .15s, transform .1s;
}
.q-card:hover { border-color: var(--primary); }
.q-card:active { transform: scale(.99); }
.q-card.selected { border-color: var(--primary); background: var(--primary-soft); }
.q-card .q-cap { flex: 1; }
.q-card .q-cap strong { display: block; font-size: 15px; line-height: 1.25; }
.q-card .q-cap span { display: block; font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.q-card .q-cardic { width: 36px; height: 36px; flex-shrink: 0; color: var(--primary); }
.q-card .q-cardic svg { width: 100%; height: 100%; }
.q-card .q-emoji { font-size: 26px; flex-shrink: 0; line-height: 1; }
.q-card .q-check { margin-left: auto; color: var(--primary); opacity: 0; flex-shrink: 0; width: 22px; height: 22px; }
.q-card .q-check svg { width: 100%; height: 100%; }
.q-card.selected .q-check { opacity: 1; }

/* Two-up grid for short text options; cols-1 keeps the roomier list layout. */
.q-options.q-textgrid { grid-template-columns: 1fr 1fr; }
.q-options.q-textgrid.cols-1 { grid-template-columns: 1fr; }
.q-textgrid:not(.cols-1) .q-card { flex-direction: column; align-items: flex-start; justify-content: center; min-height: 62px; }
.q-textgrid:not(.cols-1) .q-card .q-check { position: absolute; top: 12px; right: 14px; margin: 0; }

.q-hint { font-size: 12px; color: var(--muted); margin-top: 10px; }
.q-note { font-size: 13px; color: var(--muted); margin: -10px 0 14px; }

/* Flags (language step) */
.q-flag { width: 30px; height: 20px; flex-shrink: 0; display: block; }

/* ---- Picker (scroll wheels) ---- */
.pframe { margin: 4px 0 6px; }
.plabels { display: flex; gap: 10px; justify-content: center; margin-bottom: 8px; }
.plabel { flex: 1; max-width: 150px; text-align: center; font-size: 11.5px; text-transform: uppercase;
  letter-spacing: .08em; color: var(--muted); }
.pickers { position: relative; display: flex; gap: 10px; justify-content: center;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 18px; padding: 0 10px;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 26%, #000 74%, transparent);
          mask-image: linear-gradient(180deg, transparent, #000 26%, #000 74%, transparent); }
.phighlight { position: absolute; top: 80px; left: 10px; right: 10px; height: 40px; border-radius: 11px;
  background: var(--primary-soft); border: 1px solid var(--primary); pointer-events: none; }
.pcol { flex: 1; max-width: 150px; height: 200px; overflow-y: scroll; scroll-snap-type: y mandatory;
  scrollbar-width: none; -ms-overflow-style: none; text-align: center; }
.pcol::-webkit-scrollbar { display: none; }
.pspacer { height: 80px; flex-shrink: 0; }
.pitem { height: 40px; line-height: 40px; scroll-snap-align: start; cursor: pointer;
  color: var(--muted); font-size: 16px; font-variant-numeric: tabular-nums;
  transition: color .15s, font-size .15s, font-weight .15s; }
.pitem.on { color: var(--fg); font-weight: 800; font-size: 19px; }
.q-picksum { text-align: center; color: var(--muted); font-size: 14px; margin-top: 14px; }
.q-picksum b { color: var(--primary); }

/* ---- Slider (pace dial) ---- */
.q-slider { margin: 8px 0 4px; }
.q-slider-marks { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 14px; }
.q-slider-mark { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer;
  color: var(--muted); font-size: 12px; font-weight: 600; text-align: center; transition: color .15s; }
.q-slider-mark.on { color: var(--primary); }
.q-slider-ic { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%;
  border: 1px solid var(--border-strong); background: var(--surface); transition: border-color .15s, transform .15s; }
.q-slider-ic svg { width: 20px; height: 20px; }
.q-slider-mark.on .q-slider-ic { border-color: var(--primary); background: var(--primary-soft); transform: scale(1.12); }
.q-slider input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 8px; border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), var(--primary-600)); outline: none; cursor: pointer; }
.q-slider input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; border-radius: 50%;
  background: #fff; border: 3px solid var(--primary); cursor: grab; box-shadow: 0 3px 10px rgba(0,0,0,.4); }
.q-slider input[type=range]::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: #fff;
  border: 3px solid var(--primary); cursor: grab; }
.q-slider-sum { margin-top: 20px; background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: 16px; padding: 16px; text-align: center; font-size: 14px; color: var(--muted); line-height: 1.6; }
.q-slider-sum b { display: block; color: var(--fg); font-size: 22px; font-weight: 800; margin-top: 2px; }
.q-slider-sum .hl { color: var(--primary); }

/* ---- 2x comparison bars ---- */
.q-bars { display: flex; align-items: flex-end; justify-content: center; gap: 34px; height: 190px; margin: 18px 0 4px; }
.q-bar-col { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; width: 92px; }
.q-bar-col span { margin-top: 10px; font-size: 12px; color: var(--muted); text-align: center; }
.q-bar-fill { width: 100%; border-radius: 14px 14px 4px 4px; display: flex; align-items: flex-start;
  justify-content: center; padding-top: 10px; }
.q-bar-fill.low { background: var(--border-strong); }
.q-bar-fill.hi { background: linear-gradient(180deg, var(--primary), var(--primary-600)); }
.q-bar-fill b { color: var(--primary-fg); font-size: 20px; font-weight: 800; }

/* ---- In-quiz testimonials ---- */
.q-quotes { display: grid; gap: 12px; margin: 14px 0 4px; }
.q-quote { margin: 0; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 16px; padding: 16px; }
.q-quote-stars { color: #ffcf5c; font-size: 13px; letter-spacing: 2px; }
.q-quote blockquote { margin: 8px 0 12px; font-size: 14px; line-height: 1.5; color: var(--fg); }
.q-quote figcaption { display: flex; align-items: center; gap: 10px; }
.q-quote-av { width: 40px; height: 40px; border-radius: 50%; overflow: hidden; flex-shrink: 0;
  border: 1px solid var(--border-strong); background: var(--bg); display: block; }
.q-avatar-img { width: 100%; height: 100%; display: block; }
.q-quote figcaption strong { display: block; font-size: 13px; }
.q-quote figcaption small { color: var(--muted); font-size: 11.5px; }

/* ---- Free-text notes under an option grid ---- */
.q-notes { margin-top: 16px; }
.q-notes label { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted); margin-bottom: 7px; }
.q-notes input { width: 100%; background: var(--surface); border: 1px solid var(--border-strong); color: var(--fg);
  border-radius: 12px; padding: 13px 16px; font-size: 15px; font-family: inherit; outline: none; }
.q-notes input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }

/* ---- Number fields ---- */
.q-fields { display: grid; gap: 16px; }
.q-field label { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 7px; }
.q-field .q-input, .q-measure .q-input {
  display: flex; align-items: center; gap: 8px; border-radius: 12px;
  border: 1px solid var(--border-strong); background: var(--surface); padding: 0 16px;
}
.q-field .q-input:focus-within, .q-measure .q-input:focus-within {
  border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft);
}
.q-field input, .q-measure input {
  flex: 1; background: transparent; border: 0; color: var(--fg); font-size: 18px;
  font-weight: 700; padding: 14px 0; outline: none; font-family: inherit;
}
.q-field .q-suffix, .q-measure .q-suffix { color: var(--muted); font-size: 14px; }
.q-input.invalid { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(255, 107, 107, .15); }
.q-err { color: #ff8d8d; font-size: 12px; margin-top: 6px; }
.q-err:empty { display: none; }

/* ---- Measure (unit toggle) ---- */
.q-seg { display: flex; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 999px; padding: 4px; margin-bottom: 18px; }
.q-seg-btn { flex: 1; border: 0; background: none; color: var(--muted); font-weight: 700; font-size: 14px; padding: 10px; border-radius: 999px; cursor: pointer; font-family: inherit; transition: background .15s, color .15s; }
.q-seg-btn.on { background: var(--primary); color: var(--primary-fg); }
.q-measure-row { display: flex; gap: 12px; }
.q-measure-row .q-input { flex: 1; }

/* ---- Interstitial ---- */
.q-bigstat { font-weight: 800; font-size: clamp(30px, 8vw, 46px); color: var(--primary); line-height: 1.05; margin: 8px 0; letter-spacing: -1px; }
.q-body-text { color: var(--muted); line-height: 1.55; margin-top: 4px; }
.q-bullets { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 12px; }
.q-bullets li { display: flex; align-items: flex-start; gap: 10px; font-size: 14.5px; line-height: 1.4; }
.q-bullets li svg { width: 20px; height: 20px; color: var(--primary); flex-shrink: 0; margin-top: 1px; }
.q-cite { font-size: 13px; color: var(--muted); margin-top: 12px; font-weight: 600; }
.q-disclaimer { font-size: 11.5px; color: var(--muted); line-height: 1.5; margin-top: 16px; opacity: .85; }

/* Slow↔fast gauge */
.q-gauge { margin: 20px 0 6px; }
.q-gauge-bar { position: relative; height: 10px; border-radius: 999px; background: linear-gradient(90deg, #b84040 0%, #c9a227 50%, var(--good) 100%); }
.q-gauge-marker { position: absolute; top: -5px; width: 6px; height: 20px; background: var(--fg); border-radius: 3px; transform: translateX(-50%); box-shadow: 0 0 0 2px var(--surface); }
.q-gauge-legend { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 8px; text-transform: uppercase; letter-spacing: .04em; }

/* Projection chart */
.q-chart { background: var(--surface); border: 1px solid var(--border-strong); border-radius: 16px; padding: 16px; margin: 10px 0 4px; }
.q-chart svg { width: 100%; height: auto; display: block; }
.q-chart-legend { display: flex; gap: 18px; justify-content: center; margin-top: 8px; font-size: 12px; color: var(--muted); }
.q-chart-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }

/* ---- Summary (BMI + stats) ---- */
.q-bmi { background: var(--surface); border: 1px solid var(--border-strong); border-radius: 18px; padding: 20px; }
.q-bmi-val { font-weight: 800; font-size: 40px; color: var(--fg); line-height: 1; }
.q-bmi-val span { display: block; font-size: 13px; font-weight: 600; color: var(--primary); margin-top: 6px; }
.q-bmi-bar { position: relative; display: flex; height: 10px; border-radius: 999px; overflow: hidden; margin: 22px 0 8px; }
.q-bmi-bar .seg { height: 100%; }
.q-bmi-bar .seg.normal { flex: 2; background: var(--good); }
.q-bmi-bar .seg.over { flex: 2; background: #c9a227; }
.q-bmi-bar .seg.obese { flex: 3; background: #b84040; }
.q-bmi-marker { position: absolute; top: -4px; width: 4px; height: 18px; background: #fff; border-radius: 2px; transform: translateX(-50%); box-shadow: 0 0 0 2px rgba(0, 0, 0, .35); }
.q-bmi-legend { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.q-stats { display: grid; gap: 1px; background: var(--border-strong); border: 1px solid var(--border-strong); border-radius: 14px; overflow: hidden; margin-top: 16px; }
.q-stat { display: flex; justify-content: space-between; align-items: center; padding: 13px 16px; background: var(--surface); font-size: 14px; }
.q-stat span { color: var(--muted); }
.q-stat strong { text-align: right; }
.q-stat.hero strong { color: var(--primary); font-size: 18px; }

/* ---- Email capture ---- */
.q-socialproof { font-size: 13px; color: var(--primary); font-weight: 700; margin-top: 14px; text-align: center; }
.q-privacy { font-size: 11.5px; color: var(--muted); margin-top: 14px; line-height: 1.5; }
.q-privacy a { color: var(--muted); text-decoration: underline; }

/* ---- Footer CTA ---- */
.quiz-foot { padding-top: 8px; }
.quiz-cta {
  width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: linear-gradient(135deg, var(--primary), var(--primary-600)); color: var(--primary-fg);
  border: 0; border-radius: 999px; cursor: pointer; font-family: inherit;
  font-weight: 700; font-size: 16px; padding: 16px;
  box-shadow: 0 8px 24px var(--primary-glow); transition: filter .15s, opacity .15s;
}
.quiz-cta:hover { filter: brightness(1.06); }
.quiz-cta:disabled { opacity: .4; cursor: not-allowed; box-shadow: none; }
.quiz-secondary { text-align: center; margin-top: 14px; font-size: 14px; color: var(--muted); }
.quiz-secondary a { color: var(--primary); font-weight: 600; text-decoration: none; }

/* ---- Analyzing interlude ---- */
.q-analyze { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 48px 0 36px; text-align: center; }
.q-analyze-ring { position: relative; width: 150px; height: 150px; }
.q-analyze-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.q-analyze-ring .track { fill: none; stroke: rgba(255, 255, 255, .1); stroke-width: 9; }
.q-analyze-ring .fill { fill: none; stroke: var(--primary); stroke-width: 9; stroke-linecap: round; transition: stroke-dashoffset .12s linear; }
.q-analyze-pct { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 30px; }
.q-analyze-msg { margin-top: 24px; font-size: 15px; color: var(--muted); min-height: 22px; }
.q-pop { animation: q-pop .3s ease; }
@keyframes q-pop { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---- Step transitions ---- */
@keyframes q-in-fwd  { from { opacity: 0; transform: translateX(26px); }  to { opacity: 1; transform: none; } }
@keyframes q-in-back { from { opacity: 0; transform: translateX(-26px); } to { opacity: 1; transform: none; } }
.q-in-fwd  { animation: q-in-fwd .32s cubic-bezier(.22, .61, .36, 1) both; }
.q-in-back { animation: q-in-back .32s cubic-bezier(.22, .61, .36, 1) both; }

@media (prefers-reduced-motion: reduce) {
  .q-in-fwd, .q-in-back, .q-pop { animation: none; }
}
