@font-face {
  font-family: 'Gilroy';
  src: url('../fonts/Gilroy-Regular.woff2') format('woff2'),
    url('../fonts/Gilroy-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Gilroy';
  src: url('../fonts/Gilroy-Medium.woff2') format('woff2'),
    url('../fonts/Gilroy-Medium.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Gilroy';
  src: url('../fonts/Gilroy-SemiBold.woff2') format('woff2'),
    url('../fonts/Gilroy-SemiBold.ttf') format('truetype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Gilroy';
  src: url('../fonts/Gilroy-Bold.woff2') format('woff2'),
    url('../fonts/Gilroy-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --brand: #2563eb;
  --brand-deep: #172554;
  --accent: #7c3aed;
  --grad: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  --grad-soft: linear-gradient(135deg, rgba(37, 99, 235, 0.1), rgba(124, 58, 237, 0.1));

  --canvas: #f5f6fb;
  --surface: #ffffff;
  --ink: #0f172a;
  --ink-soft: #64748b;
  --line: #e6e9f2;
  --ok: #10b981;

  --r-card: 24px;
  --r-md: 14px;
  --r-pill: 999px;

  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 12px 32px rgba(15, 23, 42, 0.08);
  --shadow-lift: 0 24px 60px rgba(23, 37, 84, 0.16);

  --container: 1180px;
  --hdr-h: 72px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--hdr-h) + 16px);
}

body {
  margin: 0;
  min-width: 320px;
  font-family: 'Gilroy', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
}

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

/* .card sets display:flex, which would beat the UA rule for [hidden] */
[hidden] {
  display: none !important;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3,
p,
dl,
dd,
ol,
ul {
  margin: 0;
}

h1,
h2,
h3 {
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

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

.shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.container {
  width: min(100% - 32px, var(--container));
  margin-inline: auto;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 24px;
  border: 0;
  border-radius: var(--r-pill);
  font: inherit;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.btn--primary {
  color: #fff;
  background: var(--grad);
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.32);
}

.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 32px rgba(37, 99, 235, 0.4);
}

.btn--ghost {
  color: var(--brand);
  background: rgba(37, 99, 235, 0.08);
}

.btn--ghost:hover {
  background: rgba(37, 99, 235, 0.16);
}

.btn--sm {
  min-height: 40px;
  padding: 0 18px;
  font-size: 14px;
}

.btn--block {
  width: 100%;
}

/* ---------- header ---------- */

.hdr {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.hdr__inner {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: var(--hdr-h);
}

.hdr__logo img {
  width: 152px;
  height: auto;
}

.hdr__nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

/* :not(.btn) — інакше цей селектор перебиває .btn--primary за специфічністю */
.hdr__nav a:not(.btn) {
  padding: 10px 14px;
  border-radius: var(--r-pill);
  font-size: 15px;
  font-weight: 500;
  color: var(--ink-soft);
  transition: color 0.18s ease, background 0.18s ease;
}

.hdr__nav a:not(.btn):hover {
  color: var(--brand);
  background: rgba(37, 99, 235, 0.08);
}

.hdr__cta {
  margin-left: 8px;
}

.hdr__back {
  margin-left: auto;
}

.hdr__burger {
  display: none;
  margin-left: auto;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
}

.hdr__burger span {
  display: block;
  width: 20px;
  height: 2px;
  margin: 4px auto;
  border-radius: 2px;
  background: var(--ink);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.hdr__burger.is-open span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.hdr__burger.is-open span:nth-child(2) {
  opacity: 0;
}

.hdr__burger.is-open span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* ---------- hero ---------- */

.hero {
  position: relative;
  padding: 56px 0 96px;
  background: var(--grad);
  color: #fff;
  overflow: hidden;
}

.hero::after {
  content: '';
  position: absolute;
  right: -140px;
  top: -160px;
  width: 460px;
  height: 460px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  pointer-events: none;
}

.hero__inner {
  position: relative;
  z-index: 1;
  max-width: 720px;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.18);
  font-size: 14px;
  font-weight: 600;
}

.hero__title {
  margin-top: 20px;
  font-size: clamp(32px, 5.2vw, 56px);
}

.hero__lead {
  margin-top: 18px;
  max-width: 620px;
  font-size: clamp(15px, 1.6vw, 18px);
  color: rgba(255, 255, 255, 0.88);
}

.hero__points {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
  padding: 0;
  list-style: none;
}

.hero__points li {
  padding: 8px 16px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: var(--r-pill);
  font-size: 14px;
  font-weight: 500;
}

@media (max-width: 767px) {

  .hero__points,
  .hero__lead {
    display: none;
  }
}

/* ---------- filter ---------- */

.filter {
  position: relative;
  z-index: 2;
  margin-top: -120px;
  padding: 24px;
  border-radius: var(--r-card);
  background: var(--surface);
  box-shadow: var(--shadow-lift);
}

@media (max-width: 767px) {
  .filter {
    margin-top: -100px;
  }
}

/* Згорнутий вигляд — тільки на мобільних, див. @media нижче */
.filter__toggle {
  display: none;
  width: 100%;
  align-items: center;
  gap: 12px;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.filter__toggle-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.filter__toggle-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
}

.filter__toggle-values {
  font-size: 18px;
  font-weight: 700;
  color: var(--brand);
  letter-spacing: -0.02em;
}

.filter__toggle-badge {
  flex: none;
  margin-left: auto;
  min-width: 44px;
  padding: 8px 14px;
  border-radius: var(--r-pill);
  background: var(--grad-soft);
  font-size: 16px;
  font-weight: 700;
  color: var(--brand);
  text-align: center;
}

.filter__toggle-chevron {
  flex: none;
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--ink-soft);
  border-bottom: 2px solid var(--ink-soft);
  transform: translateY(-3px) rotate(45deg);
  transition: transform 0.2s ease;
}

.filter.is-open .filter__toggle-chevron {
  transform: translateY(2px) rotate(-135deg);
}

.filter__grid {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  align-items: end;
  gap: 24px;
}

.filter__field {
  min-width: 0;
}

.filter__label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
}

.filter__row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-top: 4px;
}

.filter__input {
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 26px;
  font-weight: 700;
  color: var(--brand);
  letter-spacing: -0.02em;
}

.filter__input:focus {
  outline: none;
}

.filter__unit {
  font-size: 18px;
  font-weight: 600;
  color: var(--ink-soft);
  white-space: nowrap;
}

.filter__range {
  display: block;
  width: 100%;
  height: 6px;
  margin: 14px 0 0;
  appearance: none;
  -webkit-appearance: none;
  border-radius: var(--r-pill);
  background: var(--line);
  cursor: pointer;
}

.filter__range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  margin-top: -8px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.45);
  cursor: pointer;
}

