/* ==========================================================================
   Compare USA — Personal Loan Comparison Landing Page (compare-usa.online)
   Design system measured from the live comparison-page reference build.

   1  Tokens          7  Podium          13  Article
   2  Base            8  Sidebar         14  Disclosures
   3  Layout          9  Vendor rows     15  Footer
   4  Buttons        10  Ratings         16  Modal
   5  Disclosure bar 11  Slider          17  Mobile CTA
   6  Hero           12  Cross-sell      18  Responsive
   ========================================================================== */

/* 1 — DESIGN TOKENS ======================================================= */
:root {
  /* Brand teal ramp */
  --teal-900: #004054;
  --teal-850: #00455b;
  --teal-800: #005a76;
  --teal-700: #006382;   /* primary action */
  --teal-600: #0d7898;
  --teal-500: #1380a4;
  --teal-400: #1aacdb;
  --teal-200: #a9d4e6;
  --teal-100: #daebf5;
  --teal-50:  #f3fafd;

  /* Neutrals */
  --ink:         #37474f;
  --ink-soft:    #5b6b73;
  --ink-faint:   #7798a9;
  --line:        #c2d8e1;
  --line-soft:   #e3e8eb;
  --surface:     #ffffff;
  --surface-alt: #f7fafc;

  /* Accents */
  --tp-green:   #00b67a;
  --star:       #ff9000;
  --star-track: #e1e4e5;
  --gold:       #fcc213;

  /* Shape & depth */
  --r-sm: 6px;
  --r-md: 9px;
  --r-lg: 14px;
  --r-pill: 64px;
  --shadow-card: 0 1px 4px rgba(101, 154, 171, .5);
  --shadow-lift: 0 6px 20px rgba(0, 64, 84, .14);
  --shadow-cta:  0 3px 3px rgba(0, 99, 130, .18);

  /* Metrics */
  --container: 1140px;
  --gutter: 25px;
  --sidebar-w: 210px;

  /* Five stars rendered across one element via mask */
  --star-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path d='M8 1.4l2.07 4.2 4.63.67-3.35 3.27.79 4.61L8 11.93l-4.14 2.22.79-4.61L1.3 6.27l4.63-.67z' fill='%23000'/></svg>");

  --ease: cubic-bezier(.4, 0, .2, 1);
}

/* 2 — BASE =============================================================== */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: Cabin, "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; font-weight: 700; line-height: 1.2; }
p  { margin: 0 0 14px; }
ul { margin: 0; padding: 0; list-style: none; }
img, svg { max-width: 100%; }
a { color: var(--teal-700); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible {
  outline: 3px solid var(--teal-400);
  outline-offset: 2px;
  border-radius: 4px;
}

.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;
}

/* 3 — LAYOUT ============================================================= */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: 30px; }

.section-head { margin-bottom: 16px; }
.section-head h2 { font-size: 20px; color: var(--ink); margin-bottom: 2px; }
.section-head p  { margin: 0; color: var(--ink-soft); font-size: 15px; }

/* 4 — BUTTONS ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border: 0;
  border-radius: 8px;
  font: 700 14px/16px inherit;
  letter-spacing: .14px;
  text-transform: uppercase;
  text-align: center;
  color: #fff;
  background: var(--teal-700);
  box-shadow: var(--shadow-cta);
  cursor: pointer;
  transition: background .18s var(--ease), transform .18s var(--ease),
              box-shadow .18s var(--ease);
}
.btn:hover {
  background: var(--teal-600);
  box-shadow: 0 6px 14px rgba(0, 99, 130, .28);
  transform: translateY(-1px);
  text-decoration: none;
  color: #fff;
}
.btn:active { transform: translateY(0); }

.btn--block { width: 100%; }
.btn--lg    { padding: 15px 32px; font-size: 15px; }
.btn--ghost {
  background: transparent;
  color: var(--teal-700);
  border: 1.5px solid var(--line);
  box-shadow: none;
}
.btn--ghost:hover { background: var(--teal-50); color: var(--teal-800); }

.btn__arrow { flex: none; transition: transform .18s var(--ease); }
.btn:hover .btn__arrow { transform: translateX(3px); }

.text-link {
  display: inline-block;
  font-size: 13px;
  color: var(--ink-soft);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.text-link:hover { color: var(--teal-700); }

/* 5 — DISCLOSURE BAR ===================================================== */
.disclosure-bar {
  background: var(--teal-900);
  color: rgba(255, 255, 255, .92);
  font-size: 13px;
  line-height: 1.4;
  text-align: center;
  padding: 8px 0;
}
.disclosure-bar a {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 2px;
  white-space: nowrap;
}

