/* ==========================================================================
   instalment.ca — site stylesheet
   --------------------------------------------------------------------------
   Single-file, framework-free stylesheet for the Cloudflare Worker templates.
   Design contract (tokens below are the only source of colour / spacing /
   radius / elevation values — never hardcode outside :root).

   Design read: trust-first Canadian loan-comparison site for rate shoppers.
   Institutional-modern language, navy-tinted elevation, conservative radii,
   tabular numerals for rate tables, red reserved for CTA + brand accent.

   Breakpoints: 640px (sm) and 960px (md) — mobile-first.
   Palette: navy #1A2E4E · red #E3212C · light blue-gray #A2B9CC
            mid blue-gray #7893AE · white #FFFFFF
   ========================================================================== */

/* Poppins is the brand face. A <link> in the worker <head> is preferred for
   performance; this @import is the fallback so the site never depends on the
   worker being updated. The fallback stack below is intentionally complete so
   the site looks correct if the webfont never arrives. */
@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap");

/* --------------------------------------------------------------------------
   1. TOKENS
   -------------------------------------------------------------------------- */
:root {
  /* Brand — exact contract values */
  --navy: #1a2e4e;          /* primary */
  --red: #e3212c;           /* accent / CTA */
  --mist: #a2b9cc;          /* light blue-gray (decorative) */
  --steel: #7893ae;         /* mid blue-gray (decorative / large text) */
  --white: #ffffff;

  /* Derived navy ramp */
  --navy-900: #101e33;
  --navy-700: #24395c;
  --navy-050: #eef3f8;
  --navy-100: #e3ebf3;
  --navy-line: #d9e3ee;

  /* Derived red ramp */
  --red-700: #c41b25;
  --red-050: #fdeced;
  --red-line: #f4c6c9;

  /* Ink */
  --ink: var(--navy);
  --ink-body: #46586f;      /* 7.3:1 on white */
  --ink-muted: #5f7189;     /* 5.0:1 on white */
  --ink-invert: #ffffff;

  /* Surfaces */
  --surface: #ffffff;
  --surface-alt: #f7fafc;
  --surface-sunk: var(--navy-050);
  --line: var(--navy-line);
  --line-soft: #e8eef5;

  /* Type */
  --font-sans: "Poppins", "Montserrat", -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;

  /* Spacing — 4px base */
  --s1: 0.25rem;
  --s2: 0.5rem;
  --s3: 0.75rem;
  --s4: 1rem;
  --s5: 1.5rem;
  --s6: 2rem;
  --s7: 3rem;
  --s8: 4rem;
  --s9: 6rem;

  /* Radius — locked scale:
     interactive + cards = 12px · large panels = 18px · chips = pill */
  --radius-sm: 6px;
  --radius: 12px;
  --radius-lg: 18px;
  --radius-pill: 999px;

  /* Elevation — navy-tinted, multi-layer (never neutral black) */
  --shadow-1: 0 1px 2px rgba(16, 30, 51, 0.06), 0 1px 3px rgba(16, 30, 51, 0.05);
  --shadow-2: 0 2px 4px rgba(16, 30, 51, 0.05),
    0 10px 24px -12px rgba(16, 30, 51, 0.18);
  --shadow-3: 0 4px 8px -4px rgba(16, 30, 51, 0.08),
    0 24px 48px -24px rgba(16, 30, 51, 0.28);
  --shadow-cta: 0 6px 16px -8px rgba(227, 33, 44, 0.45),
    0 2px 4px rgba(16, 30, 51, 0.08);

  /* Structure */
  --container: 1120px;
  --gutter: clamp(1rem, 4vw, 1.75rem);
  --header-h: 4rem;
  --tap: 44px;               /* minimum tap target */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --speed: 180ms;
  --z-header: 100;
}

/* --------------------------------------------------------------------------
   2. RESET / BASE
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--surface);
  color: var(--ink-body);
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

img {
  border: 0;
}

/* --------------------------------------------------------------------------
   3. TYPOGRAPHY
   -------------------------------------------------------------------------- */
h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0 0 var(--s3);
  color: var(--ink);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(1.85rem, 1.25rem + 2.6vw, 3rem);
  letter-spacing: -0.03em;
  line-height: 1.12;
}

