/* Квиз gymexe.app/start (web-to-app, ADR-0048). Токены Midnight/Paper и шрифты — из /style.css. */

.funnel-page { min-height: 100vh; min-height: 100dvh; }
.funnel { max-width: 520px; margin: 0 auto; padding: 0 16px calc(12px + env(safe-area-inset-bottom)); min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.f-boot { margin: 42vh 0 0; text-align: center; font: 14px var(--mono); color: var(--accent); }
.f-boot::after { content: ''; display: inline-block; width: 8px; height: 15px; margin-left: 4px; vertical-align: -2px; background: var(--accent); animation: blink 1s steps(1) infinite; }

/* Шапка и прогресс */
.f-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0 10px; }
.f-brand { display: flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; font: 800 16px/1 var(--mono); }
.f-brand img { width: 28px; height: 28px; border-radius: 7px; }
.f-count { font: 12px var(--mono); color: var(--faint); }
.f-bar { height: 3px; border-radius: 2px; background: var(--line); overflow: hidden; }
.f-bar i { display: block; height: 100%; width: 4%; border-radius: 2px; background: var(--accent); transition: width .35s ease-out; }
.f-main { flex: 1; padding: 14px 0 8px; }
.f-foot { display: flex; justify-content: center; gap: 18px; margin: 0; padding: 20px 0 6px; border: 0; font: 12px var(--mono); }
.f-foot a { color: var(--faint); }
.f-lang { padding: 0; border: 0; background: none; color: var(--faint); font: 12px var(--mono); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.f-lang:hover { color: var(--text); }

/* Переходы между шагами: сдвиг и проявление, без перелёта (docs/design/principles.md) */
.f-screen.enter { animation: f-enter .28s ease-out both; }
.f-screen.enter-back { animation: f-enter-back .28s ease-out both; }
@keyframes f-enter { from { opacity: 0; transform: translateX(18px); } }
@keyframes f-enter-back { from { opacity: 0; transform: translateX(-18px); } }
.f-screen :is(h1, h2):focus { outline: none; }

/* Первый экран */
.f-hero { margin: 8px 0 22px; }
.f-hero-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 10px; }
.f-hero-row .prompt { margin: 0 0 6px; }
.funnel h1 { font: 800 clamp(27px, 7.4vw, 38px)/1.12 var(--mono); letter-spacing: -.6px; margin: 0 0 12px; }
.f-lead { margin: 0; color: var(--muted); font-size: 16px; }

/* Вопрос */
.f-back { display: inline-flex; align-items: center; min-height: 40px; padding: 0 2px; border: 0; background: none; color: var(--muted); font: 13px var(--mono); cursor: pointer; }
.f-back:hover { color: var(--text); }
.f-buddy { display: flex; align-items: flex-end; gap: 12px; min-height: 64px; margin: 2px 0 8px; }
.f-bubble { margin: 0 0 6px; padding: 8px 13px; border-radius: 14px 14px 14px 4px; background: var(--surface2); font: 14px var(--mono); animation: f-pop .3s ease-out both; }
@keyframes f-pop { from { opacity: 0; transform: scale(.92); transform-origin: 0 100%; } }
.f-log p { margin: 0; font: 13px/1.75 var(--mono); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.f-log .ok { color: var(--accent); }
.f-question { font: 700 21px/1.35 var(--mono); margin: 14px 0 16px; letter-spacing: -.2px; }
.f-mark { color: var(--accent); }
.f-hint { margin: -8px 0 14px; font: 13px var(--mono); color: var(--faint); }

.f-options { display: grid; gap: 10px; }
.f-option { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 58px; padding: 11px 16px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--text); font: 17px/1.3 var(--sans); text-align: left; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: border-color .15s, background-color .15s, transform .1s; }
.f-option:hover { border-color: var(--faint); }
.f-option:active { transform: scale(.985); }
.f-option.is-selected { border-color: var(--accent); background: var(--soft); }
.f-option:focus-visible, .f-btn:focus-visible, .f-plan:focus-visible, .f-link:focus-visible, .f-back:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.f-key { min-width: 18px; font: 13px var(--mono); color: var(--faint); }
.f-option.is-selected .f-key { color: var(--accent); }
.f-label { display: flex; flex: 1; flex-direction: column; gap: 2px; }
.f-label small { font-size: 14px; color: var(--muted); }
.f-label code { font: 600 14.5px var(--mono); color: var(--accent); }
.f-box { width: 20px; height: 20px; flex: none; border: 2px solid var(--line); border-radius: 6px; }
.f-option.is-selected .f-box { border-color: var(--accent); background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='%2303140A' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat; }

