/* =========================================================
   Бюджет Займ - основные стили
   Палитра: светлый фон + фиолетовый акцент
   Фирменный приём: "бюджетный чек" - пунктирные линии,
   табличные (моноширинные) цифры для денежных значений,
   заголовок карточек с перфорацией - отсылка к слову "Бюджет"
   ========================================================= */

:root {
  --color-bg: #FBFAFE;
  --color-bg-soft: #F2ECFB;
  --color-surface: #FFFFFF;
  --color-primary: #6D33E0;
  --color-primary-dark: #4A1B9C;
  --color-primary-light: #9C6FF0;
  --color-ink: #221A34;
  --color-ink-muted: #665F7A;
  --color-border: #E5DBF7;
  --color-success: #23935E;
  --color-coin: #D98F2B;
  --color-coin-bg: #FBEBD3;

  --shadow-sm: 0 2px 10px rgba(74, 27, 156, 0.08);
  --shadow-md: 0 12px 32px rgba(74, 27, 156, 0.14);

  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 26px;

  --font-display: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SF Mono", "SFMono-Regular", "JetBrains Mono", Consolas, "Liberation Mono", Menlo, monospace;

  --container-width: 1160px;
}

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

html { scroll-behavior: smooth; }

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

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

a { color: var(--color-primary); text-decoration: none; }
a:hover { color: var(--color-primary-dark); text-decoration: underline; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--color-ink);
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.22;
  margin: 0 0 16px;
}

h1 { font-size: clamp(28px, 4vw, 42px); }
h2 { font-size: clamp(22px, 3vw, 30px); }
h3 { font-size: 19px; margin-bottom: 8px; }

p { margin: 0 0 16px; color: var(--color-ink); }
p:last-child { margin-bottom: 0; }

.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;
}

.skip-link {
  position: absolute; left: 12px; top: -60px;
  background: var(--color-primary); color: #fff;
  padding: 10px 16px; border-radius: var(--radius-sm);
  z-index: 200; transition: top .2s ease;
}
.skip-link:focus { top: 12px; }

:focus-visible {
  outline: 3px solid var(--color-primary-light);
  outline-offset: 2px;
  border-radius: 4px;
}

.container {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 24px;
}
.container-narrow { max-width: 820px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 15px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease;
  text-decoration: none;
  line-height: 1.2;
}
.btn:hover { text-decoration: none; }
.btn-primary {
  background: var(--color-primary);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { background: var(--color-primary-dark); color: #fff; box-shadow: var(--shadow-md); transform: translateY(-1px); }
.btn-outline {
  background: transparent;
  color: var(--color-primary);
  border-color: var(--color-border);
}
.btn-outline:hover { border-color: var(--color-primary); color: var(--color-primary-dark); background: var(--color-bg-soft); }
.btn-block { width: 100%; }

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(251, 250, 254, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 76px;
}
.logo { display: flex; align-items: center; flex-shrink: 0; }
.site-nav { flex: 1; display: flex; justify-content: center; }
.nav-menu {
  list-style: none;
  display: flex;
  gap: 32px;
  margin: 0; padding: 0;
}
.nav-menu a {
  color: var(--color-ink);
  font-weight: 600;
  font-size: 15px;
}
.nav-menu a:hover { color: var(--color-primary); }
.nav-menu a[aria-current="page"] { color: var(--color-primary); }

.header-actions { display: flex; align-items: center; gap: 12px; }
.header-cta { padding: 11px 20px; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px; height: 40px;
  background: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--color-ink);
  margin: 0 auto;
}

/* ---------- Hero + Calculator (ledger receipt style) ---------- */

.hero {
  background: linear-gradient(180deg, var(--color-bg-soft) 0%, var(--color-bg) 100%);
  padding: 56px 0 64px;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: start;
}
.hero-lead { font-size: 17px; color: var(--color-ink-muted); max-width: 54ch; }
.hero-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.hero-badge {
  font-size: 13px; font-weight: 700;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-primary-dark);
  padding: 7px 14px;
  border-radius: 999px;
}

.calc-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 28px 28px 24px;
  position: relative;
  border: 1px solid var(--color-border);
}
.calc-card::before {
  content: "";
  position: absolute;
  top: -1px; left: 24px; right: 24px;
  height: 0;
  border-top: 2px dashed var(--color-border);
}
.calc-card h2 { font-size: 20px; margin-bottom: 4px; }
.calc-note { font-size: 13px; color: var(--color-ink-muted); margin-bottom: 20px; }

.calc-row { margin-bottom: 18px; }
.calc-row-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}
.calc-row-head label { font-weight: 600; font-size: 14px; }
.calc-value {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--color-primary-dark);
}