h2 {
  font-size: clamp(1.4rem, 1.15rem + 1.1vw, 2rem);
  margin-top: var(--s6);
}

h3 {
  font-size: clamp(1.1rem, 1.02rem + 0.45vw, 1.375rem);
}

h4 {
  font-size: 1.0625rem;
}

h5,
h6 {
  font-size: 0.9375rem;
  letter-spacing: 0;
}

h1 + .lead,
h1 + p {
  margin-top: var(--s3);
}

p {
  margin: 0 0 var(--s4);
  text-wrap: pretty;
}

p:last-child {
  margin-bottom: 0;
}

strong,
b {
  color: var(--ink);
  font-weight: 600;
}

small {
  font-size: 0.8125rem;
  color: var(--ink-muted);
}

a {
  color: var(--navy);
  text-decoration-color: var(--mist);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: color var(--speed) var(--ease),
    text-decoration-color var(--speed) var(--ease);
}

a:hover {
  color: var(--red);
  text-decoration-color: var(--red);
}

a:focus-visible,
button:focus-visible,
summary:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 2px;
}

ul,
ol {
  margin: 0 0 var(--s4);
  padding-left: 1.25rem;
}

li {
  margin-bottom: var(--s2);
}

li::marker {
  color: var(--steel);
}

ul li::marker {
  color: var(--red);
}

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: var(--s6) 0;
}

code,
kbd,
samp,
pre {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

code {
  background: var(--navy-050);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  padding: 0.1em 0.4em;
  color: var(--navy);
}

pre {
  background: var(--navy-050);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--s4);
  overflow-x: auto;
  line-height: 1.55;
}

pre code {
  background: none;
  border: 0;
  padding: 0;
}

blockquote {
  margin: var(--s5) 0;
  padding: var(--s4) var(--s5);
  background: var(--navy-050);
  border-left: 4px solid var(--red);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--ink);
  font-size: 1.0625rem;
  line-height: 1.6;
}

blockquote p:last-child {
  margin-bottom: 0;
}

blockquote cite,
blockquote footer {
  display: block;
  margin-top: var(--s2);
  color: var(--ink-muted);
  font-size: 0.8125rem;
  font-style: normal;
}

::selection {
  background: var(--navy);
  color: var(--white);
}

/* --------------------------------------------------------------------------
   4. LAYOUT
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

main.container {
  display: block;
  padding-block: var(--s6) var(--s8);
}

.page-content {
  display: block;
}

.page-content > section:not(.hero) {
  margin-block: var(--s6);
}

.page-content > section:first-child {
  margin-top: 0;
}

.page-content h2:first-child,
.page-content h3:first-child {
  margin-top: 0;
}

.lead {
  max-width: 68ch;
  color: var(--ink-body);
  font-size: clamp(1.0625rem, 1rem + 0.45vw, 1.25rem);
  line-height: 1.6;
}

.meta {
  margin: var(--s3) 0 0;
  color: var(--ink-muted);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}

/* --------------------------------------------------------------------------
   5. HEADER
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  background: rgba(255, 255, 255, 0.92);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(16, 30, 51, 0.02);
}

/* brand signature: hairline red rule along the very top */
.site-header::before {
  content: "";
  display: block;
  height: 3px;
  background: linear-gradient(90deg, var(--red) 0%, var(--red) 22%, var(--navy) 22%, var(--navy) 100%);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s4);
  min-height: var(--header-h);
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  padding-block: var(--s2);
  text-decoration: none;
  border-radius: var(--radius-sm);
}

.brand:hover {
  text-decoration: none;
}

.logo-img {
  display: block;
  width: auto;
  height: 2.25rem;      /* 36px — source asset is 160px tall (≈4x density) */
  max-width: 100%;
}

.site-nav {
  display: none;
  flex-direction: column;
  gap: var(--s1);
  width: 100%;
  padding: var(--s3) 0 var(--s4);
  border-top: 1px solid var(--line-soft);
}

.site-nav.open,
.site-nav:focus-within {
  display: flex;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  padding: var(--s2) var(--s3);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
}

.site-nav a:hover {
  background: var(--navy-050);
  color: var(--navy);
  text-decoration: none;
}

