/* ЯсноЗаём v4. Дизайн-контракт: work/design-direction.md, разделы v3–v4 */

@font-face {
  font-family: "Onest";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("fonts/onest-cyrillic-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Onest";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("fonts/onest-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+20BD, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ───────── Токены ───────── */
:root {
  --bg: #F3F4F7;            /* фон страницы — переключается data-bg */
  --surface: #FFFFFF;       /* карточки, калькулятор */
  --soft: #F4F4F8;          /* подложка «Вернёте / Переплата», чипы */
  --line: #E5E5EC;
  --line-strong: #CDCDD8;
  --ink: #0F1222;
  --ink-2: #5D6173;

  /* Тема «Фиолет + лайм» — по умолчанию */
  --accent: #6B3CFF;        /* выбранные значения, нумерация, ссылки */
  --accent-hover: #5A2BEE;
  --accent-ink: #FFFFFF;
  --accent-soft: #EFE9FF;   /* блок «Как подать» */
  --accent-deep: #24135F;   /* финальный блок */
  --cta: #6B3CFF;           /* кнопка «Оформить» */
  --cta-hover: #5A2BEE;
  --cta-ink: #FFFFFF;
  --sel: var(--accent);
  --sel-ink: #FFFFFF;
  --link: #5A2BEE;
  --glow-1: rgba(120, 80, 255, .32);
  --glow-2: rgba(200, 245, 80, .30);
  --glow-3: rgba(190, 170, 255, .30);
  --pos: #D6F86A;           /* 0 ₽, «0% первые N дней», «Заявка открыта» */
  --pos-ink: #1E2B00;
  --frame: #CBB9FF;         /* рамка калькулятора */
  --final-btn: #D6F86A;     /* кнопка в финальном блоке */
  --final-btn-ink: #10130A;

  --note: #FFF4CC;
  --note-line: #F0D374;

  --r-card: 18px;
  --r-btn: 12px;
  --r-pill: 999px;
  --header-h: 60px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --t: 220ms;
}

body[data-theme="mandarin"] {
  --accent: #FF6A1F;
  --accent-hover: #FF7F3D;
  --accent-ink: #14110F;
  --accent-soft: #FFEDE2;
  --accent-deep: #1E1713;
  --cta: #FF6A1F;
  --cta-hover: #FF7F3D;
  --cta-ink: #14110F;       /* тёмный текст на оранжевом ≈ 6,4:1; белый не проходит (2,9:1) */
  --sel: #14110F;
  --sel-ink: #FFFFFF;
  --link: #B3410B;
  --glow-1: rgba(255, 120, 40, .30);
  --glow-2: rgba(255, 200, 120, .32);
  --glow-3: rgba(255, 150, 190, .22);
  --pos: #DDF5C4;
  --pos-ink: #1D4508;
  --frame: #FFC6A6;
  --final-btn: #FF6A1F;
  --final-btn-ink: #14110F;
}

body[data-theme="indigo"] {
  --accent: #4B3BFF;
  --accent-hover: #3B2BEE;
  --accent-ink: #FFFFFF;
  --accent-soft: #EFEDFF;
  --accent-deep: #2B20B5;
  --cta: #4B3BFF;
  --cta-hover: #3B2BEE;
  --cta-ink: #FFFFFF;
  --sel: #4B3BFF;
  --sel-ink: #FFFFFF;
  --link: #4B3BFF;
  --glow-1: rgba(98, 80, 255, .34);
  --glow-2: rgba(178, 168, 255, .30);
  --glow-3: rgba(255, 214, 236, .35);
  --pos: #DDF7A8;
  --pos-ink: #213400;
  --frame: #C4BDFF;
  --final-btn: #FFFFFF;
  --final-btn-ink: #0F1222;
}

body[data-theme="yellow"] {
  --accent: #FFC21A;
  --accent-hover: #FFCD45;
  --accent-ink: #111421;
  --accent-soft: #FFF6DA;
  --accent-deep: #121521;
  --cta: #FFC21A;
  --cta-hover: #FFCD45;
  --cta-ink: #111421;
  --sel: #111421;
  --sel-ink: #FFFFFF;
  --link: #111421;
  --glow-1: rgba(255, 194, 26, .34);
  --glow-2: rgba(255, 228, 150, .30);
  --glow-3: rgba(255, 255, 255, 0);
  --pos: #E3F5EC;
  --pos-ink: #146B40;
  --frame: #F5D77A;
  --final-btn: #FFC21A;
  --final-btn-ink: #111421;
}

/* Фон страницы (вопрос 32) */
body[data-bg="cool"]     { --bg: #F3F4F7; --soft: #F4F4F8; }
body[data-bg="cream"]    { --bg: #F7F2EA; --soft: #F7F3ED; --line: #E8E1D6; --line-strong: #D3CABB; }
body[data-bg="lavender"] { --bg: #F3F1FA; --soft: #F4F2FA; --line: #E4E0F0; --line-strong: #CCC6E0; }
body[data-bg="white"]    { --bg: #FFFFFF; --soft: #F5F5F8; }

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); }

body {
  margin: 0;
  font-family: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  font-feature-settings: "tnum" 1, "lnum" 1;
  overflow-x: hidden;
  position: relative;
}
body.lock { overflow: hidden; }

h1, h2, h3 { line-height: 1.12; margin: 0; letter-spacing: -.02em; }
p { margin: 0; }
a { color: inherit; text-underline-offset: 3px; }
button, select, input { font: inherit; color: inherit; }
button { cursor: pointer; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
body[data-theme="yellow"] :focus-visible { outline-color: var(--ink); }

[hidden] { display: none !important; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.wrap { width: 100%; max-width: 1140px; margin: 0 auto; padding: 0 16px; }

.stub { background: #FFE3E0; color: #7A1E12; padding: 0 4px; border-radius: 4px; font-weight: 600; }

/* ───────── Прототип ───────── */
.proto-bar { background: #0F1222; color: #fff; font-size: .8125rem; position: relative; z-index: 41; }
.proto-bar__in { max-width: 1140px; margin: 0 auto; padding: 6px 16px; display: flex; gap: 8px 12px; align-items: center; overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
.proto-bar__in::-webkit-scrollbar { display: none; }
.proto-bar__tag { color: #FFC21A; font-weight: 700; }
.proto-bar__field { display: inline-flex; gap: 6px; align-items: center; color: #A9AEC2; }
.proto-bar select { background: #1F2438; border: 1px solid #353B55; border-radius: 8px; color: #fff; padding: 3px 6px; font-size: .8125rem; }
.proto-bar__btn { background: transparent; border: 1px solid #353B55; border-radius: 8px; color: #fff; padding: 3px 10px; font-size: .8125rem; }
.proto-bar__btn[aria-pressed="true"] { background: #FFC21A; border-color: #FFC21A; color: #0F1222; font-weight: 600; }

/* ───────── Свечение за заголовком (градиент «от заголовка и ниже») ───────── */
.glow {
  position: absolute; left: 0; right: 0; top: 0; height: 820px; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60% 55% at 22% 18%, var(--glow-1) 0%, transparent 70%),
    radial-gradient(55% 60% at 78% 10%, var(--glow-3) 0%, transparent 70%),
    radial-gradient(90% 70% at 50% 30%, var(--glow-2) 0%, transparent 75%),
    linear-gradient(180deg, transparent 55%, var(--bg) 100%);
}

/* ───────── Шапка (липкая) ───────── */
.site-header {
  position: sticky; top: 0; z-index: 40; height: var(--header-h);
  background: transparent; border-bottom: 1px solid transparent;
  transition: background-color var(--t) var(--ease), border-color var(--t) var(--ease), backdrop-filter var(--t);
}
.site-header.is-scrolled {
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  -webkit-backdrop-filter: saturate(1.6) blur(14px); backdrop-filter: saturate(1.6) blur(14px);
  border-bottom-color: var(--line);
}
.site-header__in { height: 100%; display: flex; align-items: center; gap: 12px; }
.brand { min-height: 44px; display: inline-flex; align-items: center; gap: 9px; text-decoration: none; font-weight: 750; font-size: 1.125rem; letter-spacing: -.03em; margin-right: auto; }
.brand__mark { width: 24px; height: 24px; border-radius: 8px; background: var(--accent); position: relative; flex: none; }
.brand__mark::after { content: ""; position: absolute; left: 6px; top: 6px; width: 12px; height: 12px; border-radius: 4px 4px 4px 1px; background: var(--accent-ink); opacity: .95; }
body[data-theme="yellow"] .brand__mark { background: var(--ink); }
body[data-theme="yellow"] .brand__mark::after { background: var(--accent); }

.nav { display: none; gap: 4px; }
.nav a { text-decoration: none; font-size: .9375rem; font-weight: 550; color: var(--ink-2); padding: 8px 12px; border-radius: var(--r-pill); transition: color var(--t), background-color var(--t); }
.nav a:hover { color: var(--ink); background: rgba(15, 18, 34, .05); }

.head-cta {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: var(--r-pill);
  background: var(--ink); color: #fff; text-decoration: none; font-weight: 650; font-size: .9375rem; white-space: nowrap;
  transition: background-color var(--t);
}
.head-cta:hover { background: #262B44; }

/* Мобильный: краткая сводка расчёта в шапке, пока листаются карточки */
.sum-chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px 0 14px;
  border: 1px solid var(--line-strong); border-radius: var(--r-pill); background: #fff;
  font-weight: 650; font-size: .9375rem; white-space: nowrap; animation: pop 240ms var(--ease);
}
.sum-chip svg { width: 16px; height: 16px; fill: var(--accent); }
body[data-theme="yellow"] .sum-chip svg { fill: var(--ink); }
.sum-chip:not([hidden]) + .head-cta { display: none; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* ───────── Первый экран ───────── */
.hero { padding: 18px 0 6px; }
.hero h1 {
  font-size: clamp(1.75rem, 1rem + 4vw, 4rem); font-weight: 750; letter-spacing: -.035em;
  white-space: nowrap; overflow: hidden; line-height: 1.08;
}
.hero__lead { margin-top: 8px; color: var(--ink-2); font-size: 1rem; white-space: nowrap; overflow: hidden; }

/* ───────── Раскладка ───────── */
.layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; padding-top: 14px; padding-bottom: 40px; }
.picker-slot { min-width: 0; }

/* ───────── Быстрый расчёт ───────── */
.picker {
  background: var(--surface); border: 1.5px solid var(--frame); border-radius: var(--r-card);
  padding: 14px; display: grid; gap: 12px;
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--frame) 28%, transparent), 0 22px 44px -30px rgba(30, 20, 120, .45);
}
.picker__top { display: flex; align-items: center; justify-content: space-between; }
.picker__title { font-size: 1rem; font-weight: 700; letter-spacing: -.01em; }
.picker__done { display: none; border: 0; background: var(--ink); color: #fff; border-radius: var(--r-pill); padding: 8px 16px; font-weight: 650; font-size: .9375rem; }

.fgroup { display: grid; gap: 8px; }
body[data-input="below"] .fgroup .chips { order: -1; }
body[data-input="below"] .fgroup .field__hint { order: 2; }

.field {
  display: grid; gap: 0; padding: 7px 14px 6px; border: 1.5px solid var(--line-strong); border-radius: 14px; background: #fff; cursor: text;
  transition: border-color var(--t), box-shadow var(--t);
}
.field:hover { border-color: var(--ink-2); }
.field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
body[data-theme="yellow"] .field:focus-within { border-color: var(--ink); }
.field__label { font-size: .8125rem; color: var(--ink-2); font-weight: 550; line-height: 1.2; }
.field__row { display: flex; align-items: baseline; gap: 6px; }
.field input {
  border: 0; outline: 0; background: transparent; padding: 0; margin: 0; min-width: 0; width: 100%; flex: 1;
  font-size: 1.5rem; font-weight: 750; letter-spacing: -.02em; line-height: 1.25;
}
.field__unit { font-size: 1.125rem; font-weight: 650; color: var(--ink-2); }
.field__hint { font-size: .8125rem; color: var(--ink-2); margin-top: -4px; padding-left: 2px; transition: color var(--t); }
.field__hint.is-warn { color: #B4231A; font-weight: 600; }

.chips { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
#chips-days { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.chip {
  min-height: 40px; padding: 0 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--soft);
  font-size: .875rem; font-weight: 600; white-space: nowrap;
  transition: background-color var(--t) var(--ease), border-color var(--t) var(--ease), color var(--t) var(--ease), transform 120ms;
}
.chip:hover { border-color: var(--line-strong); background: #fff; }
.chip:active { transform: scale(.97); }
.chip[aria-pressed="true"] { background: var(--sel); border-color: var(--sel); color: var(--sel-ink); }

.switch { display: flex; align-items: center; gap: 10px; font-size: .9375rem; cursor: pointer; min-height: 40px; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch__ui { width: 40px; height: 24px; border-radius: var(--r-pill); background: var(--line-strong); position: relative; flex: none; transition: background-color var(--t) var(--ease); }
.switch__ui::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform var(--t) var(--ease); }
.switch input:checked + .switch__ui { background: var(--sel); }
.switch input:checked + .switch__ui::after { transform: translateX(16px); }
.switch input:focus-visible + .switch__ui { outline: 3px solid var(--accent); outline-offset: 2px; }

.picker__foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; border-top: 1px solid var(--line); padding-top: 10px; }
.count { font-size: .9375rem; color: var(--ink-2); white-space: nowrap; }
.count__num { display: inline-block; min-width: 1ch; font-weight: 750; color: var(--ink); font-size: 1.125rem; }
.count__num.tick { animation: tick 260ms var(--ease); }
@keyframes tick { 0% { transform: translateY(-40%); opacity: 0; } 100% { transform: none; opacity: 1; } }
.how-btn {
  display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; padding: 8px 2px; min-height: 40px;
  font-size: .875rem; font-weight: 600; color: var(--link); text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); text-underline-offset: 4px;
}
.how-btn svg { width: 16px; height: 16px; fill: currentColor; }

/* Мобильный: калькулятор открывается снизу листом */
.backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(15, 18, 34, .4); animation: fade 200ms; }
@keyframes fade { from { opacity: 0; } }
.picker.is-sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 51; border-radius: 22px 22px 0 0; background: #fff;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); max-height: 92vh; overflow: auto;
  animation: sheet 260ms var(--ease);
}
.picker.is-sheet .picker__done { display: inline-flex; }
@keyframes sheet { from { transform: translateY(40px); opacity: .4; } }

/* ───────── Список ───────── */
.offers { min-width: 0; }
.offer-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
#offer-list:empty { min-height: 2800px; }

.card {
  position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card);
  padding: 14px; display: grid; gap: 12px;
  transition: opacity var(--t) var(--ease), border-color var(--t), background-color 600ms var(--ease), box-shadow var(--t);
}
.card:hover { border-color: var(--line-strong); box-shadow: 0 14px 34px -26px rgba(15, 18, 34, .35); }
.card__head { order: 0; } .money { order: 1; } .badges { order: 2; } .card__side { order: 3; }
.terms { order: 4; } .facts-line { order: 5; } .card__extra { order: 6; } .legal { order: 7; }
.card.nudge { background: var(--accent-soft); }

.card__head { display: grid; grid-template-columns: 44px 1fr auto; gap: 10px; align-items: center; }
.logo {
  width: 44px; height: 44px; border-radius: 12px; background: var(--soft); display: grid; place-items: center;
  font-weight: 750; font-size: .9375rem; letter-spacing: -.02em; color: var(--ink);
}
.card__name { font-size: 1.125rem; font-weight: 700; line-height: 1.2; letter-spacing: -.01em; }
.card__product { font-size: .875rem; color: var(--ink-2); }
.opened {
  display: none; align-items: center; gap: 4px; font-size: .8125rem; font-weight: 650; color: var(--pos-ink);
  background: var(--pos); border-radius: var(--r-pill); padding: 3px 9px 3px 6px; align-self: start;
}
.opened svg { width: 14px; height: 14px; fill: currentColor; }
.card.is-opened .opened { display: inline-flex; }

.money { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; background: var(--soft); border-radius: 14px; padding: 10px 12px; }
.money__label { font-size: .8125rem; color: var(--ink-2); }
.money__val { font-size: 1.375rem; font-weight: 750; letter-spacing: -.025em; line-height: 1.2; }
.money__val--zero { display: inline-block; background: var(--pos); color: var(--pos-ink); border-radius: 8px; padding: 0 8px; margin-left: -2px; }
.money__hint { grid-column: 1 / -1; font-size: .8125rem; color: var(--ink-2); }
.money__hint b { color: var(--ink); font-weight: 650; }

.terms { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; }
.terms div { min-width: 0; }
.terms dt { font-size: .8125rem; color: var(--ink-2); }
.terms dd { margin: 0; font-weight: 650; font-size: .9375rem; }

.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge { display: inline-flex; align-items: center; min-height: 28px; padding: 0 9px; border-radius: 8px; font-size: .8125rem; font-weight: 650; white-space: nowrap; }
.badge--zero { background: var(--pos); color: var(--pos-ink); }
.badge--psk { background: var(--soft); color: var(--ink); }
.badge--stub { background: #FFE3E0; color: #7A1E12; }

.facts-line { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .875rem; color: var(--ink-2); }
.facts-line li { position: relative; padding-left: 12px; }
.facts-line li::before { content: ""; position: absolute; left: 0; top: .6em; width: 5px; height: 5px; border-radius: 50%; background: var(--line-strong); }
.facts-line li.is-hit { color: var(--ink); font-weight: 600; }
.facts-line li.is-hit::before { background: var(--accent); }

.reason { font-size: .875rem; font-weight: 600; color: var(--ink); background: var(--soft); border-radius: 8px; padding: 6px 10px; }

.card__side, .card__extra { display: grid; gap: 8px; }
.card__extra:empty { display: none; }
.cta {
  display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 18px;
  background: var(--cta); color: var(--cta-ink); border-radius: var(--r-btn); text-decoration: none;
  font-weight: 700; font-size: 1.0625rem; letter-spacing: -.01em; text-align: center; text-wrap: balance; line-height: 1.2;
  transition: background-color 160ms var(--ease), transform 160ms var(--ease), box-shadow 160ms;
}
.cta svg { width: 18px; height: 18px; fill: currentColor; transition: transform 160ms var(--ease); }
.cta:hover { background: var(--cta-hover); box-shadow: 0 10px 22px -14px var(--cta); }
.cta:hover svg { transform: translateX(3px); }
.cta:active { transform: translateY(1px); }
.cta__sub { font-size: .8125rem; color: var(--ink-2); text-align: center; margin-top: -4px; }

.legal { font-size: .75rem; line-height: 1.45; color: var(--ink-2); border-top: 1px solid var(--line); padding-top: 8px; }

/* Заметки для менеджера (прототип) */
.note { display: none; background: var(--note); border: 1px solid var(--note-line); border-radius: 10px; padding: 8px 10px 8px 12px; font-size: .875rem; }
.note b { display: block; font-size: .8125rem; margin-bottom: 2px; }
.note ul { margin: 0; padding-left: 16px; }
body.review .note { display: block; }
.manager { display: none; }
body.review .manager { display: block; }
.mq { margin: 12px 0 0; padding-left: 22px; display: grid; gap: 8px; }
.mq li { background: var(--note); border: 1px solid var(--note-line); border-radius: 10px; padding: 8px 12px; }

/* Резерв */
.reserve { margin-top: 12px; }
.reserve > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  min-height: 52px; padding: 0 16px; border: 1px dashed var(--line-strong); border-radius: var(--r-card); font-weight: 650;
}
.reserve > summary::-webkit-details-marker { display: none; }
.reserve > summary span { font-weight: 500; color: var(--ink-2); font-size: .875rem; margin-right: auto; margin-left: 8px; }
.reserve > summary::after { content: "+"; font-size: 1.25rem; font-weight: 500; }
.reserve[open] > summary::after { content: "−"; }
.offer-list--reserve { margin-top: 12px; }

/* Возврат после заявки */
.return { background: #fff; border: 2px solid var(--accent); border-radius: var(--r-card); padding: 14px; margin-bottom: 12px; }
body[data-theme="yellow"] .return { border-color: var(--ink); }
.return:not([hidden]) { animation: slide 280ms var(--ease); }
@keyframes slide { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.return__head { display: grid; grid-template-columns: 32px 1fr 32px; gap: 10px; align-items: start; }
.return__check { width: 32px; height: 32px; border-radius: 50%; background: var(--pos); display: grid; place-items: center; }
.return__check svg { width: 20px; height: 20px; fill: var(--pos-ink); }
.return__title { font-weight: 750; font-size: 1.0625rem; }
.return__text { font-size: .875rem; color: var(--ink-2); margin-top: 2px; }
.return__close { width: 32px; height: 32px; border: 0; background: transparent; border-radius: 8px; font-size: 1.5rem; line-height: 1; color: var(--ink-2); }
.return__close:hover { background: var(--soft); }
.return__list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.mini { display: grid; grid-template-columns: 36px 1fr auto; gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: 12px; padding: 8px 8px 8px 10px; }
.mini .logo { width: 36px; height: 36px; border-radius: 10px; font-size: .8125rem; }
.mini__name { font-weight: 700; font-size: .9375rem; }
.mini__sub { font-size: .8125rem; color: var(--ink-2); }
.mini .cta { min-height: 44px; font-size: .9375rem; padding: 0 14px; }

/* ───────── Секции ───────── */
.section { padding: 40px 0; }
.section h2 { font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.375rem); font-weight: 750; letter-spacing: -.03em; }
.section__sub { color: var(--ink-2); margin-top: 6px; font-size: .9375rem; }

/* «Как подать заявки» — выделенная панель */
.advice {
  background: var(--accent-soft); border-radius: 24px; padding: 24px 18px;
  position: relative; overflow: hidden;
}
.advice::before {
  content: ""; position: absolute; right: -80px; top: -120px; width: 320px; height: 320px; border-radius: 50%;
  background: radial-gradient(closest-side, var(--glow-1), transparent); pointer-events: none;
}
.steps { list-style: none; margin: 20px 0 0; padding: 0; display: grid; gap: 10px; counter-reset: s; position: relative; }
.steps li { counter-increment: s; background: #fff; border-radius: 16px; padding: 16px 16px 16px 60px; position: relative; }
.steps li::before {
  content: counter(s); position: absolute; left: 16px; top: 16px; width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 750; font-size: .9375rem;
}
.steps h3 { font-size: 1.0625rem; font-weight: 700; letter-spacing: -.01em; }
.steps p { color: var(--ink-2); margin-top: 4px; font-size: .9375rem; }
.advice__foot { margin-top: 16px; display: grid; gap: 14px; align-items: center; position: relative; }
.callout { font-size: .875rem; color: var(--ink-2); max-width: 62ch; }

.to-list {
  justify-self: start; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px;
  border-radius: var(--r-pill); background: var(--ink); color: #fff; text-decoration: none; font-weight: 650; font-size: .9375rem;
}
.to-list svg { width: 16px; height: 16px; fill: currentColor; }

.faq { max-width: 820px; }
.faq__list { margin-top: 14px; border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; gap: 12px; padding: 16px 0; font-weight: 650; font-size: 1.0625rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-weight: 400; font-size: 1.5rem; line-height: 1; color: var(--ink-2); transition: transform var(--t) var(--ease); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding: 0 0 16px; color: var(--ink-2); max-width: 68ch; }

/* ───────── Финальный блок (по мотивам payy.network) ───────── */
.final {
  position: relative; overflow: hidden; color: #fff; background-color: var(--accent-deep);
  background-image:
    radial-gradient(70% 60% at 80% 10%, rgba(255, 255, 255, .22), transparent 70%),
    radial-gradient(60% 70% at 10% 90%, rgba(0, 0, 0, .35), transparent 70%),
    repeating-linear-gradient(112deg, rgba(255, 255, 255, .07) 0 1px, transparent 1px 9px),
    repeating-linear-gradient(22deg, rgba(255, 255, 255, .035) 0 1px, transparent 1px 13px);
}
body[data-theme="yellow"] .final { background-image:
    radial-gradient(70% 60% at 80% 10%, rgba(255, 194, 26, .22), transparent 70%),
    repeating-linear-gradient(112deg, rgba(255, 255, 255, .05) 0 1px, transparent 1px 9px); }
.final__art { position: absolute; inset: 0; pointer-events: none; display: flex; align-items: center; justify-content: center; }
.final__word {
  font-size: 26vw; font-weight: 800; letter-spacing: -.06em; line-height: .8; white-space: nowrap;
  color: transparent; -webkit-text-stroke: 1.5px rgba(255, 255, 255, .22);
  transform: translateY(8%);
}
.final__cta { position: relative; padding-top: 72px; padding-bottom: 72px; display: grid; gap: 14px; justify-items: start; }
.final__kicker { font-size: .8125rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; opacity: .8; }
.final__title { font-size: clamp(1.875rem, 1.1rem + 3.4vw, 3.75rem); font-weight: 750; letter-spacing: -.035em; max-width: 16ch; }
.final__btn {
  margin-top: 8px; display: inline-flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 22px;
  background: var(--final-btn); color: var(--final-btn-ink); border-radius: var(--r-btn); text-decoration: none; font-weight: 700; font-size: 1.0625rem;
  transition: transform 160ms var(--ease), box-shadow 160ms;
}
.final__btn svg { width: 18px; height: 18px; fill: currentColor; transition: transform 160ms var(--ease); }
.final__btn:hover { box-shadow: 0 14px 30px -14px rgba(0, 0, 0, .6); }
.final__btn:hover svg { transform: translateY(-2px); }

.final__panel {
  position: relative; background: rgba(8, 8, 26, .42);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border-top: 1px solid rgba(255, 255, 255, .14); padding: 32px 0 calc(88px + env(safe-area-inset-bottom));
}
.final__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px 16px; }
.final__brand { grid-column: 1 / -1; }
.brand--light { color: #fff; margin: 0; }
.final__brand p { margin-top: 10px; font-size: .875rem; color: rgba(255, 255, 255, .75); max-width: 40ch; }
.final__col { display: grid; gap: 8px; align-content: start; font-size: .9375rem; }
.final__h { font-weight: 700; font-size: .875rem; margin-bottom: 2px; }
.final__col a { color: rgba(255, 255, 255, .75); text-decoration: none; }
.final__col a:hover { color: #fff; text-decoration: underline; }
.final__legal { margin-top: 28px; padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, .12); display: grid; gap: 8px; font-size: .8125rem; color: rgba(255, 255, 255, .7); }
.final__warn { color: #fff; font-weight: 600; font-size: .875rem; }

/* ───────── Окно «Как работает расчёт» ───────── */
.how {
  border: 0; padding: 0; border-radius: 22px; width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 32px);
  box-shadow: 0 30px 80px -30px rgba(15, 18, 34, .5); color: var(--ink);
}
.how::backdrop { background: rgba(15, 18, 34, .45); }
.how[open] { animation: pop 220ms var(--ease); }
.how__in { padding: 20px 20px 22px; display: grid; gap: 12px; }
.how__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.how h2 { font-size: 1.375rem; font-weight: 750; }
.how p { color: var(--ink-2); font-size: .9375rem; }
.how__close { width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--soft); font-size: 1.5rem; line-height: 1; color: var(--ink-2); }
.formula { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 8px; font-size: 1.125rem; color: var(--ink) !important; font-weight: 600; background: var(--accent-soft); border-radius: 14px; padding: 12px 14px; }
.formula span { background: #fff; border-radius: 8px; padding: 2px 8px; }
.formula strong { font-size: 1.375rem; font-weight: 800; }
.how__facts { margin: 0; display: grid; gap: 6px; }
.how__facts div { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); padding: 6px 0; }
.how__facts dt { color: var(--ink-2); font-size: .875rem; }
.how__facts dd { margin: 0; font-weight: 650; font-size: .875rem; text-align: right; }
.how__note { font-size: .8125rem !important; }

/* ───────── Появление при прокрутке (как на zapier.com/pricing: 24 px снизу, 0,5 с прозрачность, 1 с движение) ───────── */
.js .reveal { opacity: 0; translate: 0 24px; }
.js .reveal.is-in { opacity: 1; translate: 0 0; transition: opacity .5s linear, translate 1s var(--ease); }
.js .card.reveal.is-in { transition: opacity .5s linear, translate 1s var(--ease), border-color var(--t), background-color 600ms var(--ease), box-shadow var(--t); }
.js .reveal.no-anim { transition: none !important; }

/* ───────── Плавающая кнопка и тост ───────── */
.back-to-list {
  position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 30;
  display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 18px;
  background: var(--ink); color: #fff; text-decoration: none; border-radius: var(--r-pill);
  font-size: .9375rem; font-weight: 600; box-shadow: 0 10px 24px -8px rgba(15, 18, 34, .5); white-space: nowrap;
}
.back-to-list svg { width: 18px; height: 18px; fill: currentColor; }
.toast {
  position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 60; max-width: min(92vw, 420px);
  background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 12px; font-size: .875rem; text-align: center;
}

/* ───────── Планшет и десктоп ───────── */
@media (min-width: 720px) {
  .wrap { padding: 0 24px; }
  .hero { padding: 48px 0 10px; }
  .hero__lead { font-size: 1.125rem; margin-top: 12px; }
  .steps { grid-template-columns: repeat(3, 1fr); }
  .advice { padding: 36px 32px; border-radius: 28px; }
  .advice__foot { grid-template-columns: 1fr auto; }
  .final__grid { grid-template-columns: 1.6fr 1fr 1fr 1fr; }
  .final__brand { grid-column: auto; }
  .final__cta { padding-top: 110px; padding-bottom: 110px; }
}

@media (min-width: 960px) {
  :root { --header-h: 68px; }
  .nav { display: flex; }
  .sum-chip { display: none !important; }
  .head-cta { display: inline-flex !important; }
  .brand { margin-right: 0; }
  .nav { margin: 0 auto; }
  .layout { grid-template-columns: 340px minmax(0, 1fr); gap: 24px; align-items: start; padding-top: 24px; padding-bottom: 56px; }
  /* Калькулятор держится сбоку, пока не закончатся карточки (sticky внутри .layout) */
  .picker-slot { position: sticky; top: calc(var(--header-h) + 16px); }
  .picker { padding: 20px; gap: 14px; }
  .chips { gap: 5px; }
  .chip { font-size: .8125rem; }
  .card {
    grid-template-columns: minmax(0, 1fr) 260px;
    grid-template-areas:
      "head  head"
      "money side"
      "terms side"
      "badges side"
      "facts side"
      "extra extra"
      "legal legal";
    column-gap: 24px; padding: 18px 20px;
  }
  .card__head { grid-area: head; }
  .money { grid-area: money; }
  .terms { grid-area: terms; }
  .badges { grid-area: badges; }
  .facts-line { grid-area: facts; }
  .card__side { grid-area: side; align-content: center; }
  .card__extra { grid-area: extra; }
  .legal { grid-area: legal; }
  .cta__sub { margin-top: 0; }
  .cta { font-size: 1rem; padding: 0 14px; }
  .back-to-list { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
  .js .reveal { opacity: 1; translate: none; }
}

/* ───────── v4 ───────── */
body[data-theme="violet"] .brand__mark::after { background: var(--pos); }
body[data-theme="mandarin"] .brand__mark { background: var(--ink); }
body[data-theme="mandarin"] .brand__mark::after { background: var(--accent); }

/* Логотип-плашка (рисуется скриптом в цветах бренда) */
.logo { overflow: hidden; padding: 0; background: transparent; }
.logo svg { width: 100%; height: 100%; display: block; }

/* Условия МФО — читаемые плитки с иконками (п. 7) */
.facts-line {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 6px; font-size: .875rem; color: var(--ink);
}
.facts-line li { padding: 7px 10px 7px 34px; background: var(--soft); border-radius: 10px; font-weight: 550; line-height: 1.3; min-height: 34px; display: flex; align-items: center; }
.facts-line li::before { display: none; }
.facts-line li svg { position: absolute; left: 10px; top: 50%; translate: 0 -50%; width: 16px; height: 16px; fill: var(--ink-2); }
.facts-line li.is-hit { background: var(--pos); color: var(--pos-ink); }
.facts-line li.is-hit svg { fill: var(--pos-ink); }

/* Режим «По 2 в ряд» (вопрос 33): карточка складывается как на телефоне */
@media (min-width: 1100px) {
  body[data-layout="grid"] .wrap { max-width: 1280px; }
  body[data-layout="grid"] .offer-list { grid-template-columns: 1fr 1fr; align-items: stretch; }
  body[data-layout="grid"] .card { grid-template-columns: 1fr; grid-template-areas: none; padding: 16px; align-content: start; }
  body[data-layout="grid"] .card > * { grid-area: auto; }
  body[data-layout="grid"] .card__side { order: 3; }
  body[data-layout="grid"] .money__val { font-size: 1.25rem; }
  body[data-layout="grid"] .facts-line { grid-template-columns: 1fr; }
  body[data-layout="grid"] .return-slot { grid-column: 1 / -1; }
}

/* Реквизиты в подвале */
.final__req { color: rgba(255, 255, 255, .85); }

/* Уведомление о cookie */
.cookie {
  position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 55; margin: 0 auto; max-width: 720px;
  display: flex; gap: 12px; align-items: center; background: var(--ink); color: #fff; border-radius: 16px; padding: 12px 12px 12px 16px;
  font-size: .875rem; box-shadow: 0 18px 40px -16px rgba(15, 18, 34, .6); animation: pop 240ms var(--ease);
}
.cookie a { color: #fff; }
.cookie__btn { flex: none; border: 0; border-radius: 10px; min-height: 40px; padding: 0 16px; font-weight: 700; background: var(--final-btn); color: var(--final-btn-ink); }
body.has-cookie .back-to-list { bottom: 96px; }

.how-btn { white-space: nowrap; }
.picker__foot { flex-wrap: wrap; }

/* ───────── Документы (политики) ───────── */
.doc-page { background: var(--bg); }
.doc { max-width: 820px; margin: 0 auto; padding: 32px 16px 80px; }
.doc__back { display: inline-flex; gap: 6px; align-items: center; color: var(--link); font-weight: 600; text-decoration: none; margin-bottom: 18px; }
.doc__draft { background: #FFE3E0; color: #7A1E12; border-radius: 12px; padding: 10px 14px; font-weight: 600; font-size: .9375rem; margin-bottom: 18px; }
.doc h1 { font-size: clamp(1.75rem, 1.2rem + 2vw, 2.5rem); font-weight: 750; letter-spacing: -.03em; }
.doc__meta { color: var(--ink-2); margin-top: 8px; font-size: .9375rem; }
.doc h2 { font-size: 1.25rem; font-weight: 700; margin: 30px 0 10px; letter-spacing: -.01em; }
.doc p, .doc li { color: #2B2F40; font-size: 1rem; line-height: 1.6; }
.doc p + p { margin-top: 10px; }
.doc ul, .doc ol { padding-left: 22px; margin: 8px 0; }
.doc li + li { margin-top: 4px; }
.doc table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: .875rem; background: var(--surface); border-radius: 12px; overflow: hidden; }
.doc th, .doc td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.doc th { background: var(--soft); font-weight: 650; }
.doc__table { overflow-x: auto; }
.doc .chk { background: #FFF4CC; border-radius: 4px; padding: 0 4px; font-weight: 600; }

/* ───────── v5 ───────── */
/* Настоящие логотипы МФО */
.logo img { width: 100%; height: 100%; display: block; object-fit: cover; }
.logo:has(img) { background: #fff; box-shadow: inset 0 0 0 1px var(--line); }
.logo:has(img[src$=".svg"]) img { object-fit: contain; }
.logo:has(img[src*="nebus"]) { padding: 6px; }
.logo:has(img[src*="webbankir"]) { padding: 2px; }

/* Карточка, которая не подходит под сумму и срок: расчёт на условиях МФО (п. 6) */
.money--alt { background: color-mix(in srgb, var(--accent) 7%, #fff); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 22%, transparent); }
.money__alt { grid-column: 1 / -1; font-size: .875rem; color: var(--ink); margin-bottom: 4px; }
.money__alt b { font-weight: 700; }
.money__apply {
  grid-column: 1 / -1; justify-self: start; margin-top: 6px; min-height: 40px; padding: 0 14px;
  border: 1.5px solid var(--ink); border-radius: var(--r-pill); background: #fff; color: var(--ink);
  font: inherit; font-weight: 650; font-size: .875rem; cursor: pointer; transition: background-color var(--t);
}
.money__apply:hover { background: var(--soft); }

/* Телефон: шапка непрозрачная и перекрывает всё, что ушло под неё (п. 17) */
@media (max-width: 959px) {
  .site-header { padding-top: env(safe-area-inset-top); height: calc(var(--header-h) + env(safe-area-inset-top)); }
  .site-header.is-scrolled {
    background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none;
    border-bottom-color: var(--line); box-shadow: 0 6px 18px -12px rgba(15, 18, 34, .35);
  }
  /* сводка «сумма · срок» — заметная кнопка в цвете акцента */
  .sum-chip {
    background: var(--cta); color: var(--cta-ink); border-color: var(--cta);
    box-shadow: 0 6px 16px -8px color-mix(in srgb, var(--cta) 70%, transparent);
    padding: 0 12px 0 16px; min-height: 44px;
  }
  .sum-chip svg { fill: currentColor; }
  .sum-chip__edit { font-weight: 600; opacity: .85; font-size: .8125rem; padding-left: 8px; margin-left: 2px; border-left: 1px solid color-mix(in srgb, currentColor 35%, transparent); }
}
.final__req a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
p.chk { display: block; padding: 10px 12px; border-radius: 10px; font-weight: 500; }

/* ───────── Версия для модерации (04.12.2026) ───────── */
.badge--example { background: var(--soft); color: var(--ink-2); border: 1px dashed var(--line-strong); }
.card[data-card^="example"] .logo { background: var(--soft); border-radius: 12px; }
.cta--off { background: var(--soft); color: var(--ink-2); cursor: not-allowed; box-shadow: none; }
.cta--off:hover { background: var(--soft); box-shadow: none; }
.premod-note { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 14px 16px; margin-bottom: 12px; font-size: .9375rem; color: var(--ink-2); }
.premod-note b { color: var(--ink); display: block; margin-bottom: 2px; }
.check { display: grid; gap: 10px; margin-top: 18px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.check > div { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px; }
.check h3 { font-size: 1.0625rem; font-weight: 700; letter-spacing: -.01em; }
.check p { color: var(--ink-2); margin-top: 6px; font-size: .9375rem; }
.check a { color: var(--link); }
.cookie { flex-wrap: wrap; }
.cookie p { flex: 1 1 260px; }
.cookie__btns { display: flex; gap: 8px; flex: none; }
.cookie__btn--no { background: transparent; color: #fff; border: 1px solid rgba(255, 255, 255, .55); }
.final__col button.linklike { background: none; border: 0; padding: 0; font: inherit; color: rgba(255, 255, 255, .75); text-align: left; cursor: pointer; }
.final__col button.linklike:hover { color: #fff; text-decoration: underline; }
.doc .doc__back { margin-bottom: 18px; }
