/* Форма отзыва — единственный CSS (Приложение 1 §1.1). Без @import, шрифтов и внешних url().
   Цвета анкеты клиента (REQ-SUR-04): App\Form\FormTheme отдаёт этот файл с дописанным в конец :root анкеты
   (/form/theme/<цвета>-<версия файла>.css — один файл на набор цветов, кэш навсегда). Страницы состояний и сайт —
   этот файл как есть (цвета по умолчанию). */
:root {
  --bg: #fdf3f1;        /* фон страницы */
  --card: #fff;
  --brand: #0b1a44;     /* шапка и кнопка */
  --on-brand: #fff;     /* текст на шапке и кнопке — чёрный или белый, что контрастнее */
  --text: #1f1f1f;
  --muted: #5f5f5f;
  --err: #b3261e;
  --err-bg: #fdecea;
  --star: #c2185b;      /* 5,4:1 к фону; розовый Revisior #ee8ac6 — 2,1:1, не проходит 1.4.11 */
  --line: #d9d9d9;
  --focus: #0b1a44;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overflow-wrap: break-word;
}
a { color: var(--brand); text-decoration: underline; text-underline-offset: 2px; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
p { margin: 0; }
h1, h2 { margin: 0; }

.sr-only, .default-submit {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap; border: 0;
}
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
/* ловушка для ботов: вне экрана (не display:none), aria-hidden в разметке */
.hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* ---------- шапка ---------- */
.hdr { background: var(--brand); color: var(--on-brand); }
.hdr__in {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px;
  max-width: 1200px; margin: 0 auto; padding: 8px 16px; min-height: 56px;
}
.hdr__logo { display: block; height: 40px; width: auto; flex: none; }
.hdr__name { flex: 1 1 8em; min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.hdr :focus-visible { outline-color: var(--on-brand); }
.lang { display: flex; align-items: center; margin-left: auto; }
.lang__item {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 44px; min-height: 44px; padding: 0 8px;
  border: 0; background: none; color: var(--on-brand);
  font: inherit; text-decoration: none; cursor: pointer;
}
.lang__item--cur { font-weight: 700; text-decoration: underline; text-underline-offset: 4px; cursor: default; }
.lang__sep { width: 1px; height: 20px; background: var(--on-brand); opacity: .7; }

/* ---------- карточка ---------- */
.main { background: var(--card); padding: 20px 16px 24px; }
.h1 { font-size: 22px; line-height: 1.3; font-weight: 700; overflow-wrap: anywhere; }
.h1:focus { outline: none; }
.order { margin-top: 4px; font-weight: 600; }
.intro { margin-top: 4px; }
.hint { margin-top: 8px; font-size: 13px; color: var(--muted); }
.stepline { margin-top: 12px; font-weight: 600; }
.progress {
  display: block; width: 100%; height: 8px; margin-top: 6px;
  -webkit-appearance: none; appearance: none;
  border: 0; border-radius: 4px; background: #e6e8ee; color: var(--brand);
}
.progress::-webkit-progress-bar { background: #e6e8ee; border-radius: 4px; }
.progress::-webkit-progress-value { background: var(--brand); border-radius: 4px; }
.progress::-moz-progress-bar { background: var(--brand); border-radius: 4px; }
.lead { margin-top: 8px; }

/* ---------- вопросы ---------- */
fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
legend { padding: 0; }
.q { margin-top: 24px; }
.qhint { margin-top: 24px; color: var(--muted); }
.qhint + .q { margin-top: 8px; }
.q--star + .q--star { margin-top: 16px; }
.q__label { display: block; margin-bottom: 8px; font-size: 17px; font-weight: 600; line-height: 1.35; }
.req { color: var(--err); }
.qhint--small { margin-top: 6px; font-size: 13px; }
.q--err { border-left: 4px solid var(--err); padding-left: 12px; }

.err { display: flex; gap: 6px; align-items: flex-start; margin: 0 0 8px; color: var(--err); font-weight: 600; }
.err__ic { flex: none; width: 20px; height: 20px; margin-top: 2px; fill: currentColor; }
.i-err__mark { fill: #fff; }

/* радиокнопки поверх своих подписей: и мышь, и экранный диктор касанием попадают в настоящий input */
.opt { position: relative; flex: none; }
.opt input {
  position: absolute; inset: 0; z-index: 1;
  width: 100%; height: 100%; margin: 0;
  opacity: 0; cursor: pointer;
}
.opt label {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%; border-radius: 8px;
}
.opt input:focus-visible + label { outline: 2px solid var(--focus); outline-offset: 2px; }

.stars { display: flex; flex-wrap: wrap; gap: 8px; }
.opt--star { width: 44px; height: 44px; }
.star { width: 36px; height: 36px; fill: none; stroke: var(--star); stroke-width: 1.6; stroke-linejoin: round; }
/* выбранная звезда — заливка; без :has() (старые браузеры) залита только выбранная */
.opt--star input:checked + label .star { fill: var(--star); }
.stars:has(.opt:nth-child(2) input:checked) .opt:nth-child(-n+2) .star,
.stars:has(.opt:nth-child(3) input:checked) .opt:nth-child(-n+3) .star,
.stars:has(.opt:nth-child(4) input:checked) .opt:nth-child(-n+4) .star,
.stars:has(.opt:nth-child(5) input:checked) .opt:nth-child(-n+5) .star { fill: var(--star); }

/* NPS: в DOM 0→10; два ряда (0–5, 6–10) — только сеткой */
.nps { display: grid; grid-template-columns: repeat(6, minmax(40px, 44px)); gap: 8px; }
.opt--nps { height: 44px; }
.opt--nps label { border: 1px solid var(--brand); font-weight: 600; color: var(--brand); background: var(--card); }
.opt--nps input:checked + label { background: var(--brand); color: var(--on-brand); }
.nps__edge { font-size: 13px; color: var(--muted); }
.nps__edge--lo { margin-bottom: 6px; }
.nps__edge--hi { margin-top: 6px; text-align: right; }

/* да/нет: две кнопки-радиокнопки в ряд; выбор: строка целиком — цель нажатия, отметка видима */
.yn { display: flex; gap: 8px; }
.opt--yn { width: 96px; height: 44px; }
.opt--yn label { border: 1px solid var(--brand); font-weight: 600; color: var(--brand); background: var(--card); }
.opt--yn input:checked + label { background: var(--brand); color: var(--on-brand); }
.choices { display: grid; gap: 4px; }
.choice { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 4px 0; cursor: pointer; }
.choice input { flex: none; width: 22px; height: 22px; margin: 0; accent-color: var(--brand); cursor: pointer; }

.input {
  display: block; width: 100%; min-height: 44px; padding: 10px 12px;
  font: inherit; color: var(--text); background: var(--card);
  border: 1px solid var(--muted); border-radius: 6px;
}
.input--area { min-height: 112px; resize: vertical; }
.q--err .input { border-color: var(--err); }
.counter { margin-top: 4px; font-size: 13px; color: var(--muted); text-align: right; }

/* ---------- ошибки вверху ---------- */
.err-summary {
  margin-bottom: 20px; padding: 12px 16px;
  border-left: 4px solid var(--err); background: var(--err-bg);
}
.err-summary:focus { outline: 2px solid var(--focus); outline-offset: 2px; }
.err-summary__title { font-weight: 700; color: var(--err); }
.err-summary ul { margin: 8px 0 0; padding-left: 20px; }
.err-summary li + li { margin-top: 4px; }
.err-summary a { color: var(--text); }

/* ---------- кнопки (не липкие — WCAG 2.4.11) ---------- */
.actions { display: grid; gap: 12px; margin-top: 28px; }
.btn {
  display: flex; align-items: center; justify-content: center;
  width: 100%; min-height: 48px; padding: 10px 16px;
  border: 2px solid var(--brand); border-radius: 8px;
  background: var(--brand); color: var(--on-brand);
  font: inherit; font-size: 17px; font-weight: 600; line-height: 1.3;
  text-align: center; text-decoration: none; cursor: pointer;
}
.btn--sec { background: var(--card); color: var(--brand); }
.btn[aria-disabled="true"] { cursor: progress; opacity: .8; }
.notice { margin-top: 16px; font-size: 13px; color: var(--muted); }
.net-err { margin-top: 12px; padding: 10px 12px; border-left: 4px solid var(--err); background: var(--err-bg); color: var(--err); font-weight: 600; }

/* ---------- «Дякуємо» ---------- */
.ok { display: block; width: 48px; height: 48px; margin-bottom: 12px; fill: none; stroke: var(--brand); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.google { margin-top: 24px; padding: 16px; border: 1px solid var(--line); border-radius: 8px; }
.google__title { font-size: 17px; font-weight: 600; }
.google p { margin-top: 4px; }
.btn--google { margin-top: 12px; }

/* ---------- подвал ---------- */
.ftr { padding: 0 16px 24px; font-size: 13px; line-height: 24px; color: var(--muted); }
.ftr__in { max-width: 560px; margin: 0 auto; padding-top: 12px; border-top: 1px solid var(--line); }
.ftr a { display: inline-block; min-height: 24px; color: var(--muted); }
/* ---------- сайт сервиса ---------- */
.hdr__home { color: var(--on-brand); text-decoration: none; }
.site__h2 { margin-top: 24px; font-size: 18px; line-height: 1.35; }
.site .hint { margin-top: 4px; }

/* ---------- десктоп ---------- */
@media (min-width: 640px) {
  .main { max-width: 560px; margin: 24px auto; padding: 24px 20px; border-radius: 8px; }
  .ftr__in { border-top: 0; }
  .opt--star { width: 48px; height: 48px; }
  .star { width: 40px; height: 40px; }
  .nps-wrap { display: grid; grid-template-columns: 1fr 1fr; grid-template-areas: "row row" "lo hi"; }
  .nps { grid-area: row; grid-template-columns: repeat(11, minmax(40px, 1fr)); gap: 4px; }
  .nps__edge--lo { grid-area: lo; margin: 6px 0 0; }
  .nps__edge--hi { grid-area: hi; }
}

/* ---------- режим высокой контрастности Windows ---------- */
@media (forced-colors: active) {
  .opt--nps input:checked + label { forced-color-adjust: none; background: Highlight; color: HighlightText; }
  .opt--star input:checked + label { outline: 2px solid Highlight; }
  .lang__sep { background: CanvasText; }
}