/* primary nav CTA */
.nav-cta,
a.nav-cta {
  justify-content: center;
  margin-top: var(--s2);
  padding-inline: var(--s4);
  background: var(--red);
  color: var(--white) !important;
  font-weight: 600;
  border-radius: var(--radius);
  box-shadow: var(--shadow-cta);
}

.nav-cta:hover,
a.nav-cta:hover {
  background: var(--red-700);
  color: var(--white);
}

/* mobile menu toggle — 44px tap target, pure CSS icon */
.menu-toggle {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: var(--tap);
  height: var(--tap);
  margin-left: auto;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color var(--speed) var(--ease),
    background var(--speed) var(--ease);
}

.menu-toggle:hover {
  border-color: var(--steel);
  background: var(--navy-050);
}

.menu-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: var(--navy);
  transition: transform var(--speed) var(--ease),
    opacity var(--speed) var(--ease);
}

.menu-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.menu-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* --------------------------------------------------------------------------
   6. BREADCRUMBS
   -------------------------------------------------------------------------- */
.breadcrumbs {
  border-bottom: 1px solid var(--line-soft);
  background: var(--surface-alt);
}

.breadcrumbs .container {
  display: flex;
  align-items: center;
  gap: var(--s2);
  min-height: 2.75rem;
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  font-size: 0.8125rem;
  color: var(--ink-muted);
}

.breadcrumbs .container::-webkit-scrollbar {
  display: none;
}

.breadcrumbs a {
  color: var(--ink-muted);
  font-weight: 500;
  text-decoration: none;
  padding-block: var(--s2);
}

.breadcrumbs a:hover {
  color: var(--red);
  text-decoration: underline;
}

.breadcrumbs span:last-child {
  color: var(--ink);
  font-weight: 600;
}

.breadcrumbs .sep {
  color: var(--ink-muted);
  font-weight: 400;
}

/* --------------------------------------------------------------------------
   7. HERO
   -------------------------------------------------------------------------- */
/* Hero reads as a lit surface: layered navy/mist atmosphere, red hairline
   signature, contained panel so it never depends on viewport-width tricks. */
.hero {
  position: relative;
  padding: clamp(1.75rem, 5vw, 3.25rem);
  background:
    radial-gradient(760px 340px at 6% -30%, rgba(162, 185, 204, 0.42), transparent 64%),
    radial-gradient(620px 300px at 100% -20%, rgba(227, 33, 44, 0.08), transparent 62%),
    linear-gradient(180deg, var(--white) 0%, var(--surface-alt) 100%);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-2);
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4.5rem;
  height: 4px;
  border-radius: 0 0 4px 0;
  background: var(--red);
}

.hero h1 {
  max-width: 22ch;
  margin-bottom: var(--s4);
}

.hero .lead {
  max-width: 60ch;
  margin-bottom: var(--s5);
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s3);
  align-items: center;
}

.hero-cta > * {
  flex: 0 1 auto;
}

/* --------------------------------------------------------------------------
   8. BUTTONS / CTAs
   -------------------------------------------------------------------------- */
.cta-btn,
.cta-button,
.cta-bar-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  min-height: var(--tap);
  padding: 0.7rem 1.4rem;
  background: var(--red);
  color: var(--white);
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.01em;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  border: 1px solid var(--red);
  border-radius: var(--radius);
  box-shadow: var(--shadow-cta);
  cursor: pointer;
  transition: background var(--speed) var(--ease),
    border-color var(--speed) var(--ease), box-shadow var(--speed) var(--ease),
    transform var(--speed) var(--ease);
}

.cta-btn:hover,
.cta-button:hover,
.cta-bar-btn:hover {
  background: var(--red-700);
  border-color: var(--red-700);
  color: var(--white);
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 10px 22px -10px rgba(227, 33, 44, 0.5),
    0 2px 4px rgba(16, 30, 51, 0.08);
}

.cta-btn:active,
.cta-button:active,
.cta-bar-btn:active {
  transform: translateY(0) scale(0.99);
}

/* secondary — navy outline */
.cta-btn.is-secondary,
.cta-button.is-secondary,
a.cta-btn.secondary {
  background: transparent;
  border-color: var(--navy);
  color: var(--navy);
  box-shadow: none;
}

