/* ============================================================
   финанза.рус — информационный сайт о МФО «Финанза»
   Тёплая «бумажная» редакционная гамма (не индиго+лайм официалов)
   ============================================================ */

:root {
  --bg: #FAF8F3;
  --surface: #FFFDF8;
  --card: #F0EBE1;
  --good: #E4EEE8;
  --warn: #FBF1E1;
  --border: #DDD5C4;
  --ink: #23201B;
  --ink-soft: #5C564A;
  --primary: #1B5A4C;
  --primary-dark: #14473C;
  --primary-ink: #E9F0E9;
  --accent: #A84C28;
  --accent-dark: #8F3D1F;
  --accent-soft: #F6E7DC;
  --font-heading: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-sans: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; }

a { color: var(--primary); text-underline-offset: 3px; }
a:hover { color: var(--accent); }

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

h1, h2, h3 { font-family: var(--font-heading); font-weight: 700; line-height: 1.3; color: var(--ink); }
h1 { font-size: clamp(28px, 5vw, 42px); }
h2 { font-size: clamp(23px, 4vw, 29px); }
h3 { font-size: 20px; }

[id] { scroll-margin-top: 100px; }

.container { max-width: 880px; margin: 0 auto; padding: 0 20px; }

/* ---------- Ссылка «перейти к содержимому» ---------- */
.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--primary); color: #fff;
  padding: 10px 18px; z-index: 1000; border-radius: 0 0 8px 0;
  text-decoration: none; font-weight: 600;
}
.skip-link:focus { left: 0; color: #fff; }

/* ---------- Плашка-дисклеймер над шапкой ---------- */
.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink-soft);
  text-align: center;
  padding: 8px 16px;
}
.topbar a { color: var(--primary); }

/* ---------- Шапка ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 64px;
}
.logo {
  flex: none;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 21px;
  color: var(--primary);
  text-decoration: none;
  white-space: nowrap;
}
.logo .dot { color: var(--accent); }
.badge-18 {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px; height: 22px;
  border: 1.5px solid var(--ink);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink);
}

.nav { margin-left: auto; display: flex; align-items: center; gap: 0; }
.nav a {
  display: inline-block;
  padding: 7px 8px;
  border-radius: 6px;
  color: var(--ink);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}
.nav a:hover { color: var(--accent); background: var(--card); }

.header-cta { flex: none; white-space: nowrap; margin-left: 6px; }

.burger {
  display: none;
  margin-left: auto;
  width: 44px; height: 44px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
  position: relative;
}
.burger span {
  position: absolute;
  left: 11px; right: 11px; height: 2px;
  background: var(--ink);
  transition: transform .2s ease, opacity .2s ease;
}
.burger span:nth-child(1) { top: 15px; }
.burger span:nth-child(2) { top: 21px; }
.burger span:nth-child(3) { top: 27px; }
.burger[aria-expanded="true"] span:nth-child(1) { top: 21px; transform: rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { top: 21px; transform: rotate(-45deg); }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 28px;
  border: 2px solid var(--primary);
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.btn:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.btn-sm { min-height: 42px; padding: 9px 18px; font-size: 15px; }
.btn-light { background: var(--surface); border-color: var(--surface); color: var(--primary); }
.btn-light:hover { background: var(--card); border-color: var(--card); color: var(--primary-dark); }
.btn-outline { background: transparent; color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-outline.btn-light {
  background: transparent;
  border-color: #fff;
  color: #fff;
}
.btn-outline.btn-light:hover {
  background: #fff;
  border-color: #fff;
  color: var(--primary);
}

/* ---------- Hero ---------- */
.hero { padding: 56px 0 40px; }
.hero--page { padding: 28px 0 20px; }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 230px;
  gap: 36px;
  align-items: center;
}
.hero h1 { margin: 0 0 20px; }
.hero .lead { font-size: 18px; color: var(--ink-soft); margin: 0 0 24px; max-width: 640px; }
.hero .lead a { font-weight: 600; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.hero-note { font-size: 14px; color: var(--ink-soft); margin-top: 14px; max-width: 560px; }
.hero-art { display: block; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; }
.chip {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 14px;
  font-weight: 600;
}

/* ---------- Разделы ---------- */
.section { padding: 44px 0 4px; }
.section h2 { margin: 0 0 18px; }
.section h2::before {
  content: '';
  display: block;
  width: 44px; height: 3px;
  background: var(--accent);
  margin-bottom: 12px;
  border-radius: 2px;
}
.section h3 { margin: 26px 0 10px; }
.section p { margin: 0 0 14px; }
.section ul, .section ol { margin: 0 0 16px; padding-left: 24px; }
.section li { margin-bottom: 8px; }
.divider { border: none; border-top: 1px solid var(--border); margin: 40px 0 0; }

/* ---------- Таблицы ---------- */
.table-scroll { overflow-x: auto; margin: 18px 0; }
table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  background: var(--surface);
  font-size: 15.5px;
}
caption {
  caption-side: top;
  text-align: left;
  font-family: var(--font-heading);
  font-size: 17px;
  font-weight: 700;
  padding: 0 0 8px;
}
th, td {
  border: 1px solid var(--border);
  padding: 11px 14px;
  text-align: left;
  vertical-align: top;
}
th {
  background: var(--card);
  font-weight: 700;
  white-space: nowrap;
}
tbody tr:nth-child(even) td { background: #F6F2E9; }

/* ---------- Шаги ---------- */
ol.steps { list-style: none; padding: 0; counter-reset: step; }
ol.steps li {
  position: relative;
  padding: 0 0 4px 58px;
  margin-bottom: 20px;
  counter-increment: step;
}
ol.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0; top: 2px;
  width: 38px; height: 38px;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
}
ol.steps strong { display: block; margin-bottom: 2px; }

