/* Рулимир — сайт-визитка. Без сборщиков, открывается как файлы. */

:root {
  /* Основа: бетон и графит — нейтральный фон, чтобы цвет несли только плашки */
  --bg: #eef0f2;
  --surface: #ffffff;
  --ink: #15181c;
  --muted: #4e5661;
  --line: #cdd2d8;
  --go: #1b5e20;          /* кнопка «Скачать» = цвет «ВЫГОДНО» */
  --go-hover: #144a18;
  --on-go: #ffffff;
  --focus: #1b5e20;

  /* Цвета плашки — как в приложении (VerdictCard.kt) */
  --v-good: #1b5e20;
  --v-norm: #795548;
  --v-bad: #b71c1c;
  --v-pickup: #ffb300;
  --v-reason: #ffe082;

  --f-display: "Fira Sans Extra Condensed", "Arial Narrow", sans-serif;
  --f-body: "Golos Text", system-ui, sans-serif;
  --f-plate: "Roboto", system-ui, sans-serif;

  --wrap: 72rem;
  --pad: clamp(1.25rem, 4vw, 2.5rem);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171a1f;
    --surface: #20252b;
    --ink: #eceef0;
    --muted: #a8b0ba;
    --line: #353c45;
    --go: #2e7d32;
    --go-hover: #388e3c;
    --focus: #81c784;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 1rem; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--f-body);
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--pad); }
.skip { position: absolute; left: -999px; top: 0; }
.skip:focus { left: 1rem; top: 1rem; min-height: 44px; display: inline-flex; align-items: center; background: var(--surface); padding: 0.75rem 1rem; z-index: 10; }

/* ——— Шапка ——— */
.top { border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; gap: 1rem; min-height: 4.25rem; }
.brand {
  display: inline-flex; align-items: center; gap: 0.6rem;
  font: 800 1.75rem/1 var(--f-display); text-decoration: none; letter-spacing: 0.01em;
  min-height: 44px;
}
.brand svg { width: 2rem; height: 2rem; flex: none; }
.top nav { margin-left: auto; display: flex; align-items: center; gap: 0.25rem; }
.top nav a:not(.btn) {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 0.75rem;
  text-decoration: none; color: var(--muted); font-weight: 500;
}
.top nav a:not(.btn):hover { color: var(--ink); text-decoration: underline; }
@media (max-width: 34rem) { .top nav a.hide-sm { display: none; } }

/* ——— Кнопки ——— */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.6rem;
  min-height: 3.25rem; padding: 0 1.6rem;
  background: var(--go); color: var(--on-go);
  font: 600 1.125rem/1 var(--f-body); text-decoration: none;
  border-radius: 0.75rem;
  transition: background-color 150ms ease;
}
.btn:hover { background: var(--go-hover); }
.btn svg { width: 1.25rem; height: 1.25rem; }
.btn--sm { min-height: 44px; padding: 0 1rem; font-size: 1rem; border-radius: 0.6rem; }

/* ——— Первый экран ——— */
.hero { padding: clamp(2rem, 6vw, 4.5rem) 0 clamp(2.5rem, 6vw, 5rem); }
.hero .wrap { display: grid; gap: 1.75rem; }
@media (min-width: 60rem) {
  .hero .wrap {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    grid-template-areas: "head phone" "text phone";
    column-gap: 4rem; row-gap: 0;
  }
  .hero__head { grid-area: head; align-self: end; }
  .hero__text { grid-area: text; align-self: start; }
  .hero .phone { grid-area: phone; align-self: center; }
}
h1, h2, h3 { font-family: var(--f-display); font-weight: 800; line-height: 1.02; margin: 0; letter-spacing: 0; }
h1 { font-size: clamp(2.75rem, 9vw, 5.25rem); max-width: 12ch; text-wrap: balance; }
.lead { font-size: clamp(1.125rem, 2.4vw, 1.3rem); line-height: 1.55; color: var(--ink); max-width: 34rem; margin: 0; }
@media (min-width: 60rem) { .lead { margin-top: 1.5rem; } }
.cta { margin-top: 2rem; display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.25rem; }
.cta__note { color: var(--muted); font-size: 0.975rem; line-height: 1.45; max-width: 18rem; }
.cta__note b { color: var(--ink); font-weight: 600; }

