/* ============ Tokens ============ */
:root {
  --paper: #EDEFF5;
  --paper-2: #E2E5F0;
  --card: #FFFFFF;
  --ink: #1A1D3A;
  --ink-2: #4A4F72;
  --ink-3: #7A7FA0;
  --line: #CDD1E2;
  --ultra: #3047F0;
  --ultra-dark: #2234C4;
  --mint: #1FAF7A;
  --mint-bg: #E2F6EE;
  --amber: #C9780F;
  --amber-bg: #FBF0DF;
  --danger: #D0342C;

  --f-display: "Geologica", system-ui, sans-serif;
  --f-body: "Golos Text", system-ui, sans-serif;

  --r-s: 8px;
  --r-m: 14px;
  --r-l: 22px;

  --wrap: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
}

/* ============ Base ============ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.55 var(--f-body);
  font-feature-settings: "tnum" 0;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--f-display); margin: 0; font-weight: 600; letter-spacing: -0.02em; }
p { margin: 0; }
a { color: var(--ultra); }
:focus-visible { outline: 3px solid var(--ultra); outline-offset: 3px; border-radius: 4px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

/* ============ Buttons ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 26px;
  border: 0; border-radius: 999px;
  background: var(--ultra); color: #fff;
  font: 600 17px/1 var(--f-body); text-decoration: none; cursor: pointer;
  transition: background .15s, transform .1s;
}
.btn:hover { background: var(--ultra-dark); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .6; cursor: progress; }
.btn--small { min-height: 42px; padding: 0 18px; font-size: 15px; }
.btn--block { width: 100%; }
.btn--ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn--ghost:hover { background: var(--paper); }

/* ============ Topbar ============ */
.topbar { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid transparent; transition: border-color .2s; }
.topbar.is-scrolled { border-bottom-color: var(--line); }
.topbar__inner { display: flex; align-items: center; gap: 32px; height: 68px; }
.topbar__nav { display: flex; gap: 26px; margin-left: auto; }
.topbar__nav a { color: var(--ink-2); text-decoration: none; font-size: 15px; font-weight: 500; }
.topbar__nav a:hover { color: var(--ink); }

