/* ============================================================
   Kenki — Quiz funnel styles. Builds on styles.css tokens.
   One screen per question, generous tap targets, mobile-first.
   ============================================================ */

.quiz-body { display: flex; flex-direction: column; min-height: 100dvh; }
.quiz-main { flex: 1; width: 100%; padding-top: 18px; padding-bottom: 56px; }

/* --- Progress --- */
.q-progress {
  height: 4px; border-radius: 999px; background: var(--line-strong);
  overflow: hidden; margin-top: 6px;
}
.q-progress-fill {
  height: 100%; width: 0; border-radius: inherit;
  background: linear-gradient(90deg, var(--sage-deep), var(--sage));
  transition: width 0.45s var(--ease);
}
.q-topline {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 40px; margin-top: 14px;
}
.q-back {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 14px; color: var(--text-dim); padding: 8px 12px 8px 6px;
  border-radius: 999px; transition: color 0.2s var(--ease), background 0.2s var(--ease);
}
.q-back:hover { color: var(--text); background: var(--sage-wash); }
.q-back[hidden] { display: none; }
.q-back svg { width: 16px; height: 16px; }
.q-stepcount { font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.14em; color: var(--text-faint); text-transform: uppercase; }

/* --- Step container --- */
.q-root { margin-top: 10px; }
.q-step { animation: qIn 0.4s var(--ease) both; }
@keyframes qIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.q-step h1 {
  font-size: clamp(1.7rem, 4.5vw, 2.5rem); line-height: 1.06;
  letter-spacing: -0.03em; max-width: 20ch;
}
.q-step .q-sub { color: var(--text-dim); font-size: 15px; margin-top: 10px; max-width: 52ch; }

/* --- Option cards --- */
.q-options { display: grid; gap: 10px; margin-top: 26px; }
.q-opt {
  display: flex; align-items: center; gap: 14px; text-align: left;
  padding: 16px 18px; border-radius: var(--r-md);
  border: 1px solid var(--line-strong); background: var(--surface);
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease), transform 0.15s var(--spring);
  font-size: 15.5px; font-weight: 500; width: 100%;
}
.q-opt:hover { border-color: var(--sage); background: var(--sage-wash); }
.q-opt:active { transform: scale(0.99); }
.q-opt.is-selected { border-color: var(--sage); background: var(--sage-wash); box-shadow: 0 0 0 1px var(--sage) inset; }
.q-opt .q-emoji { font-size: 22px; flex: none; width: 34px; text-align: center; }
.q-opt .q-opt-sub { display: block; font-weight: 400; font-size: 13px; color: var(--text-dim); margin-top: 2px; }
.q-opt .q-check {
  margin-left: auto; flex: none; width: 22px; height: 22px; border-radius: 50%;
  border: 1.5px solid var(--line-strong); display: grid; place-items: center; color: transparent;
}
.q-opt.is-selected .q-check { background: var(--sage); border-color: var(--sage); color: var(--sage-ink); }
.q-opt .q-check svg { width: 12px; height: 12px; }

