/* =====================================================================
   A to Z Mortgage Solutions — site styles
   ---------------------------------------------------------------------
   ONE layout system:
   - .container  : single max-width wrapper, same side padding everywhere
   - .grid       : 12-column grid, one gutter size (--gutter)
   - spacing     : 8 / 16 / 24 / 32 / 48 / 64 / 96 scale only (--s1..--s7)
   - cards       : same padding, same radius, equal height in a row,
                   content top-aligned, buttons pinned to the bottom
   - controls    : every button & input is exactly --control-h tall
   Smallest text on the site is 0.875rem (14px); license text uses the
   same size so it is never smaller than any other text.
   ===================================================================== */

:root {
  /* Brand */
  --navy: #1f3354;
  --navy-800: #182a47;
  --navy-900: #111e33;
  --gold: #b39a4f;
  --gold-300: #d6c48f;
  --gold-700: #7a672c;           /* gold text on light backgrounds (AA) */

  /* Neutrals */
  --ink: #0f1b2d;
  --text: #24324a;
  --muted: #4b5870;              /* 7:1 on white */
  --bg: #f5f7fb;
  --surface: #ffffff;
  --line: rgba(31, 51, 84, 0.12);
  --line-strong: rgba(31, 51, 84, 0.22);

  /* Spacing scale (8-pt) */
  --s1: 8px;
  --s2: 16px;
  --s3: 24px;
  --s4: 32px;
  --s5: 48px;
  --s6: 64px;
  --s7: 96px;

  /* Layout */
  --container: 1200px;
  --pad: 24px;                   /* container side padding */
  --gutter: 24px;                /* every grid gap */
  --card-pad: 32px;              /* every card's inner padding */
  --radius: 20px;                /* every card */
  --radius-ctl: 12px;            /* every button & input */
  --control-h: 52px;             /* every button & input height */

  /* Type */
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --fs-sm: 0.875rem;             /* 14px — smallest size used anywhere */
  --fs-base: 1rem;
  --fs-lg: 1.125rem;
  --fs-xl: 1.25rem;
  --fs-h3: 1.1875rem;
  --fs-h2: clamp(1.75rem, 1.3rem + 1.6vw, 2.5rem);
  --fs-h1: clamp(2.25rem, 1.4rem + 3.8vw, 4.25rem);

  --shadow-sm: 0 1px 2px rgba(17, 30, 51, 0.06);
  --shadow: 0 1px 2px rgba(17, 30, 51, 0.05), 0 12px 32px -12px rgba(17, 30, 51, 0.18);
  --shadow-lg: 0 2px 4px rgba(17, 30, 51, 0.06), 0 24px 48px -16px rgba(17, 30, 51, 0.28);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

@media (max-width: 640px) {
  :root { --pad: 16px; --gutter: 16px; --card-pad: 24px; }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs-base);
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
h1, h2, h3 { color: var(--ink); line-height: 1.15; letter-spacing: -0.02em; font-weight: 700; }
a { color: var(--navy); text-underline-offset: 3px; }
a:hover { color: var(--navy-900); }
[hidden] { display: none !important; }
section[id], form[id], article[id] { scroll-margin-top: 96px; }   /* clear the sticky header */

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
  border-radius: 6px;
}
.hero :focus-visible { outline-color: #fff; }

.visually-hidden {
  position: absolute !important; 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: var(--s2); top: -100px; z-index: 100;
  padding: var(--s1) var(--s2); background: var(--navy); color: #fff;
  border-radius: var(--radius-ctl); font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: var(--s2); color: #fff; }

/* ---------- Layout system ---------- */
.container {
  width: 100%;
  max-width: calc(var(--container) + 2 * var(--pad));
  margin-inline: auto;
  padding-inline: var(--pad);
}
.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--gutter);
  align-items: stretch;          /* equal heights in a row */
}
.span-12 { grid-column: span 12; }
.span-7  { grid-column: span 7; }
.span-6  { grid-column: span 6; }
.span-5  { grid-column: span 5; }
@media (max-width: 860px) { .span-7, .span-6, .span-5 { grid-column: span 12; } }