.filter__range::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.45);
  cursor: pointer;
}

.filter__result {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 20px;
  border-radius: var(--r-md);
  background: var(--grad-soft);
  text-align: center;
  white-space: nowrap;
}

.filter__count {
  font-size: 26px;
  font-weight: 700;
  color: var(--brand);
  letter-spacing: -0.02em;
}

.filter__count-label {
  font-size: 13px;
  color: var(--ink-soft);
}

/* ---------- sections ---------- */

.section {
  padding: 56px 0;
}

.section__head {
  margin-bottom: 28px;
}

.filter+.section__head {
  margin-top: 40px;
}

.section__label {
  display: inline-block;
  margin-bottom: 10px;
  padding: 6px 14px;
  border-radius: var(--r-pill);
  background: var(--grad-soft);
  font-size: 13px;
  font-weight: 600;
  color: var(--brand);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

@media (max-width: 767px) {
  .section__label {
    display: none;
  }
  .section__title {
    text-align: center;
  }
}

.section__title {
  font-size: clamp(24px, 3vw, 36px);
}

/* ---------- offer cards ---------- */

.offers__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.card {
  display: flex;
  flex-direction: column;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(37, 99, 235, 0.35);
  box-shadow: var(--shadow-md);
}

.card__logo {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 56px;
  margin-bottom: 18px;
}

.card__logo img {
  max-height: 114px;
  width: auto;
  object-fit: contain;
}

.card__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 0;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.card__stats>div {
  min-width: 0;
  text-align: center;
}

.card__stats>div+div {
  border-left: 1px solid var(--line);
}

.card__stats dt {
  font-size: 12px;
  color: var(--ink-soft);
}

.card__stats dd {
  margin-top: 4px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.card__apr {
  margin-top: 16px;
  padding: 14px;
  border-radius: var(--r-md);
  background: var(--grad-soft);
}

.card__apr-title {
  font-size: 12px;
  color: var(--ink-soft);
}

.card__apr-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--brand);
}

.card__legal {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 14px;
}