/* 6 — HERO =============================================================== */
.hero {
  position: relative;
  isolation: isolate;
  color: #fff;
  text-align: center;
  padding-top: 24px;
  background:
    radial-gradient(1100px 520px at 12% -10%, rgba(26, 172, 219, .32), transparent 62%),
    radial-gradient(760px 420px at 88% 0%,   rgba(13, 120, 152, .40), transparent 60%),
    linear-gradient(168deg, #00607e 0%, #005871 46%, #00465c 100%);
}
/* Subtle diagonal grain, as on the reference surface */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: .55;
  background-image: repeating-linear-gradient(
    135deg, rgba(255, 255, 255, .03) 0 1px, transparent 1px 7px);
  pointer-events: none;
}

.hero__bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -.2px;
}
.brand:hover { text-decoration: none; opacity: .9; }
.brand svg { flex: none; }

.hero__body { padding-top: 26px; padding-bottom: 159px; } /* room for podium overlap */

.hero h1 {
  font-size: 38px;
  line-height: 48px;
  letter-spacing: -.4px;
  margin-bottom: 4px;
  background: linear-gradient(90deg, #fff 5%, #c5f1ff 111%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero__sub { font-size: 22px; font-weight: 700; margin-bottom: 11px; }
.hero__intro {
  max-width: 750px;
  margin: 0 auto 12px;
  line-height: 21px;
  color: rgba(255, 255, 255, .93);
}
.hero__updated { font-size: 14px; opacity: .8; margin-bottom: 22px; }

.trust-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  font-size: 15px;
}
.trust-strip li {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 26px;
  border-left: 1px solid rgba(255, 255, 255, .28);
}
.trust-strip li:first-child { border-left: 0; }
.trust-strip svg { flex: none; color: var(--teal-400); }

/* 7 — PODIUM ============================================================= */
.podium {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: -141px;
  margin-bottom: 14px;
}

.pcard {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-card);
  padding: 28px 16px 16px;
  transition: box-shadow .2s var(--ease), transform .2s var(--ease);
}
.pcard:hover { box-shadow: var(--shadow-lift); transform: translateY(-2px); }

.rank-badge {
  position: absolute;
  top: 0; left: 0;
  width: 38px; height: 38px;
  display: grid;
  place-items: center;
  padding: 0 8px 4px 0;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  background: var(--teal-500);
  border-radius: 9px 0 100px 0;
}
.rank-badge--muted {
  color: var(--ink);
  background: rgba(55, 71, 79, .1);
}

.pcard__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 38px;
}
.pcard__tagline {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 6px 16px;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--teal-800);
  background: var(--teal-50);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
}

.visitors {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  font-size: 15px;
  color: var(--ink-soft);
  margin-bottom: 22px;
}
.visitors svg { flex: none; color: var(--teal-500); }

/* 8 — SIDEBAR ============================================================ */
.layout { display: flex; align-items: flex-start; gap: 20px; }
.layout__side { width: var(--sidebar-w); flex: none; position: sticky; top: 16px; }
.layout__main { flex: 1; min-width: 0; }

