/* Elite Wealth Insights — quiz funnel styles (shared by every /q/<quiz>/ page).
   Base theme = the original "Money & Mind Check-In" sample, unchanged.
   Only additions: live-stats fill / % / Trending badge on answer buttons,
   the stats note, the result stat line, the legal links line, and swipe mode (bottom). */
:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --soft: #fff6e5;
  --ink: #1c2a3a;
  color-scheme: light;
  --muted: #55657a;
  --line: #e6e1d8;
  --accent: #f7a823;
  --accent-hover: #ee9612;
  --accent-ink: #1c1a16;
  --accent-text: #8a4b00;
  --accent-soft: #fff1d6;
  --focus: #1c2a3a;
  /* gamification additions */
  --fill: rgba(28, 26, 22, .11);
  --fill-top: rgba(28, 26, 22, .17);
  --badge-bg: #1c2a3a;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.55;
  padding-inline: 16px;
  padding-block: 40px 56px;
}
.wrap { max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; }

.card {
  background: var(--surface);
  padding: 8px 0;
  display: flex; flex-direction: column; gap: 20px;
}

.progress { display: flex; flex-direction: column; gap: 8px; }
.progress-label { font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.bars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.bars span { height: 5px; border-radius: 3px; background: var(--line); transition: background .25s; }
.bars span.on { background: var(--accent); }

h1, h2 {
  font-family: inherit; font-weight: 700;
  text-wrap: balance; margin: 0; line-height: 1.2; letter-spacing: -.01em;
}
h1 { font-size: clamp(26px, 6vw, 32px); }
h2 { font-size: clamp(22px, 5vw, 27px); }
.sub { margin: 0; color: var(--muted); }

.answers { display: flex; flex-direction: column; gap: 10px; }
.answer {
  font: inherit; font-weight: 700; text-align: left; color: var(--ink);
  background: var(--accent); color: var(--accent-ink);
  border: 2px solid var(--accent); border-radius: 12px;
  box-shadow: 0 2px 0 var(--accent-hover);
  padding: 15px 18px; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  transition: border-color .15s, background .15s, transform .1s;
}
.answer { justify-content: flex-start; padding: 16px 18px; }
.letter { flex: none; width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; background: #ffffff; color: var(--accent-text); font-weight: 700; }
.answer:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.answer:active { transform: scale(.99); }
.answer:focus-visible, .cta:focus-visible, .link-btn:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.nav { display: flex; justify-content: space-between; align-items: center; min-height: 24px; }
.link-btn { font: inherit; font-size: 15px; background: none; border: 0; color: var(--muted); cursor: pointer; padding: 4px 0; text-decoration: underline; text-underline-offset: 3px; }

.tag { align-self: flex-start; font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-text); background: var(--accent-soft); padding: 5px 10px; border-radius: 999px; }
.result-list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.cta {
  display: block; text-align: center; text-decoration: none;
  background: var(--accent); color: var(--accent-ink);
  font-weight: 700; font-size: 18px;
  padding: 17px 20px; border-radius: 12px;
  transition: filter .15s;
}
.cta { box-shadow: 0 3px 0 var(--accent-hover); }
.cta:hover { background: var(--accent-hover); }
.help-note { font-size: 14px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 16px; margin: 0; }
.help-note strong { color: var(--ink); }

.foot { font-size: 13px; color: var(--muted); text-align: center; margin: 0; }

.screen { animation: in .28s ease-out; }
@keyframes in { from { opacity: .4; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .screen { animation: none; } .bars span, .answer { transition: none; } }

/* =====================================================================
   Gamification additions: live % of readers on each answer button
   ===================================================================== */
.answer { position: relative; overflow: hidden; isolation: isolate; }
.answer .fill {
  position: absolute; inset: 0 auto 0 0; z-index: -1;
  width: 0; background: var(--fill);
  transition: width .9s cubic-bezier(.2, .8, .2, 1);
}
.answer.top .fill { background: var(--fill-top); }
.answer .label { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.answer .meta { flex: none; margin-left: auto; }
.answer .pct { font-variant-numeric: tabular-nums; font-weight: 800; font-size: 17px; color: var(--accent-ink); }
.answer .badge {
  font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  color: #ffffff; background: var(--badge-bg);
  padding: 2px 8px; border-radius: 999px; white-space: nowrap;
}
.answer .badge::before { content: "▲ "; font-size: 9px; }

.stats-note { margin: -8px 0 0; font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.stats-note::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, .18); }

.result-stat { margin: 0; font-size: 15px; color: var(--muted); background: var(--soft); border-radius: 10px; padding: 10px 12px; }
.result-stat strong { color: var(--ink); }

/* Answer recap on summary-style results: compact two-column table */
.recap { margin: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; font-size: 15px; }
.recap-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 9px 14px; }
.recap-row + .recap-row { border-top: 1px solid var(--line); }
.recap-row:nth-child(odd) { background: var(--soft); }
.recap dt { color: var(--muted); }
.recap dd { margin: 0; font-weight: 700; color: var(--ink); text-align: right; white-space: nowrap; }

/* Legal line (Terms / Privacy) */
.legal { font-size: 12px; color: var(--muted); text-align: center; margin: 0; line-height: 1.6; }
.legal a { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.legal a:hover { color: var(--ink); }

.hidden { display: none; }
@media (prefers-reduced-motion: reduce) { .answer .fill { transition: none; } }

/* =====================================================================
   Swipe mode ("mode": "swipe" in quiz-config.json)
   One card per question. Swipe right / left, or use the buttons / ←→ keys.
   ===================================================================== */
html.quiz-swipe, html.quiz-swipe body { overflow-x: clip; }   /* card flies off-screen without a sideways scrollbar */

.sw-stage { position: relative; padding-bottom: 10px; }
.sw-peek {                                   /* the "next card" edge peeking out underneath */
  position: absolute; inset: 10px 14px 0; z-index: 0;
  background: var(--soft); border: 2px solid var(--line); border-radius: 20px;
}
.sw-card {
  position: relative; z-index: 1;
  background: var(--surface);
  border: 2px solid var(--line); border-radius: 20px;
  box-shadow: 0 12px 28px rgba(28, 42, 58, .10);
  padding: 50px 22px 34px; min-height: 250px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  text-align: center;
  touch-action: pan-y;                       /* vertical = page scroll, horizontal = swipe */
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  cursor: grab;
  transition: transform .26s cubic-bezier(.2, .8, .2, 1), opacity .23s ease-in;
  will-change: transform;
}
.sw-card.dragging { transition: none; cursor: grabbing; }
.sw-card .tag { align-self: center; }

.sw-stamp {
  position: absolute; top: 14px;
  font-size: 15px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  padding: 3px 10px; border: 3px solid currentColor; border-radius: 8px;
  background: var(--surface);
  opacity: 0; pointer-events: none;
  max-width: 45%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sw-stamp-right { left: 16px;  color: var(--accent-text); transform: rotate(-10deg); }
.sw-stamp-left  { right: 16px; color: var(--ink);         transform: rotate(10deg); }

.sw-hint { margin: -6px 0 0; text-align: center; font-size: 14px; color: var(--muted); }

.sw-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sw-actions .answer, .sw-extra .answer, .sw-start { justify-content: center; text-align: center; }
.sw-actions .answer .label, .sw-extra .answer .label { flex: 0 1 auto; align-items: center; }
.sw-actions .answer .meta, .sw-extra .answer .meta { margin-left: 8px; }
.answer .arrow { font-weight: 800; }

.sw-extra { display: flex; flex-direction: column; gap: 10px; margin-top: -10px; }
.sw-btn-alt {
  background: var(--surface); color: var(--ink);
  border-color: var(--line); box-shadow: 0 2px 0 var(--line);
}
.sw-btn-alt:hover { background: var(--soft); border-color: var(--accent); }

/* Intro card: "Swipe to get started" */
.sw-intro { min-height: 300px; }
.sw-gesture { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 8px; color: var(--accent-text); font-size: 22px; font-weight: 800; }
.sw-dot {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 7px var(--accent-soft);
  animation: sw-dot 2.4s ease-in-out infinite;
}
.sw-cta { margin: 0; font-size: 15px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-text); }
.sw-start { font-size: 16px; padding: 14px 18px; background: var(--surface); color: var(--ink); border-color: var(--line); box-shadow: 0 2px 0 var(--line); }
.sw-start:hover { background: var(--soft); border-color: var(--accent); }

@keyframes sw-dot {
  0%, 100% { transform: translateX(0); }
  25%      { transform: translateX(-16px); }
  75%      { transform: translateX(16px); }
}
/* Gentle "I move" wiggle until the reader touches the card (removed on first touch). */
.sw-nudge { animation: sw-nudge 3.4s ease-in-out 1.2s infinite; }
@keyframes sw-nudge {
  0%, 68%, 100% { transform: none; }
  78% { transform: translateX(-16px) rotate(-2.5deg); }
  88% { transform: translateX(12px) rotate(2deg); }
}

@media (prefers-reduced-motion: reduce) {
  .sw-card, .sw-card.sw-fly { transition: none; }
  .sw-nudge, .sw-dot { animation: none; }
}
