/* мойбух.рф — стили посадочных под Директ.
   Палитра и типографика сняты с основного сайта xn--90apii1am.xn--p1ai */

:root {
  --bg: #f3f6fc;
  --surface: #ffffff;
  --surface-2: #f1f5fc;
  --ink: #14161b;
  --ink-2: #4b5160;
  --ink-3: #6b7280;   /* 4,83:1 на белом — проходит WCAG AA */
  --accent: #1f57e0;
  --accent-dark: #1747bd;
  --accent-soft: #eaf0fe;
  --ok: #12a06a;
  --ok-dark: #0c7d52;
  --ok-soft: #eafaf2;
  --warn: #d99400;
  --warn-soft: #fff6e3;
  --line: #d4ddf0;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 2px 4px rgba(20, 34, 62, .04), 0 12px 32px rgba(20, 34, 62, .07);
  --shadow-sm: 0 1px 2px rgba(20, 34, 62, .05), 0 4px 14px rgba(20, 34, 62, .05);
  --maxw: 1120px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Golos Text", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); }

h1, h2, h3 { line-height: 1.15; letter-spacing: -.02em; margin: 0 0 .5em; }
h1 { font-size: clamp(30px, 4.6vw, 52px); font-weight: 700; }
h2 { font-size: clamp(24px, 3.2vw, 36px); font-weight: 700; }
h3 { font-size: clamp(18px, 2.1vw, 22px); font-weight: 600; }
p { margin: 0 0 1em; color: var(--ink-2); }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.section { padding: clamp(44px, 6vw, 76px) 0; }
.section--tint { background: var(--surface); }

.eyebrow {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}

.lead { font-size: clamp(17px, 1.5vw, 20px); color: var(--ink-2); }

/* ─── шапка ─── */
.header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(243, 246, 252, .88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header__in {
  max-width: var(--maxw); margin: 0 auto; padding: 12px 20px;
  display: flex; align-items: center; gap: 16px; justify-content: space-between;
}
.logo { font-weight: 700; font-size: 19px; color: var(--ink); display: flex; align-items: center; gap: 9px; }
.logo__mark {
  width: 30px; height: 30px; border-radius: 9px;
  background: var(--accent); color: #fff;
  display: grid; place-items: center; font-size: 15px; font-weight: 700;
}
.header__right { display: flex; align-items: center; gap: 14px; }
.header__phone { color: var(--ink); font-weight: 600; white-space: nowrap; }
@media (max-width: 640px) { .header__phone { display: none; } }

/* ─── кнопки ─── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 24px; border-radius: 12px; border: 0;
  font: inherit; font-weight: 600; cursor: pointer;
  transition: transform .12s ease, background .15s ease, box-shadow .15s ease;
  text-align: center;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible,
a:focus-visible,
summary:focus-visible,
.faq details:focus-within summary {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 8px;
}
.btn--primary { background: var(--accent); color: #fff; box-shadow: 0 6px 18px rgba(31, 87, 224, .28); }
.btn--primary:hover { background: var(--accent-dark); color: #fff; }
.btn--ghost { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.btn--ghost:hover { background: var(--accent-soft); color: var(--ink); }
.btn--sm { padding: 11px 18px; font-size: 15px; min-height: 44px; }   /* 44px — минимальная зона нажатия */
.btn--wide { width: 100%; }

/* ─── первый экран ─── */
.hero { padding: clamp(32px, 5vw, 64px) 0 clamp(40px, 5vw, 72px); }
.hero__grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(24px, 3vw, 48px); align-items: start; }
@media (max-width: 900px) { .hero__grid { grid-template-columns: 1fr; } }
.hero h1 span { color: var(--accent); }
.hero__sub { font-size: clamp(17px, 1.6vw, 20px); color: var(--ink-2); margin-bottom: 24px; max-width: 34em; }

.ticks { list-style: none; margin: 0 0 26px; padding: 0; display: grid; gap: 11px; }
.ticks li { display: flex; gap: 11px; align-items: flex-start; color: var(--ink); }
.ticks li::before {
  content: "✓"; flex: none;
  width: 22px; height: 22px; margin-top: 2px; border-radius: 7px;
  background: var(--ok-soft); color: var(--ok-dark);
  display: grid; place-items: center; font-size: 13px; font-weight: 700;
}

/* цена «от» на первом экране — главный ответ на вопрос посетителя */
.price-badge {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px;
  background: var(--surface); border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-sm);
  padding: 16px 20px; margin: 0 0 22px;
}
.price-badge__sum {
  font-size: clamp(26px, 3vw, 34px); font-weight: 700;
  letter-spacing: -.02em; color: var(--ink); line-height: 1.1;
}
.price-badge__unit { font-size: 16px; font-weight: 500; color: var(--ink-2); }
.price-badge__note { flex: 1 1 100%; font-size: 14.5px; color: var(--ink-2); }
.price-badge__note b { color: var(--ink); font-weight: 600; }