.panel {
  background: var(--teal-50);
  border-radius: var(--r-md);
  overflow: hidden;
  margin-bottom: 20px;
}
.panel__title {
  font-size: 17px;
  font-weight: 700;
  color: var(--teal-800);
  padding: 16px 16px 10px;
}

/* fieldset carries a default border/margin in every browser — strip it */
.filter-group {
  border: 0;
  margin: 0;
  min-width: 0;
  padding: 2px 16px 12px;
}
.filter-group + .filter-group { border-top: 1px solid #e2eef4; padding-top: 12px; }
.filter-group h4 { font-size: 14px; font-weight: 700; margin-bottom: 6px; }

/* Custom checkbox */
.check {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 0;
  font-size: 14px;
  cursor: pointer;
  user-select: none;
}
.check input { position: absolute; opacity: 0; width: 0; height: 0; }
.check__box {
  flex: none;
  width: 17px; height: 17px;
  border: 1.5px solid var(--teal-200);
  border-radius: 4px;
  background: #fff;
  display: grid;
  place-items: center;
  transition: background .15s var(--ease), border-color .15s var(--ease);
}
.check__box svg { opacity: 0; transform: scale(.6); transition: all .15s var(--ease); }
.check input:checked + .check__box { background: var(--teal-700); border-color: var(--teal-700); }
.check input:checked + .check__box svg { opacity: 1; transform: scale(1); }
.check input:focus-visible + .check__box { outline: 3px solid var(--teal-400); outline-offset: 2px; }
.check:hover .check__box { border-color: var(--teal-500); }

/* Score-methodology accordion */
.acc__item { border-top: 1px solid #e2eef4; }
.acc__btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 16px;
  background: none;
  border: 0;
  font: 700 15px/1.3 inherit;
  color: var(--teal-800);
  text-align: left;
  cursor: pointer;
}
.acc__btn .acc__chev { margin-left: auto; flex: none; color: var(--ink-faint); transition: transform .2s var(--ease); }
.acc__btn[aria-expanded="true"] .acc__chev { transform: rotate(180deg); }
.acc__icon { flex: none; }
.acc__panel {
  display: grid;
  grid-template-rows: 0fr;
  padding: 0 16px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-soft);
  transition: grid-template-rows .25s var(--ease);
}
.acc__panel > div { overflow: hidden; }
.acc__panel[data-open="true"] { grid-template-rows: 1fr; padding-bottom: 14px; }
.acc__panel p:last-child { margin-bottom: 0; }

/* 9 — VENDOR ROWS ======================================================== */
.vendor {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 5px solid var(--teal-600);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-card);
  padding: 30px 16px 16px;
  margin-bottom: 18px;
  transition: box-shadow .2s var(--ease), transform .2s var(--ease);
}
.vendor:hover { box-shadow: var(--shadow-lift); transform: translateY(-2px); }
.vendor--first { border-color: var(--teal-400); border-left-color: var(--teal-600); }

.vendor__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, .95fr) minmax(0, 1.5fr) 200px;
  align-items: center;
  gap: 18px;
}

/* Ribbon ("For homeowners only", "Top Bad Credit Lender", …) */
.ribbon {
  position: absolute;
  top: 8px; left: 48px;
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  background: var(--teal-100);
  border-radius: 24px;
}
.ribbon--accent { color: #fff; background: var(--teal-400); }

/* Identity column */
.vendor__id { display: flex; flex-direction: column; gap: 5px; }
.vendor__nmls,
.vendor__powered { font-size: 13px; color: var(--ink-faint); }
.vendor__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  font-size: 13px;
  color: var(--ink);
}
.vendor__reviews { font-weight: 700; }
.vendor__reviews a { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }

/* Score column */
.score { display: flex; align-items: center; gap: 10px; }
.score__value {
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
  color: var(--teal-900);
  letter-spacing: -.5px;
}
.score__label { font-size: 13px; font-weight: 700; color: var(--ink); }
.score__label span { display: block; }