/* Кнопки */
.f-btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 56px; padding: 0 20px; border: 0; border-radius: 16px; background: var(--accent); color: var(--ink); font: 800 16px var(--mono); text-align: center; text-decoration: none; cursor: pointer; box-shadow: 0 12px 32px -14px var(--accent); transition: transform .1s; -webkit-tap-highlight-color: transparent; }
.f-btn:active { transform: scale(.985); }
.f-btn.ghost { background: var(--surface); color: var(--text); border: 1.5px solid var(--accent); box-shadow: none; }
.f-link { display: block; width: 100%; min-height: 44px; margin-top: 6px; padding: 12px; border: 0; background: none; color: var(--muted); font: 14px var(--mono); text-align: center; cursor: pointer; }
.f-link:hover { color: var(--text); }
.f-sticky { position: sticky; bottom: 0; z-index: 2; margin-top: 18px; padding: 16px 0 calc(8px + env(safe-area-inset-bottom)); background: linear-gradient(to bottom, transparent, var(--bg) 28%); }

/* «Терминал» */
.f-term, .f-term-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; font: 13px/1.8 var(--mono); overflow: hidden; }
.f-term p, .f-term-card p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.f-term .line { animation: f-line .3s ease-out both; animation-delay: calc(var(--i, 0) * 380ms + 150ms); }
@keyframes f-line { from { opacity: 0; transform: translateY(4px); } }
.cmd, .muted { color: var(--muted); }
.add { color: var(--accent); }
.del { color: var(--pink); }
.hash { color: var(--yellow); }
.note { color: var(--faint); }
.nowrap { display: inline-block; }
.f-term .f-commit { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; white-space: nowrap; }
.f-commit .cut { overflow: hidden; text-overflow: ellipsis; }
.warn { color: var(--warn); }

/* Вставки */
.f-info .kicker { margin: 10px 0 10px; font: 13px var(--mono); color: var(--accent); }
.f-info h2 { margin: 10px 0 12px; font: 800 25px/1.22 var(--mono); letter-spacing: -.4px; }
.f-info .body { margin: 0 0 18px; color: var(--muted); }

/* Сборка */
.f-build { display: flex; flex-direction: column; gap: 14px; padding-top: 6px; }
.f-cmd { margin: 0; font: 13px var(--mono); color: var(--muted); }
.f-pct { margin: 4px 0 0; font: 800 22px var(--mono); }
.f-progress { height: 10px; border-radius: 5px; background: var(--surface2); overflow: hidden; }
.f-progress i { display: block; height: 100%; width: 0; border-radius: 5px; background: var(--accent); transition: width .07s linear; }
.f-blocks { margin: 0; font: 13px var(--mono); letter-spacing: 1px; color: var(--faint); }
.f-buildlog { min-height: 250px; font-size: 12px; }
.f-buildlog p { white-space: pre; overflow: hidden; text-overflow: ellipsis; }
.f-buildlog .line { animation-delay: 0s; }

/* Результат */
.f-ok { margin: 4px 0 8px; font: 700 14px var(--mono); color: var(--accent); }
.f-card { margin-top: 14px; padding: 16px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.f-card.f-term-card { padding: 14px 16px; }
.f-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.f-name { margin: 0; font: 800 17px/1.3 var(--mono); }
.f-badge { flex: none; padding: 3px 9px; border-radius: 999px; background: var(--soft); color: var(--accent); font: 700 11px var(--mono); }
.f-id { margin: 2px 0 8px; font: 12px var(--mono); color: var(--faint); }
.f-meta { margin: 2px 0; font-size: 15px; color: var(--muted); }
.f-day { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.f-day h4 { margin: 0 0 6px; font: 700 11px var(--mono); letter-spacing: 1.5px; text-transform: uppercase; color: var(--accent); }
.f-row { display: flex; justify-content: space-between; gap: 12px; margin: 0; padding: 3px 0; font-size: 15px; }
.f-row span:last-child { flex: none; font: 13px/1.9 var(--mono); color: var(--muted); }
.f-comment { margin: 14px 0 0; font: 12.5px/1.6 var(--mono); color: var(--faint); }
.f-hours { margin: 16px 0 0; font: 700 16px/1.45 var(--mono); }
.f-seg { display: inline-flex; flex: none; padding: 2px; border-radius: 10px; background: var(--surface2); }
.f-seg button { min-width: 40px; min-height: 30px; padding: 0 10px; border: 0; border-radius: 8px; background: none; color: var(--muted); font: 700 12px var(--mono); cursor: pointer; }
.f-seg button.is-on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .25); }