.trust { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 13px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line);
  font-size: 14px; color: var(--ink-2);
}

/* ─── форма ─── */
.form-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: clamp(20px, 2.4vw, 28px);
  position: sticky; top: 84px;
}
@media (max-width: 900px) { .form-card { position: static; } }
.form-card h3 { margin-bottom: 4px; }
.form-card__note { font-size: 14px; color: var(--ink-3); margin-bottom: 18px; }
.field { margin-bottom: 13px; }
.field label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; color: var(--ink); }
.field input, .field select {
  width: 100%; padding: 13px 14px; font: inherit; font-size: 16px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--ink);
  transition: border-color .15s ease, background .15s ease;
}
.field input:focus, .field select:focus {
  outline: none; border-color: var(--accent); background: #fff;
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.form-legal { font-size: 13.5px; color: var(--ink-3); margin: 12px 0 0; line-height: 1.45; }
.consent-check { display: flex; gap: 10px; align-items: flex-start; margin: 4px 0 14px; font-size: 13.5px; line-height: 1.45; color: var(--ink-2, #4b5160); cursor: pointer; text-align: left; }
.consent-check input { flex: none; width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--blue, #1f57e0); cursor: pointer; }
.consent-check a { color: inherit; text-decoration: underline; }

.field-error {
  display: none; margin-top: 6px; font-size: 14px; color: #b42318; font-weight: 500;
}
.field-error.is-visible { display: block; }
.field input[aria-invalid="true"] { border-color: #d92d20; background: #fff5f4; }
.btn[aria-busy="true"] { opacity: .72; pointer-events: none; }
.form-alt { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 14px; color: var(--ink-2); }
.form-ok {
  display: none; padding: 18px; border-radius: var(--radius-sm);
  background: var(--ok-soft); color: var(--ok-dark); font-weight: 600;
}
.form-ok.is-visible { display: block; }
form.is-sent { display: none; }

/* ─── карточки ─── */
.grid { display: grid; gap: 18px; }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid--3, .grid--4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; } }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-sm);
}
.card__ico {
  width: 42px; height: 42px; margin-bottom: 14px;
  border-radius: 11px; background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center;
}
.card__ico svg { width: 22px; height: 22px; stroke-width: 1.9; }
.badge svg { width: 20px; height: 20px; flex: none; color: var(--accent); stroke-width: 1.9; }
.card h3 { margin-bottom: 6px; }
.card p { margin: 0; font-size: 15.5px; }
.section--tint .card { background: var(--surface-2); }

/* боль → решение */
.pain { display: grid; gap: 14px; }
.pain__row {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 18px; align-items: center;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 22px;
}
@media (max-width: 760px) { .pain__row { grid-template-columns: 1fr; gap: 8px; } .pain__arrow { display: none; } }
.pain__was { color: var(--ink-2); }
.pain__arrow { color: var(--accent); font-size: 20px; }
.pain__now { font-weight: 600; }

/* ─── тарифы ─── */
.price-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; align-items: start; }
@media (max-width: 900px) { .price-grid { grid-template-columns: 1fr; } }
.price {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 26px 24px; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; height: 100%;
}
.price--hot { border-color: var(--accent); box-shadow: var(--shadow); position: relative; }
.price__badge {
  position: absolute; top: -12px; left: 24px;
  background: var(--accent); color: #fff; font-size: 12.5px; font-weight: 600;
  padding: 5px 12px; border-radius: 999px;
}
.price__name { font-weight: 700; font-size: 20px; margin-bottom: 4px; }
.price__for { font-size: 14.5px; color: var(--ink-3); margin-bottom: 16px; min-height: 42px; }
.price__sum { font-size: 36px; font-weight: 700; letter-spacing: -.03em; }
.price__sum small { font-size: 16px; font-weight: 500; color: var(--ink-3); }
.price__hint { font-size: 14px; color: var(--ink-3); margin: 4px 0 18px; }
.price ul { list-style: none; margin: 0 0 20px; padding: 0; display: grid; gap: 9px; font-size: 15.5px; }
.price li { display: flex; gap: 9px; }
.price li::before { content: "✓"; color: var(--ok); font-weight: 700; flex: none; }
.price .btn { margin-top: auto; }