/* Tagline pill */
.vendor__tagline {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 64px;
  padding: 10px 18px;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--teal-800);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.vendor--first .vendor__tagline { border-color: var(--teal-400); }

/* Action column */
.vendor__action { display: flex; flex-direction: column; align-items: stretch; gap: 7px; text-align: center; }
.vendor__phone {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}
.vendor__phone:hover { color: var(--teal-700); text-decoration: none; }
.vendor__phone svg { flex: none; color: var(--teal-500); }

/* "#1 this month" strip */
.why {
  display: grid;
  grid-template-columns: 118px auto;
  align-items: center;
  gap: 16px;
  margin-top: 16px;
  padding: 10px 14px;
  background: var(--teal-50);
  border-radius: var(--r-sm);
}
.why__stamp { text-align: center; line-height: 1; color: var(--teal-200); }
.why__stamp b { display: block; font-size: 30px; font-weight: 700; }
.why__stamp span { font-size: 11px; letter-spacing: 1.2px; text-transform: uppercase; }
.why__list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: center;
  gap: 10px 16px;
  font-size: 14px;
  line-height: 1.25;
}
.why__list li { display: flex; align-items: flex-start; gap: 8px; }
.why__list li svg { flex: none; margin-top: 2px; color: var(--tp-green); }
.why__lead { font-weight: 700; }
.why__lead svg { margin-top: 0; color: var(--tp-green); }

/* 10 — RATINGS =========================================================== */
.stars {
  display: inline-block;
  width: 80px; height: 15px;
  background: linear-gradient(90deg, var(--star) var(--pct, 100%), var(--star-track) var(--pct, 100%));
  -webkit-mask: var(--star-mask) repeat-x left center / 16px 15px;
  mask: var(--star-mask) repeat-x left center / 16px 15px;
}
.stars--sm { width: 64px; height: 12px; -webkit-mask-size: 12.8px 12px; mask-size: 12.8px 12px; }

.trustpilot {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
}
.trustpilot svg { flex: none; color: var(--tp-green); }