/* --- Numeric inputs / unit rows --- */
.q-inputrow { display: flex; gap: 10px; margin-top: 26px; align-items: stretch; }
.q-field { flex: 1; position: relative; }
.q-field input {
  width: 100%; padding: 18px 64px 18px 18px; border-radius: var(--r-md);
  background: var(--surface); border: 1px solid var(--line-strong);
  color: var(--text); font: inherit; font-size: 22px; font-weight: 600;
  font-variant-numeric: tabular-nums; -moz-appearance: textfield; appearance: textfield;
}
.q-field input::-webkit-outer-spin-button, .q-field input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.q-field input:focus { outline: none; border-color: var(--sage); box-shadow: 0 0 0 1px var(--sage) inset; }
.q-field .q-unit {
  position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
  font-family: var(--f-mono); font-size: 13px; color: var(--text-faint);
}
.q-units {
  display: inline-flex; border: 1px solid var(--line-strong); border-radius: 999px;
  padding: 3px; gap: 2px; margin-top: 16px;
}
.q-units button {
  padding: 7px 16px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--text-dim);
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.q-units button.is-on { background: var(--sage); color: var(--sage-ink); }
.q-hint { font-size: 13px; color: var(--text-faint); margin-top: 12px; }
.q-error { color: #d98383; font-size: 13.5px; margin-top: 12px; min-height: 18px; }

/* --- Primary continue button --- */
.q-actions { margin-top: 28px; display: flex; flex-direction: column; gap: 12px; }
.q-actions .btn { width: 100%; padding: 16px 26px; font-size: 16px; }
.q-actions .q-skip { align-self: center; font-size: 13.5px; color: var(--text-faint); text-decoration: underline; text-underline-offset: 3px; }
.q-actions .q-skip:hover { color: var(--text-dim); }

/* --- Reassurance screens --- */
.q-reassure { text-align: left; }
.q-reassure .q-badge {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--sage); background: var(--sage-wash); border-radius: 999px; padding: 6px 14px;
  margin-bottom: 18px;
}
.q-quote {
  margin-top: 26px; padding: 20px 22px; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--line);
}
.q-quote p { font-size: 15px; line-height: 1.55; }
.q-quote .q-who { display: flex; align-items: center; gap: 10px; margin-top: 14px; font-size: 13px; color: var(--text-dim); }
.q-quote .q-avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--sage-wash); color: var(--sage); display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.q-stars { color: var(--tan); letter-spacing: 2px; font-size: 14px; }

/* --- Computing screen --- */
.q-computing { text-align: center; padding-top: 8vh; }
.q-ring { width: 110px; height: 110px; margin: 0 auto 28px; position: relative; }
.q-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.q-ring .q-ring-bg { stroke: var(--line-strong); }
.q-ring .q-ring-fg { stroke: var(--sage); stroke-linecap: round; transition: stroke-dashoffset 0.3s linear; }
.q-ring .q-ring-pct {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--f-display); font-weight: 800; font-size: 1.5rem; font-variant-numeric: tabular-nums;
}
.q-computing .q-checklist { margin: 30px auto 0; max-width: 340px; text-align: left; display: grid; gap: 12px; }
.q-computing .q-checkitem { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text-faint); transition: color 0.3s var(--ease); }
.q-computing .q-checkitem.is-done { color: var(--text); }
.q-computing .q-checkitem .dot { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--line-strong); flex: none; display: grid; place-items: center; color: transparent; }
.q-computing .q-checkitem.is-done .dot { background: var(--sage); border-color: var(--sage); color: var(--sage-ink); }
.q-computing .q-checkitem .dot svg { width: 10px; height: 10px; }

/* --- Result screen --- */
.q-result .q-kcal-card {
  margin-top: 26px; padding: 28px; border-radius: var(--r-xl); text-align: center;
  background: var(--surface); border: 1px solid var(--sage);
  box-shadow: var(--shadow-float); position: relative; overflow: hidden;
}
.q-result .q-kcal-card::before {
  content: ""; position: absolute; inset: -40% -20% auto; height: 120%;
  background: radial-gradient(circle at 50% 0%, var(--sage-wash), transparent 70%); pointer-events: none;
}
.q-kcal-num { font-family: var(--f-display); font-weight: 800; font-size: clamp(3rem, 9vw, 4.2rem); letter-spacing: -0.04em; line-height: 1; font-variant-numeric: tabular-nums; position: relative; }
.q-kcal-label { font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-dim); margin-top: 8px; position: relative; }
.q-macros { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.q-macro { padding: 16px 12px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); text-align: center; }
.q-macro b { display: block; font-family: var(--f-display); font-weight: 800; font-size: 1.4rem; font-variant-numeric: tabular-nums; }
.q-macro span { font-size: 11.5px; color: var(--text-dim); font-family: var(--f-mono); letter-spacing: 0.08em; text-transform: uppercase; }
.q-macro.m-protein b { color: var(--sage); }
.q-macro.m-carbs b { color: var(--tan); }
.q-macro.m-fat b { color: var(--peach); }
.q-goaldate {
  margin-top: 14px; padding: 16px 20px; border-radius: var(--r-md);
  background: var(--sage-wash); border: 1px solid color-mix(in srgb, var(--sage) 45%, transparent);
  font-size: 14.5px; display: flex; align-items: center; gap: 12px;
}
.q-goaldate svg { width: 20px; height: 20px; color: var(--sage); flex: none; }
.q-disclaimer { font-size: 12px; color: var(--text-faint); margin-top: 16px; }