.cta-btn.is-secondary:hover,
.cta-button.is-secondary:hover,
a.cta-btn.secondary:hover {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--white);
}

/* full-width CTAs inside narrow cards */
.order-card .cta-btn,
.inline-cta .cta-btn {
  width: 100%;
}

/* --------------------------------------------------------------------------
   9. CTA BAR (navy band)
   -------------------------------------------------------------------------- */
.cta-bar {
  margin-block: var(--s6);
  background: var(--navy);
  color: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-3);
  overflow: hidden;
}

.cta-bar-inner {
  display: flex;
  flex-direction: column;
  gap: var(--s4);
  padding: clamp(1.25rem, 4vw, 2rem);
  align-items: flex-start;
}

.cta-bar-text {
  display: flex;
  flex-direction: column;
  gap: var(--s1);
}

.cta-bar-text strong {
  color: var(--white);
  font-size: clamp(1.1rem, 1rem + 0.6vw, 1.375rem);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.cta-bar-text span {
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.9375rem;
  max-width: 60ch;
}

.cta-bar-btn {
  /* red on navy — 1px white ring guarantees non-text contrast */
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.32),
    0 6px 16px -8px rgba(0, 0, 0, 0.45);
}

.cta-bar a:focus-visible {
  outline-color: var(--white);
}

/* --------------------------------------------------------------------------
   10. CARD GRID
   -------------------------------------------------------------------------- */
.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s4);
  margin-top: var(--s5);
}

.card {
  display: flex;
  flex-direction: column;
  gap: var(--s2);
  padding: var(--s5);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  color: var(--ink-body);
  text-decoration: none;
  transition: transform var(--speed) var(--ease),
    box-shadow var(--speed) var(--ease), border-color var(--speed) var(--ease);
}

.card:hover,
.card:focus-visible {
  transform: translateY(-2px);
  border-color: var(--mist);
  box-shadow: var(--shadow-2);
  text-decoration: none;
}

.card h3 {
  margin: 0;
  color: var(--ink);
  font-size: 1.0625rem;
  font-weight: 600;
}

.card p {
  margin: 0;
  color: var(--ink-body);
  font-size: 0.9375rem;
  line-height: 1.6;
}

.card .meta {
  margin: 0;
  padding-top: var(--s2);
  border-top: 1px solid var(--line-soft);
  color: var(--ink-muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.card-cta {
  display: inline-flex;
  align-items: center;
  gap: var(--s1);
  margin-top: auto;
  padding-top: var(--s2);
  color: var(--red);
  font-size: 0.875rem;
  font-weight: 600;
}

.card-cta::after {
  content: "\2192";
  font-weight: 400;
  transition: transform var(--speed) var(--ease);
}

.card:hover .card-cta::after {
  transform: translateX(3px);
}

.card:hover .card-cta {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

/* --------------------------------------------------------------------------
   11. SERVICE CARDS
   -------------------------------------------------------------------------- */
.service-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s4);
  margin-top: var(--s5);
}

.service-card {
  display: flex;
  flex-direction: column;
  gap: var(--s3);
  padding: var(--s5);
  background: var(--surface-sunk);
  border: 1px solid var(--navy-line);
  border-radius: var(--radius);
  transition: border-color var(--speed) var(--ease),
    background var(--speed) var(--ease), box-shadow var(--speed) var(--ease);
}

.service-card:hover {
  background: var(--navy-100);
  border-color: var(--steel);
  box-shadow: var(--shadow-2);
}

.service-card h3 {
  margin: 0;
  font-size: 1.0625rem;
}

.service-card p {
  margin: 0;
  font-size: 0.9375rem;
}

.service-card img,
.service-card svg {
  width: 2.25rem;
  height: 2.25rem;
  flex: none;
  border-radius: var(--radius-sm);
}

/* --------------------------------------------------------------------------
   12. ORDER CARD + TEST META STRIP
   -------------------------------------------------------------------------- */
.order-card {
  margin-block: var(--s5);
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--red);
  border-radius: var(--radius);
  box-shadow: var(--shadow-2);
}