/* Score tooltip */
.tip { position: relative; display: inline-flex; }
.tip__btn {
  display: grid;
  place-items: center;
  width: 15px; height: 15px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--teal-100);
  color: var(--teal-700);
  font: 700 10px/1 inherit;
  cursor: pointer;
}
.tip__btn:hover { background: var(--teal-200); }
.tip__body {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  width: 280px;
  max-width: 78vw;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-lift);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--ink-soft);
  text-align: left;
  text-transform: none;
  letter-spacing: normal;
  opacity: 0;
  visibility: hidden;
  transition: opacity .16s var(--ease), transform .16s var(--ease), visibility .16s;
  z-index: 40;
}
.tip__body b { display: block; color: var(--ink); margin-bottom: 3px; }
.tip__body dl { margin: 0; }
.tip__body dt { font-weight: 700; color: var(--ink); margin-top: 8px; }
.tip[data-open="true"] .tip__body {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
@media (hover: hover) and (pointer: fine) {
  .tip:hover .tip__body {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
  }
}

/* Score breakdown rows inside tooltip */
.breakdown { display: grid; gap: 8px; margin-bottom: 10px; }
.breakdown div { display: grid; grid-template-columns: 34px 1fr; gap: 10px; align-items: baseline; }
.breakdown b { font-size: 15px; color: var(--teal-700); }
.breakdown span { font-size: 12px; }
.breakdown em { display: block; font-style: normal; color: var(--ink-faint); font-size: 11px; }

/* 11 — SLIDER (avoid these mistakes) ===================================== */
.mistakes { background: var(--teal-50); padding-block: 40px; margin-block: 34px; }
.mistakes__head { text-align: center; margin-bottom: 24px; }
.mistakes__head p { font-size: 15px; color: var(--teal-600); font-weight: 700; margin-bottom: 2px; text-transform: uppercase; letter-spacing: .6px; }
.mistakes__head h2 { font-size: 28px; color: var(--teal-800); }

.slides { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.slide {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.slide__art {
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 10;
  background: linear-gradient(150deg, var(--teal-500), var(--teal-800));
  color: rgba(255, 255, 255, .9);
}
.slide__art svg { width: 74px; height: 74px; }
.slide__body { padding: 20px; flex: 1; display: flex; flex-direction: column; }
.slide__body h3 { font-size: 18px; color: var(--teal-800); margin-bottom: 8px; }
.slide__body p { font-size: 15px; color: var(--ink-soft); margin-bottom: 16px; }
.slide__body .btn { margin-top: auto; }

/* 12 — CROSS-SELL ======================================================== */
.crosssell { margin-block: 34px; }
.crosssell h2 { font-size: 20px; margin-bottom: 2px; }
.crosssell p  { color: var(--ink-soft); font-size: 15px; margin-bottom: 14px; }

/* 13 — ARTICLE =========================================================== */
.article { max-width: 860px; margin: 44px auto 0; }
.article h2 {
  font-size: 26px;
  line-height: 1.2;
  color: var(--teal-800);
  margin: 34px 0 12px;
}
.article h2:first-child { margin-top: 0; }
.article h3 { font-size: 19px; color: var(--teal-800); margin: 26px 0 8px; }
.article p  { line-height: 1.65; margin-bottom: 15px; }
.article strong { color: var(--ink); }

.article ul { margin: 0 0 18px; display: grid; gap: 9px; }
.article ul li {
  position: relative;
  padding-left: 26px;
  line-height: 1.6;
}
.article ul li::before {
  content: "";
  position: absolute;
  left: 2px; top: .5em;
  width: 9px; height: 9px;
  border: 2px solid var(--teal-500);
  border-radius: 50%;
}

.article__cta { text-align: center; margin: 26px 0 34px; }

/* 14 — DISCLOSURES ======================================================= */
.disclosures {
  max-width: 860px;
  margin: 40px auto 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-soft);
}
.disclosures h2 { font-size: 16px; color: var(--ink); margin-bottom: 12px; }
.disclosures h3 {
  font-size: 13px;
  font-style: italic;
  font-weight: 400;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 2px;
  margin: 18px 0 6px;
}
.disclosures p { margin-bottom: 10px; }

/* Ghost CTA inside a slide keeps the three cards visually level */
.slide__body .btn--ghost { margin-top: auto; }

/* 15 — FOOTER ============================================================ */
.footer { background: var(--teal-700); color: #fff; margin-top: 40px; padding-bottom: 30px; }
.footer__top {
  text-align: center;
  font-size: 14px;
  padding: 16px 0;
  border-bottom: 1px solid rgba(255, 255, 255, .14);
}
.footer__cols {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 30px;
  padding: 34px 0 26px;
}
.footer__brand { display: flex; flex-direction: column; gap: 12px; }
.footer__brand .brand { font-size: 22px; }
.footer__brand p { font-size: 13px; color: rgba(255, 255, 255, .78); margin: 0; max-width: 280px; line-height: 1.6; }

.footer__cols h3 { font-size: 15px; margin-bottom: 12px; }
.footer__cols li { margin-bottom: 9px; }
.footer__cols a { color: rgba(255, 255, 255, .9); font-size: 14px; }
.footer__cols a:hover { color: #fff; }

.footer__legal {
  font-size: 12px;
  line-height: 1.6;
  color: rgba(255, 255, 255, .82);
  padding-bottom: 22px;
}
.footer__bottom {
  border-top: 1px solid rgba(255, 255, 255, .22);
  padding-top: 18px;
  font-size: 13px;
  color: rgba(255, 255, 255, .9);
}

/* 16 — MODAL (credit-score quiz) ========================================= */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 40, 54, .55);
  backdrop-filter: blur(2px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .22s var(--ease), visibility .22s;
}
.modal[data-open="true"] { opacity: 1; visibility: visible; }

.modal__card {
  position: relative;
  width: min(690px, 100%);
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: #fff;
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 40, 54, .35);
  transform: translateY(12px) scale(.98);
  transition: transform .26s var(--ease);
}
.modal[data-open="true"] .modal__card { transform: none; }

.modal__left { padding: 38px 30px; text-align: center; }
.modal__art { display: grid; place-items: center; margin-bottom: 18px; color: var(--teal-500); }
.modal__left h2 { font-size: 24px; color: var(--ink); margin-bottom: 20px; }

.progress { height: 6px; background: var(--line-soft); border-radius: 99px; overflow: hidden; margin-bottom: 8px; }
.progress span { display: block; height: 100%; background: var(--teal-400); border-radius: 99px; transition: width .3s var(--ease); }
.modal__step { font-size: 13px; color: var(--ink-soft); }

.modal__right {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  padding: 38px 30px;
  background: var(--teal-50);
}
.opt {
  padding: 14px 18px;
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  font: 400 16px/1.2 inherit;
  color: var(--ink);
  cursor: pointer;
  transition: all .16s var(--ease);
}
.opt:hover {
  border-color: var(--teal-400);
  background: #fff;
  color: var(--teal-800);
  box-shadow: 0 3px 10px rgba(0, 99, 130, .14);
  transform: translateY(-1px);
}

.modal__close {
  position: absolute;
  top: 12px; right: 12px;
  width: 32px; height: 32px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, .9);
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink-soft);
  cursor: pointer;
  z-index: 2;
}
.modal__close:hover { background: #fff; color: var(--ink); }

/* 17 — MOBILE STICKY CTA ================================================= */
.mobile-cta {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 60;
  display: none;
  gap: 10px;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--line);
  box-shadow: 0 -4px 16px rgba(0, 64, 84, .12);
  transform: translateY(105%);
  transition: transform .26s var(--ease);
}
.mobile-cta[data-show="true"] { transform: none; }

