/* WebSuprovid — стили без внешних библиотек.
   Идея: сайт как протокол техогляду. Бренд — «справно» (глубокий зелёный),
   сигнальные цвета светофора — только для статусов находок. */

/* Шрифт Fixel (MacPaw, SIL OFL 1.1, лицензия — /fonts/OFL.txt). Три начертания, ≈ 158 КБ. */
@font-face { font-family: "Fixel Text"; src: url("/fonts/FixelText-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Fixel Text"; src: url("/fonts/FixelText-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Fixel Display"; src: url("/fonts/FixelDisplay-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --paper: #ffffff;
  --paper-2: #f1f5f2;
  --ink: #18231f;
  --ink-2: #4c5a54;
  --rule: #d6dfda;
  --brand: #0e4d3a;
  --brand-ink: #ffffff;
  --brand-tint: #e3efe8;
  --link: #0b6648;
  --red: #b3311c;
  --red-tint: #fbe9e5;
  --amber: #9a5b00;
  --amber-dot: #e09a1a;
  --amber-tint: #fdf1dc;
  --green: #217a45;
  --green-dot: #2f9e5a;
  --green-tint: #e4f3e9;

  --font-text: "Fixel Text", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Fixel Display", var(--font-text);

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #101614;
    --paper-2: #16201c;
    --ink: #e7eeea;
    --ink-2: #a3b2ab;
    --rule: #2b3833;
    --brand: #6fcf9c;
    --brand-ink: #0b1a14;
    --brand-tint: #17302a;
    --link: #8fdcb2;
    --red: #ff9a86;
    --red-tint: #3a1d18;
    --amber: #f3c46b;
    --amber-dot: #f0b13c;
    --amber-tint: #362a12;
    --green: #8fdcb2;
    --green-dot: #4cc27f;
    --green-tint: #15301f;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 18px/1.6 var(--font-text);
  font-variant-numeric: tabular-nums;
}

img, svg { max-width: 100%; }
a { color: var(--link); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3 { font-family: var(--font-display); font-weight: 700; color: var(--ink); margin: 0 0 .5em; text-wrap: balance; }
h1 { font-size: clamp(2.2rem, 5.2vw, 3.6rem); line-height: 1.06; letter-spacing: -.025em; }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.3rem); line-height: 1.15; letter-spacing: -.015em; }
h3 { font-family: var(--font-text); font-weight: 600; font-size: 1.15rem; line-height: 1.3; letter-spacing: 0; }
p, ul, ol { margin: 0 0 1em; }
ul, ol { padding-left: 1.4em; }
strong, b { font-weight: 600; }
code { font-size: .88em; background: var(--paper-2); border: 1px solid var(--rule); border-radius: var(--r-sm); padding: .05em .35em; overflow-wrap: anywhere; }

.wrap { width: 100%; max-width: 72rem; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 32px; } }
/* .narrow: контейнер на всю ширину сетки (левый край совпадает с логотипом),
   а строки текста ограничены удобной для чтения длиной. */
.narrow > * { max-width: 46rem; }
.narrow.center > * { margin-left: auto; margin-right: auto; }
.muted { color: var(--ink-2); }
.small { font-size: .9rem; }
.plain { list-style: none; padding: 0; }
.center { text-align: center; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--brand); color: var(--brand-ink); padding: 8px 12px; border-radius: var(--r-sm); z-index: 10; }
.skip:focus { left: 8px; }

/* ── Шапка ─────────────────────────────────────────── */
.site-header { border-bottom: 1px solid var(--rule); background: var(--paper); }
.header-row { display: flex; align-items: center; gap: 8px 28px; flex-wrap: wrap; padding-top: 14px; padding-bottom: 14px; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; letter-spacing: -.01em; color: var(--ink); text-decoration: none; }
.logo-bg { fill: var(--brand); }
.logo-mark { fill: none; stroke: var(--brand-ink); stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }
.site-header nav { order: 3; flex-basis: 100%; }
.site-header nav ul { display: flex; flex-wrap: wrap; gap: 0 20px; list-style: none; margin: 0; padding: 0; white-space: nowrap; }
.site-header nav a { color: var(--ink); text-decoration: none; padding: 10px 0; display: inline-block; font-size: 1rem; }
.site-header nav a:hover { color: var(--link); }
.site-header nav a[aria-current="page"] { color: var(--brand); box-shadow: inset 0 -2px 0 var(--brand); }
.site-header .header-cta { margin-left: auto; }
@media (max-width: 479px) {
  .site-header .header-cta { display: none; }
  /* Четыре пункта меню в одну строку на телефоне 360–480 px */
  .site-header nav ul { gap: 0 8px; justify-content: space-between; }
  .site-header nav a { font-size: .9rem; padding: 12px 0; }
}
@media (min-width: 900px) {
  .site-header nav { order: 0; flex-basis: auto; margin-left: auto; }
  .site-header .header-cta { margin-left: 0; }
}