/* --- Account step (Firebase sign-up, replaces the old email capture) --- */
.q-account input {
  width: 100%; padding: 16px 18px; border-radius: var(--r-md); margin-top: 12px;
  background: var(--surface); border: 1px solid var(--line-strong);
  color: var(--text); font: inherit; font-size: 16px;
}
.q-account input:first-of-type { margin-top: 20px; }
.q-account input:focus { outline: none; border-color: var(--sage); box-shadow: 0 0 0 1px var(--sage) inset; }
.q-google-btn {
  width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 15px 20px; border-radius: 999px; margin-top: 26px;
  background: var(--surface); border: 1px solid var(--line-strong);
  color: var(--text); font-size: 15px; font-weight: 600;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease), transform 0.15s var(--spring);
}
.q-google-btn:hover { border-color: var(--sage); background: var(--sage-wash); }
.q-google-btn:active { transform: scale(0.99); }
.q-or {
  display: flex; align-items: center; gap: 14px; margin: 20px 0 0;
  font-size: 12px; color: var(--text-faint); font-family: var(--f-mono); letter-spacing: 0.08em; text-transform: uppercase;
}
.q-or::before, .q-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.q-hint { font-size: 13px; color: var(--text-faint); margin-top: 16px; text-align: center; }
.q-linklike { color: var(--sage); text-decoration: underline; text-underline-offset: 3px; font-size: inherit; }
.q-privacy { display: flex; gap: 10px; align-items: flex-start; margin-top: 18px; font-size: 12.5px; color: var(--text-faint); }
.q-privacy svg { width: 15px; height: 15px; flex: none; margin-top: 1px; color: var(--sage); }

/* --- Plan / paywall screen --- */
.q-plan .q-planbox {
  margin-top: 24px; border-radius: var(--r-xl); border: 1px solid var(--sage);
  background: var(--surface); padding: 26px; position: relative; box-shadow: var(--shadow-float);
}
.q-plan .price-pill { position: absolute; top: -12px; right: 22px; background: var(--sage); color: var(--sage-ink); font-family: var(--f-mono); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; padding: 5px 11px; border-radius: 999px; }
.q-plan .q-price { display: flex; align-items: baseline; gap: 8px; font-family: var(--f-display); font-weight: 800; letter-spacing: -0.03em; margin-top: 6px; }
.q-plan .q-price strong { font-size: 2.6rem; line-height: 1; font-variant-numeric: tabular-nums; }
.q-plan .q-price span { font-size: 1rem; color: var(--text-dim); font-family: var(--f-sans); font-weight: 400; }
.q-plan .q-permonth { font-size: 13px; color: var(--text-faint); margin-top: 4px; }
.q-timeline { margin-top: 22px; display: grid; gap: 0; }
.q-timeline .q-tl { display: grid; grid-template-columns: 26px 1fr; gap: 14px; padding: 10px 0; }
.q-timeline .q-tl .tl-ic { width: 26px; height: 26px; border-radius: 50%; background: var(--sage-wash); color: var(--sage); display: grid; place-items: center; }
.q-timeline .q-tl .tl-ic svg { width: 13px; height: 13px; }
.q-timeline .q-tl b { font-size: 14.5px; display: block; }
.q-timeline .q-tl p { font-size: 13px; color: var(--text-dim); }
.q-guarantee { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 12.5px; color: var(--text-faint); margin-top: 14px; }
.q-guarantee svg { width: 14px; height: 14px; color: var(--sage); }

/* --- Footer --- */
.q-footer { border-top: 1px solid var(--line); padding: 20px 0; }
.q-footer-inner { font-size: 12px; color: var(--text-faint); font-family: var(--f-mono); letter-spacing: 0.04em; }
.q-footer a { color: var(--text-dim); text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 560px) {
  .q-step h1 { font-size: 1.55rem; }
  .q-macros { gap: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .q-step { animation: none; }
}