/* ─── шаги ─── */
.steps { counter-reset: s; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; } }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.step::before {
  counter-increment: s; content: counter(s);
  display: grid; place-items: center;
  width: 34px; height: 34px; margin-bottom: 12px; border-radius: 10px;
  background: var(--accent-soft); color: var(--accent); font-weight: 700;
}

/* ─── доверие ─── */
.badges { display: flex; flex-wrap: wrap; gap: 12px; }
.badge {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 12px 16px; font-size: 15px;
}
.badge b { font-weight: 600; }

/* ─── FAQ ─── */
.faq { display: grid; gap: 10px; }
.faq details {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 10px 20px;
}
.faq summary {
  cursor: pointer; font-weight: 600; list-style: none;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 44px;   /* палец должен попадать по заголовку вопроса */
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent); font-size: 22px; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq p { margin: 12px 0 0; font-size: 15.5px; }

/* ─── финальный экран ─── */
.cta {
  background: linear-gradient(135deg, #1f57e0, #1747bd);
  color: #fff; border-radius: var(--radius); padding: clamp(28px, 4vw, 48px);
}
.cta h2 { color: #fff; }
.cta p { color: rgba(255, 255, 255, .86); }
.cta__grid { display: grid; grid-template-columns: 1fr .8fr; gap: 32px; align-items: center; }
@media (max-width: 900px) { .cta__grid { grid-template-columns: 1fr; } }
.cta .form-card { position: static; }

/* ─── подвал ─── */
.footer { background: var(--surface); border-top: 1px solid var(--line); padding: 36px 0; font-size: 14.5px; color: var(--ink-2); }
.footer__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 28px; }
@media (max-width: 760px) { .footer__grid { grid-template-columns: 1fr; } }
.footer b { display: block; color: var(--ink); margin-bottom: 8px; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; }
.footer__req { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-3); }

/* липкая кнопка на мобильном */
.sticky-cta {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: rgba(243, 246, 252, .95); backdrop-filter: blur(8px);
  border-top: 1px solid var(--line); display: none;
}
@media (max-width: 900px) { .sticky-cta { display: block; } body { padding-bottom: 76px; } }


/* пользователь попросил меньше движения — убираем анимации и плавную прокрутку */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .btn:active { transform: none; }
}

/* ─── логотип и фирменная графика с мойбух.рф ─── */
.logo { font-family: "Onest", "Golos Text", system-ui, sans-serif; letter-spacing: -.3px; }
.logo__mark {
  width: 34px; height: 34px; border-radius: 11px;
  background: linear-gradient(160deg, #2f6bff, #1741b8);
  box-shadow: 0 4px 12px rgba(31, 87, 224, .32);
  display: grid; place-items: center; font-size: 0;
}
.logo__mark img { width: 21px; height: 21px; }
h1, h2, h3, .price__sum, .calc-side__sum { font-family: "Onest", "Golos Text", system-ui, sans-serif; }

/* полоса партнёров — логотипы те же, что на основном сайте */
.partners { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 26px; }
.partners img { max-height: 26px; max-width: 104px; object-fit: contain; opacity: .8; }
.partners__cap { font-size: 13.5px; color: var(--ink-3); flex: 1 1 100%; margin: 0; }

/* Кай — маскот с основного сайта */
.kai { display: grid; grid-template-columns: 168px 1fr; gap: 26px; align-items: center; }
.kai img { width: 168px; height: auto; filter: drop-shadow(0 18px 26px rgba(20, 58, 166, .22)); }
@media (max-width: 620px) { .kai { grid-template-columns: 1fr; } .kai img { width: 120px; } }

/* ─── калькулятор ─── */
.calc-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 900px) { .calc-grid { grid-template-columns: 1fr; } }

.calc-form {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  padding: clamp(20px, 2.6vw, 30px);
}
.calc-fld + .calc-fld { margin-top: 18px; }
.fld-label { font-size: 14px; font-weight: 600; color: var(--ink); margin-bottom: 8px; display: block; }
.fld-hint { font-weight: 400; color: var(--ink-3); }

