/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 76px; }
body, h1, h2, h3, p, ul, ol, dl, dd, figure, fieldset { margin: 0; padding: 0; }
ul, ol { list-style: none; }
fieldset { border: 0; min-width: 0; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }

body {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---------- типографика ---------- */
.display, h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  text-transform: uppercase;
  line-height: 1.04;
  letter-spacing: .005em;
}
h1 { font-size: clamp(2.5rem, 6.4vw, 4.6rem); }
h2 { font-size: clamp(2rem, 4.6vw, 3.4rem); }
h3 { font-size: 1.35rem; line-height: 1.15; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-display);
  font-size: .95rem; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted);
}
.eyebrow::before { content: ""; width: 28px; height: 8px; background: repeating-linear-gradient(-45deg, var(--accent) 0 5px, var(--ink) 5px 10px); }
.on-dark .eyebrow { color: var(--muted-on-dark); }

.lead { font-size: clamp(1.05rem, 1.5vw, 1.2rem); color: var(--muted); max-width: 46ch; }

/* ---------- кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 26px;
  font-family: var(--font-display); font-size: 1.05rem; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase; text-decoration: none;
  border: 2px solid transparent; border-radius: var(--radius);
  transition: transform var(--dur-fast) var(--ease-out), background-color var(--dur-fast), box-shadow var(--dur-fast) var(--ease-out);
}
.btn--accent { background: var(--accent); color: var(--ink); box-shadow: 4px 4px 0 var(--ink); }
.btn--accent:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }
.btn--accent:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }
.on-dark .btn--accent { box-shadow: none; }
.on-dark .btn--accent:hover { background: #ffc933; transform: translateY(-2px); box-shadow: none; }
.btn--ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn--ghost:hover { border-color: var(--ink); }
.btn--sm { min-height: 42px; padding: 0 18px; font-size: .95rem; }
.btn[disabled] { opacity: .6; cursor: progress; transform: none; }

/* ---------- шапка ---------- */
.header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(20, 23, 26, .94);
  backdrop-filter: blur(8px);
  color: var(--white);
  border-bottom: 1px solid var(--line-on-dark);
}
.header__in { display: flex; align-items: center; gap: 24px; min-height: 64px; }
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; letter-spacing: .08em; text-transform: uppercase; line-height: 1; white-space: nowrap; }
.logo__mark { width: 30px; height: 30px; flex: none; }
.logo b { color: var(--accent); font-weight: 600; }
.nav { display: none; gap: 26px; margin-left: auto; font-size: .95rem; }
.nav a { text-decoration: none; color: var(--muted-on-dark); transition: color var(--dur-fast); }
.nav a:hover { color: var(--white); }
.header__phone { margin-left: auto; font-family: var(--font-display); font-size: 1.1rem; letter-spacing: .04em; text-decoration: none; white-space: nowrap; }
.header .btn { display: none; }
@media (min-width: 960px) {
  .nav { display: flex; }
  .header__phone { margin-left: 0; }
  .header .btn { display: inline-flex; }
}
@media (max-width: 400px) { .logo span { display: none; } }

/* ---------- hero ---------- */
.hero {
  position: relative;
  background: var(--ink);
  color: var(--white);
  padding-block: clamp(40px, 6vw, 80px) clamp(56px, 8vw, 104px);
  isolation: isolate;
}
/* чертёжная сетка + тёплое пятно света */
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(900px 520px at 12% 0%, rgba(255, 184, 0, .13), transparent 62%),
    linear-gradient(var(--line-on-dark) 1px, transparent 1px) 0 0 / 100% 56px,
    linear-gradient(90deg, var(--line-on-dark) 1px, transparent 1px) 0 0 / 56px 100%;
  -webkit-mask-image: linear-gradient(180deg, #000 40%, transparent 100%);
          mask-image: linear-gradient(180deg, #000 40%, transparent 100%);
}
/* сигнальная лента по нижнему краю */
.hero::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 12px;
  background: repeating-linear-gradient(-45deg, var(--accent) 0 18px, var(--ink) 18px 36px);
}
.hero__grid { display: grid; gap: 40px; align-items: start; }
.hero__text { padding-top: clamp(0px, 2vw, 28px); }
.hero h1 { margin-top: 20px; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero .lead { margin-top: 22px; color: #c9cdd0; }
.hero__facts { display: grid; grid-template-columns: repeat(3, auto); gap: 12px 28px; justify-content: start; margin-top: 36px; padding-top: 24px; border-top: 1px solid var(--line-on-dark); }
.fact__n { font-family: var(--font-display); font-size: clamp(1.7rem, 3vw, 2.3rem); font-weight: 600; line-height: 1; color: var(--accent); white-space: nowrap; }
.fact__t { margin-top: 6px; font-size: .86rem; line-height: 1.3; color: var(--muted-on-dark); max-width: 16ch; }
.hero__cta-mobile { margin-top: 28px; }
@media (min-width: 1000px) {
  .hero__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 520px); gap: 56px; }
  .hero__cta-mobile { display: none; }
}

