/* ==========================================================================
   zayavka-na-kredit.su — дизайн-система

   Содержание:
   1. Токены
   2. Цвета блоков (card-color-*)  — независимые от смысла блока
   3. База и типографика
   4. Раскладка
   5. Компоненты
   6. Адаптив
   ========================================================================== */

/* 1. Токены ================================================================ */

:root {
    /* Палитра: только лиловый, серебро и золото — тёплых оттенков нет */
    --violet: #6c5ce7;
    --violet-dark: #5a49d6;
    --violet-deep: #453a94;
    --violet-050: #efecfd;
    /* Золото держим жёлтым, а не рыжим: разница R−G мала, иначе читается
       как оранжевый. Тон притемнён, чтобы белый текст проходил по контрасту. */
    --gold: #ad8e22;
    --gold-deep: #9c7d18;
    --silver: #78788a;
    --silver-deep: #6f6f82;
    --silver-light: #dcdce4;
    --silver-soft: #f0f0f5;
    --graphite: #2f2f3d;

    /* Поверхности и текст */
    --page: #f4f4f8;
    --surface: #ffffff;
    --ink: #1b1b23;
    --muted: #7a7a8c;
    --line: #e7e7ee;

    /* Метрики */
    --max-width: 1160px;
    --gap: 16px;
    --radius-sm: 10px;
    --radius: 16px;
    --radius-lg: 22px;
    --shadow: 0 1px 2px rgba(27, 27, 35, .04), 0 8px 24px rgba(27, 27, 35, .05);
    --shadow-hover: 0 2px 6px rgba(27, 27, 35, .06), 0 16px 40px rgba(27, 27, 35, .1);

    /* Мягкие «приподнятые» тени — блокам, иконкам и надписям на цветном */
    --shadow-block: 0 1px 2px rgba(27, 27, 35, .05), 0 6px 18px rgba(27, 27, 35, .07);
    --shadow-tile: 0 1px 2px rgba(27, 27, 35, .06), 0 4px 10px rgba(27, 27, 35, .08);
    --shadow-text: 0 1px 2px rgba(22, 22, 32, .22);

    --transition: .18s ease;
}

/* 2. Цвета блоков ==========================================================
   Класс задаёт только окраску: фон, цвет текста, приглушённый текст и фон
   вложенных чипов. Форму и размеры задаёт компонент (.card, .tile__icon,
   .partner__logo). Поэтому один и тот же card-color-gold работает и на
   большой карточке, и на квадратной иконке 44×44.
   Названия — по цвету, а не по назначению: любой блок перекрашивается
   заменой одного класса.
   ========================================================================== */

.card-color-white,
.card-color-violet,
.card-color-indigo,
.card-color-gold,
.card-color-silver,
.card-color-silver-light,
.card-color-graphite,
.card-color-dark {
    background: var(--card-bg);
    color: var(--card-fg);
    text-shadow: var(--card-text-shadow, none);
}

.card-color-white {
    --card-bg: var(--surface);
    --card-fg: var(--ink);
    --card-fg-muted: var(--muted);
    --card-chip-bg: var(--silver-soft);
    --card-chip-fg: var(--ink);
    --card-border: var(--line);
}