.logo { display: inline-flex; align-items: center; gap: 9px; color: var(--ultra); text-decoration: none; }
.logo span { font: 700 22px/1 var(--f-display); letter-spacing: -0.03em; color: var(--ink); }
.logo__mark { width: 28px; height: 28px; }
.logo--light { color: #fff; }
.logo--light span { color: #fff; }

/* ============ Hero ============ */
.hero { padding: clamp(32px, 6vw, 80px) 0 clamp(56px, 8vw, 110px); }
.hero__grid {
  display: grid; grid-template-columns: 1.08fr 1fr; column-gap: clamp(32px, 6vw, 88px); row-gap: 0;
  grid-template-areas: "text receipt" "facts receipt"; grid-template-rows: auto 1fr; align-items: start;
}
.hero__text { grid-area: text; padding-top: clamp(0px, 3vw, 36px); }
.receipt-slot { grid-area: receipt; }
.facts { grid-area: facts; }
.hero h1 {
  font-size: clamp(38px, 5.6vw, 72px);
  line-height: 1.02;
  letter-spacing: -0.035em;
  font-weight: 700;
  max-width: 11.5em;
  text-wrap: balance;
}
.hero__lead { margin-top: 26px; font-size: clamp(17px, 1.5vw, 20px); color: var(--ink-2); max-width: 32em; }

.facts { list-style: none; padding: 0; margin: 36px 0 0; display: grid; gap: 14px; max-width: 34em; }
.facts li { position: relative; padding-left: 30px; color: var(--ink-2); font-size: 16px; }
.facts li b { color: var(--ink); font-weight: 600; }
.facts li::before {
  content: ""; position: absolute; left: 0; top: 5px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--mint) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath d='M5 9.3l2.6 2.6L13 6.5' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/18px no-repeat;
}

/* --- Receipt: the one bold element --- */
.receipt-slot {
  position: relative;
  padding-top: 14px;
}
/* the "printer slot" the receipt comes out of */
.receipt-slot::before {
  content: ""; position: absolute; top: 0; left: -14px; right: -14px; height: 18px;
  background: var(--ink); border-radius: 10px;
  box-shadow: inset 0 -5px 0 #0d0f24;
  z-index: 2;
}
.receipt-slot { overflow: hidden; padding-bottom: 24px; margin-bottom: -24px; }
.receipt {
  --tooth: 9px;
  position: relative;
  margin-top: -4px;
  background: var(--card);
  padding: 30px clamp(20px, 3vw, 34px) calc(30px + var(--tooth));
  box-shadow: 0 24px 50px -24px rgba(26, 29, 58, .35);
  /* zig-zag bottom edge */
  -webkit-mask: linear-gradient(#000 0 0) top/100% calc(100% - var(--tooth)) no-repeat,
                conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom/calc(var(--tooth) * 2) var(--tooth) repeat-x;
          mask: linear-gradient(#000 0 0) top/100% calc(100% - var(--tooth)) no-repeat,
                conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom/calc(var(--tooth) * 2) var(--tooth) repeat-x;
}
/* печать запускается, когда чек попадает в экран (класс ставит app.js) */
.js .receipt { transform: translateY(-100%); }
.js .receipt.is-printed { transform: none; animation: print 1.1s cubic-bezier(.3,.7,.2,1) .15s both; }
@keyframes print {
  from { transform: translateY(-100%); }
  to   { transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) { .js .receipt, .js .receipt.is-printed { animation: none; transform: none; } }

.receipt__head {
  display: flex; justify-content: space-between; align-items: baseline;
  padding-bottom: 18px; margin-bottom: 22px;
  border-bottom: 2px dashed var(--line);
  font: 600 18px/1.2 var(--f-display);
}
.receipt__date { font: 400 14px/1 var(--f-body); color: var(--ink-3); font-variant-numeric: tabular-nums; }

.range { margin-bottom: 22px; }
.range__row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.range label { font-size: 15px; color: var(--ink-2); }
.range output { font: 600 26px/1 var(--f-display); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.range__scale { display: flex; justify-content: space-between; font-size: 13px; color: var(--ink-3); margin-top: 6px; }

input[type="range"] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 28px; background: transparent; margin: 0; cursor: pointer;
  --p: 50%;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 6px; border-radius: 6px;
  background: linear-gradient(var(--ultra), var(--ultra)) 0/var(--p) 100% no-repeat, var(--paper-2);
}
input[type="range"]::-moz-range-track { height: 6px; border-radius: 6px; background: var(--paper-2); }
input[type="range"]::-moz-range-progress { height: 6px; border-radius: 6px; background: var(--ultra); }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 26px; height: 26px; margin-top: -10px; border-radius: 50%;
  background: #fff; border: 7px solid var(--ultra); box-shadow: 0 2px 6px rgba(26,29,58,.25);
}
input[type="range"]::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 7px solid var(--ultra); }
input[type="range"]:focus-visible { outline: none; }
input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px color-mix(in srgb, var(--ultra) 30%, transparent); }

.lines { margin: 26px 0 0; padding-top: 20px; border-top: 2px dashed var(--line); display: grid; gap: 12px; }
.line { display: flex; align-items: baseline; gap: 8px; }
/* dotted leader between label and value */
.line dt { flex: 1; display: flex; align-items: baseline; gap: 8px; font-size: 15px; color: var(--ink-2); }
.line dt::after { content: ""; flex: 1; min-width: 16px; border-bottom: 2px dotted var(--line); transform: translateY(-4px); }
.line dd {
  margin: 0; white-space: nowrap;
  font: 600 19px/1.1 var(--f-display); font-variant-numeric: tabular-nums;
}
.line--good dd { color: var(--mint); font-size: 22px; }
.line--good dt { color: var(--ink); font-weight: 500; }
.line--muted dd { font-size: 16px; font-weight: 500; color: var(--ink-2); }

.receipt__note { margin: 18px 0 22px; font-size: 13.5px; color: var(--ink-3); line-height: 1.45; }
.receipt__note.is-capped { color: var(--amber); }

/* ============ Sections ============ */
.section { padding: clamp(64px, 9vw, 120px) 0; }
.section--tint { background: var(--paper-2); }
.section--flush { padding: 0; }
.h2 { font-size: clamp(30px, 3.6vw, 46px); line-height: 1.08; letter-spacing: -0.03em; max-width: 18em; text-wrap: balance; }
.section__head { display: flex; justify-content: space-between; align-items: end; gap: 24px; flex-wrap: wrap; }
.section__sub { color: var(--ink-2); max-width: 26em; font-size: 16px; }

/* --- Steps (real sequence → numbers are justified) --- */
.steps { list-style: none; padding: 0; margin: 48px 0 0; display: grid; grid-template-columns: repeat(4, 1fr); counter-reset: s; border-top: 2px solid var(--ink); }
.steps li { counter-increment: s; padding: 24px 26px 0 0; position: relative; }
.steps li + li { padding-left: 26px; border-left: 1px solid var(--line); }
.steps li::before {
  content: counter(s);
  display: block; margin-bottom: 30px;
  font: 600 52px/1 var(--f-display); color: var(--ultra); letter-spacing: -0.04em;
}
.steps h3 { font-size: 20px; line-height: 1.2; margin-bottom: 10px; }
.steps p { color: var(--ink-2); font-size: 16px; }

/* --- Ledger --- */
.ledger { margin-top: 40px; background: var(--card); border-radius: var(--r-l); padding: 8px 0; }
.ledger__row {
  display: grid; grid-template-columns: 2.2fr 1.1fr 1fr 1fr 150px; gap: 16px; align-items: center;
  padding: 20px 28px;
}
.ledger__row + .ledger__row, #ledgerBody .ledger__row { border-top: 1px solid var(--paper-2); }
.ledger__row--head { padding-top: 14px; padding-bottom: 14px; font-size: 14px; color: var(--ink-3); }
.ledger__name b { display: block; font: 600 19px/1.25 var(--f-display); letter-spacing: -0.01em; }
.ledger__name small { display: block; margin-top: 3px; color: var(--ink-3); font-size: 14px; }
.ledger__cell { font-variant-numeric: tabular-nums; font-weight: 500; }
.ledger__cell small { display: none; }
.ledger__rate--zero { color: var(--mint); font-weight: 600; }
.ledger__btn {
  justify-self: end; min-height: 42px; padding: 0 18px; border-radius: 999px;
  border: 1.5px solid var(--ultra); background: transparent; color: var(--ultra);
  font: 600 15px/1 var(--f-body); cursor: pointer;
}
.ledger__btn:hover { background: var(--ultra); color: #fff; }

/* --- Honest --- */
.honest { margin-top: 44px; display: grid; grid-template-columns: 1fr 1fr; gap: 0; border-radius: var(--r-l); overflow: hidden; }
.honest__col { padding: clamp(26px, 3.5vw, 44px); }
.honest__col--yes { background: var(--mint-bg); }
.honest__col--no { background: var(--amber-bg); }
.honest h3 { font-size: 22px; margin-bottom: 22px; }
.honest ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.honest li { position: relative; padding-left: 32px; font-size: 16.5px; }
.honest li::before { position: absolute; left: 0; top: 0; font: 700 18px/1.4 var(--f-display); }
.honest__col--yes li::before { content: "+"; color: var(--mint); }
.honest__col--no li::before { content: "−"; color: var(--amber); }

/* --- Money disclosure --- */
.money {
  display: grid; grid-template-columns: 1fr 1.6fr; gap: clamp(20px, 4vw, 64px);
  background: var(--ultra); color: #fff; border-radius: var(--r-l);
  padding: clamp(30px, 5vw, 64px);
}
.money h2 { font-size: clamp(28px, 3vw, 40px); line-height: 1.1; }
.money__body { display: grid; gap: 16px; font-size: 18px; color: #E4E7FF; }

/* ============ Apply / Quiz ============ */
.apply { display: grid; grid-template-columns: 1fr 1.3fr; gap: clamp(32px, 6vw, 88px); align-items: start; }
.apply__intro { position: sticky; top: 100px; }
.apply__intro p { margin-top: 18px; color: var(--ink-2); max-width: 26em; }
.apply__intro .apply__small { margin-top: 28px; padding: 16px 18px; border-left: 3px solid var(--amber); background: var(--amber-bg); border-radius: 0 var(--r-s) var(--r-s) 0; font-size: 15px; color: var(--ink); }

.quiz { position: relative; background: var(--card); border-radius: var(--r-l); padding: clamp(22px, 3.5vw, 40px); box-shadow: 0 20px 50px -30px rgba(26,29,58,.4); }
.quiz__progress { height: 4px; background: var(--paper-2); border-radius: 4px; overflow: hidden; }
.quiz__progress span { display: block; height: 100%; width: 33.33%; background: var(--ultra); transition: width .35s ease; }
.quiz__step-label { margin-top: 12px; font-size: 14px; color: var(--ink-3); }

.quiz__step { border: 0; padding: 0; margin: 0; min-width: 0; display: none; }
.quiz__step.is-active { display: block; animation: stepIn .3s ease; }
@keyframes stepIn { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .quiz__step.is-active { animation: none; } }
.quiz__step legend { font: 600 26px/1.15 var(--f-display); letter-spacing: -0.02em; padding: 0; margin: 10px 0 26px; }

.field { margin-bottom: 22px; }
.field > label, .field__label { display: block; font-size: 15px; font-weight: 500; margin-bottom: 8px; color: var(--ink-2); }
.field input[type="text"], .field input[type="tel"] {
  width: 100%; height: 54px; padding: 0 16px;
  border: 1.5px solid var(--line); border-radius: var(--r-m);
  background: #fff; color: var(--ink);
  font: 500 18px/1 var(--f-body); font-variant-numeric: tabular-nums;
  transition: border-color .15s;
}
.field input:focus { outline: none; border-color: var(--ultra); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ultra) 15%, transparent); }
.field input.is-invalid { border-color: var(--danger); }
.field__error { min-height: 0; margin-top: 6px; font-size: 14px; color: var(--danger); }
.field__error:empty { display: none; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip input, .option input { position: absolute; opacity: 0; pointer-events: none; }
.chip span {
  display: inline-flex; align-items: center; min-height: 42px; padding: 0 16px;
  border-radius: 999px; border: 1.5px solid var(--line); cursor: pointer;
  font-size: 15px; font-weight: 500; transition: background .12s, border-color .12s;
}
.chip input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip input:focus-visible + span, .option input:focus-visible + span { outline: 3px solid var(--ultra); outline-offset: 2px; }

.options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.option span {
  display: block; height: 100%; padding: 14px 16px; border-radius: var(--r-m);
  border: 1.5px solid var(--line); cursor: pointer; font-size: 14px; color: var(--ink-3); line-height: 1.4;
}
.option b { display: block; margin-bottom: 3px; font-size: 16px; color: var(--ink); font-weight: 600; }
.option input:checked + span { border-color: var(--ultra); background: color-mix(in srgb, var(--ultra) 6%, #fff); box-shadow: inset 0 0 0 1px var(--ultra); }

.check { display: flex; gap: 12px; align-items: flex-start; margin-top: 14px; font-size: 15px; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--ultra); flex: none; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.quiz__nav { display: flex; gap: 10px; margin-top: 30px; }
.quiz__nav .btn:not(.btn--ghost) { flex: 1; }
.quiz__error { margin-top: 14px; color: var(--danger); font-size: 15px; }
.quiz__error:empty { display: none; }

.quiz__done { text-align: center; padding: 40px 10px 20px; }
.quiz__done svg { width: 64px; height: 64px; }
.quiz__done h3 { font-size: 28px; margin: 18px 0 10px; }
.quiz__done p { color: var(--ink-2); max-width: 24em; margin: 0 auto; }
.quiz.is-done > :not(.quiz__done) { display: none; }

/* ============ FAQ ============ */
.faq-wrap { display: grid; grid-template-columns: 1fr 2fr; gap: clamp(24px, 5vw, 80px); align-items: start; }
.faq details { border-bottom: 1px solid var(--line); }
.faq details:first-child { border-top: 2px solid var(--ink); }
.faq summary {
  list-style: none; cursor: pointer; padding: 22px 44px 22px 0; position: relative;
  font: 600 19px/1.3 var(--f-display); letter-spacing: -0.01em;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 4px; top: 50%; width: 14px; height: 14px; margin-top: -7px;
  background: linear-gradient(var(--ink), var(--ink)) center/14px 2px no-repeat, linear-gradient(var(--ink), var(--ink)) center/2px 14px no-repeat;
  transition: transform .2s;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding: 0 44px 24px 0; color: var(--ink-2); max-width: 40em; }

/* ============ Footer ============ */
.footer { background: var(--ink); color: #B9BDD6; padding: 56px 0 40px; font-size: 14px; }
.footer__top { display: flex; justify-content: space-between; gap: 32px; flex-wrap: wrap; padding-bottom: 32px; border-bottom: 1px solid #33375A; }
.footer__links { display: flex; flex-direction: column; gap: 10px; }
.footer a { color: #DDE0F2; }
.footer__legal { display: grid; gap: 12px; padding-top: 28px; max-width: 70em; line-height: 1.6; }

/* ============ Sticky mobile CTA ============ */
.sticky-cta { display: none; }

/* ============ Responsive ============ */
@media (max-width: 980px) {
  .topbar__nav { display: none; }
  .topbar__inner { justify-content: space-between; }
  .hero__grid { grid-template-columns: 1fr; grid-template-areas: "text" "receipt" "facts"; row-gap: 32px; }
  .facts { margin-top: 0; }
  .apply, .faq-wrap { grid-template-columns: 1fr; }
  .apply__intro { position: static; }
  .steps { grid-template-columns: 1fr 1fr; row-gap: 36px; }
  .steps li:nth-child(3) { padding-left: 0; border-left: 0; }
  .money { grid-template-columns: 1fr; }
  .ledger__row { grid-template-columns: 1fr 1fr 1fr; row-gap: 10px; }
  .ledger__row--head { display: none; }
  .ledger__name { grid-column: 1 / -1; }
  .ledger__cell small { display: block; font-size: 13px; color: var(--ink-3); font-weight: 400; }
  .ledger__btn { grid-column: 1 / -1; justify-self: stretch; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .topbar .btn--small { display: none; }
  .steps { grid-template-columns: 1fr; }
  .steps li, .steps li + li { padding: 22px 0 0; border-left: 0; }
  .steps li + li { border-top: 1px solid var(--line); }
  .steps li::before { margin-bottom: 14px; font-size: 40px; }
  .honest { grid-template-columns: 1fr; }
  .options { grid-template-columns: 1fr; }
  .ledger__row { padding: 18px 20px; }
  .receipt-slot::before { left: -6px; right: -6px; }
  .line dd { font-size: 17px; }
  .line--good dd { font-size: 19px; }
  .line dt { font-size: 14px; }

  .sticky-cta {
    display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(10px);
    border-top: 1px solid var(--line);
    transform: translateY(110%); transition: transform .25s ease;
  }
  .sticky-cta.is-visible { transform: none; }
  .footer { padding-bottom: 100px; }
}


/* ============ Линейные иконки (Tabler Icons, MIT) ============ */
.ico { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }

.facts li { display: flex; gap: 14px; align-items: center; padding-left: 0; }
.facts li::before { content: none; }
.facts__ico {
  display: grid; place-items: center; flex: none; width: 42px; height: 42px; border-radius: 12px;
  background: color-mix(in srgb, var(--ultra) 10%, transparent); color: var(--ultra);
}
.facts__ico .ico { width: 22px; height: 22px; }

.receipt__date { display: inline-flex; align-items: center; gap: 6px; }
.receipt__cal { width: 16px; height: 16px; }

.steps__ico { position: absolute; top: 28px; right: 26px; width: 40px; height: 40px; color: var(--ink-2); stroke-width: 1.4; }
.steps li:last-child .steps__ico { right: 0; }

.honest h3 { display: flex; align-items: center; gap: 10px; }
.honest__ico { width: 28px; height: 28px; stroke-width: 1.8; }
.honest__col--yes .honest__ico { color: var(--mint); }
.honest__col--no .honest__ico { color: var(--amber); }

.apply__intro .apply__time { display: flex; gap: 12px; align-items: flex-start; }
.apply__ico { width: 26px; height: 26px; margin-top: 1px; color: var(--ultra); }
.apply__intro .apply__small { display: flex; gap: 10px; align-items: flex-start; }
.apply__warn { width: 22px; height: 22px; color: var(--amber); stroke-width: 1.8; }

@media (max-width: 640px) {
  .steps__ico { top: 24px; right: 0; width: 30px; height: 30px; }
}
