:root {
  --bg: #F3F5F9;
  --card: #FFFFFF;
  --ink: #0B1B2B;
  --ink-2: #4A5868;
  --muted: #8A96A3;
  --line: #E6EAF0;
  --brand: #12B76A;
  --brand-ink: #067647;
  --link: #2563EB;
  --hero-1: #0B1B2B;
  --hero-2: #12324A;
  --radius: 20px;
  --shadow: 0 1px 2px rgba(11, 27, 43, .04), 0 8px 24px rgba(11, 27, 43, .06);
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; line-height: 1.15; letter-spacing: -.02em; }
a { color: var(--link); }
.wrap { width: 100%; max-width: 560px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); font-size: 13px; }

/* top bar */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: rgba(11, 27, 43, .92);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
}
.topbar__in { height: 56px; display: flex; align-items: center; justify-content: space-between; }
.logo { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 700; font-size: 18px; }
.logo__mark {
  width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center;
  background: var(--brand); color: #fff; font-weight: 800;
}
.logo__text b { color: var(--brand); font-weight: 800; }
.topbar__link { color: rgba(255,255,255,.75); text-decoration: none; font-weight: 600; font-size: 14px; padding: 8px 0; }

/* hero */
.hero {
  background: radial-gradient(120% 90% at 100% 0%, #1B4D5C 0%, transparent 60%),
              linear-gradient(160deg, var(--hero-1), var(--hero-2));
  color: #fff;
  padding: 28px 0 84px;
}
.hero h1 { font-size: 30px; font-weight: 800; }
.hero__sub { color: rgba(255,255,255,.72); margin: 10px 0 22px; font-size: 15px; }

.picker {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--radius);
  padding: 16px 16px 12px;
}
.picker__head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.picker__head span { color: rgba(255,255,255,.72); font-weight: 600; font-size: 14px; }
.picker__value { font-size: 24px; font-weight: 800; }
.picker__scale { display: flex; justify-content: space-between; color: rgba(255,255,255,.5); font-size: 12px; margin-top: 6px; }