/* Телефон с карточкой заказа и плашкой поверх */
.phone {
  position: relative; width: min(100%, 26rem); margin: 0 auto;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 2.25rem; padding: 4.5rem 1rem 1.5rem;
  box-shadow: 0 1.5rem 3rem -1.5rem rgb(20 24 28 / 0.35);
}
.phone::before { /* динамик */
  content: ""; position: absolute; top: 0.9rem; left: 50%; width: 3.5rem; height: 0.35rem;
  margin-left: -1.75rem; border-radius: 1rem; background: var(--line);
}
.order { color: var(--muted); font: 400 1rem/1.35 var(--f-plate); padding: 9rem 0.5rem 0; }
.order p { margin: 0 0 0.6rem; }
.order .order__pts { display: grid; grid-template-columns: 1.5rem 1fr; gap: 0.15rem 0.25rem; margin-bottom: 0.9rem; color: var(--ink); opacity: 0.75; }
.order__accept {
  margin-top: 1rem; display: flex; justify-content: space-between; align-items: center;
  border-radius: 0.8rem; background: var(--line); color: var(--ink); padding: 0.85rem 1rem; font-weight: 500;
}
.phone .plate { position: absolute; top: 2.75rem; left: -0.6rem; right: 1.6rem; font-size: clamp(0.8rem, 3.6vw, 1.05rem); }
/* На телефоне показываем только верх экрана: плашка и начало карточки, чтобы кнопка «Скачать» не уходила далеко вниз */
@media (max-width: 59.99rem) {
  .hero .phone { height: 19rem; overflow: hidden; border-bottom: 0; border-radius: 2.25rem 2.25rem 0 0; box-shadow: none;
    -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
  .hero .phone .plate { left: 0.5rem; right: 0.5rem; }
}

@media (prefers-reduced-motion: no-preference) {
  .phone .plate { animation: plate-in 220ms cubic-bezier(.2,.8,.2,1) 350ms both; }
  @keyframes plate-in { from { opacity: 0; transform: translateY(-0.6rem); } }
}

/* ——— Плашка (макет того, что рисует приложение) ——— */
.plate {
  font-family: var(--f-plate); color: #fff;
  background: var(--v-norm); border-radius: 1.15em; padding: 0.95em 1.1em 1em;
  box-shadow: 0 0.8em 1.6em -0.6em rgb(0 0 0 / 0.45);
  font-size: 1rem;
}
.plate--good { background: var(--v-good); }
.plate--bad { background: var(--v-bad); }
.plate__row { display: flex; justify-content: space-between; align-items: baseline; gap: 0.75em; }
.plate__verdict, .plate__price { font-weight: 700; font-size: 1.5em; line-height: 1.15; white-space: nowrap; }
.plate__pickup {
  margin: 0.35em 0 0.3em; font-weight: 700; font-size: 1.5em; line-height: 1.2; white-space: nowrap;
}
.plate__pickup--far { background: var(--v-pickup); color: #000; border-radius: 0.4em; padding: 0.08em 0.4em; }
.plate__rates { font-weight: 700; font-size: 1.2em; line-height: 1.3; }
.plate__reason { color: var(--v-reason); font-weight: 700; font-size: 0.98em; line-height: 1.3; margin-top: 0.2em; }
.plate__total { font-size: 0.98em; line-height: 1.35; color: rgb(255 255 255 / 0.9); margin-top: 0.15em; }

/* ——— Секции ——— */
section { padding: clamp(3rem, 8vw, 6rem) 0; border-top: 1px solid var(--line); }
h2 { font-size: clamp(2.25rem, 6.5vw, 3.75rem); max-width: 16ch; text-wrap: balance; }
.sub { color: var(--muted); max-width: 38rem; margin: 1rem 0 0; font-size: 1.125rem; }

/* Разбор плашки: слева большая плашка, справа подписи к строкам */
.anatomy { margin-top: clamp(2rem, 5vw, 3.5rem); display: grid; gap: 2rem; align-items: start; }
@media (min-width: 56rem) { .anatomy { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4rem; } }
.anatomy .plate { font-size: clamp(0.85rem, 3.6vw, 1.25rem); position: relative; padding-right: 1.25rem; margin-right: 1.4rem; }
.anatomy .plate > * { position: relative; }
@media (min-width: 56rem) { .anatomy .plate { position: sticky; top: 2rem; } }
.mark {
  display: inline-grid; place-items: center; width: 1.5rem; height: 1.5rem; border-radius: 50%;
  background: var(--ink); color: var(--bg); font: 700 0.85rem/1 var(--f-body); flex: none;
}
.plate .mark { position: absolute; right: -2.15rem; top: 50%; transform: translateY(-50%); width: 1.6rem; height: 1.6rem; font-size: 0.85rem;
  box-shadow: 0 0 0 3px var(--bg); }
.legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.5rem; }
.legend li { display: grid; grid-template-columns: 1.5rem 1fr; gap: 0.9rem; }
.legend h3 { font-size: 1.6rem; line-height: 1.1; }
.legend p { margin: 0.35rem 0 0; color: var(--muted); max-width: 30rem; }
.legend .mark { margin-top: 0.2rem; }
.swatch { display: inline-block; width: 0.8em; height: 0.8em; border-radius: 0.2em; vertical-align: -0.05em; background: var(--v-pickup); }

/* Три ответа */
.verdicts { margin-top: clamp(2rem, 5vw, 3rem); display: grid; gap: 2.25rem; }
@media (min-width: 62rem) { .verdicts { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.75rem; align-items: start; } }
.verdict .plate { font-size: clamp(0.78rem, 3.7vw, 0.92rem); }
@media (min-width: 62rem) {
  .verdicts { grid-template-rows: auto auto auto; row-gap: 0; }
  .verdict { display: grid; grid-row: span 3; grid-template-rows: subgrid; }
  .verdict .plate { font-size: 0.9rem; }
}
.verdict h3 { font-size: 1.6rem; margin-top: 1.1rem; }
.verdict p { margin: 0.35rem 0 0; color: var(--muted); }

/* Что учитывает */
.facts { margin-top: clamp(2rem, 5vw, 3rem); display: grid; gap: 0; border-top: 1px solid var(--line); }
@media (min-width: 48rem) { .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 3rem; } }
.fact { display: grid; grid-template-columns: 2.5rem 1fr; gap: 1rem; padding: 1.5rem 0; border-bottom: 1px solid var(--line); }
.fact svg { width: 2rem; height: 2rem; color: var(--ink); margin-top: 0.15rem; }
.fact h3 { font-size: 1.6rem; line-height: 1.1; }
.fact p { margin: 0.35rem 0 0; color: var(--muted); }

