/* Брифи: анкета — без JS все шаги списком, с JS (html.js) — один шаг на экране (src/scripts/quiz.js); страница-список — карточки .bf-card */
.q-wrap { max-width: 760px; }
.q-sub { margin-top: 8px; }
.q-lead { margin-top: 12px; }
.quiz { margin-top: 32px; }
.q-step { border: 0; border-top: 1px solid var(--line); padding: 28px 0; margin: 0; min-width: 0; }
.q-title { font-size: 22px; font-weight: 500; line-height: 1.3; outline: none; }
.q-hint { margin-top: 6px; font-size: 14px; color: rgba(255, 255, 255, 0.6); }
.q-opts { display: grid; gap: 8px; margin-top: 16px; }
.q-opt { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 10px 14px; box-shadow: inset 0 0 0 1px var(--line); cursor: pointer; transition: background 0.2s, box-shadow 0.2s; }
.q-opt:hover { background: var(--ink-800); }
.q-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.q-box { flex: 0 0 14px; height: 14px; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.4); }
.q-opt input:checked ~ .q-box { background: var(--sava); box-shadow: none; }
.q-opt:has(input:checked) { box-shadow: inset 0 0 0 2px var(--sava); }
.q-opt:has(input:focus-visible) { outline: 2px solid var(--sava-light); outline-offset: 2px; }
.q-text, .q-other, .q-contact input { width: 100%; margin-top: 12px; min-height: 48px; padding: 12px 14px; background: var(--ink-950); color: #fff; border: 0; box-shadow: inset 0 0 0 1px var(--line); font: inherit; }
.q-text:focus, .q-other:focus, .q-contact input:focus { outline: none; box-shadow: inset 0 0 0 2px var(--sava); }
textarea.q-text { resize: vertical; }
.q-contact label { display: block; margin-top: 16px; font-family: var(--font-mono); font-size: 14px; color: var(--sava-light); }
.q-nav, .q-submit { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 24px; }
.q-nav button, .q-submit button { min-height: 48px; }
.q-back, .q-skip { background: none; border: 0; color: rgba(255, 255, 255, 0.7); font: inherit; padding: 0 8px; cursor: pointer; }
.q-next { margin-inline-start: auto; }
.q-personal { margin-top: 12px; display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 13px; color: var(--sava-light); }
.q-personal::before { content: ''; width: 8px; height: 8px; background: var(--sava); }
.q-personal[hidden] { display: none; }
/* согласие — галочка перед «Надіслати» (≥ 48 px по высоте, как варианты ответа) */
.q-consent-check { flex-basis: 100%; display: flex; align-items: center; gap: 12px; min-height: 48px; cursor: pointer; font-size: 14px; line-height: 1.4; color: rgba(255, 255, 255, 0.75); }
.q-consent-check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.q-consent-check input:checked ~ .q-box { background: var(--sava); box-shadow: none; }
.q-consent-check:has(input:focus-visible) { outline: 2px solid var(--sava-light); outline-offset: 2px; }
.q-consent-need { flex-basis: 100%; margin-top: -8px; font-size: 12px; color: var(--sava-light); }
.q-consent-need[hidden] { display: none; }
.q-error { margin-top: 16px; padding: 14px; box-shadow: inset 0 0 0 1px var(--sava); }
.q-error a { display: inline-flex; margin-top: 8px; margin-inline-end: 16px; color: var(--sava-light); }
html:not(.js) .q-nav, html:not(.js) .q-progress { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Пошаговый режим (JS) */
.quiz.is-stepper .q-step { border-top: 0; padding-top: 8px; }
.quiz.is-stepper .q-step[hidden] { display: none; }
.q-nav [hidden], .q-submit[hidden], .q-other[hidden] { display: none; }
.q-next:disabled, .q-send:disabled { opacity: 0.45; cursor: not-allowed; }
/* Змейка-прогресс: клетка 16px на каждый шаг анкеты */
.q-progress { display: flex; gap: 4px; margin-bottom: 8px; }
.q-cell { width: 16px; height: 16px; background: transparent; box-shadow: inset 0 0 0 1px var(--line); transition: background 0.25s, transform 0.25s; }
.q-cell.is-food { box-shadow: none; background: radial-gradient(circle, var(--sava) 0 3px, transparent 3.5px); }
.q-cell.is-eaten { background: var(--sava); box-shadow: none; opacity: 0.75; }
.q-cell.is-head { background: var(--sava); box-shadow: none; transform: scale(1.15); }
.q-progress.is-done .q-cell { animation: q-blink 0.9s steps(2) 3; }
@keyframes q-blink { 50% { opacity: 0.2; } }
@media (prefers-reduced-motion: reduce) { .q-cell { transition: none; } .q-progress.is-done .q-cell { animation: none; } }
@media (max-width: 480px) { .q-title { font-size: 19px; } .q-cell { width: 14px; height: 14px; } }

/* Фоновая змейка на странице квиза спит и визуально скрыта (спец §4): прогресс-строка её заменяет.
   Игра уже логически на паузе через [data-snake-pause] — здесь только прячем канвасы и пульт,
   чтобы змейка не перекрывала варианты ответов и кнопку «Далі» на любом размере экрана.
   «Дякуємо» (BriefThanksPage.astro) и список брифов тоже подключают quiz.css, но без body.quiz-page — змейка там обычная. */
body.quiz-page #snake, body.quiz-page #snake-top, body.quiz-page .pad { display: none; }

/* Страница-список «Брифи»: 8 карточек-дверей змейки (сетка с линиями, как .svcs у кабинета) */
.bf-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-inline-start: 1px solid var(--line); border-top: 1px solid var(--line); }
.bf-card { display: flex; flex-direction: column; gap: 10px; min-height: 220px; padding: 24px; border-inline-end: 1px solid var(--line); border-bottom: 1px solid var(--line); background: rgba(11, 11, 13, 0.7); color: #fff; transition: background 0.2s, color 0.2s; }
.bf-num { font-family: var(--font-mono); font-size: 12px; color: var(--sava-light); }
.bf-title { font-family: var(--font-display); font-size: 21px; font-weight: 500; line-height: 1.25; letter-spacing: -0.01em; }
.bf-text { font-size: 15px; line-height: 1.5; color: rgba(255, 255, 255, 0.65); }
.bf-meta { margin-top: auto; padding-top: 8px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; font-family: var(--font-mono); font-size: 13px; }
.bf-time { color: rgba(255, 255, 255, 0.5); }
.bf-cta { color: var(--sava-light); }
.bf-card:hover, .bf-card:focus-visible, .bf-card.near { background: var(--sava); color: var(--ink-950); }
.bf-card:hover :is(.bf-num, .bf-text, .bf-time, .bf-cta), .bf-card:focus-visible :is(.bf-num, .bf-text, .bf-time, .bf-cta), .bf-card.near :is(.bf-num, .bf-text, .bf-time, .bf-cta) { color: var(--ink-950); }
@media (max-width: 1023px) { .bf-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 639px) {
  .bf-cards { grid-template-columns: 1fr; }
  .bf-card { min-height: 0; padding: 16px; gap: 6px; }
  .bf-title { font-size: 18px; }
  .bf-text { font-size: 14px; }
}