input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: var(--color-bg-soft);
  outline-offset: 4px;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--color-primary);
  border: 3px solid #fff;
  box-shadow: 0 2px 6px rgba(74,27,156,.35);
  cursor: pointer;
}
input[type="range"]::-moz-range-thumb {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--color-primary);
  border: 3px solid #fff;
  box-shadow: 0 2px 6px rgba(74,27,156,.35);
  cursor: pointer;
}

.calc-result {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  background: var(--color-bg-soft);
  border-radius: var(--radius-md);
  padding: 16px;
  margin: 20px 0;
  border-top: 1px dashed var(--color-border);
}
.calc-result dt { font-size: 12px; color: var(--color-ink-muted); margin-bottom: 4px; }
.calc-result dd {
  margin: 0;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  font-size: 19px;
  color: var(--color-ink);
}

.calc-fine-print { font-size: 12px; color: var(--color-ink-muted); text-align: center; margin-top: 12px; margin-bottom: 0; }

/* ---------- Sections ---------- */

.section { padding: 64px 0; }
.section-alt { background: var(--color-bg-soft); }
.section-note { font-size: 13px; color: var(--color-ink-muted); margin-top: 20px; }

/* ---------- MFO grid ---------- */

.mfo-grid {
  list-style: none;
  margin: 28px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.mfo-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: transform .15s ease, box-shadow .15s ease;
}
.mfo-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.mfo-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; min-height: 36px; }
.mfo-logo { object-fit: contain; }
.mfo-promo {
  font-size: 11px; font-weight: 700;
  background: var(--color-coin-bg);
  color: var(--color-coin);
  padding: 4px 9px;
  border-radius: 999px;
  white-space: nowrap;
}
.mfo-name { font-weight: 800; font-size: 17px; margin-bottom: 10px; }

.mfo-details { margin: 0 0 16px; padding-top: 10px; border-top: 1px dashed var(--color-border); }
.mfo-details div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 5px 0;
  font-size: 13px;
}
.mfo-details dt { color: var(--color-ink-muted); }
.mfo-details dd {
  margin: 0;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  text-align: right;
}
.mfo-card .btn { margin-top: auto; }

/* ---------- Steps ---------- */

.step {
  display: flex;
  gap: 18px;
  padding: 22px 0;
  border-top: 1px dashed var(--color-border);
}
.step:first-of-type { border-top: none; padding-top: 4px; }
.step-num {
  flex-shrink: 0;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  font-family: var(--font-mono);
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
}
.step h3 { margin-bottom: 6px; }
.step p { margin-bottom: 0; color: var(--color-ink-muted); }

/* ---------- Table ---------- */

.content-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  background: var(--color-surface);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.content-table th, .content-table td {
  text-align: left;
  padding: 13px 16px;
  border-bottom: 1px solid var(--color-border);
  font-size: 14.5px;
}
.content-table th {
  background: var(--color-bg-soft);
  font-weight: 700;
  color: var(--color-primary-dark);
}
.content-table tr:last-child td { border-bottom: none; }

/* ---------- Lists ---------- */

.content-list {
  margin: 20px 0;
  padding-left: 0;
  list-style: none;
}
.content-list li {
  position: relative;
  padding: 10px 0 10px 28px;
  border-top: 1px dashed var(--color-border);
  font-size: 15px;
}
.content-list li:first-child { border-top: none; }
.content-list li::before {
  content: "";
  position: absolute;
  left: 4px; top: 18px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--color-primary-light);
}

/* ---------- Callout ---------- */

.callout {
  margin: 20px 0;
  padding: 20px 22px;
  border-left: 4px solid var(--color-primary);
  background: var(--color-surface);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  box-shadow: var(--shadow-sm);
}
.callout p { color: var(--color-ink); font-weight: 500; margin-bottom: 0; }

/* ---------- FAQ ---------- */