.order-card-content {
  display: flex;
  flex-direction: column;
  gap: var(--s3);
  padding: clamp(1.25rem, 4vw, 1.75rem);
}

.order-card h2 {
  margin: 0;
  font-size: clamp(1.25rem, 1.1rem + 0.8vw, 1.625rem);
}

.order-card p {
  margin: 0;
  max-width: 62ch;
  font-size: 0.9375rem;
}

.order-card-meta {
  padding-top: var(--s4);
  border-top: 1px solid var(--line-soft);
  color: var(--ink-muted);
  font-size: 0.8125rem;
}

.order-card-meta strong {
  color: var(--navy);
  font-variant-numeric: tabular-nums;
}

.test-meta-strip {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s4) var(--s5);
  align-items: center;
  padding: var(--s4) 0;
  margin-block: var(--s4);
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}

.test-meta-stat {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 6.5rem;
}

.test-meta-stat > span,
.test-meta-stat > small,
.test-meta-stat .label {
  color: var(--ink-muted);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.test-meta-stat > strong,
.test-meta-stat > b,
.test-meta-stat .value {
  color: var(--navy);
  font-size: 1.0625rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.test-meta-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap);
  margin-left: auto;
  padding: 0.6rem 1.25rem;
  background: transparent;
  border: 2px solid var(--navy);
  border-radius: var(--radius);
  color: var(--navy);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background var(--speed) var(--ease),
    color var(--speed) var(--ease);
}

.test-meta-cta:hover {
  background: var(--navy);
  color: var(--white);
  text-decoration: none;
}

/* --------------------------------------------------------------------------
   13. CONTENT BLOCKS
   -------------------------------------------------------------------------- */
.guide-content {
  max-width: 72ch;
  font-size: 1.0625rem;
  line-height: 1.75;
}

.guide-content > p:first-of-type {
  font-size: 1.125rem;
  color: var(--ink);
}

.guide-content h2 {
  position: relative;
  margin-top: var(--s7);
  padding-top: var(--s4);
}

.guide-content h2::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 2.25rem;
  height: 3px;
  border-radius: 3px;
  background: var(--red);
}

.guide-content h3 {
  margin-top: var(--s5);
}

.guide-content ul,
.guide-content ol {
  padding-left: 1.4rem;
}

.guide-content li {
  margin-bottom: var(--s3);
}

.guide-content table {
  margin-block: var(--s5);
}

.editorial-box {
  margin-top: var(--s6);
  padding: var(--s5);
  background: var(--surface-sunk);
  border: 1px solid var(--navy-line);
  border-left: 4px solid var(--navy);
  border-radius: var(--radius);
  font-size: 0.9375rem;
}

.editorial-box p {
  margin-bottom: var(--s2);
  color: var(--ink-body);
}

.editorial-box p:first-child strong {
  color: var(--navy);
}

.editorial-box p:last-child {
  margin-bottom: 0;
}

.disclaimer-box {
  margin-top: var(--s4);
  padding: var(--s4) var(--s5);
  background: var(--red-050);
  border: 1px solid var(--red-line);
  border-left: 4px solid var(--red);
  border-radius: var(--radius);
  color: var(--ink-body);
  font-size: 0.8125rem;
  line-height: 1.65;
}

.disclaimer-box strong {
  color: var(--navy);
}

.aff-note {
  display: block;
  margin-block: var(--s4);
  padding-top: var(--s3);
  border-top: 1px dashed var(--mist);
  color: var(--ink-muted);
  font-size: 0.8125rem;
  line-height: 1.6;
}

.aff-note a {
  color: var(--ink-body);
  text-decoration: underline;
}

.inline-cta {
  display: flex;
  flex-direction: column;
  gap: var(--s4);
  align-items: flex-start;
  margin-top: var(--s6);
  padding: clamp(1.25rem, 4vw, 1.75rem);
  background: var(--surface-sunk);
  border: 1px solid var(--navy-line);
  border-radius: var(--radius-lg);
}

.inline-cta p {
  margin: 0;
  max-width: 62ch;
  color: var(--ink-body);
  font-size: 0.9375rem;
}

.inline-cta p strong {
  color: var(--navy);
}

