/* Квиз на сайте (templates/quiz.html): «Шаг за шагом» (выбран 28.11.2026, варианты — /demo/quiz).
   Один вопрос на экране, по центру колонка 34rem; на телефоне кнопка «Дальше» прижата к низу экрана.
   Без JS (класс no-js на <html>) все вопросы видны сразу, как обычная форма. Основа — site.css. */
body { background: #FFF; }

/* ---------- верхняя полоса: назад, логотип, «3 из 12», прогресс ---------- */
.qbar { position: sticky; top: 0; z-index: 10; display: grid; grid-template-columns: 2.75rem 1fr 2.75rem; align-items: center; height: 3.75rem; padding: 0 0.75rem; background: rgba(255, 255, 255, .92); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.qb-back { display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border: 0; border-radius: 50%; background: #F4F1EA; color: var(--ink); cursor: pointer; }
.qb-back:hover { background: #ECE7DC; }
.qb-logo { justify-self: center; display: inline-flex; min-height: 2.75rem; align-items: center; }
.qb-logo img { display: block; height: 1.5rem; width: auto; }
.qb-num { justify-self: end; font-size: 0.8125rem; font-weight: 800; color: #8A8A84; white-space: nowrap; font-variant-numeric: tabular-nums; }
.qb-line { height: 4px; background: #F1ECE3; }
.qb-line i { display: block; height: 100%; width: 0; border-radius: 0 4px 4px 0; background: var(--orange); transition: width .4s cubic-bezier(.3, .7, .2, 1); }
.no-js .qb-back, .no-js .qb-num, .no-js .qb-line { visibility: hidden; }

/* ---------- экраны ---------- */
.qz { max-width: 34rem; margin: 0 auto; padding: 1.75rem 1.25rem 7rem; }
.js .qs { display: none; }
.js .qs.on { display: block; animation: rise .35s cubic-bezier(.3, .7, .2, 1); }
.no-js .qs { margin-bottom: 3rem; }
.off { display: none !important; }
@keyframes rise { from { opacity: 0; transform: translateY(0.75rem); } }
.k { margin: 0 0 0.625rem; font-size: 0.75rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--peel); }
.q { margin: 0; font-size: 1.75rem; font-weight: 800; line-height: 1.12; letter-spacing: -.03em; text-wrap: balance; }
.q:focus { outline: none; }
.h { margin: 0.625rem 0 1.5rem; font-size: 1rem; line-height: 1.5; color: #6B6B66; }
.qs-err { margin: 0.75rem 0 0; padding: 0.625rem 0.875rem; border-radius: 0.75rem; background: #FDECE6; color: #A2351A; font-size: 0.875rem; font-weight: 700; }
.shake { animation: shake .35s; }
@keyframes shake { 20%, 60% { transform: translateX(-4px); } 40%, 80% { transform: translateX(4px); } }

/* варианты ответа — карточки; сама радиокнопка скрыта, но остаётся в фокусе и для экранных дикторов */
.opts { display: grid; gap: 0.625rem; }
.opt { position: relative; display: flex; align-items: center; gap: 0.875rem; min-height: 4.25rem; padding: 0.875rem 1rem; border-radius: 1.25rem; background: #FFF; box-shadow: inset 0 0 0 1.5px #E6DECF; cursor: pointer; transition: box-shadow .15s, background .15s; }
.opt:hover { box-shadow: inset 0 0 0 1.5px #C9BFAD; }
.opt input, .chip input { position: absolute; opacity: 0; pointer-events: none; }
.opt:has(input:focus-visible) { outline: 0.1875rem solid rgba(242, 140, 40, .65); outline-offset: 2px; }
.opt .ic { flex: none; display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: 0.875rem; background: #FFF3E3; color: var(--peel); }
.opt .ic .i { width: 1.375rem; height: 1.375rem; }
.opt .tx { flex: 1; display: grid; gap: 0.125rem; }
.opt .t { font-size: 1.0625rem; font-weight: 800; }
.opt small { font-size: 0.875rem; color: #77776F; }
.opt .mk { flex: none; display: grid; place-items: center; width: 1.5rem; height: 1.5rem; border-radius: 50%; box-shadow: inset 0 0 0 1.5px #D9D0BF; color: transparent; }
.opt .mk .i { width: 0.875rem; height: 0.875rem; stroke-width: 3; }
.opt:has(input:checked) { background: #F1F7F2; box-shadow: inset 0 0 0 2px var(--forest); }
.opt:has(input:checked) .mk { background: var(--forest); box-shadow: none; color: #FFF; }
/* короткие ответы (пол, взрослые, дети) — квадратными плитками; четыре варианта — 2×2 на телефоне, в ряд шире */
.opts.sq { grid-template-columns: repeat(auto-fit, minmax(4.75rem, 1fr)); }
.opts.sq:has(> :nth-child(4)) { grid-template-columns: 1fr 1fr; }
.opts.sq .opt { flex-direction: column; justify-content: center; gap: 0.5rem; min-height: 6.5rem; padding: 1.25rem 0.5rem 0.875rem; text-align: center; }
.opts.sq .tx { flex: none; }
.opts.sq .t { font-size: 1.125rem; }
.opts.sq .mk { position: absolute; top: 0.5rem; right: 0.5rem; width: 1.25rem; height: 1.25rem; }
@media (min-width: 30em) { .opts.sq:has(> :nth-child(4)) { grid-template-columns: repeat(4, 1fr); } }

/* число: крупно, с единицей */
.num { display: flex; align-items: baseline; gap: 0.75rem; padding: 0.5rem 0 0.75rem; border-bottom: 2px solid #E6DECF; }
.num:focus-within { border-color: var(--forest); }
.num input { width: 100%; min-width: 0; border: 0; background: none; font: inherit; font-size: 3.5rem; font-weight: 800; letter-spacing: -.04em; color: var(--ink); -moz-appearance: textfield; }
.num input::placeholder { color: #D9D3C7; }
.num input:focus { outline: none; }
.num input::-webkit-inner-spin-button, .num input::-webkit-outer-spin-button { display: none; }
.num .u { font-size: 1.5rem; font-weight: 700; color: #8A8A84; }

/* «что не едите» — плашками */
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip { position: relative; cursor: pointer; }
.chip span { display: inline-flex; align-items: center; gap: 0.375rem; padding: 0.75rem 1rem; border-radius: 62.4375rem; background: #FFF; box-shadow: inset 0 0 0 1.5px #E6DECF; font-size: 0.9688rem; font-weight: 700; transition: box-shadow .15s, background .15s; }
.chip span .i { display: none; width: 1rem; height: 1rem; stroke-width: 3; }
.chip:hover span { box-shadow: inset 0 0 0 1.5px #C9BFAD; }
.chip input:checked + span { background: var(--forest); box-shadow: none; color: #FFF; }
.chip input:checked + span .i { display: block; }
.chip input:focus-visible + span { outline: 0.1875rem solid rgba(242, 140, 40, .65); outline-offset: 2px; }

/* кнопка «Дальше»: на телефоне — у нижнего края; на экране с одним выбором появляется, только когда ответ уже есть
   (вернулись назад и не хотите менять) */
.go { display: inline-flex; align-items: center; justify-content: center; gap: 0.625rem; height: 3.5rem; padding: 0 1.75rem; border: 0; border-radius: 62.4375rem; background: var(--orange); color: #1A2E22; font: inherit; font-size: 1.0625rem; font-weight: 800; cursor: pointer; transition: background .2s, transform .1s; }
.go:hover { background: #FF9C3F; }
.go:active { transform: scale(.98); }
.go .i { width: 1.125rem; height: 1.125rem; stroke-width: 2.4; }
.act { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; padding: 0.875rem 1.25rem calc(0.875rem + env(safe-area-inset-bottom)); background: linear-gradient(rgba(255, 255, 255, 0), #FFF 35%); }
.act .go { display: flex; width: 100%; max-width: 31.5rem; margin: 0 auto; }
.act.auto { visibility: hidden; }
.qs:has(input:checked) .act.auto { visibility: visible; }
.no-js .act { display: none; }

/* начало, подсказка посередине, конец */
.intro img { display: block; width: 4.5rem; height: 4.5rem; margin: 0 0 1.25rem; }
.ticks { display: grid; gap: 0.625rem; margin: 0 0 1.5rem; padding: 0; list-style: none; }
.ticks li { display: flex; align-items: center; gap: 0.625rem; font-size: 1rem; font-weight: 700; }
.ticks .i { color: var(--leaf); stroke-width: 2.6; }
.warn { display: flex; gap: 0.75rem; padding: 0.875rem 1rem; border-radius: 1rem; background: #F7F3EB; font-size: 0.8125rem; line-height: 1.5; color: #55554F; }
.warn .i { flex: none; width: 1.25rem; height: 1.25rem; color: var(--leaf); }
.warn p { margin: 0; }
.warn a, .chk a { color: var(--forest); font-weight: 700; }
.fact-n { margin: 0; font-size: 6rem; font-weight: 800; line-height: 1; letter-spacing: -.05em; color: var(--orange); }
.fact-t { margin: 0.25rem 0 0; font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; }
.no-js .fact { display: none; }
.sum { display: grid; margin: 0 0 1.5rem; padding: 0.25rem 1rem; border-radius: 1.125rem; background: #F7F3EB; }
.sum div { display: flex; justify-content: space-between; gap: 1rem; padding: 0.625rem 0; border-bottom: 1px solid #EBE4D6; font-size: 0.9375rem; }
.sum div:last-child { border: 0; }
.sum dt { color: #77776F; }
.sum dd { margin: 0; font-weight: 800; text-align: right; }
.no-js .sum { display: none; }
.fld { display: grid; gap: 0.375rem; margin: 0 0 1rem; }
.fld > span { font-size: 0.875rem; font-weight: 700; }
.fld > span i { font-style: normal; font-weight: 600; color: #8A8A84; }
.fld input { width: 100%; min-width: 0; height: 3.25rem; padding: 0 1rem; border: 0; border-radius: 0.875rem; background: #FFF; box-shadow: inset 0 0 0 1.5px #E2DACB; font: inherit; font-size: 1rem; color: var(--ink); }
.fld input:focus { outline: none; box-shadow: inset 0 0 0 2px var(--forest); }
.chk { position: relative; display: flex; gap: 0.75rem; margin: 0 0 0.875rem; font-size: 0.875rem; line-height: 1.5; color: #4A4A45; cursor: pointer; }
.chk input { flex: none; appearance: none; width: 1.375rem; height: 1.375rem; margin: 0.0625rem 0 0; border-radius: 0.375rem; background: #FFF; box-shadow: inset 0 0 0 1.5px #CFC6B5; cursor: pointer; }
.chk input:checked { background: var(--forest) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 0.9rem no-repeat; box-shadow: none; }
.chk input:focus-visible { outline: 0.1875rem solid rgba(242, 140, 40, .65); outline-offset: 2px; }
.final .go { display: flex; width: 100%; margin-top: 0.5rem; }
.note { margin: 0.75rem 0 0; font-size: 0.8125rem; color: #8A8A84; }

/* «Собираем меню…» — пока сервер считает */
.qz-load { position: fixed; inset: 0; z-index: 90; display: none; place-items: center; padding: 1.5rem; background: rgba(255, 255, 255, .97); }
.qz-load.on { display: grid; animation: fade .3s; }
.ql-in { display: grid; justify-items: center; gap: 1rem; text-align: center; }
.ql-in img { animation: spin 2.4s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.ql-in b { font-size: 1.375rem; font-weight: 800; letter-spacing: -.02em; }
.ql-in ul { display: grid; gap: 0.625rem; margin: 0; padding: 0; list-style: none; text-align: left; }
.ql-in li { display: flex; align-items: center; gap: 0.625rem; color: #55554F; opacity: 0; animation: rise .4s forwards; }
.ql-in li:nth-child(2) { animation-delay: .7s; }
.ql-in li:nth-child(3) { animation-delay: 1.4s; }
.ql-in li .i { color: var(--leaf); stroke-width: 2.6; }
@media (prefers-reduced-motion: reduce) { .ql-in li { opacity: 1; } }

/* низкий экран (телефон лёжа): кнопка «Дальше» не висит внизу, а стоит сразу под вопросом — иначе закрывает четверть экрана */
@media (max-height: 31.24em) {
  .act { position: static; padding: 1.25rem 0 0; background: none; }
  .qz { padding-bottom: 2.5rem; }
}
@media (min-width: 48em) {
  .qbar { height: 4.5rem; padding: 0 1.5rem; grid-template-columns: 3rem 1fr 6rem; }
  .qb-logo img { height: 1.875rem; }
  .qz { padding-top: 3.5rem; }
  .q { font-size: 2.25rem; }
  .act { position: static; padding: 1.5rem 0 0; background: none; }
}