.faq-list { margin-top: 24px; }
.faq-item {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 4px 20px;
  margin-bottom: 12px;
}
.faq-item summary {
  cursor: pointer;
  list-style: none;
  padding: 16px 28px 16px 0;
  position: relative;
  font-weight: 700;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary h3 { display: inline; font-size: 16px; margin: 0; }
.faq-item summary::after {
  content: "+";
  position: absolute;
  right: 0; top: 14px;
  font-family: var(--font-mono);
  font-size: 20px;
  color: var(--color-primary);
}
.faq-item[open] summary::after { content: "\2212"; }
.faq-item p { padding-bottom: 16px; border-top: 1px dashed var(--color-border); padding-top: 12px; color: var(--color-ink-muted); }

/* ---------- CTA section ---------- */

.cta-section { padding: 56px 0 72px; }
.cta-inner { text-align: center; }
.cta-inner p { max-width: 52ch; margin-left: auto; margin-right: auto; color: var(--color-ink-muted); }

/* ---------- Breadcrumbs ---------- */

.breadcrumbs { margin-bottom: 18px; }
.breadcrumbs ol { list-style: none; display: flex; gap: 8px; padding: 0; margin: 0; font-size: 13px; color: var(--color-ink-muted); flex-wrap: wrap; }
.breadcrumbs li:not(:last-child)::after { content: "/"; margin-left: 8px; color: var(--color-border); }
.breadcrumbs a { color: var(--color-ink-muted); }
.breadcrumbs li[aria-current="page"] { color: var(--color-ink); font-weight: 600; }

/* ---------- Page hero (inner pages) ---------- */

.page-hero-compact { padding: 44px 0 48px; background: linear-gradient(180deg, var(--color-bg-soft) 0%, var(--color-bg) 100%); }
.page-hero-compact h1 { margin-bottom: 12px; }

/* ---------- Auth card (LK) ---------- */

.auth-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 8px 28px 28px;
  max-width: 440px;
  margin: 0 auto;
}
.auth-tabs { display: flex; gap: 4px; padding: 16px 0; border-bottom: 1px solid var(--color-border); margin-bottom: 20px; }
.auth-tab {
  flex: 1;
  padding: 10px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 14px;
  color: var(--color-ink-muted);
  cursor: pointer;
}
.auth-tab.is-active { background: var(--color-bg-soft); color: var(--color-primary-dark); }
.auth-panel { display: none; }
.auth-panel.is-active { display: block; }
.auth-form { display: flex; flex-direction: column; gap: 6px; }
.auth-form label { font-size: 13px; font-weight: 600; margin-top: 10px; }
.auth-form input[type="tel"], .auth-form input[type="password"] {
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: var(--font-body);
  background: var(--color-bg);
}
.auth-form input:focus { border-color: var(--color-primary); }
.auth-check { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 400; margin-top: 12px; }
.auth-form .btn { margin-top: 16px; }
.auth-link { text-align: center; font-size: 13px; margin-top: 12px; }
.auth-note { font-size: 12px; color: var(--color-ink-muted); text-align: center; margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--color-border); }

/* ---------- 404 ---------- */

.error-section { padding: 96px 0; }
.error-inner { text-align: center; }
.error-code {
  font-family: var(--font-mono);
  font-size: 96px;
  font-weight: 800;
  color: var(--color-primary-light);
  margin: 0 0 8px;
  line-height: 1;
}
.error-actions { display: flex; gap: 12px; justify-content: center; margin-top: 24px; flex-wrap: wrap; }

/* ---------- Footer ---------- */

.site-footer { background: var(--color-ink); color: #D8D2E6; padding: 48px 0 24px; margin-top: 40px; }
.footer-inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.4fr;
  gap: 32px;
  padding-bottom: 32px;
  border-bottom: 1px solid rgba(255,255,255,.12);
}
.footer-logo { filter: brightness(0) invert(1); margin-bottom: 14px; }
.footer-about p { font-size: 13.5px; color: #B7AECC; }
.footer-heading { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: #fff; margin-bottom: 14px; }
.footer-col ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.footer-col a { color: #B7AECC; font-size: 14px; }
.footer-col a:hover { color: #fff; }
.footer-disclaimer p { font-size: 12.5px; color: #9A8FB5; line-height: 1.6; }
.footer-bottom { display: flex; justify-content: space-between; padding-top: 20px; font-size: 12.5px; color: #8A81A3; flex-wrap: wrap; gap: 8px; }
.footer-bottom p { margin: 0; }

/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; }
  .mfo-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-inner { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  .nav-menu {
    position: fixed;
    top: 76px; left: 0; right: 0;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    flex-direction: column;
    gap: 4px;
    margin: 0;
    padding: 8px 24px 16px;
    box-shadow: var(--shadow-sm);
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: transform .18s ease, opacity .18s ease, visibility .18s;
  }
  .nav-menu.is-open { transform: translateY(0); opacity: 1; visibility: visible; pointer-events: auto; }
  .nav-menu a { display: block; padding: 10px 0; }
  .nav-toggle { display: flex; }
  .header-cta { display: none; }
  .mfo-grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
  .section { padding: 44px 0; }
}

@media (max-width: 480px) {
  h1 { font-size: 28px; }
  .calc-card { padding: 22px 18px 20px; }
  .error-code { font-size: 72px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}