/* --------------------------------------------------------------------------
   14. FAQ (details / summary)
   -------------------------------------------------------------------------- */
.faq-item {
  margin-bottom: var(--s3);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color var(--speed) var(--ease),
    box-shadow var(--speed) var(--ease);
}

.faq-item:hover {
  border-color: var(--mist);
}

.faq-item[open] {
  border-color: var(--steel);
  box-shadow: var(--shadow-2);
}

.faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
  min-height: var(--tap);
  padding: var(--s4) var(--s5);
  color: var(--ink);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  cursor: pointer;
  list-style: none;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: var(--radius-pill);
  background: var(--navy-050);
  color: var(--navy);
  font-size: 1.125rem;
  font-weight: 500;
  line-height: 1;
  transition: transform var(--speed) var(--ease),
    background var(--speed) var(--ease), color var(--speed) var(--ease);
}

.faq-item[open] summary::after {
  content: "\2212";
  background: var(--red);
  color: var(--white);
}

.faq-item summary:hover {
  background: var(--surface-alt);
}

.faq-item > p {
  margin: 0;
  padding: 0 var(--s5) var(--s5);
  max-width: 70ch;
  color: var(--ink-body);
  font-size: 0.9375rem;
  line-height: 1.7;
}

/* --------------------------------------------------------------------------
   15. TABLES (loan / rate comparison)
   -------------------------------------------------------------------------- */
table {
  width: 100%;
  border-collapse: collapse;
  margin-block: var(--s5);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  font-size: 0.9375rem;
  box-shadow: var(--shadow-1);
}

caption {
  caption-side: top;
  padding: 0 0 var(--s3);
  color: var(--ink-muted);
  font-size: 0.8125rem;
  text-align: left;
}

th,
td {
  padding: 0.75rem 1rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line-soft);
}

thead th {
  background: var(--navy);
  color: var(--white);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  border-bottom: 0;
}

/* comparison tables: first column is the label, the rest are figures */
thead th:not(:first-child),
tbody td:not(:first-child) {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

tbody tr:nth-child(even) {
  background: var(--surface-alt);
}

tbody tr:hover {
  background: var(--navy-050);
}

tbody tr:last-child td {
  border-bottom: 0;
}

tfoot td {
  border-top: 2px solid var(--navy-line);
  border-bottom: 0;
  background: var(--navy-050);
  color: var(--ink);
  font-weight: 600;
}

td strong {
  font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------------
   16. TRUST STRIP / BADGES
   -------------------------------------------------------------------------- */
.trust-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s2) var(--s3);
  margin-block: var(--s5);
  padding: var(--s4) 0;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  list-style: none;
  padding-left: 0;
}

.trust-strip li {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  margin: 0;
  color: var(--ink-body);
  font-size: 0.8125rem;
  font-weight: 500;
}

.trust-strip li::before {
  content: "";
  flex: none;
  width: 1.125rem;
  height: 1.125rem;
  border-radius: var(--radius-pill);
  background-color: var(--navy-050);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%231a2e4e' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 8.5l3 3 6-6.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 0.75rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.7rem;
  background: var(--navy-050);
  border: 1px solid var(--navy-line);
  border-radius: var(--radius-pill);
  color: var(--navy);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.4;
  white-space: nowrap;
}

.badge.is-accent {
  background: var(--red-050);
  border-color: var(--red-line);
  color: var(--red-700);
}

.badge.is-solid {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--white);
}

/* --------------------------------------------------------------------------
   17. FORMS (apply / contact)
   -------------------------------------------------------------------------- */
label {
  display: block;
  margin-bottom: var(--s2);
  color: var(--navy);
  font-size: 0.875rem;
  font-weight: 500;
}

input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
  width: 100%;
  min-height: var(--tap);
  padding: 0.65rem 0.85rem;
  background: var(--surface);
  border: 1px solid var(--steel);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.4;
  transition: border-color var(--speed) var(--ease),
    box-shadow var(--speed) var(--ease);
}

textarea {
  min-height: 7rem;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: var(--ink-muted);
  opacity: 1;
}

input:not([type="checkbox"]):not([type="radio"]):hover,
select:hover,
textarea:hover {
  border-color: var(--steel);
}