.section { padding-block: var(--s7); }
.section + .section { padding-top: 0; }
@media (max-width: 640px) { .section { padding-block: var(--s6); } }

.section-head { display: grid; gap: var(--s2); margin-bottom: var(--s5); max-width: 720px; }
.eyebrow {
  font-size: var(--fs-sm); font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--gold-700);
}
.section-head h2 { font-size: var(--fs-h2); }
.section-head p { font-size: var(--fs-lg); color: var(--muted); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s2);
  height: 88px;
}
.brand { display: inline-flex; align-items: center; flex-shrink: 0; }
.brand img { height: 68px; width: auto; }
@media (max-width: 400px) { .brand img { height: 52px; } }
.header-actions { display: flex; align-items: center; gap: var(--s2); }
.header-phone {
  display: inline-flex; align-items: center; gap: var(--s1);
  font-weight: 600; text-decoration: none; color: var(--navy);
  height: 40px; padding-inline: var(--s1);
}
.header-phone svg { width: 18px; height: 18px; }
@media (max-width: 719px) { .header-phone { display: none; } }

.lang-toggle {
  display: inline-grid; grid-template-columns: 1fr 1fr;
  padding: 4px; gap: 4px; border-radius: 999px;
  background: #eef1f6; border: 1px solid var(--line);
}
.lang-toggle button {
  font: inherit; font-size: var(--fs-sm); font-weight: 700; letter-spacing: 0.04em;
  min-width: 48px; height: 36px; padding: 0 var(--s2);
  border: 0; border-radius: 999px; cursor: pointer;
  background: transparent; color: var(--muted);
  transition: background-color .2s var(--ease), color .2s var(--ease), box-shadow .2s var(--ease);
}
.lang-toggle button[aria-pressed="true"] { background: var(--navy); color: #fff; box-shadow: var(--shadow-sm); }
.lang-toggle button:not([aria-pressed="true"]):hover { color: var(--navy); }

/* ---------- Hero ---------- */
.hero {
  position: relative; isolation: isolate; overflow: hidden;
  color: #e9eef7;
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(179, 154, 79, 0.22), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(64, 104, 168, 0.35), transparent 60%),
    linear-gradient(160deg, var(--navy) 0%, var(--navy-900) 100%);
  padding-block: var(--s7) var(--s6);
}
.hero::after {               /* soft fade into page background */
  content: ""; position: absolute; inset: auto 0 0 0; height: 1px; background: rgba(255,255,255,.08);
}
#swarm {
  position: absolute; inset: 0; width: 100%; height: 100%;
  z-index: 0; pointer-events: none;
}
.swarm-toggle { position: absolute; right: var(--s3); bottom: var(--s3); z-index: 2; display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 999px; border: 1px solid rgba(255,255,255,.25); background: rgba(10,20,40,.45); color: #fff; cursor: pointer; opacity: .7; transition: opacity .2s; }
.swarm-toggle[hidden] { display: none; }
.swarm-toggle:hover, .swarm-toggle:focus-visible { opacity: 1; }
.swarm-toggle svg { fill: currentColor; }
.swarm-toggle .ic-play, .swarm-toggle[aria-pressed="true"] .ic-pause { display: none; }
.swarm-toggle[aria-pressed="true"] .ic-play { display: inline; }
.hero-inner { position: relative; z-index: 1; }
.hero-copy { display: grid; gap: var(--s3); max-width: 820px; }
.hero .eyebrow { color: var(--gold-300); }
.hero h1 { font-size: var(--fs-h1); color: #fff; letter-spacing: -0.03em; }
.hero h1 .accent {
  background: linear-gradient(90deg, var(--gold-300), var(--gold));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-lead { font-size: clamp(1.0625rem, 1rem + 0.4vw, 1.3125rem); color: #d3dbe8; max-width: 680px; }

/* CTA row: identical widths & heights */
.cta-row {
  --cols: 5;
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  grid-auto-rows: 1fr;
  gap: var(--s2);
  margin-top: var(--s5);
  list-style: none; padding: 0;
}
.cta-row > li { display: flex; min-width: 0; }
@media (max-width: 1020px) {
  .cta-row { --cols: 2 !important; }
  /* odd count -> first (primary) button spans the full row so the grid stays even */
  .cta-row > li:first-child:nth-last-child(odd) { grid-column: 1 / -1; }
}
@media (max-width: 520px) {
  .cta-row { --cols: 1 !important; }
}

.cta {
  flex: 1; display: grid; grid-template-columns: 44px minmax(0, 1fr); align-items: center;
  column-gap: var(--s2);
  min-height: 88px; padding: var(--s2) var(--s3);
  border-radius: var(--radius-ctl);
  text-decoration: none; color: #fff;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.16);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  transition: translate .25s var(--ease), background-color .25s var(--ease), border-color .25s var(--ease), box-shadow .25s var(--ease);
}
.cta:hover { color: #fff; background: rgba(255, 255, 255, 0.13); border-color: rgba(214, 196, 143, 0.6); translate: 0 -2px; box-shadow: 0 16px 32px -16px rgba(0,0,0,.5); }
.cta-icon {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  background: rgba(179, 154, 79, 0.18); color: var(--gold-300);
}
.cta-icon svg { width: 22px; height: 22px; }
.cta-text { display: grid; gap: 2px; min-width: 0; }
.cta-label { font-weight: 700; font-size: var(--fs-base); line-height: 1.25; }
.cta-sub { font-size: var(--fs-sm); line-height: 1.35; color: #c3cde0; }
.cta--primary { background: var(--gold); border-color: var(--gold); color: var(--navy-900); }
.cta--primary:hover { background: var(--gold-300); border-color: var(--gold-300); color: var(--navy-900); }
.cta--primary .cta-icon { background: rgba(17, 30, 51, 0.12); color: var(--navy-900); }
.cta--primary .cta-sub { color: var(--navy-900); }
/* Desktop: one row of identical tiles, icon on top so every label starts on the same line */
@media (min-width: 1021px) {
  .cta { grid-template-columns: minmax(0, 1fr); grid-template-rows: 44px auto; row-gap: var(--s2); align-items: start; align-content: start; padding: var(--s3); min-height: 152px; }
}

.hero-note {
  display: flex; align-items: flex-start; gap: var(--s1);
  margin-top: var(--s3); font-size: var(--fs-sm); color: #c3cde0; max-width: 820px;
}
@media (max-width: 640px) { .hero { padding-block: var(--s6) var(--s5); } .cta-row { margin-top: var(--s4); } }
.hero-note svg { flex: 0 0 18px; width: 18px; height: 18px; margin-top: 2px; color: var(--gold-300); }

/* ---------- Cards (shared) ---------- */
.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--card-pad);
  box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: var(--s2);
  min-width: 0;
}
.card h3 { font-size: var(--fs-h3); }
.card-actions { margin-top: auto; padding-top: var(--s2); }  /* pin to bottom */

.section--soft {
  position: relative; isolation: isolate;
}
.section--soft::before {          /* faint brand glow behind glass cards */
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(600px 300px at 10% 20%, rgba(179, 154, 79, 0.10), transparent 70%),
    radial-gradient(700px 360px at 90% 80%, rgba(31, 51, 84, 0.08), transparent 70%);
}

/* ---------- Loan cards: equal widths, equal heights, aligned rows ---------- */
.loan-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--gutter);
  list-style: none; padding: 0;
}
@media (max-width: 1020px) { .loan-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px)  { .loan-grid { grid-template-columns: minmax(0, 1fr); } }
.loan-grid { grid-auto-rows: 1fr; }   /* fallback: every row track equal */
.loan-card { height: 100%; display: flex; flex-direction: column; }
.loan-card p { flex: 1 0 auto; }
/* Subgrid: icon / title / text / buttons line up across every card in a row */
@supports (grid-template-rows: subgrid) {
  .loan-grid { grid-auto-rows: auto auto 1fr auto; }  /* icon / title / text / actions: text rows equal across ALL rows, so every card is the same height */
  .loan-grid > .loan-card {
    grid-row: span 4;
    display: grid; grid-template-rows: subgrid; row-gap: var(--s2);
    grid-template-columns: minmax(0, 1fr);   /* nowrap button min-content must not widen the card */
    height: auto;
  }
  .loan-card .card-actions { margin-top: 0; padding-top: var(--s1); align-self: end; }
}
.loan-icon {
  width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center;
  background: linear-gradient(145deg, var(--navy), var(--navy-900)); color: var(--gold-300);
  box-shadow: 0 8px 16px -8px rgba(17, 30, 51, .5);
}
.loan-icon svg { width: 24px; height: 24px; }
.loan-card p { color: var(--muted); font-size: var(--fs-base); }
.loan-card { transition: translate .25s var(--ease), box-shadow .25s var(--ease), border-color .25s var(--ease); }
.loan-card:hover { translate: 0 -3px; box-shadow: var(--shadow-lg); border-color: var(--line-strong); }

.btn-pair { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s1); }   /* stacked: every button full card width */
.btn-pair .btn { width: 100%; }

/* ---------- Buttons (one height everywhere) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s1);
  height: var(--control-h); min-height: var(--control-h); padding: 0 var(--s3);
  border-radius: var(--radius-ctl); border: 1px solid transparent;
  font: inherit; font-weight: 700; font-size: var(--fs-base); line-height: 1; white-space: nowrap;
  text-decoration: none; cursor: pointer;
  transition: background-color .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease);
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn--sm { padding: 0 var(--s2); }
.btn--block {
  width: 100%; white-space: normal; height: auto; min-height: var(--control-h);
  padding-block: 12px; line-height: 1.25; text-align: center;   /* long labels wrap; still at least --control-h tall */
}
.btn--navy { background: var(--navy); color: #fff; }
.btn--navy:hover { background: var(--navy-900); color: #fff; }
.btn--gold { background: var(--gold); color: var(--navy-900); }
.btn--gold:hover { background: var(--gold-300); color: var(--navy-900); }
.btn--ghost { background: transparent; color: var(--navy); border-color: var(--line-strong); }
.btn--ghost:hover { background: #eef1f6; color: var(--navy-900); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .6; cursor: progress; }

/* ---------- About & Contact ---------- */
#about-text { font-size: var(--fs-lg); color: var(--text); }
.person { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: var(--s2); align-items: center; }
.person-mark {
  width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center;
  background: linear-gradient(145deg, var(--navy), var(--navy-900)); color: var(--gold-300);
  font-weight: 700; font-size: var(--fs-xl); letter-spacing: 0.02em;
}
.person-name { font-weight: 700; color: var(--ink); font-size: var(--fs-lg); line-height: 1.3; }
.person-title { color: var(--muted); font-size: var(--fs-sm); }
.chip {
  display: inline-flex; align-items: center; height: 32px; padding: 0 var(--s2);
  border-radius: 999px; background: #eef1f6; color: var(--navy); font-size: var(--fs-sm); font-weight: 600;
  width: max-content;
}

.contact-list { display: grid; gap: 0; }
.contact-row {
  display: grid; grid-template-columns: 40px 96px minmax(0, 1fr); align-items: center; column-gap: var(--s2);
  min-height: 56px; padding-block: var(--s1);
  border-bottom: 1px solid var(--line);
}
.contact-row:last-child { border-bottom: 0; }
.contact-row:has(+ .contact-row[hidden]:last-child) { border-bottom: 0; }
.contact-row dt { font-size: var(--fs-sm); font-weight: 600; color: var(--muted); }
.contact-row dd { font-weight: 600; color: var(--ink); overflow-wrap: anywhere; line-height: 1.4; }
.contact-row dd a { color: var(--navy); }
.contact-ico {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: #eef1f6; color: var(--navy);
}
.contact-ico svg { width: 20px; height: 20px; }
@media (max-width: 420px) {
  .contact-row { grid-template-columns: 40px minmax(0, 1fr); }
  .contact-row dt { grid-column: 2; }
  .contact-row dd { grid-column: 2; }
  .contact-row .contact-ico { grid-row: span 2; }
}

/* ---------- Form ---------- */
.form-card { gap: var(--s3); }
.form-head { display: grid; gap: var(--s1); }
.form-head p { color: var(--muted); }
.form-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: var(--gutter); row-gap: var(--s3);
}
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: minmax(0, 1fr); } }
.field { display: grid; gap: var(--s1); align-content: start; min-width: 0; }
.field label { font-size: var(--fs-sm); font-weight: 700; color: var(--ink); line-height: 1.3; }
.field .opt { font-weight: 500; color: var(--muted); }
.input {
  width: 100%; height: var(--control-h); padding: 0 var(--s2);
  font: inherit; font-size: var(--fs-base); color: var(--ink);
  background: #fff; border: 1px solid var(--line-strong); border-radius: var(--radius-ctl);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
  -webkit-appearance: none; appearance: none;
}
.input:hover { border-color: rgba(31, 51, 84, 0.4); }
.input:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 4px rgba(179, 154, 79, 0.35); }
textarea.input { height: auto; min-height: 136px; padding: var(--s2); resize: vertical; line-height: 1.5; }
select.input {
  padding-right: var(--s5);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%231f3354' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right var(--s2) center;
}
.check {
  display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: var(--s2); align-items: start;
  padding: var(--s2); border: 1px solid var(--line); border-radius: var(--radius-ctl); background: #f8f9fc;
}
.check input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--navy); }
.check label { font-size: var(--fs-sm); color: var(--text); font-weight: 500; line-height: 1.5; }
.form-foot {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s2);
}
.form-foot p { font-size: var(--fs-sm); color: var(--muted); }
@media (max-width: 640px) { .form-foot .btn { width: 100%; } }
.form-status { font-size: var(--fs-sm); font-weight: 600; min-height: 1.5em; }
.form-note { font-size: var(--fs-sm); line-height: 1.45; color: var(--text); padding: var(--s1) var(--s2); border-radius: 10px; background: #fbf7ea; border: 1px solid rgba(179, 154, 79, .45); }
.input[aria-invalid="true"] { border-color: #b3261e; }
.form-status.ok { color: #1d6b3a; }
.form-status.err { color: #a42323; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--surface); border-top: 1px solid var(--line);
  padding-block: var(--s6) var(--s5);
  font-size: var(--fs-sm); color: var(--text); line-height: 1.6;
}
.footer-grid { row-gap: var(--s4); }
.footer-brand { grid-column: span 5; display: grid; gap: var(--s2); align-content: start; }
.footer-brand img { height: 56px; width: auto; }
.footer-links { grid-column: span 4; display: grid; gap: var(--s1); align-content: start; list-style: none; padding: 0; }
.footer-eho { grid-column: span 3; display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: var(--s2); align-items: center; align-content: start; }
.footer-eho svg { width: 48px; height: 48px; color: var(--navy); }
.footer-legal { grid-column: span 12; display: grid; gap: var(--s2); padding-top: var(--s4); border-top: 1px solid var(--line); color: var(--muted); }
@media (max-width: 860px) {
  .footer-brand, .footer-links { grid-column: span 12; }
  .footer-eho { grid-column: span 12; }
}
.site-footer a { color: var(--navy); }
.license-line { color: var(--ink); font-weight: 600; }
.license-line span + span::before { content: " | "; color: var(--muted); font-weight: 400; }

/* ---------- Disclosures page ---------- */
.page-hero { background: linear-gradient(160deg, var(--navy) 0%, var(--navy-900) 100%); color: #d3dbe8; padding-block: var(--s6); }
.page-hero h1 { color: #fff; font-size: var(--fs-h2); }
.page-hero .eyebrow { color: var(--gold-300); }
.page-hero-copy { display: grid; gap: var(--s2); max-width: 820px; }
.page-hero a { color: #fff; }

.legal-layout { align-items: start; }
.toc { grid-column: span 4; position: sticky; top: 112px; }
.legal { grid-column: span 8; display: grid; gap: var(--gutter); }
@media (max-width: 960px) {
  .toc, .legal { grid-column: span 12; }
  .toc { position: static; }
}
.toc ol { list-style: none; padding: 0; display: grid; gap: 4px; counter-reset: toc; }
.toc a {
  display: flex; align-items: center; min-height: 40px; padding: 0 var(--s2);
  margin-inline: calc(-1 * var(--s2));          /* link text aligns with the heading edge */
  border-radius: 10px; text-decoration: none; color: var(--text); font-weight: 600; font-size: var(--fs-sm);
}
.toc a:hover { background: #eef1f6; color: var(--navy); }
.legal .card { gap: var(--s2); scroll-margin-top: 112px; }
.legal h2 { font-size: 1.375rem; }
.legal h3 { font-size: var(--fs-base); margin-top: var(--s1); }
.legal p, .legal li { color: var(--text); }
.legal ul { padding-left: 1.25rem; display: grid; gap: var(--s1); }
.note-ru {
  display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: var(--s2);
  padding: var(--s3); border-radius: var(--radius); background: #fbf7ea; border: 1px solid rgba(179, 154, 79, .45); color: var(--text);
}
.note-ru svg { width: 24px; height: 24px; color: var(--gold-700); }
.kv { display: grid; grid-template-columns: minmax(140px, 220px) minmax(0, 1fr); border-top: 1px solid var(--line); }
.kv > div { display: contents; }
.kv dt, .kv dd { padding: 12px 0; border-bottom: 1px solid var(--line); }
.kv dt { font-weight: 600; color: var(--muted); font-size: var(--fs-sm); padding-right: var(--s2); }
.kv dd { color: var(--ink); font-weight: 600; overflow-wrap: anywhere; }
@media (max-width: 520px) {
  .kv { grid-template-columns: minmax(0, 1fr); }
  .kv dt { border-bottom: 0; padding-bottom: 0; }
}
.doc-list { list-style: none; padding: 0 !important; }
.doc-list a { display: inline-flex; align-items: center; gap: var(--s1); font-weight: 600; }
.doc-list svg { width: 18px; height: 18px; }

/* ---------- Scroll-in animation ---------- */
.js .reveal {
  opacity: 0; transform: translateY(16px);
  transition: opacity .7s var(--ease), transform .7s var(--ease), translate .25s var(--ease), box-shadow .25s var(--ease), border-color .25s var(--ease);
  transition-delay: var(--d, 0ms), var(--d, 0ms), 0ms, 0ms, 0ms;
}
.js .reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .cta, .loan-card, .btn { transition: none; }
  .cta:hover, .loan-card:hover { translate: none; }
}

/* ---------- Print ---------- */
@media print {
  .site-header, #swarm, .swarm-toggle, .cta-row, .form-card, .toc, .mobile-bar, #calculator { display: none !important; }
  .hero, .page-hero { background: none; color: #000; }
  .hero h1, .page-hero h1 { color: #000; }
  .card { box-shadow: none; }
}

/* ---------- Header: My loan + Apply ---------- */
.header-link {
  display: inline-flex; align-items: center; gap: var(--s1);
  height: 40px; padding-inline: var(--s1);
  font-weight: 600; text-decoration: none; color: var(--navy);
}
.header-link svg { width: 18px; height: 18px; }
.header-apply { height: 44px; min-height: 44px; }
@media (max-width: 900px) { .header-link { display: none; } }
@media (max-width: 719px) { .header-apply { display: none; } }

/* ---------- Pick-your-path cards ---------- */
.path-body { display: grid; gap: var(--s1); align-content: start; }
.loan-card .path-note { font-size: var(--fs-sm); color: var(--muted); line-height: 1.5; flex: none; }
.loan-card .path-tags { font-size: var(--fs-sm); color: var(--muted); font-weight: 600; line-height: 1.5; flex: none; }

/* ---------- Calculator ---------- */
.hint { font-size: var(--fs-sm); color: var(--muted); line-height: 1.4; }
.calc-result { background: linear-gradient(160deg, var(--navy) 0%, var(--navy-900) 100%); border-color: transparent; color: #d3dbe8; }
.calc-result .eyebrow { color: var(--gold-300); }
.calc-big { display: grid; gap: 4px; min-height: 96px; align-content: start; }
.calc-amount { font-size: clamp(2.25rem, 1.6rem + 2vw, 3rem); font-weight: 700; color: #fff; letter-spacing: -0.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.calc-per { font-size: var(--fs-sm); color: #d3dbe8; }
.calc-rows { display: grid; border-top: 1px solid rgba(255,255,255,.14); }
.calc-rows > div { display: flex; justify-content: space-between; gap: var(--s2); padding-block: 10px; border-bottom: 1px solid rgba(255,255,255,.14); }
.calc-rows dt { font-size: var(--fs-sm); color: #d3dbe8; }
.calc-rows dd { font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; }
.fine { font-size: var(--fs-sm); line-height: 1.5; }
.calc-result .fine { color: #c3cde0; }

/* ---------- Rate request form ---------- */
.rate-form fieldset { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: var(--s3); }
.step-legend { font-size: var(--fs-xl); font-weight: 700; color: var(--ink); padding: 0; margin-bottom: var(--s3); line-height: 1.3; }
.steps { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s1); }
.steps__item { display: flex; align-items: center; gap: var(--s1); font-size: var(--fs-sm); font-weight: 600; color: var(--muted); padding-bottom: var(--s1); border-bottom: 3px solid var(--line); }
.steps__item span:first-child { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 999px; background: #eef1f6; color: var(--navy); font-size: 0.8125rem; }
.steps__item.is-active { color: var(--ink); border-bottom-color: var(--gold); }
.steps__item.is-active span:first-child, .steps__item.is-done span:first-child { background: var(--navy); color: #fff; }
.steps__item.is-done { border-bottom-color: var(--navy); }
html:not(.js) .steps, html:not(.js) #rate-next, html:not(.js) .step-done { display: none; }

.goal-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: 1fr; gap: var(--s2); }
@media (max-width: 760px) { .goal-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.goal-tile {
  position: relative; display: grid; grid-template-columns: 44px minmax(0, 1fr); align-items: center; gap: var(--s2);
  min-height: 76px; padding: var(--s2); cursor: pointer;
  border: 1px solid var(--line-strong); border-radius: var(--radius-ctl); background: #fff;
  font-weight: 700; color: var(--ink); line-height: 1.3;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease), background-color .2s var(--ease);
}
.goal-tile:hover { border-color: var(--navy); }
.goal-tile input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.goal-tile:has(input:checked) { border-color: var(--navy); background: #f3f5fa; box-shadow: inset 0 0 0 1px var(--navy); }
.goal-tile:has(input:focus-visible) { outline: 3px solid var(--gold); outline-offset: 3px; }
.goal-ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: #eef1f6; color: var(--navy); }
.goal-ico svg { width: 22px; height: 22px; }
.goal-tile:has(input:checked) .goal-ico { background: var(--navy); color: var(--gold-300); }
@media (max-width: 420px) { .goal-tile { grid-template-columns: minmax(0, 1fr); text-align: left; } }
/* Goal tiles: let long RU single words break or hyphenate (lang is set at runtime in main.js) */
.goal-tile > span:not(.goal-ico) { min-width: 0; overflow-wrap: anywhere; hyphens: auto; -webkit-hyphens: auto; }
.step-actions { display: flex; justify-content: flex-end; }
@media (max-width: 640px) { .step-actions .btn { width: 100%; } }
.goal-chosen { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s1); color: var(--muted); margin-top: calc(-1 * var(--s1)); }
.goal-chosen strong { color: var(--ink); }
.link-btn { font: inherit; font-weight: 600; color: var(--navy); background: none; border: 0; padding: 4px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.step-done { display: grid; gap: var(--s2); justify-items: start; padding-block: var(--s3); }
.step-done:focus { outline: none; }
.done-ico { width: 56px; height: 56px; border-radius: 999px; display: grid; place-items: center; background: #e6f2ea; color: #1d6b3a; }
.done-ico svg { width: 28px; height: 28px; }
.step-done h3 { font-size: var(--fs-xl); }
.step-done p { color: var(--text); max-width: 640px; }
.btn-row { display: grid; grid-template-columns: repeat(2, minmax(0, 240px)); gap: var(--s2); width: 100%; }
@media (max-width: 560px) { .btn-row { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Reverse FAQ (native details) ---------- */
.faq { gap: 0; padding-block: var(--s1) var(--card-pad); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s2);
  min-height: 64px; padding-block: var(--s2); cursor: pointer; list-style: none;
  font-weight: 700; color: var(--ink); font-size: var(--fs-lg); line-height: 1.35;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; flex: none; width: 12px; height: 12px; margin-right: 6px;
  border-right: 2px solid var(--navy); border-bottom: 2px solid var(--navy); transform: rotate(45deg) translateY(-3px);
  transition: transform .2s var(--ease);
}
.faq details[open] summary::after { transform: rotate(-135deg) translateY(-3px); }
.faq details p { padding-bottom: var(--s3); color: var(--text); max-width: 820px; }
.faq-foot { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s2); padding-top: var(--s3); }
@media (max-width: 640px) { .faq-foot { grid-template-columns: minmax(0, 1fr); } }
@media (prefers-reduced-motion: reduce) { .faq summary::after { transition: none; } }

/* ---------- Russian courtesy text (shown only in RU mode) ---------- */
html:not([lang="ru"]) .ru-only, html:not([lang="ru"]) .note-ru { display: none; }
.eho-line { color: var(--ink); }

/* ---------- Narrow screens: full-width / stacked buttons wrap, keeping the minimum height ---------- */
@media (max-width: 640px) {
  .btn--block, .btn-pair .btn, .faq-foot .btn, .form-foot .btn, .step-actions .btn, .btn-row .btn {
    white-space: normal; height: auto; min-height: var(--control-h);
    padding-block: 12px; line-height: 1.25; text-align: center;
  }
}

/* ---------- Mobile sticky bottom bar ---------- */
.mobile-bar { display: none; }
@media (max-width: 719px) {
  .mobile-bar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s1);
    padding: var(--s1) var(--pad) calc(var(--s1) + env(safe-area-inset-bottom, 0px));
    background: rgba(255, 255, 255, 0.97); border-top: 1px solid var(--line);
    box-shadow: 0 -8px 24px -12px rgba(17, 30, 51, 0.25);
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  }
  .mobile-bar__btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    height: 48px; border-radius: var(--radius-ctl); text-decoration: none;
    font-weight: 700; font-size: var(--fs-base); color: var(--navy);
    background: #eef1f6; border: 1px solid var(--line);
  }
  .mobile-bar__btn svg { width: 18px; height: 18px; flex: none; }
  .mobile-bar__btn--primary { background: var(--gold); border-color: var(--gold); color: var(--navy-900); }
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
}

/* ---------- License guard banner (shown only while license numbers are missing) ---------- */
.license-pending{background:#b42318;color:#fff;text-align:center;font-weight:600;padding:.6rem 1rem;font-size:.95rem;position:relative;z-index:1000}
