/* ═══════════════════════════════════════════════════
   Remember — Web Quiz
   Matches iOS onboarding exactly.
   ═══════════════════════════════════════════════════ */

:root {
    --bg: #000F25;
    --bg-card: #0A1B35;
    --accent: #0597FF;
    --green: #33B866;
    --red: #FF6673;
    --orange: #FF9F43;
    --purple: #9461F2;
    --teal: #2DD4BF;
    --text: #F0F2F8;
    --text-sec: #8A9AB5;
    --text-muted: #4A5A75;
    --divider: #152540;
    --font: 'Inter', -apple-system, system-ui, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* ── Progress ──────────────────────────── */

.quiz-progress {
    position: fixed; top: 0; left: 0; right: 0;
    height: 4px; background: var(--divider); z-index: 100;
    opacity: 0; transition: opacity 0.3s;
}
.quiz-progress.visible { opacity: 1; }
.quiz-progress-fill {
    height: 100%; background: var(--accent);
    width: 0; transition: width 0.5s ease; border-radius: 0 2px 2px 0;
}

/* ── Steps ─────────────────────────────── */

.quiz-app { min-height: 100vh; }

.quiz-step {
    display: none;
    height: 100vh; height: 100dvh;
    flex-direction: column;
    padding: 0 24px;
    overflow: hidden;
}

.quiz-step.active {
    display: flex;
    animation: stepIn 0.5s ease;
}

@keyframes stepIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.step-inner {
    max-width: 480px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex: 1;
}

/* ── Typography (matching iOS) ─────────── */

/* .rmDisplay = 52pt black → web: 44px 800 */
.display-text {
    font-size: 44px;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: var(--text);
    padding: 0 20px;
}

/* .rmHeadline = 32pt heavy → web: 34px 800 */
.headline {
    font-size: 34px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: var(--text);
    padding: 0 16px;
}

/* .rmHeadlineSmall = 26pt bold → web: 30px 700 */
.headline-sm {
    font-size: 30px;
    font-weight: 700;
    line-height: 1.25;
    color: var(--text);
    padding: 0 16px;
}

.body-text {
    font-size: 20px;
    color: var(--text-sec);
    line-height: 1.6;
}

.label-text {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-sec);
}

/* Counter number — large accent */
.counter {
    font-size: 96px;
    font-weight: 800;
    color: var(--accent);
    line-height: 1;
    letter-spacing: -0.04em;
    min-height: 105px;
}

.counter.xl { font-size: 110px; min-height: 120px; }

/* ── Buttons ───────────────────────────── */

.btn {
    width: 100%;
    max-width: 360px;
    padding: 18px 32px;
    font-size: 18px;
    font-weight: 700;
    font-family: var(--font);
    color: #fff;
    background: var(--accent);
    border: none;
    border-radius: 16px;
    cursor: pointer;
    /* Duolingo 3D edge */
    box-shadow: 0 5px 0 0 #0070CC;
    transition: transform 0.1s;
    margin-bottom: 40px;
}

.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 0 0 #0070CC; }
.btn:active {
    transform: translateY(4px);
    box-shadow: 0 1px 0 0 #0070CC;
    transition: transform 0.05s, box-shadow 0.05s;
}

.btn-apple {
    width: 100%;
    max-width: 360px;
    padding: 18px 32px;
    font-size: 17px;
    font-weight: 600;
    font-family: var(--font);
    color: #fff;
    background: #000;
    border: 1px solid #333;
    border-radius: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 40px;
    box-shadow: 0 5px 0 0 #000;
    transition: transform 0.1s;
}

.btn-apple:active {
    transform: translateY(3px);
    box-shadow: 0 2px 0 0 #000;
}

.btn-glow {
    box-shadow: 0 5px 0 0 #0070CC, 0 0 30px rgba(5,151,255,0.3);
}

.hidden { opacity: 0; pointer-events: none; }
.fade-in { transition: opacity 0.4s ease; }

.disclaimer {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: -24px;
    margin-bottom: 40px;
}

/* ── Typewriter cursor ─────────────────── */