/* 18 — RESPONSIVE ======================================================== */
@media (max-width: 1080px) {
  .vendor__grid { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) 190px; }
  .vendor__tagline { grid-column: 1 / -1; order: 4; min-height: 0; }
  .why__list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .layout { flex-direction: column; }
  .layout__side { position: static; width: 100%; }
  .panel { margin-bottom: 16px; }
  .filters-panel .filter-body { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
  .footer__cols { grid-template-columns: 1fr 1fr; }
  .footer__brand { grid-column: 1 / -1; }
}

@media (max-width: 820px) {
  .hero h1 { font-size: 30px; line-height: 38px; }
  .hero__sub { font-size: 19px; }
  .hero__body { padding-bottom: 40px; }
  .podium { grid-template-columns: 1fr; gap: 14px; margin-top: 20px; }
  .visitors { justify-content: center; }
  .trust-strip { gap: 10px 0; font-size: 14px; }
  .trust-strip li { padding: 0 16px; }
  .slides { grid-template-columns: 1fr; }
  .mistakes__head h2 { font-size: 23px; }
  .article h2 { font-size: 22px; }

  .modal__card { grid-template-columns: 1fr; }
  .modal__left { padding: 34px 22px 18px; }
  .modal__right { padding: 18px 22px 28px; }
  .modal__art { display: none; }

  .mobile-cta { display: flex; }
  body { padding-bottom: 74px; }

  /* position:fixed also keeps the hidden panel out of the scroll width */
  .tip__body {
    position: fixed;
    top: auto;
    bottom: 88px;
    left: 50%;
    width: min(340px, calc(100vw - 32px));
    max-width: none;
  }
}

