/* Справочник заёмщика — статьи, хабы, калькуляторы */
:root {
  --green: var(--mig-leaf);
  --green-d: var(--mig-forest);
  --green-l: var(--mig-mint);
  --ink: var(--mig-ink);
  --ink-2: var(--mig-muted);
  --muted: var(--mig-muted);
  --line: var(--mig-line);
  --bg: var(--mig-ivory);
  --bg-2: var(--mig-mint);
  --amber-bg: #fff8e6;
  --amber-line: #d9b461;
  --red: var(--mig-error);
  --radius: var(--mig-radius);
  --wrap: 800px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 16px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 17px/1.65 var(--mig-font);
}
a { color: var(--green-d); text-underline-offset: 2px; }
a:hover { color: var(--green); }
img { max-width: 100%; height: auto; }

/* header */
.g-header { background: var(--bg); color: var(--green-d); border-bottom: 1px solid var(--line); }
.g-head-in {
  max-width: 1200px; margin: 0 auto; padding: 18px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.g-brand { display: inline-flex; flex-direction: column; flex: none; max-width: 100%; text-decoration: none; }
.g-brand img { display: block; width: 260px; height: auto; }
.g-brand span { margin: -2px 0 0 69px; font-size: 11px; line-height: 1.3; }
.g-nav { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.g-nav a { color: var(--green-d); text-decoration: none; font-size: 14px; font-weight: 500; padding: 8px 0; min-height: 44px; display: inline-flex; align-items: center; gap: 6px; }
.g-nav a:hover { text-decoration: underline; color: var(--green); }
.g-nav a.g-nav-apply { border: 1px solid var(--green-d); border-radius: 8px; padding: 7px 12px; min-height: 44px; display: inline-flex; align-items: center; }

/* layout */
.g-main { max-width: var(--wrap); margin: 0 auto; padding: 28px 24px 64px; }
.g-crumbs { font-size: 14px; color: var(--muted); margin: 4px 0 12px; }
.g-crumbs a { color: var(--muted); }
.g-crumbs span { margin: 0 2px; }
h1 { font-size: clamp(32px, 4vw, 44px); font-weight: 600; line-height: 1.12; margin: 12px 0 16px; letter-spacing: -.035em; color: var(--green-d); overflow-wrap: break-word; }
.g-meta { color: var(--muted); font-size: 14px; margin: 0 0 12px; }
.g-disclaimer {
  font-size: 14px; line-height: 1.55; color: var(--muted); background: var(--bg-2);
  border-radius: 8px; padding: 12px 14px; margin: 28px 0 8px;
}
.g-meta a { color: var(--muted); }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* toc */
.g-toc { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; margin: 0 0 28px; }
.g-toc-t { font-weight: 700; margin-bottom: 6px; }
.g-toc ol { margin: 0; padding-left: 20px; }
.g-toc li { margin: 3px 0; font-size: 15px; }

/* body typography */
.g-body { overflow-wrap: anywhere; }
.g-body h2, .g-article > section h2 { font-size: 24px; line-height: 1.3; margin: 36px 0 12px; }
.g-body h3 { font-size: 19px; margin: 26px 0 8px; }
.g-body p { margin: 0 0 14px; }
.g-body ul, .g-body ol { margin: 0 0 16px; padding-left: 22px; }
.g-body li { margin: 5px 0; }
.g-body .lead { font-size: 19px; line-height: 1.55; color: var(--ink-2); }
.g-body blockquote { margin: 0 0 16px; padding: 4px 0 4px 16px; border-left: 3px solid var(--line); color: var(--ink-2); }
.note, .warn, .ok {
  border-radius: 10px; padding: 12px 16px; margin: 0 0 18px; font-size: 16px;
}
.note { background: var(--green-l); border-left: 4px solid var(--green); }
.warn { background: var(--amber-bg); border-left: 4px solid var(--amber-line); }
.ok { background: var(--bg-2); border-left: 4px solid var(--muted); }
.note > :last-child, .warn > :last-child, .ok > :last-child { margin-bottom: 0; }
.steps { counter-reset: st; list-style: none; padding-left: 0 !important; }
.steps > li { counter-increment: st; position: relative; padding-left: 44px; margin: 0 0 14px; }
.steps > li::before {
  content: counter(st); position: absolute; left: 0; top: 0; width: 30px; height: 30px; border-radius: 50%;
  background: var(--green-d); color: #fff; font-weight: 700; font-size: 15px; display: flex; align-items: center; justify-content: center;
}
.t-wrap { overflow-x: auto; margin: 0 0 18px; -webkit-overflow-scrolling: touch; }
table.t { border-collapse: collapse; width: 100%; font-size: 15px; }
table.t th, table.t td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; overflow-wrap: break-word; }
table.t th { background: var(--bg-2); font-weight: 700; }
.letter {
  background: var(--bg-2); border: 1px dashed #b9c2bd; border-radius: 10px; padding: 16px 18px; margin: 0 0 18px;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 14px; line-height: 1.6; white-space: pre-wrap;
}

/* faq */
.g-faq details { border: 1px solid var(--line); border-radius: 10px; margin: 0 0 10px; background: #fff; }
.g-faq summary { cursor: pointer; padding: 12px 16px; font-weight: 600; list-style: none; position: relative; padding-right: 40px; }
.g-faq summary::-webkit-details-marker { display: none; }
.g-faq summary::after { content: "+"; position: absolute; right: 16px; top: 9px; font-size: 22px; color: var(--green-d); }
.g-faq details[open] summary::after { content: "–"; }
.g-faq details > div { padding: 0 16px 14px; color: var(--ink-2); }
.g-faq details > div p:last-child { margin-bottom: 0; }

/* cta */
.g-cta { border: 2px solid var(--green); border-radius: var(--radius); padding: 18px 20px; margin: 32px 0; background: #fff; }
.g-cta-soft { border-color: var(--line); background: var(--bg-2); }
.g-cta-t { font-weight: 800; font-size: 19px; margin-bottom: 6px; }
.g-cta p { margin: 0 0 12px; color: var(--ink-2); }
.g-cta-n { font-size: 14px; color: var(--muted); margin-top: 8px; }
.g-btn {
  display: inline-block; background: var(--green-d); color: #fff; text-decoration: none; font-weight: 700;
  padding: 12px 22px; border-radius: 8px; min-height: 48px; border: 2px solid var(--green-d); font-size: 16px; font-weight: 600;
}
.g-btn:hover { background: #205542; border-color: #205542; color: #fff; }
.g-btn-o { background: #fff; color: var(--green-d); }
.g-btn-o:hover { background: var(--green-l); color: var(--green-d); }
.g-apply { margin: 0 0 24px; }
.g-apply-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; }
.g-apply .g-btn { min-height: 48px; text-align: center; }
.g-apply-details { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }
.g-apply .g-cta-n { margin: 8px 0 0; }

/* sources & related */
.g-sources ol { padding-left: 22px; font-size: 14px; color: var(--muted); }
.g-sources li { margin: 4px 0; word-break: break-word; }
.g-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin: 0 0 18px; }
.g-card {
  display: grid; grid-template-columns: 36px minmax(0, 1fr) 20px; align-items: start; gap: 12px; padding: 22px 18px; border: 1px solid var(--line);
  border-radius: var(--radius); text-decoration: none; color: var(--ink); background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.g-card:hover { border-color: var(--green); box-shadow: 0 2px 10px rgba(0,0,0,.06); color: var(--ink); }
.g-card-t { font-weight: 700; color: var(--green-d); }
.g-card-d { font-size: 14px; color: var(--muted); line-height: 1.45; }

/* calculators */
.calc { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin: 0 0 24px; background: #fff; }
.calc-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px 16px; }
.calc label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 4px; color: var(--ink-2); }
.calc input, .calc select {
  width: 100%; min-width: 0; font: inherit; font-size: 17px; padding: 10px 12px; border: 1px solid #c9cfcc; border-radius: 8px;
  background: #fff; color: var(--ink); min-height: 44px;
}
.calc input:focus, .calc select:focus { outline: 2px solid var(--green); outline-offset: 1px; border-color: var(--green); }
.calc input[aria-invalid="true"] { border: 2px solid var(--red); }
.calc input[aria-invalid="true"]:focus { outline-color: var(--red); }
.calc .hint { font-size: 13px; color: var(--muted); margin-top: 4px; }
.calc-out { margin-top: 20px; background: #f5f8f3; border-radius: 10px; padding: 14px 16px; border: 1px solid var(--line); }
.calc-row { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.calc-row:last-child { border-bottom: 0; }
.calc-row b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.calc-verdict { margin-top: 10px; padding: 10px 12px; border-radius: 8px; font-size: 15px; }
.calc-verdict.good { background: var(--green-l); }
.calc-verdict.bad { background: #fdecea; color: #8a1c1c; }
.calc-verdict.info { background: var(--bg-2); }
.calc fieldset { border: 0; padding: 0; margin: 0; }
.calc-checks label { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; font-size: 16px; margin: 0 0 10px; color: var(--ink); }
.calc-checks input { width: 22px; height: 22px; min-height: 0; margin-top: 2px; flex: none; }

/* figures */
.g-fig { margin: 0 0 24px; }
.g-fig img { display: block; width: 100%; max-width: 640px; height: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.g-fig figcaption { font-size: 14px; color: var(--muted); margin-top: 8px; }

/* hub */

.hub-notice {
  border: 2px solid var(--green-d); background: var(--green-l); border-radius: var(--radius);
  padding: 14px 18px; margin: 0 0 18px; font-size: 16px;
}
.hub-notice p { margin: 0; }
.g-offer { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin: 0 0 24px; background: #fff; }
.g-offer p { margin: 0 0 12px; }
.g-offer .t-wrap { margin-bottom: 14px; }
.g-offer table.t th { width: 34%; }

/* footer */
.g-footer { background: var(--green-d); color: #e4efe6; margin-top: 24px; position: relative; overflow: hidden; }
.g-foot-in { max-width: 1200px; margin: 0 auto; padding: 44px 24px; position: relative; font-size: 14px; }
.g-foot-cols { display: flex; flex-wrap: wrap; gap: 24px 56px; margin-bottom: 18px; }
.g-foot-cols a { display: block; color: #e6ebe8; text-decoration: none; padding: 6px 0; }
.g-foot-cols a:hover { text-decoration: underline; color: #fff; }
.g-foot-h { font-weight: 700; margin-bottom: 6px; color: #fff; }
.g-footer p { margin: 6px 0; opacity: .85; max-width: 820px; }
.g-foot-small { font-size: 12px; opacity: .7 !important; }

@media (max-width: 640px) {
  body { font-size: 16px; }
  h1 { font-size: 32px; }
  .g-main { padding: 24px 16px 40px; }
  .g-brand img { width: 236px; }
  .g-head-in { padding: 10px 16px 8px; gap: 8px; }
  .g-nav { flex-wrap: wrap; width: 100%; }
  .g-nav a { white-space: nowrap; padding: 8px 0; }
  table.t { font-size: 14px; }
  table.t th, table.t td { padding: 7px 8px; }
  table.t.stack thead { display: none; }
  table.t.stack, table.t.stack tbody, table.t.stack tr, table.t.stack td { display: block; width: 100%; }
  table.t.stack tr { border: 1px solid var(--line); border-radius: 10px; margin: 0 0 10px; padding: 8px 12px; }
  table.t.stack td { border: 0; padding: 4px 0; }
  table.t.stack td::before { content: attr(data-label); display: block; font-weight: 700; font-size: 13px; color: var(--muted); }
  .g-foot-cols a { padding: 9px 0; }
  .g-body h2, .g-article > section h2 { font-size: 21px; }
  .g-body .lead { font-size: 17px; }
  .calc-grid { grid-template-columns: 1fr; }
  .g-nav { gap: 2px 14px; }
  .g-nav a { font-size: 13px; }
  .g-apply-actions { align-items: stretch; flex-direction: column; gap: 4px; }
}

/* Brand identity: shared components and home composition. */
.g-icon { width: 24px; height: 24px; flex: none; color: var(--green-d); }
.g-nav .g-icon { width: 18px; height: 18px; }
.g-card-icon { display: grid; place-items: center; width: 36px; height: 36px; background: var(--green-l); border-radius: 10px; }
.g-card-copy { display: flex; flex-direction: column; gap: 8px; }
.g-card-arrow { width: 18px; margin-top: 6px; }
.g-page-heading { padding-top: 8px; margin-bottom: 22px; }
.g-toc { background: var(--bg) url('/assets/mig-brand/v1/patterns/path-tile.svg') right top / 260px 240px repeat; }
.g-page-icon { width: 44px; height: 44px; padding: 10px; box-sizing: content-box; border: 1px solid var(--line); border-radius: 16px; background: var(--green-l); }
.g-faq h2 { display: flex; align-items: center; gap: 12px; }
.g-skip { position: absolute; left: 16px; top: -100px; z-index: 10; padding: 12px 18px; background: var(--green-d); color: white; border-radius: 8px; }
.g-skip:focus { top: 10px; color: white; }
a:focus-visible, summary:focus-visible, button:focus-visible { outline: 3px solid var(--green-d); outline-offset: 4px; }
.g-footer a:focus-visible { outline-color: var(--mig-lime); }
.g-cta-soft { display: flow-root; padding: 26px; background: var(--green-l); }
.g-cta-art { width: 142px; float: right; margin: -12px -4px 0 16px; }
.g-cta-t { font-weight: 600; }
.g-foot-brand { display: inline-flex; flex-direction: column; margin-bottom: 32px; text-decoration: none; color: white; }
.g-foot-brand img { width: 260px; height: auto; }
.g-foot-brand span { margin: -2px 0 0 69px; font-size: 11px; line-height: 1.3; }
.g-footer::before { content: ""; position: absolute; inset: 0; background: url('/assets/mig-brand/v1/patterns/path-dark.svg') right center / auto 100% no-repeat; opacity: .16; pointer-events: none; }
.g-footer p { opacity: 1; }
.g-foot-small { opacity: 1 !important; color: #c5d7cd; }
.g-hub { max-width: 1200px; padding-top: 24px; }
.g-hero { position: relative; isolation: isolate; border-radius: 28px; overflow: hidden; min-height: 558px; margin-bottom: 36px; background: #f7f5ed; border: 1px solid #e7e5da; }
.g-hero-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -1; }
.g-hero-copy { width: 55%; padding: 42px 0 40px 36px; }
.g-eyebrow { font-size: 13px; color: var(--muted); margin: 0 0 18px; }
.g-hero h1 { font-size: clamp(42px, 4.3vw, 58px); letter-spacing: -.045em; line-height: 1.04; max-width: 570px; }
.g-hero .g-meta { font-size: 12px; margin-bottom: 20px; }
.g-hero .lead { font-size: 18px; line-height: 1.55; color: var(--ink-2); max-width: 425px; margin: 0 0 22px; }
.g-hero .g-apply { max-width: 430px; margin: 0; }
.g-hero .g-apply-actions { gap: 4px 16px; }
.g-hero .g-cta-n { max-width: 430px; font-size: 13px; line-height: 1.5; margin-top: 12px; }
.g-hub .g-body > h2, .g-hub .g-article > section > h2 { font-size: clamp(26px, 3vw, 34px); font-weight: 600; margin-top: 52px; letter-spacing: -.025em; }
.g-hub .g-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.g-hub .g-body > p { max-width: 850px; }
.g-hub .g-body > .warn, .g-hub .g-body > .note { padding: 20px 24px; }
.g-tools-heading { display: flex; align-items: center; gap: 24px; margin: 44px 0 16px; padding: 28px 32px; background: var(--green-l); border-radius: 24px; }
.g-tools-heading > div { flex: 1; }
.g-tools-heading h2 { margin: 0 0 12px; font-size: 34px; font-weight: 600; letter-spacing: -.025em; }
.g-tools-heading p { max-width: 580px; margin: 0; color: var(--muted); }
.g-tools-heading img { width: 166px; height: auto; }
.g-offer { padding: 28px; }
.g-offer p { max-width: 870px; }
.g-hub .g-fig { max-width: 780px; }
.g-hub .g-fig img { max-width: 640px; }
.g-btn:active { background: #0a2a20; border-color: #0a2a20; }
@media (min-width: 641px) and (max-width: 1000px) {
  .g-hero-copy { width: 62%; padding-left: 28px; }
  .g-hero-art { object-position: 42% center; opacity: .46; }
  .g-hero-copy { background: linear-gradient(90deg, #f7f5ed 78%, transparent); }
  .g-hub .g-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .g-page-icon { width: 30px; height: 30px; padding: 8px; }
  .g-brand span { margin-left: 62px; }
  .g-hub { padding-top: 16px; }
  .g-hero { min-height: 0; display: flex; flex-direction: column; border: 0; border-radius: 0; overflow: visible; margin-bottom: 28px; }
  .g-hero-copy { width: 100%; padding: 8px 0 0; order: 0; }
  .g-eyebrow { margin-bottom: 10px; font-size: 12px; }
  .g-hero h1 { font-size: clamp(32px, 8.5vw, 42px); line-height: 1.08; margin: 8px 0 12px; }
  .g-hero .g-meta { margin-bottom: 14px; }
  .g-hero .lead { font-size: 17px; margin-bottom: 16px; }
  .g-hero-art { position: static; width: 100%; height: auto; aspect-ratio: 3 / 2; order: 1; z-index: 0; border-radius: 20px; margin-top: 22px; }
  .g-hero .g-apply-actions { gap: 4px; }
  .g-hub .g-cards { grid-template-columns: 1fr; gap: 10px; }
  .g-card { padding: 20px 16px; }
  .g-hub .g-body > h2, .g-hub .g-article > section > h2 { font-size: 27px; margin-top: 36px; }
  .g-hub .g-body > .warn, .g-hub .g-body > .note { padding: 16px; }
  .g-tools-heading { padding: 22px 18px; gap: 10px; margin-top: 36px; }
  .g-tools-heading h2 { font-size: 27px; }
  .g-tools-heading p { font-size: 14px; }
  .g-tools-heading img { width: 85px; }
  .g-offer { padding: 20px 16px; }
  .g-cta-soft { padding: 20px; }
  .g-cta-art { width: 90px; margin: 0 -6px 0 8px; }
  .g-foot-in { padding: 36px 16px; }
  .g-foot-cols { display: grid; gap: 28px; }
  .g-footer::before { background-size: auto 48%; background-position: right bottom; opacity: .08; }
}
@media (prefers-reduced-motion: reduce) { .g-card { transition: none; } }
@media (forced-colors: active) { .g-btn, .g-card, .g-card-icon { border: 1px solid ButtonText; } }