input[type=range] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 28px; background: transparent; margin: 0;
  --p: 20%;
}
input[type=range]::-webkit-slider-runnable-track {
  height: 6px; border-radius: 99px;
  background: linear-gradient(to right, var(--brand) var(--p), rgba(255,255,255,.2) var(--p));
}
input[type=range]::-moz-range-track { height: 6px; border-radius: 99px; background: rgba(255,255,255,.2); }
input[type=range]::-moz-range-progress { height: 6px; border-radius: 99px; background: var(--brand); }
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 26px; height: 26px; margin-top: -10px; border-radius: 50%;
  background: #fff; border: 6px solid var(--brand); box-shadow: 0 2px 8px rgba(0,0,0,.3);
}
input[type=range]::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%;
  background: #fff; border: 6px solid var(--brand);
}
input[type=range]:focus-visible { outline: 2px solid #fff; outline-offset: 4px; border-radius: 8px; }

/* offers */
.offers { margin-top: -60px; position: relative; }
.offers__head { display: flex; align-items: baseline; justify-content: space-between; color: #fff; margin-bottom: 12px; }
.offers__head h2 { font-size: 18px; }
.offers__head .muted { color: rgba(255,255,255,.6); }
.offers__list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  transition: opacity .25s, transform .25s;
}
.card.is-dim { opacity: .55; }
.card__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.plate {
  flex: none; width: 124px; height: 48px; padding: 8px 12px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  background: #fff; border: 1px solid var(--line);
}
.plate img { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.plate--dark { background: var(--ink); border-color: var(--ink); }
.plate__text { font-size: 17px; font-weight: 800; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card__company { margin-top: 8px; font-size: 12px; color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.badge {
  flex: none;
  background: #ECFDF3; color: var(--brand-ink);
  font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 99px;
}

.badge--done { display: inline-flex; align-items: center; gap: 4px; background: var(--ink); color: #fff; }
.badge--done svg { width: 12px; height: 12px; }
.card.is-applied { box-shadow: none; outline: 1px solid var(--line); }

/* підказка над списком */
.nudge {
  display: flex; gap: 10px; align-items: flex-start;
  background: #FFF8E6; border: 1px solid #FCE3A6; border-radius: 16px; padding: 12px 14px;
}
.nudge p { margin: 0; font-size: 14px; line-height: 1.45; }
.nudge__icon { font-size: 18px; line-height: 1.2; }
.nudge--return { background: #EEF4FF; border-color: #C7D7FE; }
.nudge.is-flash { animation: nudge-flash 1.2s ease 2; }
@keyframes nudge-flash { 50% { box-shadow: 0 0 0 4px rgba(37, 99, 235, .25); } }

/* Умови послуги: однакові гарнітура, колір і розмір (вимога НБУ, п. 15-1, 15-2) */
.terms {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  margin: 14px 0 0; padding: 0;
}
.terms > .terms__wide { grid-column: 1 / -1; }
.terms > div { background: var(--bg); border-radius: 12px; padding: 10px; min-width: 0; }
.terms dt { font-size: 12px; color: var(--ink-2); font-weight: 600; }
.terms dd, .promo { margin: 2px 0 0; font-size: 15px; font-weight: 700; color: var(--ink); overflow-wrap: anywhere; }
.promo { margin-top: 10px; display: flex; gap: 8px; align-items: flex-start; }
.promo::before { content: "★"; color: var(--brand); }

.legal-links { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 10px 0 0; padding: 0; list-style: none; font-size: 13px; }
.legal-links a { color: var(--link); text-decoration: underline; text-underline-offset: 2px; font-weight: 600; }
.legal-links .is-missing { color: #B42318; font-weight: 600; }

.cta {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-top: 14px; min-height: 52px; border-radius: 14px;
  background: var(--brand); color: #fff; text-decoration: none;
  font-weight: 800; font-size: 16px;
  box-shadow: 0 6px 16px rgba(18, 183, 106, .35);
  transition: transform .1s, background .2s;
}
.cta:active { transform: scale(.98); }
.cta:hover { background: #0FA35E; }
.cta svg { width: 18px; height: 18px; }
.card__note { margin: 10px 0 0; font-size: 12px; color: var(--muted); text-align: center; }
.cta.is-off { background: var(--bg); color: var(--muted); box-shadow: none; cursor: default; font-size: 15px; }

/* перший / повторний кредит */
.tier { display: grid; row-gap: 6px; }
.tier dt { margin-bottom: 0; color: var(--ink); font-weight: 800; font-size: 13px; }
.tier dd { margin: 0; }
.tier__k { display: block; font-size: 12px; font-weight: 600; color: var(--ink-2); }

/* промокод */
.code {
  display: flex; align-items: center; gap: 10px; margin-top: 10px;
  padding: 8px 8px 8px 12px; border: 1.5px dashed var(--brand); border-radius: 12px; background: #F3FBF6;
}
.code__label { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.code__value { flex: 1; font-size: 17px; font-weight: 800; letter-spacing: .08em; }
.code__copy {
  font: inherit; font-size: 13px; font-weight: 700; color: var(--brand-ink);
  background: #fff; border: 1px solid #BDEBD2; border-radius: 9px; padding: 8px 12px; cursor: pointer;
}
.code__copy.is-done { background: var(--brand); color: #fff; border-color: var(--brand); }

/* сервіс підбору */
.card--service { background: linear-gradient(160deg, #FFFFFF 55%, #EEF6FF); }
.card__lead { margin: 12px 0 0; font-size: 15px; font-weight: 600; }
.points { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.points li { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; color: var(--ink-2); }
.points svg { flex: none; width: 18px; height: 18px; margin-top: 1px; color: var(--brand); }

/* приклад розрахунку — цифри тим самим шрифтом, що й умови */
.example { margin-top: 10px; border: 1px solid var(--line); border-radius: 12px; }
.example summary {
  list-style: none; cursor: pointer; padding: 12px 40px 12px 12px; position: relative;
  font-size: 14px; font-weight: 700; color: var(--ink-2);
}
.example summary::-webkit-details-marker { display: none; }
.example summary::after {
  content: ""; position: absolute; right: 16px; top: 50%; width: 8px; height: 8px;
  border-right: 2px solid var(--ink-2); border-bottom: 2px solid var(--ink-2);
  transform: translateY(-70%) rotate(45deg); transition: transform .2s;
}
.example[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
.example__rows { margin: 0; padding: 0 12px; }
.example__rows > div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.example__rows dt { font-size: 13px; color: var(--ink-2); font-weight: 600; }
.example__rows dd { margin: 0; font-size: 15px; font-weight: 700; color: var(--ink); text-align: right; white-space: nowrap; }
.example__cap { margin: 0; padding: 4px 12px 12px; font-size: 12px; color: var(--muted); }

/* попередження: рамка + напівжирний шрифт */
.warning {
  margin: 22px 0 0;
  border: 2px solid var(--ink);
  border-radius: 14px;
  padding: 14px;
  background: #fff;
  font-weight: 700;
  font-size: 15px;
}

/* FAQ */
.faq { margin-top: 32px; }
.faq h2 { font-size: 20px; margin-bottom: 12px; }
.faq details { background: var(--card); border-radius: 16px; margin-bottom: 8px; box-shadow: var(--shadow); }
.faq summary {
  list-style: none; cursor: pointer; padding: 16px 44px 16px 16px; font-weight: 700; position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 18px; top: 50%; width: 9px; height: 9px;
  border-right: 2px solid var(--ink-2); border-bottom: 2px solid var(--ink-2);
  transform: translateY(-70%) rotate(45deg); transition: transform .2s;
}
.faq details[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
.faq details p { margin: 0; padding: 0 16px 16px; color: var(--ink-2); }

/* footer */
.footer { margin-top: 36px; padding: 24px 0 calc(28px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-2); }
.footer p { margin: 0 0 10px; }

/* липка кнопка внизу */
.sticky {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  background: rgba(255, 255, 255, .96);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  box-shadow: 0 -6px 24px rgba(11, 27, 43, .10);
  padding: 10px 0 calc(10px + env(safe-area-inset-bottom));
  transform: translateY(110%); transition: transform .25s ease;
}
.sticky.is-on { transform: none; }
.sticky__in { display: flex; gap: 10px; align-items: center; }
.sticky__plate { width: 96px; height: 52px; padding: 8px 10px; text-decoration: none; color: var(--ink); }
.sticky__plate .plate__text { font-size: 15px; }
.sticky__cta { flex: 1; margin-top: 0; }
body.has-sticky .footer { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
.card.is-flash { animation: nudge-flash 1.2s ease 2; }
.card, .nudge { scroll-margin-top: 68px; }

@media (min-width: 720px) {
  .hero { padding-top: 48px; }
  .hero h1 { font-size: 40px; }
  .wrap { max-width: 640px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