/* ---------- Плашки-заметки ---------- */
.note {
  background: var(--warn);
  border-left: 4px solid var(--accent);
  border-radius: 0 8px 8px 0;
  padding: 14px 18px;
  margin: 20px 0;
  font-size: 15px;
}
.note.good { background: var(--good); border-left-color: var(--primary); }
.note-title { display: block; font-weight: 700; margin-bottom: 4px; font-size: 15px; }

/* ---------- Карточки тарифов ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
  margin: 20px 0;
}
.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 22px;
}
.card--featured { background: var(--good); border-color: var(--primary); }
.card h3 { margin: 0 0 10px; font-size: 19px; }
.card .card-sum { font-family: var(--font-heading); font-size: 25px; font-weight: 700; color: var(--primary); margin-bottom: 10px; }
.card ul { margin: 0 0 16px; padding-left: 20px; font-size: 15px; }
.card ul li { margin-bottom: 6px; }
.card .btn { margin-top: auto; }

/* ---------- FAQ ---------- */
details.faq {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 10px;
}
details.faq summary {
  cursor: pointer;
  list-style: none;
  position: relative;
  padding: 16px 52px 16px 18px;
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.4;
}
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after {
  content: '+';
  position: absolute;
  right: 16px; top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-sans);
  font-size: 26px;
  font-weight: 400;
  color: var(--accent);
  line-height: 1;
}
details.faq[open] summary::after { content: '–'; }
details.faq .faq-body { padding: 0 18px 18px; font-size: 16px; }
details.faq .faq-body p { margin: 0 0 10px; }
details.faq .faq-body p:last-child { margin-bottom: 0; }

/* ---------- Хлебные крошки ---------- */
.breadcrumbs {
  margin: 20px 0 0;
  font-size: 14px;
  color: var(--ink-soft);
}
.breadcrumbs a { color: var(--primary); text-decoration: none; }
.breadcrumbs a:hover { color: var(--accent); text-decoration: underline; }
.breadcrumbs .sep { margin: 0 8px; color: var(--border); }

/* ---------- CTA-баннер ---------- */
.cta-band {
  background: var(--primary);
  color: var(--primary-ink);
  border-radius: 14px;
  padding: 34px 30px;
  margin: 44px 0 0;
}
.cta-band h2 { color: #fff; margin: 0 0 10px; }
.cta-band h2::before { background: var(--accent); }
.cta-band p { margin: 0 0 20px; color: #DCE7DC; }
.cta-band .hero-actions { margin-bottom: 4px; }
.cta-band .hero-note { color: #B9CABB; }

/* ---------- Футер ---------- */
.site-footer {
  margin-top: 64px;
  background: #14382F;
  color: #D8E2DA;
  font-size: 14.5px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1.4fr;
  gap: 32px;
  padding: 44px 0 28px;
}
.site-footer h2 {
  color: #fff;
  font-size: 18px;
  margin: 0 0 12px;
}
.site-footer h2::before { display: none; }
.site-footer a { color: #F2E5DA; }
.site-footer a:hover { color: #fff; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer ul li { margin-bottom: 8px; }
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, .16);
  padding: 18px 0 26px;
  font-size: 13px;
  color: #A9BCAC;
}

/* ---------- Страница 404 ---------- */
.notfound { padding: 80px 0; text-align: center; }
.notfound .code {
  font-family: var(--font-heading);
  font-size: 72px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 12px;
}
.notfound h1 { margin-bottom: 14px; }
.notfound p { color: var(--ink-soft); margin-bottom: 28px; }
.notfound .hero-actions { justify-content: center; }

/* ---------- Адаптив ---------- */
@media (max-width: 820px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-art { display: none; }
}

@media (max-width: 980px) {
  .header-cta { display: none; }
}

@media (max-width: 768px) {
  body { font-size: 16.5px; }
  .burger { display: block; }
  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 8px 20px 16px;
    box-shadow: 0 12px 24px rgba(35, 32, 27, .08);
  }
  .nav.open { display: flex; }
  .nav a { padding: 12px 8px; border-bottom: 1px solid var(--border); border-radius: 0; }
  .nav a:last-child { border-bottom: none; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .section { padding-top: 36px; }
  .hero { padding-top: 40px; }
  ol.steps li { padding-left: 50px; }
  ol.steps li::before { width: 34px; height: 34px; font-size: 15px; }
  details.faq summary { font-size: 16.5px; padding-right: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