/* ── Кнопки ────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; background: var(--brand); color: var(--brand-ink); border: 2px solid var(--brand); border-radius: var(--r-md); padding: 10px 22px; font-weight: 600; font-size: 1rem; text-decoration: none; line-height: 1.2; text-align: center; }
.btn:hover { filter: brightness(1.12); }
.btn-ghost { background: transparent; color: var(--brand); }
.btn-ghost:hover { background: var(--brand-tint); filter: none; }
.btn-small { min-height: 40px; padding: 6px 16px; font-size: .95rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 1.6em; }
.btn-row-center { justify-content: center; }
@media (max-width: 479px) { .btn-row > .btn { flex: 1 1 100%; } }

/* ── Секции ────────────────────────────────────────── */
.section { padding: 64px 0; }
.section-soft { background: var(--paper-2); }
.section-head { max-width: 44rem; margin-bottom: 32px; }
.lead { font-size: 1.15rem; color: var(--ink-2); max-width: 40rem; }
.page-head { padding: 56px 0 8px; }
.page-head + .section { padding-top: 32px; }
.page-head h1 { max-width: 60rem; }

/* Страница с боковой колонкой: основной текст слева, справка или действия справа */
.page-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px 64px; align-items: start; }
.page-grid > .main > * { max-width: 48rem; }
.page-grid > .main > .finding { max-width: none; }
@media (min-width: 960px) {
  .page-grid { grid-template-columns: minmax(0, 1fr) 21rem; }
  .page-grid > .aside { position: sticky; top: 24px; }
}
.aside { display: grid; gap: 16px; }
.aside .card { padding: 22px; }
.aside h2 { font-family: var(--font-text); font-weight: 600; font-size: 1.1rem; letter-spacing: 0; margin-bottom: .6em; }
.aside .btn { width: 100%; }
/* Документы: на телефоне оглавление идёт перед текстом, а дублирующий
   контакт (он есть в подвале) скрываем */
@media (max-width: 959px) {
  .aside-first > .aside { order: -1; }
  .aside-first .desktop-only { display: none; }
}
.aside .btn + .btn { margin-top: 10px; }
.aside .tally { flex-direction: column; gap: 8px; margin: 0 0 18px; }
.aside .req { grid-template-columns: minmax(0, 1fr); }
.aside .req dd { margin: 0 0 12px; }
.toc { list-style: none; margin: 0; padding: 0; }
.toc li + li { border-top: 1px solid var(--rule); }
.toc a { display: block; padding: 9px 0; text-decoration: none; color: var(--ink); }
.toc a:hover { color: var(--link); }
.prose > h2:first-child, .main > h2:first-child { margin-top: 0; }

/* ── Первый экран: заголовок + квитанция перевірки ── */
.hero { padding: 56px 0 64px; }
.hero-grid { display: grid; gap: 40px; align-items: center; }
@media (min-width: 960px) { .hero-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 56px; } }
.hero-facts { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 24px 0 0; padding: 0; list-style: none; color: var(--ink-2); font-size: .95rem; }
.hero-facts li { display: inline-flex; align-items: center; gap: 8px; }
.hero-facts li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--green-dot); }

/* Квитанция: главный образ сайта */
.slip { margin: 0; background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r-lg); box-shadow: 0 1px 0 var(--rule), 0 18px 40px -24px rgba(14, 77, 58, .35); overflow: hidden; }
.slip-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; padding: 18px 22px; border-bottom: 1px dashed var(--rule); }
.slip-domain { font-weight: 600; }
.slip-date { color: var(--ink-2); font-size: .9rem; }
.slip-rows { list-style: none; margin: 0; padding: 6px 0; }
.slip-row { display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 4px 14px; padding: 12px 22px; }
.slip-row + .slip-row { border-top: 1px solid var(--rule); }
.slip-row b { display: block; font-weight: 600; line-height: 1.35; }
.slip-row small { display: block; color: var(--ink-2); font-size: .9rem; line-height: 1.4; }
.slip-foot { display: block; padding: 14px 22px; border-top: 1px dashed var(--rule); background: var(--paper-2); font-weight: 600; text-decoration: none; }
.slip-foot:hover { text-decoration: underline; }

/* Статус-точки: красный, янтарный, зелёный */
.dot { width: 12px; height: 12px; margin-top: 6px; border-radius: 50%; background: var(--rule); flex: none; }
.is-red .dot, .dot.is-red { background: var(--red); box-shadow: 0 0 0 4px var(--red-tint); }
.is-amber .dot, .dot.is-amber { background: var(--amber-dot); box-shadow: 0 0 0 4px var(--amber-tint); }
.is-green .dot, .dot.is-green { background: var(--green-dot); box-shadow: 0 0 0 4px var(--green-tint); }