/* загрузка hero: каскадное появление */
@keyframes rise { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
.hero .eyebrow     { animation: rise var(--dur) var(--ease-out) both; }
.hero h1           { animation: rise var(--dur) var(--ease-out) 80ms both; }
.hero .lead        { animation: rise var(--dur) var(--ease-out) 160ms both; }
.hero__facts       { animation: rise var(--dur) var(--ease-out) 240ms both; }
.hero__cta-mobile  { animation: rise var(--dur) var(--ease-out) 300ms both; }
.ticket            { animation: rise 600ms var(--ease-out) 200ms both; }

/* ---------- форма-заявка («бланк») ---------- */
.ticket {
  position: relative;
  background: var(--white);
  color: var(--ink);
  border-radius: var(--radius);
  box-shadow: 10px 10px 0 rgba(255, 184, 0, .9);
}
.ticket__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 20px clamp(18px, 4vw, 28px) 0; }
.ticket__title { font-family: var(--font-display); font-size: 1.5rem; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.ticket__step { font-family: var(--font-display); font-size: .95rem; letter-spacing: .1em; color: var(--muted); white-space: nowrap; }
.progress { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 14px clamp(18px, 4vw, 28px) 0; }
.progress i { height: 5px; background: var(--paper-2); transition: background-color var(--dur) var(--ease-out); }
.progress i.is-on { background: var(--ink); }
.ticket__body { padding: 20px clamp(18px, 4vw, 28px) clamp(20px, 4vw, 28px); }

.step { display: none; }
.step.is-active { display: block; animation: stepIn var(--dur) var(--ease-out) both; }
@keyframes stepIn { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
.step__legend { font-family: var(--font-display); font-size: 1.05rem; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }

.field { margin-bottom: 16px; }
.field > label, .field > .label { display: block; margin-bottom: 6px; font-size: .88rem; font-weight: 600; }
.field .opt { font-weight: 400; color: var(--muted); }
.row { display: grid; gap: 0 14px; }
@media (min-width: 520px) { .row--2 { grid-template-columns: 1fr 1fr; } .row--21 { grid-template-columns: 2fr 1fr; } }

.input, select.input, textarea.input {
  width: 100%; min-height: 48px; padding: 10px 14px;
  background: var(--paper); border: 1.5px solid transparent; border-bottom-color: var(--ink);
  border-radius: var(--radius) var(--radius) 0 0;
  font-size: 1rem;
  transition: border-color var(--dur-fast), background-color var(--dur-fast);
}
.input::placeholder { color: #8d9195; }
.input:hover { background: var(--paper-2); }
.input:focus { outline: 0; border-color: var(--ink); background: var(--white); }
textarea.input { min-height: 84px; resize: vertical; }
select.input {
  appearance: none; padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' fill='none' stroke='%2314171a' stroke-width='2'%3E%3Cpath d='m1 1 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
.field.has-error .input { border-color: var(--err); background: #fbeae6; }
.field__err { display: none; margin-top: 5px; font-size: .82rem; color: var(--err); }
.field.has-error .field__err { display: block; }
.hint { margin-top: 5px; font-size: .82rem; color: var(--muted); }
.hint--ok { color: var(--ok); font-weight: 600; }

/* сегментированный выбор (радио) */
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg label { position: relative; flex: 1 1 auto; margin: 0; }
.seg input { position: absolute; opacity: 0; inset: 0; }
.seg span {
  display: flex; align-items: center; justify-content: center;
  min-height: 46px; padding: 0 14px;
  background: var(--paper); border: 1.5px solid transparent; border-radius: var(--radius);
  font-weight: 600; font-size: .95rem; white-space: nowrap; cursor: pointer;
  transition: background-color var(--dur-fast), color var(--dur-fast), border-color var(--dur-fast);
}
.seg span:hover { border-color: var(--ink); }
.seg input:checked + span { background: var(--ink); color: var(--white); }
.seg input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.seg--sm span { min-height: 40px; padding: 0 10px; font-size: .9rem; }

/* блок «б/у» раскрывается плавно */
.collapse { display: grid; grid-template-rows: 0fr; transition: grid-template-rows var(--dur) var(--ease-out); }
.collapse > div { overflow: hidden; }
.collapse.is-open { grid-template-rows: 1fr; }
.used-box { margin-bottom: 16px; padding: 14px 14px 0; border-left: 4px solid var(--accent); background: #fbf6e6; }

/* ползунок аванса */
.range-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.range-head output { font-family: var(--font-display); font-size: 1.5rem; font-weight: 600; line-height: 1; }
input[type="range"] { width: 100%; height: 32px; background: transparent; accent-color: var(--ink); cursor: pointer; }
.range-scale { display: flex; justify-content: space-between; font-size: .78rem; color: var(--muted); }

.summary { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin: 4px 0 18px; background: var(--line); border: 1px solid var(--line); }
.summary div { padding: 10px 12px; background: var(--white); }
.summary dt { font-size: .78rem; color: var(--muted); }
.summary dd { font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; white-space: nowrap; }

.file { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.file input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.file__list { font-size: .85rem; color: var(--muted); }
.file input:focus-visible + .btn { outline: 3px solid var(--accent); outline-offset: 2px; }

.consent { display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: start; margin: 4px 0 16px; font-size: .84rem; line-height: 1.4; color: var(--muted); cursor: pointer; }
.consent input { width: 22px; height: 22px; margin: 0; accent-color: var(--ink); }
.consent.has-error { color: var(--err); }

.step__nav { display: flex; gap: 10px; margin-top: 6px; }
.step__nav .btn--accent { flex: 1; }
.form-error { display: none; margin-top: 14px; padding: 12px 14px; background: #fbeae6; border-left: 4px solid var(--err); font-size: .9rem; }
.form-error.is-on { display: block; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.done { text-align: center; padding: 28px 8px 12px; }
.done__mark { width: 64px; height: 64px; margin: 0 auto 18px; }
.done__id { display: inline-block; margin: 14px 0; padding: 6px 14px; background: var(--ink); color: var(--accent); font-family: var(--font-display); font-size: 1.2rem; letter-spacing: .1em; }
.done p { color: var(--muted); max-width: 36ch; margin-inline: auto; }

/* ---------- секции ---------- */
.section { padding-block: var(--section); }
.section--dark { background: var(--ink); color: var(--white); }
.section--tint { background: var(--paper-2); }
.section__head { display: grid; gap: 18px; margin-bottom: clamp(32px, 5vw, 56px); }
.section__head h2 { margin-top: 14px; max-width: 16ch; }
@media (min-width: 900px) { .section__head { grid-template-columns: 1.2fr 1fr; align-items: end; } }
.section--dark .lead { color: #c9cdd0; }

/* что берём: типографский список вместо сетки карточек */
.types { border-top: 2px solid var(--ink); }
.types a {
  display: grid; grid-template-columns: 44px 1fr auto; align-items: baseline; gap: 6px 16px;
  padding: 18px 4px; border-bottom: 1px solid var(--line); text-decoration: none;
  transition: background-color var(--dur-fast), padding var(--dur) var(--ease-out);
}
.types a:hover { background: var(--accent); padding-inline: 16px; }
.types__n { font-family: var(--font-display); color: var(--muted); font-size: .95rem; letter-spacing: .08em; }
.types__t { font-family: var(--font-display); font-size: clamp(1.3rem, 3vw, 2rem); font-weight: 600; text-transform: uppercase; line-height: 1.1; }
.types__d { grid-column: 2 / -1; font-size: .92rem; color: var(--muted); }
.types a:hover .types__n, .types a:hover .types__d { color: var(--ink); }
.types__go { display: none; font-family: var(--font-display); font-size: .9rem; letter-spacing: .1em; text-transform: uppercase; }
@media (min-width: 800px) {
  .types a { grid-template-columns: 56px minmax(0, 1.1fr) minmax(0, 1.3fr) auto; align-items: center; }
  .types__d { grid-column: auto; }
  .types__go { display: block; opacity: 0; transition: opacity var(--dur-fast); }
  .types a:hover .types__go { opacity: 1; }
}

/* как работает */
.flow { display: grid; gap: 0; counter-reset: flow; }
.flow li { position: relative; display: grid; grid-template-columns: 64px 1fr; gap: 0 18px; padding: 22px 0; border-top: 1px solid var(--line-on-dark); counter-increment: flow; }
.flow li::before { content: counter(flow, decimal-leading-zero); font-family: var(--font-display); font-size: 2.4rem; font-weight: 600; line-height: 1; color: var(--accent); }
.flow h3 { margin-bottom: 8px; }
.flow p { color: #c9cdd0; max-width: 60ch; }
.flow small { display: inline-block; margin-top: 10px; padding: 3px 10px; border: 1px solid var(--line-on-dark); font-size: .8rem; color: var(--muted-on-dark); }
@media (min-width: 900px) {
  .flow { grid-template-columns: repeat(5, 1fr); gap: 0 28px; }
  .flow li { grid-template-columns: 1fr; border-top: 2px solid var(--accent); padding-top: 20px; }
  .flow li::before { margin-bottom: 16px; }
}

/* зачем брокер */
.why { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.why > div { padding: clamp(20px, 3vw, 32px); background: var(--paper); }
.why h3 { margin-bottom: 10px; }
.why p { color: var(--muted); }
@media (min-width: 760px) { .why { grid-template-columns: 1fr 1fr; } .why > div:first-child { grid-row: span 2; background: var(--ink); color: var(--white); display: flex; flex-direction: column; justify-content: flex-end; } .why > div:first-child p { color: #c9cdd0; } }
.why .big { font-family: var(--font-display); font-size: clamp(4rem, 10vw, 7rem); font-weight: 600; line-height: .9; color: var(--accent); margin-bottom: 16px; }

/* документы */
.docs { display: grid; gap: 28px; }
@media (min-width: 900px) { .docs { grid-template-columns: repeat(3, 1fr); gap: 36px; } }
.docs__col { padding-top: 18px; border-top: 2px solid var(--ink); }
.docs__col h3 { margin-bottom: 14px; }
.docs__col li { position: relative; padding: 9px 0 9px 26px; border-bottom: 1px solid var(--line); font-size: .96rem; }
.docs__col li::before { content: ""; position: absolute; left: 0; top: 16px; width: 12px; height: 7px; border-left: 2.5px solid var(--ink); border-bottom: 2.5px solid var(--ink); transform: rotate(-45deg); }
.note { margin-top: 32px; padding: 16px 20px; border-left: 4px solid var(--accent); background: var(--white); font-size: .95rem; color: var(--muted); max-width: 80ch; }
.note b { color: var(--ink); }

/* FAQ */
.faq { max-width: 860px; border-top: 2px solid var(--ink); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { display: flex; justify-content: space-between; gap: 20px; align-items: center; padding: 20px 4px; font-weight: 600; font-size: 1.08rem; cursor: pointer; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; flex: none; font-family: var(--font-display); font-size: 1.8rem; line-height: 1; transition: transform var(--dur) var(--ease-out); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding: 0 4px 22px; color: var(--muted); max-width: 70ch; }

/* финальный CTA */
.cta { position: relative; background: var(--accent); padding-block: clamp(56px, 8vw, 96px); }
.cta__in { display: grid; gap: 28px; align-items: center; }
.cta h2 { max-width: 18ch; }
.cta p { margin-top: 14px; max-width: 48ch; }
.cta .btn { background: var(--ink); color: var(--white); box-shadow: none; }
.cta .btn:hover { transform: translateY(-2px); }
.cta__contacts { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; }
.cta__contacts a:not(.btn) { font-family: var(--font-display); font-size: 1.4rem; font-weight: 600; text-decoration: none; border-bottom: 2px solid var(--ink); }
@media (min-width: 900px) { .cta__in { grid-template-columns: 1.3fr 1fr; } .cta__contacts { justify-content: flex-end; } }

/* футер */
.footer { background: var(--ink); color: var(--muted-on-dark); padding-block: 44px; font-size: .88rem; }
.footer__in { display: grid; gap: 24px; }
.footer a { color: var(--white); text-decoration-color: var(--line-on-dark); text-underline-offset: 3px; }
.footer .logo { color: var(--white); margin-bottom: 12px; }
.footer__legal { max-width: 70ch; line-height: 1.5; }
.footer ul { display: grid; gap: 6px; }
@media (min-width: 800px) { .footer__in { grid-template-columns: 2fr 1fr 1fr; } }

/* юридические страницы */
.legal { max-width: 820px; padding-block: clamp(40px, 6vw, 72px); }
.legal h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin-bottom: 24px; }
.legal h2 { font-size: 1.3rem; margin: 32px 0 10px; }
.legal p, .legal li { margin-bottom: 10px; }
.legal ul { list-style: disc; padding-left: 22px; }
.legal mark { background: var(--accent); padding: 0 4px; }

/* ---------- reveal на скролле ---------- */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity var(--dur) var(--ease-out), transform var(--dur) var(--ease-out); }
.js .reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}
