/* Токены — SPEC ч. 2 §4; других цветов в коде нет. Вёрстка от 390 px.
   Шрифты PT Serif и Golos Text подключаются вместе с главной (часть 2), пока — запасные семейства. */
:root {
  --paper: #F5F4EF;
  --surface: #FFFFFF;
  --ink: #171A1F;
  --ink-2: #5B6470;
  --ink-deep: #1B2430;
  --line: #DDDAD1;
  --accent: #0F6E66;
  --accent-hover: #0B5951;
  --accent-tint: #E4F0EE;
  --serif: "PT Serif", Georgia, "Times New Roman", serif;
  --sans: "Golos Text", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.55 var(--sans);
  font-variant-numeric: tabular-nums;
}
a { color: var(--accent); }
a:hover { color: var(--accent-hover); }

.top, .page, .foot { max-width: 680px; margin: 0 auto; padding: 0 16px; }
.top { padding-top: 16px; padding-bottom: 8px; }
.wordmark { font-weight: 600; text-decoration: none; color: var(--ink); }
.page { padding-bottom: 40px; }
.foot { padding-top: 24px; padding-bottom: 32px; border-top: 1px solid var(--line); font-size: 14px; }
.foot a { color: var(--ink-2); }

h1, h2 { font-family: var(--serif); font-weight: 700; }
h1 { font-size: clamp(30px, 4.6vw, 44px); line-height: 1.08; margin: 16px 0 12px; }
h2 { font-size: 22px; line-height: 1.2; margin: 32px 0 12px; }
h3 { font-size: 17px; line-height: 1.3; font-weight: 600; margin: 20px 0 6px; }
.note, .caption, .quotes { color: var(--ink-2); font-size: 14px; }
.hours { font-size: 18px; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px 16px;
  margin: 16px 0;
}
.card > h2:first-child { margin-top: 0; }
.question { border: 2px solid var(--accent); }

fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.group { margin: 0 0 16px; }
.group legend { font-weight: 600; margin-bottom: 8px; padding: 0; }
.q { font-family: var(--serif); font-size: 21px; line-height: 1.3; margin: 0 0 12px; }
legend.q { font-weight: 700; }

/* Кнопка быстрого ответа: input скрыт, но доступен с клавиатуры; выбор виден на span. */
.chip { display: block; position: relative; margin: 0 0 8px; }
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip span {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 150ms, background 150ms;
}
.chip span:hover { border-color: var(--accent); }
.chip input:checked + span { background: var(--accent-tint); border-color: var(--accent); font-weight: 600; }
.chip input:focus-visible + span, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent);
  box-shadow: 0 0 0 5px var(--accent-tint);
}

.free, .field { display: block; margin: 16px 0 0; }
.free span, .field span { display: block; color: var(--ink-2); font-size: 14px; margin-bottom: 4px; }
textarea, input[name="contact"], input[name="rate"] {
  width: 100%;
  font: inherit;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
}
input[name="rate"] { width: 8em; }
.mic:empty { display: none; } /* место под кнопку микрофона (v1.1) */

/* В разметке «Дальше» первой (Enter нажимает её), на экране «Назад» слева. */
.actions { display: flex; flex-direction: row-reverse; gap: 12px; margin-top: 20px; }
button {
  font: 600 17px/1 var(--sans);
  min-height: 48px;
  padding: 0 20px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 150ms;
}
button:active { transform: translateY(1px); }
button:disabled { opacity: 0.6; cursor: wait; }
.primary { background: var(--accent); color: #FFFFFF; border: 0; flex: 1; }
.primary:hover { background: var(--accent-hover); }
.secondary { background: transparent; color: var(--ink); border: 1px solid var(--ink); }

.error { border-left: 3px solid var(--accent); padding-left: 10px; font-weight: 600; margin: 16px 0 0; }

/* Ожидание ответа (HTMX): сразу «Минуту…», через 5 с — «Считаем…» (PLAN-2-web, Р3). */
.wait { display: none; color: var(--ink-2); margin: 12px 0 0; }
.htmx-request .wait { display: block; }
.wait .long { visibility: hidden; }
.htmx-request .wait .long { animation: reveal 0s linear 5s forwards; }
@keyframes reveal { to { visibility: visible; } }

.progress { margin: 8px 0 0; }
.step { color: var(--ink-2); font-size: 14px; margin: 0 0 6px; }
progress { width: 100%; height: 6px; accent-color: var(--accent); }
.map h2 { font-family: var(--sans); font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-2); margin: 16px 0 6px; }
.map ul { margin: 0; padding-left: 18px; }
.map .status { color: var(--ink-2); font-size: 14px; }

.formula { background: var(--accent-tint); border-radius: 8px; padding: 10px 12px; font-weight: 500; }
.rate { margin: 16px 0; }
.rate label { margin-right: 12px; }
.contact form { margin-top: 12px; }
.consent { display: flex; gap: 10px; align-items: flex-start; margin: 16px 0 0; font-size: 14px; }
.consent input { margin-top: 3px; width: 20px; height: 20px; flex: none; accent-color: var(--accent); }
.contact .primary { margin-top: 16px; width: 100%; }

.scroll { overflow-x: auto; }
.admin { border-collapse: collapse; font-size: 14px; white-space: nowrap; }
.admin th, .admin td { border-bottom: 1px solid var(--line); padding: 6px 10px 6px 0; text-align: left; }
.transcript { white-space: pre-wrap; word-break: break-word; font-size: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }

@media (min-width: 1024px) {
  body { font-size: 18px; }
  .top, .page, .foot { padding-left: 24px; padding-right: 24px; }
  .card { padding: 24px; }
  button { min-height: 52px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