.typewriter-cursor::after {
    content: '|';
    animation: blink 0.8s step-end infinite;
    color: var(--accent);
    margin-left: 2px;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* ── Spacers ───────────────────────────── */

.spacer-top { height: 100px; flex-shrink: 0; }
.spacer-s { height: 12px; flex-shrink: 0; }
.spacer-m { height: 24px; flex-shrink: 0; }
.spacer-l { height: 36px; flex-shrink: 0; }
.flex-spacer { flex: 1; }

/* ── Brain emoji ───────────────────────── */

.brain-emoji {
    transition: font-size 1s ease, opacity 1s ease;
    line-height: 1;
}

/* ── Medicine animation ────────────────── */

.medicine-area {
    position: relative;
    width: 100%;
    height: 260px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.medicine-center {
    width: 120px; height: 120px;
    border-radius: 28px;
    background: rgba(45, 212, 191, 0.1);
    border: 2.5px solid rgba(45, 212, 191, 0.28);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 52px;
    opacity: 0;
    transform: scale(0.5);
    transition: opacity 0.5s, transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 2;
}

.medicine-center.visible {
    opacity: 1; transform: scale(1);
}

.medicine-center.pulse {
    animation: pulse 0.3s ease;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.08); }
    100% { transform: scale(1); }
}

.flying-icon {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 3;
}

.flying-icon.visible { opacity: 1; transform: scale(1); }

.flying-icon.absorbed {
    opacity: 0;
    transform: scale(0.1) !important;
    left: 50% !important;
    top: 50% !important;
    margin-left: -40px !important;
    margin-top: -40px !important;
}

.flying-icon .icon-circle {
    width: 80px; height: 80px;
    border-radius: 50%;
    background: rgba(45, 212, 191, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
}

.flying-icon .icon-label {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-sec);
}

.wave-icon {
    position: absolute;
    width: 32px; height: 32px;
    border-radius: 50%;
    background: rgba(45, 212, 191, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    opacity: 0;
    transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 1;
}

.wave-icon.visible { opacity: 1; }
.wave-icon.absorbed { opacity: 0; transform: scale(0.05); }

/* ── Inputs ────────────────────────────── */

.text-input {
    width: 100%; max-width: 360px;
    padding: 18px 20px;
    font-size: 20px;
    font-family: var(--font);
    font-weight: 600;
    color: var(--text);
    background: var(--bg-card);
    border: 2px solid var(--divider);
    border-radius: 14px;
    outline: none;
    text-align: center;
    transition: border-color 0.2s;
}

.text-input:focus { border-color: var(--accent); }
.text-input::placeholder { color: var(--text-muted); font-weight: 500; }
.text-input.shake { animation: shake 0.4s ease; border-color: var(--red); }

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    75% { transform: translateX(8px); }
}

.text-input[type="number"]::-webkit-inner-spin-button,
.text-input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; }
.text-input[type="number"] { -moz-appearance: textfield; }

/* ── Option cards ──────────────────────── */

.options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%; max-width: 400px;
}

.option-card {
    width: 100%;
    padding: 18px 22px;
    font-size: 19px;
    font-family: var(--font);
    font-weight: 600;
    color: var(--text);
    background: var(--bg-card);
    border: 2px solid var(--divider);
    border-radius: 14px;
    cursor: pointer;
    text-align: left;
    transition: border-color 0.2s, background 0.2s, transform 0.1s;
}

.option-card:active { transform: scale(0.98); }
.option-card.selected { border-color: var(--accent); background: rgba(5,151,255,0.08); color: var(--accent); }

/* ── Calculating ring ──────────────────── */

.calc-wrap {
    position: relative;
    width: 150px; height: 150px;
}

.calc-wrap svg { width: 100%; height: 100%; }
.calc-wrap circle:last-child { transition: stroke-dashoffset 0.1s ease; }

.calc-pct {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    font-size: 34px; font-weight: 700;
}

.calc-status {
    font-size: 16px;
    color: var(--text-sec);
    font-weight: 500;
}

/* ── Fact rows ─────────────────────────── */

.fact-list {
    display: flex; flex-direction: column;
    gap: 12px; width: 100%; max-width: 400px;
    text-align: left;
}

.fact {
    display: flex; align-items: center; gap: 14px;
    padding: 16px 18px;
    background: var(--bg-card);
    border-radius: 14px;
    font-size: 17px; font-weight: 500;
    color: var(--text-sec);
    border: 1px solid var(--divider);
}

.fact-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--accent);
    flex-shrink: 0;
}

/* ── Graph ─────────────────────────────── */

.graph-card {
    background: var(--bg-card);
    border: 1px solid var(--divider);
    border-radius: 16px;
    padding: 22px;
    width: 100%; max-width: 400px;
}

.graph-legend {
    display: flex; gap: 24px; justify-content: center;
    margin-bottom: 16px;
    font-size: 13px; font-weight: 600; color: var(--text-sec);
}

.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.dot.green { background: var(--green); }
.dot.red { background: var(--red); opacity: 0.6; }