@media (max-width: 640px) {
  :root { --gutter: 16px; }

  .vendor { padding: 34px 14px 16px; }
  .vendor__grid { grid-template-columns: 1fr; gap: 14px; text-align: center; }
  .vendor__id { align-items: center; }
  .score { justify-content: center; }
  .vendor__tagline { order: 0; }
  .vendor__action { order: 5; }
  .ribbon { left: 46px; font-size: 12px; }

  .why { grid-template-columns: 1fr; gap: 10px; text-align: center; }
  .why__stamp { display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--teal-500); }
  .why__stamp b { font-size: 22px; }
  .why__list { grid-template-columns: 1fr; gap: 8px; text-align: left; }
  .why__lead { justify-content: center; }

  .footer__cols { grid-template-columns: 1fr; gap: 22px; }
  .hero h1 { font-size: 26px; line-height: 33px; }
  .trust-strip li { border-left: 0; }
}

/* Motion & print ========================================================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
}

@media print {
  .modal, .mobile-cta, .disclosure-bar { display: none !important; }
  .hero { background: var(--teal-800) !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .vendor { break-inside: avoid; box-shadow: none; }
}

/* 19 — LENDER WORDMARKS =================================================
   Typographic wordmarks stand in for partner logo files. Drop in a real
   <img> per partner when you have licensed assets; keep the .logo box so
   the row grid stays put.
   ====================================================================== */
.logo {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -.4px;
  white-space: nowrap;
  color: var(--ink);
}
.logo em { font-style: normal; font-weight: 400; }