.card__legal a {
  font-size: 12px;
  line-height: 1.35;
  color: var(--ink-soft);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.card__legal a:hover {
  color: var(--brand);
}

.card__cta {
  margin-top: auto;
  padding-top: 18px;
}

/* ---------- empty states ---------- */

.empty {
  padding: 40px 24px;
  border: 1px dashed var(--line);
  border-radius: var(--r-card);
  background: var(--surface);
  text-align: center;
  color: var(--ink-soft);
}

.no-results {
  margin-top: 20px;
  padding: 36px 24px;
  border-radius: var(--r-card);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  text-align: center;
}

.no-results p {
  margin-bottom: 16px;
  color: var(--ink-soft);
}

/* ---------- faq ---------- */

.faq__list {
  display: grid;
  gap: 12px;
}

.faq__item {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  overflow: hidden;
}

.faq__item[open] {
  border-color: rgba(37, 99, 235, 0.35);
  box-shadow: var(--shadow-sm);
}

.faq__q {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.faq__q::-webkit-details-marker {
  display: none;
}

.faq__q::after {
  content: '+';
  flex: none;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--grad-soft);
  font-size: 18px;
  color: var(--brand);
  transition: transform 0.2s ease;
}

.faq__item[open] .faq__q::after {
  content: '\2212';
  transform: rotate(180deg);
}

.faq__a {
  padding: 0 20px 20px;
  color: var(--ink-soft);
}

/* ---------- lenders ---------- */

.lenders__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.lender {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.lender:hover,
.lender:focus-visible {
  transform: translateY(-4px);
  border-color: rgba(124, 58, 237, 0.35);
  box-shadow: var(--shadow-md);
}

.lender__name {
  padding-bottom: 14px;
  border-bottom: 2px solid transparent;
  border-image: var(--grad) 1;
  border-image-slice: 0 0 1 0;
  font-size: 17px;
  font-weight: 700;
}

.lender__rows {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}

.lender__row {
  min-width: 0;
  font-size: 13px;
}

.lender__row span {
  display: block;
  color: var(--ink-soft);
}

.lender__row strong {
  display: block;
  margin-top: 2px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.lender__row a {
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.lender__row--full {
  grid-column: 1 / -1;
}

/* ---------- prose (seo + docs) ---------- */

.prose {
  padding: 28px;
  border-radius: var(--r-card);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.prose h2 {
  font-size: clamp(22px, 2.6vw, 30px);
}

.prose h3 {
  margin-top: 24px;
  font-size: 19px;
}

.prose p,
.prose li {
  margin-top: 12px;
  color: var(--ink-soft);
}

.prose ol {
  padding-left: 20px;
}

.prose ol li::marker {
  color: var(--brand);
  font-weight: 700;
}

.prose strong {
  color: var(--ink);
}

/* ---------- doc pages ---------- */

.page-hero {
  padding: 48px 0 64px;
  background: var(--grad);
  color: #fff;
}

.page-hero__label {
  display: inline-block;
  padding: 6px 14px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.18);
  font-size: 13px;
  font-weight: 600;
}

.page-hero h1 {
  margin-top: 16px;
  font-size: clamp(28px, 4.4vw, 44px);
}

.page-hero__lead {
  margin-top: 16px;
  max-width: 680px;
  color: rgba(255, 255, 255, 0.88);
}

.doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  margin-top: -32px;
}

.doc-card {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.doc-card h2 {
  font-size: 17px;
}

.doc-card p {
  margin-top: 10px;
  font-size: 15px;
  color: var(--ink-soft);
}

/* ---------- footer ---------- */

.ftr {
  margin-top: auto;
  padding: 48px 0 32px;
  background: var(--brand-deep);
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
}

.ftr__top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.ftr__logo img {
  width: 152px;
  height: auto;
  filter: brightness(0) invert(1);
}

.ftr__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}

.ftr__nav a:hover,
.ftr__contacts a:hover,
.ftr__bottom a:hover {
  color: #fff;
}

.ftr__contacts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  padding: 20px 0;
}

.ftr__contacts a {
  color: #fff;
  font-weight: 600;
}

.ftr__text p+p {
  margin-top: 10px;
}

.ftr__bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 13px;
}

.ftr__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
}

/* ---------- responsive ---------- */

@media (max-width: 992px) {
  .filter__grid {
    grid-template-columns: 1fr 1fr;
  }

  .filter__result {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: baseline;
    justify-content: center;
    gap: 8px;
  }
}

@media (max-width: 767px) {
  .hdr__burger {
    display: block;
  }

  .hdr__cta {
    display: none;
  }

  .hdr__nav {
    position: absolute;
    left: 16px;
    right: 16px;
    top: calc(var(--hdr-h) - 4px);
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    background: #fff;
    box-shadow: var(--shadow-md);
  }

  .hdr__nav.is-open {
    display: flex;
  }

  .hero {
    padding: 36px 0 84px;
  }

  .section {
    padding: 40px 0;
  }

  .filter {
    padding: 18px;
  }

  .filter__toggle {
    display: flex;
  }

  .filter__body {
    display: none;
  }

  .filter.is-open .filter__body {
    display: block;
    margin-top: 16px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
  }

  .filter__grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  /* згорнутий фільтр підтягує картки вище — щоб перша була видна без скролу */
  .filter+.section__head {
    margin-top: 24px;
  }

  .section__head {
    margin-bottom: 20px;
  }

  .lender__rows {
    grid-template-columns: 1fr;
  }

  .prose,
  .doc-card {
    padding: 20px;
  }

  .ftr__top {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }

  .btn:hover,
  .card:hover,
  .lender:hover {
    transform: none;
  }
}