/* 15 секунд: шкала */
.clock { margin-top: 2.5rem; max-width: 46rem; }
.clock__bar { display: grid; grid-template-columns: 1fr 14fr; height: 3.25rem; border-radius: 0.6rem; overflow: hidden; border: 1px solid var(--line); }
.clock__bar span { display: flex; align-items: center; padding: 0 0.75rem; font-weight: 600; font-size: 0.95rem; white-space: nowrap; }
.clock__bar span:first-child { background: var(--v-norm); color: #fff; padding: 0; justify-content: center; }
.clock__bar span:last-child { background: var(--surface); }
.clock__scale { display: flex; justify-content: space-between; color: var(--muted); font-size: 0.9rem; margin-top: 0.4rem; }
.clock__cap { margin: 0.75rem 0 0; color: var(--muted); }

/* Тарифы */
.prices { margin-top: clamp(2rem, 5vw, 3rem); display: grid; gap: 1rem; }
@media (min-width: 48rem) { .prices { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.price { background: var(--surface); border: 1px solid var(--line); border-radius: 1rem; padding: 1.5rem 1.5rem 1.6rem; }
.price--main { border: 2px solid var(--ink); }
.price__term { font: 700 1.5rem/1.1 var(--f-display); }
.price__sum { font: 800 clamp(3rem, 12vw, 4rem)/1 var(--f-display); margin: 0.6rem 0 0; }
.price__note { margin: 0.6rem 0 0; color: var(--muted); font-size: 1rem; line-height: 1.45; }
.pay { margin-top: 2.5rem; display: grid; grid-template-columns: minmax(0, 1fr); gap: 2rem; }
@media (min-width: 56rem) { .pay { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4rem; } }
.pay h3 { font-size: 1.75rem; }
.pay p { margin: 0.6rem 0 0; max-width: 34rem; }
.steps { margin: 1rem 0 0; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 1rem; }
.steps li { display: grid; grid-template-columns: 2rem 1fr; gap: 0.75rem; counter-increment: s; }
.steps li::before {
  content: counter(s); display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%;
  border: 2px solid var(--ink); font-weight: 700; font-size: 0.95rem;
}
.steps li > span { padding-top: 0.2rem; }
.path { font-weight: 600; }

/* Контакты */
.contacts { margin-top: clamp(2rem, 5vw, 3rem); display: grid; gap: 2rem; }
@media (min-width: 56rem) { .contacts { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4rem; } }
.links { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.links a {
  display: grid; grid-template-columns: 2rem 1fr; align-items: center; gap: 0.9rem;
  min-height: 4.25rem; padding: 0.6rem 0; border-bottom: 1px solid var(--line); text-decoration: none;
}
.links a:hover strong { text-decoration: underline; }
.links svg { width: 1.6rem; height: 1.6rem; }
.links strong { display: block; font-weight: 600; font-size: 1.1rem; }
.links small { display: block; color: var(--muted); font-size: 0.95rem; }
.req { margin: 0; font-style: normal; line-height: 1.75; }
.req dt { color: var(--muted); font-size: 0.95rem; }
.req dd { margin: 0 0 0.6rem; font-weight: 500; overflow-wrap: anywhere; }

/* ——— Подвал ——— */
.foot { border-top: 1px solid var(--line); padding: 2rem 0 2.5rem; color: var(--muted); font-size: 0.95rem; line-height: 1.55; }
.foot .wrap { display: grid; gap: 0.9rem; }
.foot p { margin: 0; overflow-wrap: anywhere; }
.foot nav { display: flex; flex-wrap: wrap; gap: 0 1.5rem; }
.foot nav a { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink); }

/* ——— Юридические страницы ——— */
.doc { padding: clamp(2rem, 6vw, 4rem) 0 clamp(3rem, 8vw, 5rem); }
.doc article { max-width: 46rem; }
.doc h1 { font-size: clamp(2.1rem, 7vw, 3.4rem); max-width: 22ch; line-height: 1.05; }
.doc h2 { font-size: clamp(1.6rem, 4.5vw, 2.1rem); margin: 2.5rem 0 0.75rem; max-width: none; }
.doc p, .doc li { line-height: 1.7; }
.doc p { margin: 0.9rem 0 0; }
.doc ul { padding-left: 1.25rem; margin: 0.9rem 0 0; }
.doc li { margin-top: 0.5rem; }
.doc .edition { color: var(--muted); margin-top: 1rem; }
.doc .back { display: inline-flex; align-items: center; min-height: 44px; color: var(--muted); margin-bottom: 0.5rem; }
.table-wrap { position: relative; overflow-x: auto; margin-top: 1.25rem; border: 1px solid var(--line); border-radius: 0.75rem; background: var(--surface); }
.doc table { border-collapse: collapse; width: 100%; font-size: 0.975rem; line-height: 1.5; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 0.75rem 0.9rem; border-bottom: 1px solid var(--line); }
.doc tr:last-child td { border-bottom: 0; }
.doc th { font-weight: 600; background: var(--bg); }
.doc table.wide { min-width: 40rem; }

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

/* Одна колонка на телефоне: трек не распирается длинными строками */
.hero .wrap, .anatomy, .verdicts, .facts, .prices, .contacts { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 60rem) { .hero .wrap { grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); } }
@media (min-width: 56rem) { .anatomy, .contacts, .pay { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
@media (min-width: 62rem) { .verdicts { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 48rem) { .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } .prices { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Широкая таблица политики на телефоне — стопкой: каждая строка отдельным блоком с подписями */
@media (max-width: 40rem) {
  .table-wrap:has(table.wide) { overflow: visible; border: 0; background: none; }
  .doc table.wide { min-width: 0; }
  .doc table.wide thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .doc table.wide, .doc table.wide tbody, .doc table.wide tr, .doc table.wide td { display: block; }
  .doc table.wide tr { background: var(--surface); border: 1px solid var(--line); border-radius: 0.75rem; padding: 0.4rem 0; margin-bottom: 0.75rem; }
  .doc table.wide td { border: 0; padding: 0.4rem 1rem; }
  .doc table.wide td::before { content: attr(data-label); display: block; color: var(--muted); font-size: 0.85rem; }
  .doc table.wide td:first-child { font-weight: 600; }
}