.graph-rows { display: flex; flex-direction: column; gap: 12px; }
.graph-row { display: flex; align-items: center; gap: 12px; }
.graph-row > span { font-size: 12px; font-weight: 600; color: var(--text-muted); min-width: 50px; }
.bars { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.bar { height: 14px; border-radius: 7px; }
.bar-green { background: var(--green); }
.bar-red { background: var(--red); opacity: 0.4; }

.line-chart { width: 100%; height: auto; margin-top: 8px; }

/* ── Results reveal ────────────────────── */

.reveal-diff {
    font-size: 18px; font-weight: 600;
    opacity: 0; transition: opacity 0.5s;
}
.reveal-diff.visible { opacity: 1; }

/* ── Demo cards ────────────────────────── */

.demo-cards {
    display: flex; flex-direction: column;
    gap: 12px; width: 100%; max-width: 400px;
}

.demo-card {
    display: flex; align-items: center; gap: 16px;
    padding: 18px 20px;
    background: var(--bg-card);
    border: 1px solid var(--divider);
    border-radius: 16px;
    text-align: left;
}

.demo-emoji {
    font-size: 28px;
    width: 52px; height: 52px;
    border-radius: 14px;
    background: rgba(5,151,255,0.08);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}

.demo-card h3 { font-size: 17px; font-weight: 700; margin-bottom: 4px; }
.demo-card p { font-size: 14px; color: var(--text-sec); margin: 0; line-height: 1.4; }

/* ── Reviews ───────────────────────────── */

.rating-badge {
    display: flex; align-items: center; gap: 8px;
}

.stars { color: #FFB800; font-size: 20px; letter-spacing: 2px; }
.rating-num { font-size: 18px; font-weight: 700; color: var(--text-sec); }

.review-cards {
    display: flex; flex-direction: column;
    gap: 12px; width: 100%; max-width: 400px;
}

.review-card {
    background: var(--bg-card);
    border: 1px solid var(--divider);
    border-radius: 16px;
    padding: 18px; text-align: left;
}

.review-top { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }

.avatar {
    width: 36px; height: 36px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 15px; font-weight: 700; color: #fff;
}

.review-top strong { flex: 1; font-size: 15px; }
.mini-stars { color: #FFB800; font-size: 12px; }
.review-card p { font-size: 15px; color: var(--text-sec); line-height: 1.5; margin: 0; }

/* ── Plan rows ─────────────────────────── */

.plan-rows {
    display: flex; flex-direction: column;
    gap: 12px; width: 100%; max-width: 400px;
}

.plan-row {
    display: flex; align-items: center; gap: 14px;
    padding: 16px 18px;
    background: var(--bg-card);
    border: 1px solid var(--divider);
    border-radius: 16px;
    text-align: left;
    opacity: 0; transform: translateY(16px);
    transition: opacity 0.5s, transform 0.5s;
}

.plan-row.show { opacity: 1; transform: translateY(0); }

.plan-emoji {
    font-size: 24px;
    width: 44px; height: 44px;
    border-radius: 12px;
    background: rgba(5,151,255,0.08);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}

.plan-text { flex: 1; }
.plan-text strong { display: block; font-size: 16px; margin-bottom: 2px; }
.plan-text span { font-size: 13px; color: var(--text-sec); }
.plan-check { color: var(--green); font-size: 20px; font-weight: 700; flex-shrink: 0; }

.plan-tagline {
    font-size: 20px; font-weight: 700;
    color: var(--accent);
    opacity: 0; transform: translateY(12px);
    transition: opacity 0.5s, transform 0.5s;
}
.plan-tagline.show { opacity: 1; transform: translateY(0); }

/* ── Card flip ─────────────────────────── */

.card-grid {
    display: grid;
    grid-template-columns: repeat(3, 72px);
    gap: 12px; justify-content: center;
    perspective: 800px;
}

.flip-card { width: 72px; height: 84px; perspective: 600px; }
.flip-inner {
    position: relative; width: 100%; height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.5s ease;
}
.flip-card.flipped .flip-inner { transform: rotateY(180deg); }

.flip-front, .flip-back {
    position: absolute; inset: 0;
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.flip-front {
    background: var(--bg-card);
    border: 2px solid var(--divider);
    font-size: 22px; font-weight: 700; color: var(--text-muted);
}

.flip-back {
    transform: rotateY(180deg);
    font-size: 28px;
}
.flip-back.blue { background: rgba(5,151,255,0.12); border: 2px solid rgba(5,151,255,0.25); }
.flip-back.purple { background: rgba(148,97,242,0.12); border: 2px solid rgba(148,97,242,0.25); }
.flip-back.green { background: rgba(51,184,102,0.12); border: 2px solid rgba(51,184,102,0.25); }

/* ── Gauge ─────────────────────────────── */

.gauge-visual {
    display: flex; flex-direction: column; align-items: center;
    position: relative;
}

.gauge-glow {
    position: absolute; width: 140px; height: 140px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(45,212,191,0.15) 0%, transparent 70%);
    top: -10px;
}

.gauge-brain-emoji { font-size: 64px; position: relative; z-index: 1; }
.gauge-number { font-size: 56px; font-weight: 800; letter-spacing: -0.03em; position: relative; z-index: 1; }
.gauge-arrow { font-size: 24px; color: var(--green); font-weight: 700; opacity: 0; transition: opacity 0.3s; }
.gauge-arrow.show { opacity: 1; }

/* ── Streak ────────────────────────────── */

.streak-visual {
    display: flex; flex-direction: column; align-items: center;
    position: relative;
}

.streak-glow {
    position: absolute; width: 120px; height: 120px; border-radius: 50%;
    background: radial-gradient(circle, rgba(255,159,67,0.2) 0%, transparent 70%);
    top: -5px;
}

.streak-flame {
    font-size: 64px;
    transform: scale(0.3);
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative; z-index: 1;
}
.streak-flame.pop { transform: scale(1); }

.streak-calendar { display: flex; gap: 10px; margin-top: 16px; }
.cal-day { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.cal-day span { font-size: 12px; font-weight: 700; color: var(--text-muted); }
.cal-circle {
    width: 30px; height: 30px; border-radius: 50%;
    border: 2px solid var(--divider);
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700; color: transparent;
    transition: all 0.3s;
}
.cal-circle.checked { border-color: var(--accent); background: rgba(5,151,255,0.12); color: var(--accent); }

/* ── Compare card ──────────────────────── */

.compare-card {
    display: flex; align-items: center; gap: 20px;
    justify-content: center;
    padding: 28px 24px;
    background: var(--bg-card);
    border: 1px solid var(--divider);
    border-radius: 20px;
    width: 100%; max-width: 360px;
}

.compare-side { text-align: center; flex: 1; }
.compare-label { font-size: 13px; font-weight: 600; color: var(--text-muted); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 1px; }
.compare-label.green { color: var(--green); }
.compare-num { font-size: 36px; font-weight: 800; letter-spacing: -0.02em; }
.compare-num.red { color: var(--red); }
.compare-num.green { color: var(--green); }
.compare-arrow { font-size: 24px; color: var(--accent); flex-shrink: 0; }
.compare-unit { font-size: 13px; font-weight: 600; color: var(--text-muted); margin-top: 4px; }

/* Staggered fact animation */
.fact.stagger { opacity: 0; transform: translateY(12px); transition: opacity 0.4s, transform 0.4s; }
.fact.stagger.show { opacity: 1; transform: translateY(0); }

/* ── App Mock ───────────────────────────── */

.app-mock {
    width: 100%; max-width: 340px;
    background: var(--bg-card);
    border: 1px solid var(--divider);
    border-radius: 20px;
    padding: 16px;
    overflow: hidden;
}

.mock-header {
    margin-bottom: 14px;
}

.mock-bar {
    height: 6px;
    width: 30%;
    background: var(--accent);
    border-radius: 3px;
    margin-bottom: 12px;
}

.mock-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
}

.mock-photo {
    width: 100%;
    height: 120px;
    background: rgba(5,151,255,0.06);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    gap: 12px;
    margin-bottom: 12px;
}

.mock-options {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.mock-opt {
    padding: 12px 14px;
    border-radius: 10px;
    background: rgba(255,255,255,0.03);
    border: 1.5px solid var(--divider);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-sec);
}

.mock-opt.correct {
    border-color: var(--green);
    background: rgba(51,184,102,0.08);
    color: var(--green);
}

/* ── Mini Proof (inline testimonial) ───── */

.mini-proof {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 16px;
    background: var(--bg-card);
    border: 1px solid var(--divider);
    border-radius: 14px;
    width: 100%;
    max-width: 400px;
}

.mini-proof p {
    font-size: 14px;
    color: var(--text-sec);
    line-height: 1.5;
    margin: 0;
    font-style: italic;
}

/* ── Review stagger ────────────────────── */

.review-card.stagger {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.5s, transform 0.5s;
}

.review-card.stagger.show {
    opacity: 1;
    transform: translateY(0);
}

/* ── Mobile ────────────────────────────── */

@media (max-width: 480px) {
    .display-text { font-size: 36px; }
    .headline { font-size: 26px; }
    .headline-sm { font-size: 22px; }
    .counter { font-size: 72px; }
    .counter.xl { font-size: 80px; }
    .card-grid { grid-template-columns: repeat(3, 64px); gap: 10px; }
    .flip-card { width: 64px; height: 76px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