.card-color-violet {
    --card-bg: linear-gradient(135deg, #7b6bf0 0%, var(--violet) 55%, #5f4ede 100%);
    --card-fg: #ffffff;
    --card-fg-muted: rgba(255, 255, 255, .72);
    --card-chip-bg: rgba(255, 255, 255, .18);
    --card-chip-fg: #ffffff;
    --card-border: transparent;
    --card-text-shadow: var(--shadow-text);
}

/* Тёмно-лиловый — самый глубокий тон лиловой ветки */
.card-color-indigo {
    --card-bg: linear-gradient(135deg, #514499 0%, var(--violet-deep) 100%);
    --card-fg: #ffffff;
    --card-fg-muted: rgba(255, 255, 255, .7);
    --card-chip-bg: rgba(255, 255, 255, .16);
    --card-chip-fg: #ffffff;
    --card-border: transparent;
    --card-text-shadow: var(--shadow-text);
}

/* Золото притемнено, чтобы белый текст читался */
.card-color-gold {
    --card-bg: linear-gradient(135deg, #c2a02c 0%, var(--gold) 55%, var(--gold-deep) 100%);
    --card-fg: #ffffff;
    --card-fg-muted: rgba(255, 255, 255, .9);
    --card-chip-bg: rgba(255, 255, 255, .24);
    --card-chip-fg: #ffffff;
    --card-border: transparent;
    --card-text-shadow: var(--shadow-text);
}

/* Холодное серебро — без тёплой примеси: R, G и B в тоне равны */
.card-color-silver {
    --card-bg: linear-gradient(135deg, #85859a 0%, var(--silver) 60%, var(--silver-deep) 100%);
    --card-fg: #ffffff;
    --card-fg-muted: rgba(255, 255, 255, .9);
    --card-chip-bg: rgba(255, 255, 255, .24);
    --card-chip-fg: #ffffff;
    --card-border: transparent;
    --card-text-shadow: var(--shadow-text);
}

/* Светлое серебро — для блоков, которые должны быть легче основного */
.card-color-silver-light {
    --card-bg: linear-gradient(135deg, #eeeef3 0%, var(--silver-light) 100%);
    --card-fg: var(--ink);
    --card-fg-muted: var(--muted);
    --card-chip-bg: rgba(255, 255, 255, .78);
    --card-chip-fg: var(--ink);
    --card-border: transparent;
}

.card-color-dark {
    --card-bg: linear-gradient(135deg, #26262f 0%, #17171d 100%);
    --card-fg: #ffffff;
    --card-fg-muted: rgba(255, 255, 255, .6);
    --card-chip-bg: rgba(255, 255, 255, .12);
    --card-chip-fg: #ffffff;
    --card-border: transparent;
    --card-text-shadow: var(--shadow-text);
}

.card-color-graphite {
    --card-bg: linear-gradient(135deg, #3b3b4d 0%, var(--graphite) 100%);
    --card-fg: #ffffff;
    --card-fg-muted: rgba(255, 255, 255, .66);
    --card-chip-bg: rgba(255, 255, 255, .14);
    --card-chip-fg: #ffffff;
    --card-border: transparent;
    --card-text-shadow: var(--shadow-text);
}

/* Уровень «Серебро» на макете почти без перехода — придерживаем градиент.
   Модификатор цветовой, не смысловой: годится любому блоку. */
.card-color-silver.card-color-flat {
    --card-bg: linear-gradient(135deg, #7d7d90 0%, #757587 100%);
}

.card-color-gold.card-color-flat {
    --card-bg: linear-gradient(135deg, #ab8b20 0%, #a4851c 100%);
}

/* 3. База ================================================================== */

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', Roboto, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.55;
    color: var(--ink);
    background: var(--page);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
    margin: 0;
    line-height: 1.2;
    letter-spacing: -.02em;
    font-weight: 700;
}

h1 { font-size: 40px; }
h2 { font-size: 26px; }
h3 { font-size: 18px; }

p { margin: 0; }

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition), opacity var(--transition);
}

ul { margin: 0; padding: 0; list-style: none; }

img, svg { max-width: 100%; display: block; }

button { font: inherit; cursor: pointer; }

.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* 4. Раскладка ============================================================= */

.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

.page {
    max-width: calc(var(--max-width) + 40px);
    margin: 0 auto;
    padding: 12px 20px 32px;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.section__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.section__note {
    font-size: 13px;
    color: var(--muted);
}

.grid {
    display: grid;
    gap: var(--gap);
}

/* 5. Компоненты ============================================================ */

/* --- Карточка --- */

.card {
    border-radius: var(--radius);
    border: 1px solid var(--card-border, var(--line));
    padding: 22px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-block);
}

.card--flat { box-shadow: none; }
.card--pad-lg { padding: 28px; }

.card__muted { color: var(--card-fg-muted); }

/* Декоративный блик на цветных карточках.
   position/overflow заданы здесь, а не только в .card: модификатор вешают и на
   блоки без .card, и без них блик вылезает за документ и даёт горизонтальный скролл. */
.card--glow {
    position: relative;
    overflow: hidden;
}

.card--glow::after {
    content: '';
    position: absolute;
    right: -60px;
    bottom: -90px;
    width: 260px;
    height: 260px;
    border-radius: 40px;
    background: rgba(255, 255, 255, .10);
    transform: rotate(24deg);
    pointer-events: none;
}

/* --- Кнопки --- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 44px;
    padding: 0 22px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    transition: background var(--transition), color var(--transition),
                border-color var(--transition), transform var(--transition),
                box-shadow var(--transition);
}

.btn:active { transform: translateY(1px); }

.btn--primary {
    background: var(--violet);
    color: #fff;
    box-shadow: 0 6px 18px rgba(108, 92, 231, .28);
}

.btn--primary:hover { background: var(--violet-dark); }

.btn--white {
    background: #fff;
    color: var(--ink);
}

.btn--white:hover { background: rgba(255, 255, 255, .88); }

.btn--ghost {
    background: transparent;
    border-color: var(--line);
    color: var(--ink);
}

.btn--ghost:hover { border-color: var(--violet); color: var(--violet); }

.btn--sm { height: 36px; padding: 0 16px; font-size: 13px; }
.btn--block { width: 100%; }

/* --- Чипы и бейджи --- */

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--card-chip-bg, var(--silver-soft));
    color: var(--card-chip-fg, var(--ink));
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

/* --- Шапка --- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 30;
    background: rgba(244, 244, 248, .88);
    backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid transparent;
}

.site-header__inner {
    max-width: calc(var(--max-width) + 40px);
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 24px;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -.02em;
    flex-shrink: 0;
}

.logo__mark {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #7b6bf0, var(--violet));
    color: #fff;
    flex-shrink: 0;
    box-shadow: var(--shadow-tile);
}

.logo__mark svg { width: 14px; height: 14px; }

.logo__text b { font-weight: 700; }
.logo__text span { font-weight: 400; color: var(--muted); }

.nav {
    display: flex;
    align-items: center;
    gap: 22px;
    font-size: 14px;
    margin-right: auto;
}

.nav a { color: var(--muted); }
.nav a:hover { color: var(--ink); }
.nav a.is-active { color: var(--ink); font-weight: 600; }

.header-contact {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1.25;
}

.header-contact__phone { font-size: 14px; font-weight: 600; }
.header-contact__note { font-size: 11px; color: var(--muted); }

.burger {
    display: none;
    width: 40px;
    height: 40px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    align-items: center;
    justify-content: center;
}

.burger span {
    display: block;
    width: 16px;
    height: 1.5px;
    background: var(--ink);
    position: relative;
}

.burger span::before,
.burger span::after {
    content: '';
    position: absolute;
    left: 0;
    width: 16px;
    height: 1.5px;
    background: var(--ink);
}

.burger span::before { top: -5px; }
.burger span::after { top: 5px; }

/* --- Первый экран --- */

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.72fr) minmax(0, 1fr);
    gap: var(--gap);
}

.hero__aside {
    display: grid;
    gap: var(--gap);
    grid-template-rows: 1fr 1fr;
}

.hero__main {
    min-height: 320px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 24px;
    padding: 28px;
}

.hero__title {
    font-size: 40px;
    max-width: 15ch;
}

.hero__lead {
    margin-top: 12px;
    max-width: 44ch;
    font-size: 14px;
    color: var(--card-fg-muted);
}

.hero__actions {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.hero__note { font-size: 12px; color: var(--card-fg-muted); }

.hero__card-title { font-size: 15px; font-weight: 700; }

.hero__card-text {
    margin-top: 8px;
    font-size: 13px;
    color: var(--card-fg-muted);
    max-width: 34ch;
}

.hero__aside .card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 18px;
}

/* --- Плитки категорий --- */

.tiles {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 12px;
}

.tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    padding: 18px 10px 16px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    text-align: center;
    box-shadow: var(--shadow-block);
    transition: transform var(--transition), box-shadow var(--transition),
                border-color var(--transition);
}

.tile:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
    border-color: transparent;
}

.tile__icon {
    width: 44px;
    height: 44px;
    border-radius: 13px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    box-shadow: var(--shadow-tile);
}

.tile__icon svg { width: 20px; height: 20px; }

.tile__title { font-size: 12px; font-weight: 500; color: var(--muted); }

.tile.is-active .tile__title { color: var(--ink); font-weight: 600; }

/* --- Табы --- */

.tabs {
    display: flex;
    gap: 22px;
    border-bottom: 1px solid var(--line);
    overflow-x: auto;
    scrollbar-width: none;
}

.tabs::-webkit-scrollbar { display: none; }

.tab {
    position: relative;
    padding: 0 0 10px;
    border: 0;
    background: none;
    font-size: 14px;
    color: var(--muted);
    white-space: nowrap;
    transition: color var(--transition);
}

.tab::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 2px;
    border-radius: 2px;
    background: transparent;
    transition: background var(--transition);
}