/* Пейволл */
.f-paywall h1 { margin-top: 6px; }
.f-plans { display: grid; gap: 10px; margin: 16px 0 0; }
.f-plan { display: grid; grid-template-columns: 22px 1fr; column-gap: 12px; row-gap: 2px; align-items: center; width: 100%; padding: 14px 16px; border: 1.5px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--text); text-align: left; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.f-plan.is-selected { border-color: var(--accent); background: var(--soft); }
.f-radio { grid-row: span 3; width: 20px; height: 20px; border: 2px solid var(--line); border-radius: 50%; }
.f-plan.is-selected .f-radio { border: 6px solid var(--accent); }
.f-plan-name { font: 700 14px var(--mono); color: var(--muted); }
.f-plan-price { font: 800 20px/1.25 var(--mono); }
.f-plan-sub { font-size: 14px; color: var(--muted); }
.f-pipe { margin: 10px 0 0; padding: 0; list-style: none; }
.f-pipe li { position: relative; padding: 0 0 14px 24px; font: 13px/1.5 var(--mono); color: var(--muted); }
.f-pipe li::before { content: ''; position: absolute; left: 0; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); }
.f-pipe li::after { content: ''; position: absolute; left: 5px; top: 18px; bottom: 2px; width: 2px; background: var(--line); }
.f-pipe li:last-child { padding-bottom: 0; }
.f-pipe li:last-child::before { background: var(--yellow); }
.f-pipe li:last-child::after { display: none; }
.f-pipe b { color: var(--text); }
.f-pay { margin-top: 18px; }
.f-terms { margin: 10px 0 0; font-size: 13px; color: var(--muted); text-align: center; }
.f-alert { margin: 12px 0 0; padding: 12px 14px; border-left: 3px solid var(--warn); border-radius: 10px; background: var(--surface); font-size: 14px; }

/* Передача плана */
.f-mini { margin-top: 16px; }
.f-steps { display: grid; gap: 18px; margin: 20px 0 0; padding: 0; list-style: none; }
.f-steps li { display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: start; }
.f-num { display: grid; place-items: center; width: 34px; height: 34px; margin-top: 11px; border-radius: 10px; background: var(--soft); color: var(--accent); font: 800 15px var(--mono); }
.f-note { margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.f-desktop { margin-top: 18px; }
.f-qr { width: 240px; margin: 0 auto; padding: 14px; border-radius: 16px; background: #fff; text-align: center; }
.f-qr:empty { display: none; }
.f-qr svg { display: block; width: 100%; height: auto; }
.f-qr figcaption { margin-top: 8px; font: 12px/1.4 var(--mono); color: #3B4452; }

/* Уточка Ping */
.duck { position: relative; flex: none; width: calc(16 * var(--px)); height: calc(16 * var(--px)); }
.duck svg { display: block; }
.duck-bob .duck-body { animation: f-bob 2.4s ease-in-out infinite; }
@keyframes f-bob { 50% { transform: translateY(calc(var(--px) * -1.5)); } }
.duck-bell { position: absolute; left: calc(var(--px) * 9); top: calc(var(--px) * 9); transform-origin: 30% 60%; animation: f-curl 1.2s ease-in-out infinite; }
@keyframes f-curl { 50% { transform: translateY(calc(var(--px) * -4)) rotate(-10deg); } }

@media (prefers-reduced-motion: reduce) {
  .f-screen.enter, .f-screen.enter-back, .f-bubble, .f-term .line, .duck-bob .duck-body, .duck-bell, .f-boot::after { animation: none; }
  .f-bar i, .f-progress i { transition: none; }
}

@media (min-width: 600px) {
  .f-main { padding-top: 24px; }
  .f-question { font-size: 23px; }
}