input:not([type="checkbox"]):not([type="radio"]):focus,
select:focus,
textarea:focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(26, 46, 78, 0.14);
  outline: none;
}

button {
  font-family: inherit;
}

/* --------------------------------------------------------------------------
   18. FOOTER
   -------------------------------------------------------------------------- */
.site-footer {
  margin-top: var(--s8);
  background: var(--navy);
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.875rem;
}

.site-footer > .container {
  padding-block: var(--s7) var(--s5);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s6) var(--s5);
}

.footer-grid h4 {
  margin: 0 0 var(--s3);
  color: var(--white);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.footer-grid ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-grid li {
  margin-bottom: var(--s1);
}

.footer-grid a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  color: rgba(255, 255, 255, 0.78);
  text-decoration: none;
}

.footer-grid a:hover {
  color: var(--white);
  text-decoration: underline;
  text-decoration-color: var(--red);
  text-decoration-thickness: 2px;
}

.footer-base {
  margin-top: var(--s6);
  padding-top: var(--s5);
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.62);
}

.footer-base p {
  margin-bottom: var(--s2);
  max-width: 80ch;
}

.footer-base p:last-child {
  margin-bottom: 0;
}

.footer-base a {
  color: rgba(255, 255, 255, 0.86);
}

.footer-base a:hover {
  color: var(--white);
}

.site-footer a:focus-visible {
  outline-color: var(--white);
}

/* --------------------------------------------------------------------------
   19. RESPONSIVE — 640px
   -------------------------------------------------------------------------- */
@media (min-width: 640px) {
  .logo-img {
    height: 2.5rem;
  }

  .card-grid,
  .service-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cta-bar-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .cta-bar-btn,
  .order-card .cta-btn,
  .inline-cta .cta-btn {
    width: auto;
    flex: none;
  }

  .inline-cta {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .test-meta-cta {
    margin-left: auto;
  }
}

/* --------------------------------------------------------------------------
   20. RESPONSIVE — 960px
   -------------------------------------------------------------------------- */
@media (min-width: 960px) {
  main.container {
    padding-block: var(--s7) var(--s9);
  }

  .header-inner {
    flex-wrap: nowrap;
    gap: var(--s6);
  }

  .logo-img {
    height: 2.75rem;
  }

  .menu-toggle {
    display: none;
  }

  .site-nav {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: var(--s1);
    width: auto;
    padding: 0;
    border-top: 0;
  }

  .site-nav a {
    padding: 0.5rem 0.75rem;
  }

  .nav-cta,
  a.nav-cta {
    margin: 0 0 0 var(--s2);
    padding-inline: 1.25rem;
  }

  .card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--s5);
  }

  .service-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--s5);
  }

  .footer-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .footer-grid a {
    min-height: 2rem;
  }

  .hero {
    padding-block: clamp(2.5rem, 4vw, 3.5rem);
  }
}

/* --------------------------------------------------------------------------
   21. MOBILE TABLE SCROLL (<640px)
   -------------------------------------------------------------------------- */
@media (max-width: 639px) {
  /* the table becomes its own scroll container; cells stay on one line so
     numeric columns stay readable, the caption wraps to the container width */
  table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--steel) var(--navy-050);
    white-space: nowrap;
  }

  table caption {
    display: block;
    width: 100%;
    white-space: normal;
  }

  th,
  td {
    padding: 0.65rem 0.85rem;
  }
}

/* --------------------------------------------------------------------------
   22. MOTION PREFERENCES
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .card:hover,
  .cta-btn:hover,
  .cta-button:hover,
  .cta-bar-btn:hover {
    transform: none;
  }
}

/* --------------------------------------------------------------------------
   23. PRINT
   -------------------------------------------------------------------------- */
@media print {
  .site-header,
  .site-nav,
  .menu-toggle,
  .breadcrumbs,
  .cta-bar,
  .inline-cta,
  .hero-cta {
    display: none !important;
  }

  body {
    color: #000;
    font-size: 11pt;
  }

  .card,
  .order-card,
  .editorial-box,
  .disclaimer-box {
    box-shadow: none;
    border: 1px solid #999;
  }

  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 9pt;
    color: #555;
  }
}