/* Один оркестрованный момент: статусы в квитанции «загораются» по очереди, как результаты проверки.
   Текст виден всегда: анимируется только точка, поэтому даже без анимации ничего не теряется. */
@media (prefers-reduced-motion: no-preference) {
  .slip-row .dot { animation: light-up .5s ease-out backwards; }
  .slip-row:nth-child(1) .dot { animation-delay: .3s; }
  .slip-row:nth-child(2) .dot { animation-delay: .7s; }
  .slip-row:nth-child(3) .dot { animation-delay: 1.1s; }
  .slip-row:nth-child(4) .dot { animation-delay: 1.5s; }
  .slip-row:nth-child(5) .dot { animation-delay: 1.9s; }
  @keyframes light-up { from { background: var(--rule); box-shadow: 0 0 0 0 transparent; transform: scale(.7); } }
}

/* ── Списки с разделителями вместо карточек ───────── */
.ruled { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); column-gap: 48px; }
@media (min-width: 760px) { .ruled-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ruled-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.ruled > li { border-top: 1px solid var(--rule); padding: 18px 0 22px; }
.ruled > li h3 { margin-bottom: .35em; }
.ruled > li p:last-child { margin-bottom: 0; }
.ruled .status { display: flex; gap: 14px; }
.ruled .status h3, .ruled .status p { margin-left: 0; }

/* Шаги — настоящая последовательность, поэтому нумерация */
.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; display: grid; gap: 0 32px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 760px) { .steps { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.steps li { counter-increment: step; border-top: 3px solid var(--brand); padding: 16px 0 24px; }
.steps li::before { content: counter(step); display: block; font-family: var(--font-display); font-weight: 700; font-size: 2rem; line-height: 1; color: var(--brand); margin-bottom: 10px; }
.steps p { margin-bottom: 0; color: var(--ink-2); }

/* Карточки — только там, где содержимое действительно отдельный объект */
.card { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r-lg); padding: 24px; }
.card h3 { margin-bottom: .4em; }
.card p:last-child, .card ul:last-child { margin-bottom: 0; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }

/* ── Тарифы ────────────────────────────────────────── */
.plans { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); align-items: stretch; }
@media (min-width: 900px) { .plans { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.plan { display: flex; flex-direction: column; }
.plan .price { font-family: var(--font-display); font-weight: 700; font-size: 2.4rem; line-height: 1.1; letter-spacing: -.02em; margin: .1em 0 .4em; }
.plan .price span { font-family: var(--font-text); font-size: 1rem; font-weight: 400; letter-spacing: 0; color: var(--ink-2); }
.plan > p:not(.price):not(.plan-note) { color: var(--ink-2); }
.plan .btn { margin-top: auto; }
.plan-featured { border: 2px solid var(--brand); background: var(--brand-tint); }
.plan-note { font-size: .9rem; font-weight: 600; color: var(--brand); margin-bottom: .3em; }

/* ── Таблицы ───────────────────────────────────────── */
.table-wrap { overflow-x: auto; border: 1px solid var(--rule); border-radius: var(--r-lg); background: var(--paper); margin-bottom: 1.4em; }
table { border-collapse: collapse; width: 100%; min-width: 600px; font-size: .95rem; }
th, td { text-align: left; vertical-align: top; padding: 12px 16px; border-bottom: 1px solid var(--rule); }
thead th { background: var(--paper-2); font-weight: 600; }
tbody th { font-weight: 400; }
tbody tr:last-child td, tbody tr:last-child th { border-bottom: 0; }
td.yes { color: var(--green); font-weight: 600; }
td.no { color: var(--ink-2); }

/* На телефоне строка таблицы становится карточкой: подписи столбцов
   берутся из data-label, который build.py добавляет каждой ячейке. */
@media (max-width: 719px) {
  .table-wrap { overflow: visible; border: 0; border-radius: 0; background: none; }
  .table-wrap table { min-width: 0; }
  .table-wrap thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .table-wrap table, .table-wrap tbody, .table-wrap tr, .table-wrap th, .table-wrap td { display: block; }
  .table-wrap tr { border: 1px solid var(--rule); border-radius: var(--r-lg); background: var(--paper); padding: 4px 0 8px; }
  .table-wrap tr + tr { margin-top: 10px; }
  .table-wrap tbody th { font-weight: 600; padding: 12px 16px 10px; border-bottom: 1px solid var(--rule); margin-bottom: 6px; }
  .table-wrap td { display: grid; grid-template-columns: minmax(0, 8.5rem) minmax(0, 1fr); gap: 12px; padding: 6px 16px; border: 0; }
  .table-wrap td::before { content: attr(data-label); color: var(--ink-2); font-weight: 400; }
  .table-wrap tbody tr:last-child td { border: 0; }
  /* Длинный текст: подпись над значением, а не слева */
  .table-stack-above td { display: block; }
  .table-stack-above td::before { display: block; font-size: .85rem; margin-bottom: 2px; }
  .table-stack-above td:last-child { font-weight: 600; }
  .table-stack-above td:last-child::before { font-weight: 400; }
}

/* ── Отчёт ─────────────────────────────────────────── */
.report-meta { display: flex; flex-wrap: wrap; gap: 4px 24px; color: var(--ink-2); }
.tally { display: flex; flex-wrap: wrap; gap: 10px 24px; list-style: none; padding: 0; margin: 18px 0 0; font-weight: 600; }
.tally li { display: inline-flex; align-items: center; gap: 10px; }
.tally .dot { margin-top: 0; }

.finding { border-left: 6px solid var(--rule); margin-bottom: 16px; border-radius: var(--r-sm) var(--r-lg) var(--r-lg) var(--r-sm); }
.finding.p0 { border-left-color: var(--red); }
.finding.p1 { border-left-color: var(--amber-dot); }
.finding.p2 { border-left-color: var(--rule); }
.finding .level { font-size: .95rem; font-weight: 600; margin-bottom: .3em; }
.finding.p0 .level { color: var(--red); }
.finding.p1 .level { color: var(--amber); }
.finding.p2 .level { color: var(--ink-2); }
.finding dl { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px 20px; margin: 14px 0 0; }
.finding dl > * { min-width: 0; }
.finding dt { font-weight: 600; margin-top: 10px; }
.finding dd { margin: 0; }
@media (min-width: 720px) {
  .finding dl { grid-template-columns: 11rem minmax(0, 1fr); row-gap: 12px; }
  .finding dt { margin-top: 0; }
}
.evidence { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85rem; line-height: 1.5; background: var(--paper-2); border: 1px solid var(--rule); border-radius: var(--r-sm); padding: 10px 12px; overflow-x: auto; white-space: pre-wrap; overflow-wrap: anywhere; margin: 8px 0 0; }

/* ── Сообщения ─────────────────────────────────────── */
.note { background: var(--brand-tint); border-radius: var(--r-md); padding: 16px 20px; }
.draft { background: var(--amber-tint); color: var(--ink); border: 1px solid var(--amber-dot); border-radius: var(--r-md); padding: 12px 16px; margin-bottom: 24px; }

/* ── FAQ ───────────────────────────────────────────── */
details { border-top: 1px solid var(--rule); }
details:last-of-type { border-bottom: 1px solid var(--rule); }
summary { cursor: pointer; font-weight: 600; padding: 14px 0 14px 1.6em; list-style: none; position: relative; }
summary::-webkit-details-marker { display: none; }
summary::before { content: "+"; position: absolute; left: 0; top: 12px; width: 1.1em; text-align: center; color: var(--brand); font-size: 1.2rem; line-height: 1.4; }
details[open] > summary::before { content: "−"; }
details > p { margin: 0 0 16px; padding-left: 1.6em; color: var(--ink-2); }

/* ── Текстовые страницы ────────────────────────────── */
.prose h2 { margin-top: 1.4em; font-size: clamp(1.35rem, 2.6vw, 1.7rem); }
.prose h3 { margin-top: 1.2em; }
.prose li { margin-bottom: .3em; }
.req { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px 16px; }
.req dt { color: var(--ink-2); }
.req dd { margin: 0 0 12px; font-weight: 600; }
@media (min-width: 640px) { .req { grid-template-columns: 14rem minmax(0, 1fr); } .req dd { margin: 0; } }

/* ── Призыв ────────────────────────────────────────── */
.cta-band { background: var(--brand); color: var(--brand-ink); border-radius: var(--r-lg); padding: 40px 28px; }
.cta-band h2, .cta-band .lead { color: var(--brand-ink); }
.cta-band .lead { opacity: .9; }
.cta-band .btn-row + p { margin: 20px 0 0; }
.cta-band a { color: var(--brand-ink); }
.cta-band .btn { background: var(--brand-ink); color: var(--brand); border-color: var(--brand-ink); }
.cta-band .btn-ghost { background: transparent; color: var(--brand-ink); border-color: var(--brand-ink); }
.cta-band .btn-ghost:hover { background: rgba(255, 255, 255, .12); }
@media (min-width: 720px) { .cta-band { padding: 48px 56px; } }
.cta-band :focus-visible { outline-color: var(--brand-ink); }

/* ── Подвал ────────────────────────────────────────── */
.site-footer { border-top: 1px solid var(--rule); background: var(--paper-2); padding: 44px 0 28px; margin-top: 32px; font-size: .95rem; }
.footer-grid { display: grid; gap: 28px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
.footer-brand, .footer-title { font-weight: 600; margin-bottom: .4em; }
.footer-bottom { margin-top: 28px; font-size: .85rem; }