.logo--amerisave  { font-family: Georgia, "Times New Roman", serif; font-size: 23px; color: #1b3a5c; }
.logo--credible   { font-size: 27px; color: #3c46c8; letter-spacing: -1.1px; }
.logo--achieve    { font-size: 24px; color: #12305c; }
.logo--lightstream{ font-size: 21px; color: #2d3a45; letter-spacing: -.2px; }
.logo--sofi       { font-size: 27px; color: #00a5e0; letter-spacing: -1px; }
.logo--creditkarma{ font-size: 20px; color: #0a8a43; letter-spacing: -.3px; }
.logo--figure     { font-size: 22px; color: #101820; letter-spacing: 2.6px; font-weight: 700; }
.logo--happen     { font-size: 20px; color: #0b5d8f; }
.logo--upstart    { font-size: 24px; color: #18a97f; }
.logo--bankrate   { font-size: 22px; color: #17375e; }
.logo--lending    {
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  font-size: 20px;
  color: #17417a;
  letter-spacing: .2px;
}
.logo--lending em {
  font-size: 10px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: #5b7fa8;
}

/* A small coloured mark ahead of the wordmark, where the brand has one */
.logo--amerisave::before,
.logo--upstart::before,
.logo--sofi::after {
  content: "";
  display: inline-block;
  flex: none;
  width: 16px; height: 16px;
  align-self: center;
}
.logo--amerisave::before {
  background: linear-gradient(135deg, #3fbfa0, #1b6ea8);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}
.logo--upstart::before {
  background: #18a97f;
  clip-path: polygon(50% 100%, 0 32%, 22% 0, 50% 26%, 78% 0, 100% 32%);
}
.logo--sofi::after {
  background: #00a5e0;
  border-radius: 3px;
}

/* No-results row */
.no-results {
  padding: 26px 18px;
  text-align: center;
  color: var(--ink-soft);
  background: var(--teal-50);
  border-radius: var(--r-md);
}
.no-results button {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  cursor: pointer;
}

/* 20 — DISCLOSURE MODAL + BRAND LOCKUP ===================================== */
.brand img { display: block; height: 40px; width: auto; }
.footer__brand .brand img { height: 46px; }

.hero__disclosure {
  font-size: 13px;
  color: rgba(255, 255, 255, .88);
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
}
.hero__disclosure:hover { color: #fff; }

.disclosure-bar strong { font-weight: 700; color: #fff; }

/* Document-style modal (scrollable long-form copy) */
.modal--doc { align-items: center; }

.modal__card--doc {
  display: flex;
  flex-direction: column;
  width: min(660px, 100%);
  max-height: min(86vh, 780px);
  text-align: left;
}

.doc__head {
  flex: none;
  padding: 30px 32px 20px;
  color: #fff;
  background:
    radial-gradient(620px 280px at 8% -30%, rgba(26, 172, 219, .45), transparent 60%),
    linear-gradient(150deg, #00607e, #00465c);
}
.doc__badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 12px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .6px;
  text-transform: uppercase;
  background: rgba(255, 255, 255, .16);
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 99px;
}
.doc__head h2 { font-size: 24px; margin-bottom: 8px; letter-spacing: -.3px; }
.doc__head p {
  margin: 0;
  font-size: 15px;
  line-height: 1.55;
  color: rgba(255, 255, 255, .92);
}

.doc__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 22px 32px 26px;
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--ink-soft);
}
.doc__body h3 {
  font-size: 15px;
  color: var(--teal-800);
  margin: 20px 0 6px;
}
.doc__body h3:first-child { margin-top: 0; }
.doc__body strong { color: var(--ink); }
.doc__body p { margin-bottom: 12px; }

.doc__meta {
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
  font-size: 13px;
}

.doc__foot {
  flex: none;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 32px;
  background: var(--teal-50);
  border-top: 1px solid var(--line);
}

@media (max-width: 640px) {
  .brand img { height: 34px; }
  .hero__disclosure { display: none; }
  .doc__head { padding: 26px 20px 18px; }
  .doc__head h2 { font-size: 20px; }
  .doc__body { padding: 18px 20px 22px; }
  .doc__foot { padding: 14px 20px; }
  .modal__card--doc { max-height: 90vh; }
}

/* 21 — LEGAL PAGES ======================================================== */
.legal-head {
  color: #fff;
  padding: 26px 0 34px;
  background:
    radial-gradient(900px 420px at 10% -20%, rgba(26, 172, 219, .32), transparent 62%),
    linear-gradient(160deg, #00607e, #00465c);
}
.legal-head .brand { margin-bottom: 22px; }
.legal-head h1 {
  font-size: 34px;
  letter-spacing: -.5px;
  margin-bottom: 5px;
  background: linear-gradient(90deg, #fff 5%, #c5f1ff 111%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.legal-head p { margin: 0; font-size: 14px; opacity: .82; }

.legal {
  max-width: 780px;
  margin: 0 auto;
  padding: 36px 0 10px;
  font-size: 15.5px;
  line-height: 1.7;
}
.legal__lead {
  font-size: 17px;
  line-height: 1.65;
  padding: 18px 20px;
  margin-bottom: 8px;
  color: var(--teal-800);
  background: var(--teal-50);
  border-left: 4px solid var(--teal-400);
  border-radius: 0 var(--r-md) var(--r-md) 0;
}
.legal h2 {
  font-size: 20px;
  color: var(--teal-800);
  margin: 32px 0 10px;
}
.legal p  { margin-bottom: 13px; color: var(--ink-soft); }
.legal strong { color: var(--ink); }

.legal ul { margin: 0 0 16px; display: grid; gap: 8px; }
.legal ul li {
  position: relative;
  padding-left: 24px;
  color: var(--ink-soft);
}
.legal ul li::before {
  content: "";
  position: absolute;
  left: 2px; top: .62em;
  width: 8px; height: 8px;
  border: 2px solid var(--teal-500);
  border-radius: 50%;
}

/* Reminder block for the site owner — delete the markup before launch. */
.legal__note {
  margin: 38px 0 14px;
  padding: 18px 20px;
  font-size: 14px;
  line-height: 1.6;
  color: #7a4b00;
  background: #fff8e6;
  border: 1px solid #f5d98a;
  border-radius: var(--r-md);
}

@media (max-width: 640px) {
  .legal-head h1 { font-size: 26px; }
  .legal { font-size: 15px; padding-top: 26px; }
  .legal__lead { font-size: 16px; }
  .legal h2 { font-size: 18px; }
}