.tab:hover { color: var(--ink); }

.tab.is-active { color: var(--ink); font-weight: 600; }
.tab.is-active::after { background: var(--violet); }

/* --- Калькулятор --- */

.calc {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
    gap: var(--gap);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-block);
}

.calc__form {
    padding: 26px;
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.field__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.field__label { font-size: 13px; color: var(--muted); }

.field__value { font-size: 22px; font-weight: 700; letter-spacing: -.02em; }

.field__limits {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 11px;
    color: var(--muted);
}

/* Слайдер */

.range {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 999px;
    background: linear-gradient(var(--violet), var(--violet)) 0 / var(--range-fill, 40%) 100% no-repeat,
                var(--silver);
    outline: none;
}

.range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #fff;
    border: 6px solid var(--violet);
    box-shadow: 0 2px 8px rgba(108, 92, 231, .35);
    cursor: pointer;
    transition: transform var(--transition);
}

.range::-webkit-slider-thumb:hover { transform: scale(1.08); }

.range::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #fff;
    border: 6px solid var(--violet);
    box-shadow: 0 2px 8px rgba(108, 92, 231, .35);
    cursor: pointer;
}

.range:focus-visible { box-shadow: 0 0 0 3px var(--violet-050); }

/* Переключатель срока */

.segmented {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.segmented__item {
    height: 40px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    font-size: 13px;
    color: var(--ink);
    transition: background var(--transition), border-color var(--transition),
                color var(--transition);
}

.segmented__item:hover { border-color: var(--violet); color: var(--violet); }

.segmented__item.is-active {
    background: var(--violet);
    border-color: var(--violet);
    color: #fff;
    font-weight: 600;
}

/* Поля ввода */

.inputs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.input,
.textarea {
    width: 100%;
    height: 44px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    color: var(--ink);
    font: inherit;
    font-size: 14px;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.textarea { height: auto; padding: 12px 14px; resize: vertical; min-height: 96px; }

.input::placeholder,
.textarea::placeholder { color: #b3b3c2; }

.input:focus,
.textarea:focus {
    outline: none;
    border-color: var(--violet);
    box-shadow: 0 0 0 3px var(--violet-050);
}

.input.is-error,
.textarea.is-error { border-color: #d6455d; }

.field-error { margin-top: 6px; font-size: 12px; color: #d6455d; }

/* Результат расчёта */

.calc__result {
    padding: 26px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 18px;
    border-radius: 0;
}

.calc__result-label { font-size: 12px; color: var(--card-fg-muted); }

.calc__result-value {
    font-size: 34px;
    font-weight: 700;
    letter-spacing: -.03em;
    line-height: 1.1;
}

.calc__result-note { font-size: 12px; color: var(--card-fg-muted); }

/* --- Таблица предложений партнёров --- */

.offers-table-wrap {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-block);
    overflow: hidden;
}

.offers-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.offers-table thead th {
    padding: 14px 18px;
    background: linear-gradient(135deg, #7b6bf0 0%, var(--violet) 100%);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
}

.offers-table thead th:first-child { text-align: left; }

/* Сортировка по клику: стрелка показывает направление */
.offers-table thead th.is-sortable { cursor: pointer; user-select: none; }
.offers-table thead th.is-sortable::after {
    content: '↕';
    margin-left: 6px;
    opacity: .5;
    font-size: 11px;
}
.offers-table thead th[data-sort="asc"]::after { content: '↑'; opacity: 1; }
.offers-table thead th[data-sort="desc"]::after { content: '↓'; opacity: 1; }
.offers-table thead th.is-sortable:hover { background: rgba(255, 255, 255, .12); }

.offers-table tbody tr { border-top: 1px solid var(--line); }
.offers-table tbody tr:nth-child(even) { background: #fafafc; }
.offers-table tbody tr:hover { background: var(--violet-050); }

.offers-table td {
    padding: 18px;
    vertical-align: middle;
    text-align: center;
}

.offers-table td:first-child { text-align: left; }

/* Ширины: организация и особенности шире, служебные колонки узкие */
.offers-table td:nth-child(1) { width: 20%; }
.offers-table td:nth-child(2) { width: 20%; }
.offers-table td:nth-child(3) { width: 11%; }
.offers-table td:nth-child(4) { width: 14%; }
.offers-table td:nth-child(5) { width: 25%; text-align: left; }
.offers-table td:nth-child(6) { width: 10%; }

.offer__logo-img {
    width: 92px;
    height: 40px;
    object-fit: contain;
    flex-shrink: 0;
}

.offer__amount {
    display: block;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -.02em;
    /* Суммы вроде «100 000 — 40 000 000 ₽» длинные: без этого узкая колонка
       рвала их по словам в столбик */
    overflow-wrap: anywhere;
}
.offer__amount-note { display: block; margin-top: 4px; font-size: 12px; color: var(--muted); }

.offer__features-title { font-weight: 600; margin-bottom: 4px; }

.offer__features { display: flex; flex-direction: column; gap: 2px; font-size: 13px; }

.offer__erid {
    margin-top: 8px;
    font-size: 11px;
    color: #a5a5b5;
    word-break: break-all;
}

.offers-table__cta { width: 100%; max-width: 150px; }

/* --- Список предложений (старая карточная раскладка) --- */

.offers { display: flex; flex-direction: column; gap: 10px; }

.offer {
    display: grid;
    grid-template-columns: minmax(200px, 1.6fr) repeat(3, minmax(90px, .9fr)) auto;
    align-items: center;
    gap: 20px;
    padding: 16px 20px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-block);
    transition: box-shadow var(--transition), border-color var(--transition);
}

.offer:hover { box-shadow: var(--shadow-hover); border-color: transparent; }

.offer__brand { display: flex; align-items: center; gap: 12px; min-width: 0; }

.offer__logo {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    font-size: 15px;
    font-weight: 700;
    box-shadow: var(--shadow-tile);
}

.offer__name { font-size: 14px; font-weight: 600; }
.offer__note { font-size: 12px; color: var(--muted); }

.offer__label { font-size: 11px; color: var(--muted); }
.offer__value { font-size: 15px; font-weight: 600; margin-top: 2px; }

.offer__action { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.offer__approval { font-size: 11px; color: var(--muted); }

/* --- Уровни --- */

.levels {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
}

.level {
    min-height: 150px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 20px;
    padding: 18px;
}

.level__title { font-size: 14px; font-weight: 700; }
.level__condition { font-size: 11px; color: var(--card-fg-muted); margin-top: 2px; }

.level__value { font-size: 26px; font-weight: 700; letter-spacing: -.03em; }
.level__value--sm { font-size: 17px; line-height: 1.25; }
.level__note { font-size: 11px; color: var(--card-fg-muted); margin-top: 4px; }

/* --- Промо, статистика, отзывы --- */

.promo-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    gap: var(--gap);
    align-items: start;
}

.promo { display: flex; flex-direction: column; gap: 20px; height: 100%; }
.promo__text { font-size: 13px; color: var(--muted); max-width: 46ch; }

/* Иллюстрация карты — рисуем стилями, без картинки */
.card-visual {
    margin-top: auto;
    aspect-ratio: 16 / 9;
    border-radius: var(--radius);
    background:
        radial-gradient(120% 120% at 15% 10%, #ffffff 0%, #e9e9ef 45%, #d5d5de 100%);
    border: 1px solid var(--line);
    position: relative;
    overflow: hidden;
}

.card-visual::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(115deg, transparent 42%, rgba(255, 255, 255, .85) 50%, transparent 58%);
}

.card-visual__chip {
    position: absolute;
    left: 10%;
    bottom: 22%;
    width: 34px;
    height: 26px;
    border-radius: 6px;
    background: linear-gradient(135deg, #dcdce6, #b9b9c8);
}

.card-visual__mark {
    position: absolute;
    right: 9%;
    top: 16%;
    width: 26px;
    height: 26px;
    border-radius: 8px;
    background: var(--graphite);
}

.stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.stat__value { font-size: 26px; font-weight: 700; letter-spacing: -.03em; }
.stat__label { font-size: 12px; color: var(--muted); margin-top: 2px; }

.reviews { display: flex; flex-direction: column; gap: 12px; }

.review { padding: 16px 18px; border-radius: var(--radius); background: var(--silver-soft); }
.review__text { font-size: 13px; }
.review__author { margin-top: 8px; font-size: 11px; color: var(--muted); }

.side-stack { display: flex; flex-direction: column; gap: var(--gap); }

/* --- Аккордеон --- */

.faq {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-block);
}

.faq__item { border-bottom: 1px solid var(--line); }
.faq__item:last-child { border-bottom: 0; }

.faq__question {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 18px 22px;
    border: 0;
    background: none;
    text-align: left;
    font-size: 14px;
    font-weight: 500;
    color: var(--ink);
}

.faq__sign {
    position: relative;
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    color: var(--muted);
}

.faq__sign::before,
.faq__sign::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    background: currentColor;
    transform: translate(-50%, -50%);
    transition: opacity var(--transition), transform var(--transition);
}

.faq__sign::before { width: 12px; height: 1.5px; }
.faq__sign::after { width: 1.5px; height: 12px; }

.faq__item.is-open .faq__sign::after { opacity: 0; transform: translate(-50%, -50%) rotate(90deg); }

.faq__answer {
    display: none;
    padding: 0 22px 20px;
    font-size: 13px;
    color: var(--muted);
    max-width: 78ch;
}

.faq__item.is-open .faq__answer { display: block; }

/* --- CTA --- */

.cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
    padding: 30px;
}

.cta__title { font-size: 24px; }
.cta__text { margin-top: 8px; font-size: 13px; color: var(--card-fg-muted); }

/* --- Продуктовые страницы --- */

.page-hero {
    display: flex;
    flex-direction: column;
    gap: 22px;
    padding: 32px;
    min-height: 240px;
}

.page-hero__title { font-size: 36px; max-width: 18ch; }
.page-hero__lead { margin-top: 12px; font-size: 15px; color: var(--card-fg-muted); max-width: 52ch; }

.facts { display: flex; gap: 28px; flex-wrap: wrap; }
.fact__value { font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.fact__label { font-size: 12px; color: var(--card-fg-muted); }

.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.feature__title { font-size: 15px; font-weight: 600; }
.feature__text { margin-top: 8px; font-size: 13px; color: var(--muted); }

.checklist { display: flex; flex-direction: column; gap: 12px; }

.checklist li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
}

.checklist li::before {
    content: '';
    width: 18px;
    height: 18px;
    margin-top: 2px;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--violet-050) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236c5ce7' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center / 11px no-repeat;
}

/* Хлебные крошки */

.breadcrumbs { display: flex; gap: 8px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.breadcrumbs a:hover { color: var(--ink); }
.breadcrumbs span::after { content: '/'; margin-left: 8px; color: #c9c9d4; }
.breadcrumbs > :last-child::after { content: none; }

/* --- Форма заявки --- */

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid--full { grid-template-columns: 1fr; }

.form-field { display: flex; flex-direction: column; }
.form-field__label { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.form-field--wide { grid-column: 1 / -1; }

.form-note { font-size: 12px; color: var(--muted); max-width: 62ch; }

.alert {
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    background: #fdeaed;
    color: #a32e43;
    font-size: 13px;
}

/* --- Страница-статус (404, 500, спасибо) --- */

.status {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 18px;
    padding: 72px 24px;
}

.status__code { font-size: 60px; font-weight: 700; letter-spacing: -.04em; color: var(--violet); }
.status__text { color: var(--muted); max-width: 46ch; }

/* --- Подвал --- */

.site-footer {
    margin-top: 12px;
    padding: 36px 0 40px;
    border-top: 1px solid var(--line);
}

.footer-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr));
    gap: 28px;
}

.footer__about { margin-top: 14px; font-size: 12px; color: var(--muted); max-width: 40ch; }

.footer__title { font-size: 13px; font-weight: 600; margin-bottom: 12px; }

.footer__list { display: flex; flex-direction: column; gap: 9px; font-size: 13px; color: var(--muted); }
.footer__list a:hover { color: var(--ink); }

.footer__bottom {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
    font-size: 11px;
    color: var(--muted);
    max-width: 92ch;
}

/* 6. Адаптив =============================================================== */

@media (max-width: 1024px) {
    .hero { grid-template-columns: 1fr; }
    .hero__aside { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: none; }
    .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .levels { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .calc { grid-template-columns: 1fr; }
    .promo-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

    .offer {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        row-gap: 16px;
    }

    .offer__brand { grid-column: 1 / -1; }
    .offer__action { grid-column: 1 / -1; align-items: stretch; }
    .offer__action .btn { width: 100%; }
}

@media (max-width: 860px) {
    .nav { display: none; }
    .burger { display: flex; }

    .nav.is-open {
        display: flex;
        position: absolute;
        left: 12px;
        right: 12px;
        top: 68px;
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
        padding: 18px 20px;
        background: var(--surface);
        border: 1px solid var(--line);
        border-radius: var(--radius);
        box-shadow: var(--shadow-hover);
    }

    .site-header__inner { position: relative; }
    .header-contact { display: none; }
    .cols-3, .cols-2 { grid-template-columns: 1fr; }
    .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Таблица офферов на планшете: убираем шапку и раскладываем строки карточками */
@media (max-width: 900px) {
    .offers-table-wrap { background: none; border: 0; box-shadow: none; overflow: visible; }
    .offers-table, .offers-table tbody, .offers-table tr, .offers-table td { display: block; width: auto; }
    .offers-table thead { display: none; }

    .offers-table tbody tr {
        margin-bottom: 12px;
        padding: 16px 18px;
        background: var(--surface);
        border: 1px solid var(--line);
        border-radius: var(--radius);
        box-shadow: var(--shadow-block);
    }

    .offers-table tbody tr:nth-child(even),
    .offers-table tbody tr:hover { background: var(--surface); }

    /* :nth-child(n) — та же специфичность, что у процентных ширин выше,
       поэтому колонки сбрасываются: в карточке ширина не нужна */
    .offers-table td:nth-child(n) { width: auto; }

    .offers-table td,
    .offers-table td:first-child,
    .offers-table td:nth-child(5) {
        width: auto;
        padding: 8px 0;
        text-align: left;
        display: flex;
        gap: 16px;
        align-items: baseline;
        justify-content: space-between;
        border-top: 1px dashed var(--line);
    }

    .offers-table td:first-child { border-top: 0; padding-top: 0; display: block; }

    /* Подпись колонки берём из data-label — шапки на мобильных нет */
    .offers-table td[data-label]:not([data-label=""])::before {
        content: attr(data-label);
        flex-shrink: 0;
        font-size: 12px;
        color: var(--muted);
    }

    .offers-table td > *:not(:only-child) { text-align: right; }
    /* Значению нужно право сжиматься, иначе подпись слева выдавливает его
       в столбик по одному слову */
    .offers-table td > * { min-width: 0; }
    .offers-table td[data-label]:not([data-label=""])::before { flex: 0 0 auto; }

    .offers-table td[data-label="Особенности"] { display: block; }
    .offers-table td[data-label="Особенности"]::before { display: block; margin-bottom: 6px; }

    /* Ячейка кнопки: подписи нет, а во flex кнопка сжималась в кружок */
    .offers-table td[data-label=""] { display: block; }
    .offers-table__cta { max-width: none; width: 100%; margin-top: 4px; }
}

/* На телефоне подпись и значение встают друг под друга: в строку они
   не помещаются и ломаются по слогам */
@media (max-width: 620px) {
    .offers-table td,
    .offers-table td:first-child,
    .offers-table td:nth-child(5) {
        display: block;
        text-align: left;
    }

    .offers-table td[data-label]:not([data-label=""])::before {
        display: block;
        margin-bottom: 4px;
    }

    .offers-table td > *,
    .offers-table td > *:not(:only-child) { text-align: left; }
    .offer__value { font-size: 16px; }
}

@media (max-width: 600px) {
    h1, .hero__title { font-size: 28px; }
    h2 { font-size: 21px; }
    .page-hero__title { font-size: 26px; }

    .page { padding: 8px 12px 24px; gap: 20px; }
    .card { padding: 18px; }
    .hero__main, .page-hero, .calc__form, .calc__result { padding: 20px; }

    .hero__aside { grid-template-columns: 1fr; }
    .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .levels { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .inputs, .form-grid { grid-template-columns: 1fr; }
    .segmented { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stats { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
    .calc__result-value { font-size: 28px; }
    .offer { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cta { padding: 22px; }
}

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

/* Кат в списке предложений: остальное открывается кнопкой */
.is-hidden { display: none; }

/* Кнопка под катом — крупная и заметная: её должны увидеть, иначе часть
   предложений останется незамеченной */
.offers-more {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    max-width: 420px;
    margin: 22px auto 0;
    padding: 18px 28px;
    font-size: 16px;
}

.offers-more__chevron {
    width: 8px;
    height: 8px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: translateY(-2px) rotate(45deg);
}

.offers-more:hover { box-shadow: var(--shadow-hover); }