.seg { display: flex; gap: 8px; flex-wrap: wrap; }
.seg-grid { display: grid; grid-template-columns: repeat(4, 1fr); }
@media (max-width: 560px) { .seg-grid { grid-template-columns: repeat(2, 1fr); } }
.seg-opt { position: relative; flex: 1 1 0; min-width: 92px; }
.seg-opt input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.seg-opt span {
  display: grid; place-items: center; min-height: 44px; padding: 8px 12px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--ink-2);
  font-size: 14.5px; font-weight: 500; text-align: center;
  transition: border-color .15s ease, background .15s ease, color .15s ease;
}
.seg-opt input:checked + span {
  border-color: var(--accent); background: var(--accent-soft);
  color: var(--accent-dark); font-weight: 600;
}
.seg-opt input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }

.num {
  width: 100%; padding: 12px 14px; font: inherit; font-size: 16px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--ink);
}
.num:focus { outline: none; border-color: var(--accent); background: #fff; box-shadow: 0 0 0 3px var(--accent-soft); }

.rng-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.rng-head .fld-label { margin: 0; }
.rng-val { color: var(--accent); font-size: 17px; }
.rng { width: 100%; margin: 10px 0 4px; accent-color: var(--accent); height: 26px; }
.rng-scale { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--ink-3); }

.calc-more { border-top: 1px solid var(--line); margin-top: 24px; padding-top: 18px; }
.calc-more > summary {
  list-style: none; cursor: pointer; font-weight: 600; font-size: 15px;
  color: var(--accent); display: flex; align-items: center; gap: 8px; min-height: 44px;
}
.calc-more > summary::-webkit-details-marker { display: none; }
.calc-more > summary::after { content: "▾"; font-size: 12px; transition: transform .2s ease; }
.calc-more[open] > summary::after { transform: rotate(180deg); }
.calc-more__in { margin-top: 14px; }
.calc-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 520px) { .calc-pair { grid-template-columns: 1fr; } }
.calc-checks { display: flex; flex-direction: column; gap: 10px; }
.chk { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; color: var(--ink-2); cursor: pointer; }
.chk input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--accent); flex: none; }

.calc-side {
  position: sticky; top: 86px;
  border-radius: var(--radius); padding: 28px;
  background: linear-gradient(165deg, #2f77ff, #173a8f); color: #fff;
}
@media (max-width: 900px) { .calc-side { position: static; } }
.calc-side__cap { font-size: 12.5px; font-weight: 600; color: #cddcff; letter-spacing: .06em; text-transform: uppercase; }
.calc-side__sum { font-weight: 700; font-size: clamp(30px, 3.6vw, 40px); margin: 10px 0 4px; line-height: 1.05; white-space: nowrap; }
.calc-side__note { font-size: 14.5px; color: #dbe6ff; }
.calc-side__legal { font-size: 12.5px; color: #bdd0ff; margin: 12px 0 0; line-height: 1.5; }
.calc-break { margin-top: 22px; }
.calc-row { display: flex; justify-content: space-between; gap: 14px; font-size: 13.5px; padding: 7px 0; border-bottom: 1px solid rgba(255, 255, 255, .14); }
.calc-row span:first-child { color: #cddcff; }
.calc-row span:last-child { font-weight: 600; white-space: nowrap; }
.calc-row--total { border-bottom: none; border-top: 1.5px solid rgba(255, 255, 255, .35); margin-top: 4px; padding-top: 10px; font-size: 15px; }
.calc-row--total span:first-child { color: #fff; font-weight: 600; }
.calc-row--total span:last-child { font-weight: 800; }
.calc-once { display: none; margin-top: 14px; font-size: 13px; color: #dbe6ff; background: rgba(255, 255, 255, .12); border-radius: 12px; padding: 11px 13px; }

.btn--white { background: #fff; color: var(--accent-dark); margin-top: 22px; }
.btn--white:hover { background: #eef3ff; color: var(--accent-dark); }

/* Калькулятор стоит в блоке цен, а тот на белой подложке: без этого
   карточка формы белым по белому теряет края. */
.section--tint .calc-form { background: var(--surface-2); }
.section--tint .calc-form .seg-opt span,
.section--tint .calc-form .num,
.section--tint .calc-form .rng { background: #fff; }
.section--tint .calc-form .seg-opt input:checked + span { background: var(--accent-soft); }

/* якоря не должны прятаться под липкой шапкой */
#calc, #zayavka { scroll-margin-top: 90px; }
