/* Comparisons.org - HELOC Veterans quiz v2 (20700146 with fixes: no hover shading, mortgage slider locked until moved, white box around sliders) */
/* =========================================================
   VA HELOC landing (20700146 v2) - mobile-first
   Base styles target mobile (<=767px). min-width breakpoints
   add tablet (768px+) and desktop (1024px+) refinements.
   ========================================================= */
:root {
  --brand-teal: #1d3557;
  --brand-teal-2: #2670a8;
  --brand-teal-3: #155578;
  --bg-trust: #e8f1f9;
  --bg-footer: rgba(168, 200, 224, 0.29);
  --text: #1a1a1a;
  --text-muted: #7a7a7a;
  --text-nav: #1d3557;
  --radius-card: 16px;
  --gutter: 16px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; width: 100%; min-height: 100%; }

/* Push the patriotic hero background onto the <html> root so it fills the
   ENTIRE viewport even when a CMS wraps the page in a narrow main column.
   The gray gutter the CMS chrome reserves on either side now shows this
   image instead of plain gray. */
html {
  background:
    linear-gradient(rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.85)),
    url("assets/flag-bg.jpg") center top / cover no-repeat fixed;
  min-height: 100vh;
}

body {
  font-family: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: var(--text);
  background: transparent;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Force common CMS wrappers to span full width so the form content
   isn't squeezed into a narrow left column. */
.contentContainer,
.container-fluid > .row,
main > section,
main > div {
  max-width: none !important;
  width: 100% !important;
}

#form_id { display: none; }

._cont { max-width: 1200px; margin: 0 auto; padding: 0 var(--gutter); }

/* =========================================================
   SITE HEADER
   ========================================================= */
.site-header {
  background: #fff;
  border-bottom: 1px solid #e5e5e5;
  padding: 0;
  position: relative;
  z-index: 10;
}
.site-header .header-row {
  max-width: 1170px;
  margin: 0 auto;
  padding: 0 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 60px;
}
.site-header .logo {
  display: block;
  width: 250px;
  height: 46px;
  background: url('https://d31otfhas71ais.cloudfront.net/cms-assets/reviewsv2/images/logo.svg') no-repeat center left;
  background-size: contain;
  flex-shrink: 0;
}
.nd-tooltip-wrapper {
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
}
.nd-tooltip-title {
  font-size: 11px;
  color: #aaa;
  text-decoration: none;
}
.nd-tooltip-text {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  width: 360px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 14px;
  font-size: 11px;
  color: #555;
  line-height: 1.5;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  z-index: 100;
}
.nd-tooltip-wrapper:hover .nd-tooltip-text,
.nd-tooltip-wrapper:focus .nd-tooltip-text { display: block; }
.nd-tooltip-text p { margin: 0; }

@media (max-width: 576px) {
  .site-header .header-row { min-height: 46px; padding: 0 12px; }
  .site-header .logo { width: 170px; height: 32px; }
  .nd-tooltip-title { font-size: 10px; }
  .nd-tooltip-text { width: 260px; right: -10px; }
}

/* =========================================================
   MAIN - hero background image
   Viewport-breakout: if a CMS wrapper constrains page width,
   force the hero background to span the full viewport so the
   patriotic bg reaches the screen edges (no gray gutter).
   ========================================================= */
.main-section {
  position: relative;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  background:
    linear-gradient(rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.85)),
    url("assets/flag-bg.jpg") center top / cover no-repeat;
}
html, body { overflow-x: hidden; }

/* =========================================================
   HERO + FORM CARD
   ========================================================= */
.second_section { padding: 20px 16px 0; }

.form_wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 0 24px;
  border-radius: var(--radius-card);
}

.form_wrapper .hero-h1 {
  margin: 0 0 14px;
  text-align: center;
  font-size: 26px;
  line-height: 1.25;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--text);
}
.flag {
  display: block;
  margin: 0 auto 12px;
  width: 44px;
  height: auto;
}

.hero-trust {
  list-style: none;
  margin: 18px auto 0;
  padding: 0;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: center;
  gap: 14px;
}
.hero-trust li {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 500;
  color: #2a4a4a;
  white-space: nowrap;
}
.hero-trust svg { flex-shrink: 0; }

._form { display: flex; justify-content: center; margin-top: 20px; }

#form { width: 100%; max-width: 460px; }

/* When past step 1: hide hero & below-fold sections so the quiz takes over */
body.quiz-active .form_wrapper > .hero-h1,
body.quiz-active .form_wrapper > .hero-trust,
body.quiz-active .fifth_section,
body.quiz-active .fourth_section,
body.quiz-active .third_section {
  display: none !important;
}
body.quiz-active .second_section { padding-top: 16px; padding-bottom: 80px; min-height: calc(100vh - 60px); }

/* progress row: back arrow + progress bar */
.form_progress_row {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 560px;
  margin: 0 auto 20px;
  padding: 0 16px;
}
.back-arrow {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 50%;
  color: var(--brand-teal-2);
  cursor: pointer;
  padding: 0;
  transition: background 0.15s ease, color 0.15s ease;
}
.back-arrow:hover { background: rgba(38, 112, 168, 0.08); color: var(--brand-teal-3); }
.back-arrow[hidden] { display: none; }

/* hide per-step prev buttons (replaced by global back arrow) */
.prev-step { display: none !important; }

/* progress bar */
.form_progress {
  position: relative;
  height: 6px;
  background: #e8f1f9;
  border-radius: 999px;
  margin: 0;
  flex: 1;
}
.form_progress_fill {
  display: block;
  height: 100%;
  background: #5b9bd5;
  border-radius: 999px;
  transition: width 0.4s ease;
}
.form_progress_text {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  font-weight: 500;
  color: var(--brand-teal-3);
  white-space: nowrap;
}

.form_steps { position: relative; }
.form_step { display: none; animation: fadeIn 0.25s ease; }
.form_step.--active { display: block; }
@keyframes  fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.for_step_body { padding: 0 8px; }
.for_step_actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
  padding: 0 8px;
}

.stepN, .stepLoad, .finalStep { text-align: center; }

.stepN h4, .stepLoad h4 {
  margin: 4px auto 14px;
  font-size: 22px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: #1e2a32;
  max-width: 360px;
  text-align: center;
  display: block;
  width: 100%;
}
/* Step 1 first question - extra prominent on mobile */
.form_step[data-step="1"] .stepN h4 {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.015em;
  color: #0f1e2a;
  margin: 8px auto 12px;
  max-width: 340px;
}
.stepN h5 {
  margin: 0 auto 18px;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--text-muted);
  max-width: 320px;
}

/* =========================================================
   RADIO OPTIONS - three layout variants (mobile-first)
   ========================================================= */
.options_div { display: flex; margin: 10px auto 0; max-width: 360px; }

.options_div label { cursor: pointer; position: relative; display: flex; }
.options_div label input[type=radio] {
  position: absolute; opacity: 0; inset: 0; cursor: pointer;
}

.options_div .img_box {
  flex: 1;
  display: flex;
  background: #fff;
  border: 1.5px solid var(--brand-teal-2);
  border-radius: 10px;
  color: var(--text);
  font-size: 16px;
  font-weight: 500;
  text-align: center;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.options_div .img_box p { margin: 0; }

/* v2: no hover shading on the answers */
.options_div label input[type=radio]:checked + .img_box {
  background: var(--brand-teal-2);
  color: #fff;
  border-color: var(--brand-teal-2);
}

/* ── two-up: mobile = stacked full-width pills (BIG on mobile) */
.options_div.two-up { flex-direction: column; gap: 14px; max-width: 380px; }
.options_div.two-up label { width: 100%; }
.options_div.two-up .img_box {
  align-items: center;
  justify-content: center;
  min-height: 88px;
  padding: 24px 20px;
  font-size: 20px;
  font-weight: 600;
  border-radius: 14px;
  border-width: 2px;
  box-shadow: 0 4px 16px rgba(38, 112, 168, 0.10);
}

/* ── stack-pills: vertical pill stack */
.options_div.stack-pills { flex-direction: column; gap: 12px; }
.options_div.stack-pills label { width: 100%; }
.options_div.stack-pills .img_box {
  align-items: center;
  justify-content: center;
  min-height: 68px;
  padding: 20px 22px;
  font-size: 16px;
  font-weight: 500;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

/* ── grid-cards: mobile = stacked horizontal-inner cards (icon left, label center) */
.options_div.grid-cards { flex-direction: column; gap: 12px; }
.options_div.grid-cards label { width: 100%; }
.options_div.grid-cards .img_box {
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  padding: 24px 22px;
  min-height: 92px;
  border-radius: 12px;
  text-align: left;
  font-size: 16px;
  font-weight: 600;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}
.options_div.grid-cards .opt-icon {
  width: 32px; height: 32px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.options_div.grid-cards .opt-icon svg { width: 100%; height: 100%; }
.options_div.grid-cards .img_box p { flex: 1; }

/* selected state - switch icon strokes to white */
.options_div.grid-cards label input[type=radio]:checked + .img_box .opt-icon svg path,
.options_div.grid-cards label input[type=radio]:checked + .img_box .opt-icon svg circle,
.options_div.grid-cards label input[type=radio]:checked + .img_box .opt-icon svg rect,
.options_div.grid-cards label input[type=radio]:checked + .img_box .opt-icon svg line,
.options_div.grid-cards label input[type=radio]:checked + .img_box .opt-icon svg polyline {
  stroke: #fff;
}
.options_div.grid-cards label input[type=radio]:checked + .img_box .opt-icon svg text {
  fill: #fff;
}

/* nav buttons */
.next-step, .prev-step {
  padding: 14px 32px;
  font: 600 16px "Poppins", sans-serif;
  border-radius: 999px;
  cursor: pointer;
  min-height: 48px;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.next-step {
  background: var(--brand-teal-2);
  border: 1.5px solid var(--brand-teal-2);
  color: #fff;
}
.next-step:hover { background: var(--brand-teal-3); border-color: var(--brand-teal-3); }
.next-step[disabled],
.next-step.next-step-disabled {
  background: #cbd5e1;
  border-color: #cbd5e1;
  color: #fff;
  cursor: not-allowed;
  opacity: 0.7;
  pointer-events: none;
}
.prev-step {
  background: transparent;
  border: 1.5px solid #d1d5db;
  color: #6b7280;
}
.prev-step:hover { background: #f3f4f6; }

/* zip step */
.zip_div {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #fff;
  border: 1.5px solid var(--brand-teal-2);
  border-radius: 12px;
  padding: 18px 20px;
  margin: 16px auto 0;
  max-width: 380px;
  min-height: 72px;
  box-shadow: 0 2px 12px rgba(38, 112, 168, 0.10);
}
.zip_div input[type=text] {
  border: none; outline: none;
  font: 700 24px "Poppins", sans-serif;
  letter-spacing: 0.2em;
  width: 100%;
  flex: 1;
  background: transparent;
  color: var(--text);
  text-align: center;
}
.zip_div input[type=text]::placeholder {
  color: #b9c2c4;
  letter-spacing: 0.1em;
  font-weight: 500;
}
.zip_div svg { flex-shrink: 0; width: 24px; height: 24px; }

.field-error {
  color: #c43c3c;
  font-size: 12px;
  margin: 8px 0 0;
  text-align: center;
}

/* range slider - property value & mortgage balance */
.range-slider {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 24px;
  margin: 28px auto 16px;
  max-width: 380px;
  padding: 22px 20px 16px;
  /* v2: white box around the slider, like the answer boxes on the other steps */
  background: #fff;
  border: 1.5px solid var(--brand-teal-2);
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}
.range-value-display {
  text-align: center;
  font-size: 40px;
  font-weight: 800;
  color: var(--brand-teal-2);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  margin-bottom: 2px;
}
.range-slider input[type=range] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: linear-gradient(to right, var(--brand-teal-2) 0%, var(--brand-teal-2) 50%, #e8f1f9 50%, #e8f1f9 100%);
  border-radius: 999px;
  outline: none;
  cursor: pointer;
  margin: 12px 0;
}
.range-slider input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--brand-teal-2);
  box-shadow: 0 2px 8px rgba(38, 112, 168, 0.35);
  cursor: pointer;
  transition: transform 0.1s ease;
}
.range-slider input[type=range]::-webkit-slider-thumb:active { transform: scale(1.15); }
.range-slider input[type=range]::-moz-range-thumb {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--brand-teal-2);
  box-shadow: 0 2px 8px rgba(38, 112, 168, 0.35);
  cursor: pointer;
}
.range-bounds {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  padding: 0 4px;
}

/* loading step */
.stepLoad {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 0;
}
.stepLoad #loading_bar { margin-top: 16px; }

/* final step / offer cards */
.finalStep .cards-title { font-size: 22px; font-weight: 800; margin: 8px 0 4px; }
.finalStep .cards-sub {
  margin: 0 0 14px;
  color: var(--text-muted);
  font-size: 13px;
}

.sort-dropdown { position: relative; display: inline-block; margin-bottom: 14px; }
.dropdown-toggle {
  background: #fff;
  border: 1px solid #d1d5db;
  padding: 8px 16px;
  border-radius: 8px;
  font: 500 13px "Poppins", sans-serif;
  color: var(--text);
  cursor: pointer;
}
.dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  list-style: none;
  margin: 0;
  padding: 4px;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  min-width: 220px;
  z-index: 10;
}
.dropdown-menu li { padding: 8px 12px; font-size: 13px; cursor: pointer; border-radius: 4px; }
.dropdown-menu li:hover { background: #f3f4f6; }

#cards-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}

.offer-card {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "badge cta"
    "logo  logo"
    "stats stats"
    "rate  rate";
  align-items: center;
  gap: 10px 16px;
  background: #fff;
  border: 1px solid #e8f1f9;
  border-radius: 12px;
  padding: 14px;
  text-align: left;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}
.offer-badge {
  grid-area: badge;
  background: var(--brand-teal-2);
  color: #fff;
  font: 700 11px "Poppins", sans-serif;
  padding: 4px 8px;
  border-radius: 6px;
  white-space: nowrap;
  justify-self: start;
}
.offer-logo { grid-area: logo; }
.offer-logo img { max-height: 26px; width: auto; }
.offer-stats { grid-area: stats; display: flex; gap: 14px; flex-wrap: wrap; }
.offer-stats .stat { display: flex; flex-direction: column; }
.offer-stats .lbl { font-size: 11px; color: var(--text-muted); }
.offer-stats .val { font-size: 14px; font-weight: 700; color: var(--text); }
.offer-rating { grid-area: rate; font-size: 13px; color: #d97706; font-weight: 600; }
.offer-cta {
  grid-area: cta;
  background: var(--brand-teal-2);
  color: #fff;
  text-decoration: none;
  padding: 9px 16px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
  justify-self: end;
}
.offer-cta:hover { background: var(--brand-teal-3); }

/* =========================================================
   PARTNERS LOGO STRIP
   ========================================================= */
.fifth_section {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  padding: 24px 8px 16px;
}
.fifth_section h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 500;
  color: var(--text);
  text-align: center;
}
.partners-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  align-items: center;
  justify-items: stretch;
  gap: 0;
  margin: 0 auto 24px;
  width: 100%;
  max-width: 100%;
}
.partners-row img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
  padding: 0;
}

/* =========================================================
   TRUST BAR
   ========================================================= */
.fourth_section {
  background: var(--bg-trust);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 12px 16px;
}
.trust-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
}
.trust-inner p { margin: 0; }

/* =========================================================
   ADVANTAGES OF HELOC
   ========================================================= */
.third_section { padding: 32px 16px 40px; background: #fff; }
.third_section_wrapper { max-width: 1200px; margin: 0 auto; }
.why-choose h2 {
  margin: 0 0 24px;
  text-align: center;
  font-size: 22px;
  font-weight: 400;
  color: var(--text);
}
.why-choose ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.why-choose li {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}
.adv-icon { display: flex; align-items: center; justify-content: center; height: 48px; }
.why-choose li h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}
.why-choose li p {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.5;
  max-width: 320px;
}
.why-choose > a { display: block; text-align: center; margin-top: 28px; text-decoration: none; }
.why-choose button {
  display: inline-block;
  padding: 14px 32px;
  background: var(--brand-teal-2);
  color: #fff;
  font: 600 16px "Poppins", sans-serif;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease;
}
.why-choose button:hover { background: var(--brand-teal-3); }

/* =========================================================
   SITE FOOTER
   ========================================================= */
.site-footer {
  background: #fff;
  border-top: 1px solid #e5e5e5;
  padding: 30px 0 40px;
  text-align: center;
  position: relative;
  z-index: 9;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}
.site-footer .container {
  max-width: 1170px;
  margin: 0 auto;
  padding: 0 15px;
}
.site-footer .referral-text {
  font-size: 10px;
  color: #555;
  margin-bottom: 10px;
}
.site-footer .copyright-text {
  font-size: 10px;
  color: #555;
  line-height: 1.6;
  margin-bottom: 16px;
  max-width: 960px;
  margin-left: auto;
  margin-right: auto;
}
.site-footer .footer-nav {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 16px;
  padding: 0;
  margin: 0;
}
.site-footer .footer-nav li { display: inline-block; }
.site-footer .footer-nav a {
  font-size: 11px;
  color: #116696;
  text-decoration: none;
  transition: opacity 0.2s;
}
.site-footer .footer-nav a:hover {
  text-decoration: underline;
  opacity: 0.8;
}

@media (max-width: 576px) {
  .site-footer .footer-nav { flex-direction: column; gap: 8px; }
}

/* =========================================================
   v2: PHONES - each step fits one screen (375x667)
   ========================================================= */
@media (max-width: 767px) {
  body.quiz-active .second_section { padding-top: 8px; }
  .form_progress_row { margin-bottom: 14px; }
  .options_div.grid-cards { gap: 10px; }
  .options_div.grid-cards .img_box { min-height: 64px; padding: 14px 20px; }
  /* result */
  #pageContent h2 { margin: 14px 0 4px; font-size: 20px; line-height: 1.25; text-wrap: balance; }
  .logoSection img { max-width: 150px; }
  .reviewButton { margin: 0; }
  #pageContent > p { margin: 0 0 8px; }
  .sort-dropdown { margin-bottom: 0; }
  .insuranceBox { margin: 12px auto; }
  .insuranceContent { padding: 32px 16px 14px; gap: 8px; }
  .highLights ul li { margin: 2px 0; }
  /* rating in 2 lines: label + score, then stars + note */
  .rating-line { flex-direction: row; flex-wrap: wrap; justify-content: center; column-gap: 8px; }
  .rating-line p { margin: 0; }
  .ratingContainer { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 2px; }
  .ratingContainer svg { width: 100px; height: auto; display: block; flex: none; }
  .ratingContainer p { margin: 0; }
}

/* =========================================================
   TABLET 768px+
   ========================================================= */
@media (min-width: 768px) {
  body { font-size: 14px; }
  ._cont { padding: 0 24px; }

  .second_section { padding: 28px 24px 0; }
  .form_wrapper .hero-h1 { font-size: 38px; margin-bottom: 18px; }
  .hero-trust { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 8px 18px; margin-top: 28px; }
  .hero-trust li { font-size: 14px; }
  .flag { width: 54px; margin-bottom: 14px; }
  #form { max-width: 480px; }

  .stepN h4, .stepLoad h4 { font-size: 23px; font-weight: 500; margin: 20px auto 18px; max-width: 480px; }
  .for_step_body { padding: 0 16px; }
  .for_step_actions { gap: 12px; margin-top: 20px; padding: 0 16px; }

  .form_progress { max-width: 320px; margin: 0 auto 32px; }

  /* grid-cards: 2-up on tablet */
  .options_div { max-width: 720px; }
  .options_div.grid-cards { flex-direction: row; flex-wrap: wrap; gap: 14px; justify-content: center; }
  .options_div.grid-cards label { flex: 0 1 calc(50% - 7px); }
  .options_div.grid-cards .img_box {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 28px 14px;
    min-height: 130px;
    text-align: center;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.06);
  }
  .options_div.grid-cards .opt-icon { width: 34px; height: 34px; }
  .options_div.grid-cards .img_box p { flex: 0 1 auto; }

  .fifth_section { padding: 32px 24px 20px; }
  .fifth_section h2 { font-size: 22px; }
  .partners-row { grid-template-columns: repeat(3, 1fr); max-width: 100%; gap: 0; }
  .partners-row img { padding: 0; }

  .fourth_section { padding: 14px; }
  .trust-inner { font-size: 14px; }

  .third_section { padding: 48px 24px 56px; }
  .why-choose h2 { font-size: 26px; margin: 0 0 36px; }
  .why-choose ul { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 28px; }
  .why-choose li { width: calc(50% - 20px); max-width: 240px; }


  .offer-card {
    grid-template-columns: auto auto 1fr auto auto;
    grid-template-areas: "badge logo stats rate cta";
    gap: 16px;
  }
}

/* =========================================================
   DESKTOP 1024px+
   ========================================================= */
@media (min-width: 1024px) {
  ._cont { padding: 0 40px; }

  .second_section { padding: 32px 40px 0; }
  .form_wrapper .hero-h1 {
    font-size: 50px;
    font-weight: 800;
    line-height: 1.15;
    margin: 0 0 22px;
  }
  .hero-trust { gap: 10px 24px; margin-top: 32px; }
  .hero-trust li { font-size: 15px; }
  .flag { width: 64px; margin-bottom: 18px; }
  #form { max-width: 460px; }
  body.quiz-active #form { max-width: 960px; }

  .stepN h4 { font-size: 26px; font-weight: 500; line-height: 1.3; letter-spacing: -0.01em; margin: 24px auto 14px; max-width: 540px; }
  .stepN h5 { font-size: 14px; margin-bottom: 18px; }

  /* grid-cards: 4-up on desktop */
  .options_div { max-width: 920px; }
  .options_div.grid-cards { gap: 16px; }
  .options_div.grid-cards label { flex: 0 1 180px; }
  .options_div.grid-cards .img_box {
    padding: 40px 12px;
    min-height: 140px;
    border-radius: 8px;
    font-size: 15px;
  }
  .options_div.grid-cards .opt-icon { width: 36px; height: 36px; }

  .options_div.stack-pills { max-width: 380px; }

  .fifth_section { padding: 40px 40px 24px; }
  .fifth_section h2 { font-size: 25px; }
  .partners-row { grid-template-columns: repeat(6, 1fr); max-width: 1170px; gap: 0; }
  .partners-row img { padding: 0; }

  .third_section { padding: 56px 40px 64px; }
  .why-choose h2 { font-size: 28px; margin: 0 0 48px; }
  .why-choose ul { gap: 32px; }
  .why-choose li { width: 200px; max-width: 200px; }

  .site-footer .footer-nav { gap: 6px 22px; }
  .site-footer .footer-nav a { font-size: 12px; }
}

/* =========================================================
   RESULT PAGE - eligibility banner + brand list (.insuranceBox)
   Styles cover the HTML fetched into #result1Brands/2/3 containers
   ========================================================= */
.eligibility-banner {
  background-color: var(--bg-trust);
  color: var(--text-nav);
  padding: 14px 18px;
  border-radius: 10px;
  font-size: 15px;
  line-height: 1.4;
  border: 1px solid rgba(38, 112, 168, 0.18);
  text-align: center;
  margin: 4px auto 18px;
  max-width: 560px;
}
.eligibility-banner strong { color: var(--brand-teal-2); }
@media (min-width: 768px) {
  .eligibility-banner { font-size: 17px; padding: 16px 22px; margin: 8px auto 24px; }
}

.result-fallback {
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 10px;
  padding: 24px 20px;
  margin-top: 18px;
  text-align: center;
  color: var(--text);
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}
.result-fallback h3 { margin: 0 0 8px; font-size: 18px; color: var(--text-nav); }
.result-fallback p { margin: 0; font-size: 14px; color: var(--text-muted); line-height: 1.5; }
.result-fallback code { background: #f1f5f9; padding: 2px 6px; border-radius: 4px; font-size: 12px; }

/* Brand list cards - match production .insuranceBox markup */
#result1Brands, #result2Brands, #result3Brands, #result4Brands { width: 100%; }

.insuranceBox {
  background-color: #fff;
  border: none;
  border-radius: 10px;
  margin: 20px auto;
  width: 100%;
  position: relative;
  box-shadow: 0 0 15px 0 rgba(0, 0, 0, 0.15);
  display: block;
}
.insuranceContent {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  padding: 36px 16px 20px;
  width: 100%;
  gap: 14px;
}
@media (min-width: 768px) {
  .insuranceContent { padding: 40px 24px 24px; gap: 20px; flex-wrap: nowrap; }
}

.ribbon {
  background-color: #ffa41d;
  border-color: #ffa41d;
  box-sizing: content-box;
  color: #fff;
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  height: 24px;
  left: -6px;
  line-height: 24px;
  margin: 0;
  padding: 0 14px;
  position: absolute;
  text-align: left;
  top: 6px;
  white-space: nowrap;
  z-index: 5;
  border-radius: 2px;
}
.ribbon-corner {
  border-style: solid;
  border-color: #c47800 transparent transparent;
  border-width: 6px 0 0 6px;
  bottom: -6px;
  display: block;
  left: 0;
  position: absolute;
  z-index: 4;
}

.logoSection { margin: 0; flex: 0 0 auto; text-align: center; }
.logoSection img { width: 100%; max-width: 180px; height: auto; margin: 0; display: block; }
@media (min-width: 768px) {
  .logoSection img { max-width: 220px; }
}

.rating-line { display: flex; flex-direction: column; align-items: center; flex: 0 0 auto; }
.rating-line p { margin: 2px 0; font-size: 14px; }
.rating-line p:nth-child(1) { font-weight: 700; color: var(--text-nav); }
.rating-line p:nth-child(2) { color: var(--text-muted); font-size: 12px; }
.ratingPercentage { color: #00b67a; font-weight: 700; font-size: 18px; }
.reviewNumber { color: var(--text-muted); font-size: 12px; }

.highLights { text-align: left; font-size: 14px; flex: 1 1 200px; min-width: 0; }
.highLights ul { padding-left: 18px; margin: 0; list-style: disc; }
.highLights ul li { margin: 4px 0; line-height: 1.4; }

.reviewButton {
  background-color: #00b67a;
  border-radius: 999px;
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  outline: none;
  margin: 4px 0;
  padding: 10px 22px;
  text-align: center;
  min-width: 180px;
  border: 2px solid #00b67a;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.reviewButton:hover { background-color: #009864; border-color: #009864; color: #fff; }

/* Sort dropdown - also support fetched-in markup using production class names */
.dropdownToggle {
  padding: 8px 16px;
  font-size: 14px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  cursor: pointer;
  background: #fff;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.dropdownMenu { display: none; list-style: none; padding: 0; margin: 0; }
.dropdownMenu.active {
  display: block;
  position: absolute;
  top: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  min-width: 220px;
  z-index: 100;
}
.dropdownMenu li { padding: 8px 12px; font-size: 13px; cursor: pointer; border-radius: 4px; }
.dropdownMenu li:hover { background: #f3f4f6; }

/* Tooltip wrappers that may appear inside fetched .insuranceBox markup */
.insuranceBox .tooltipWrapper { position: relative; display: inline-block; }
.insuranceBox .tooltipTitle { font-size: 12px; color: var(--text-muted); cursor: pointer; text-decoration: underline dotted; }
.insuranceBox .tooltipText {
  display: none;
  position: absolute;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 12px;
  font-size: 12px;
  color: #555;
  line-height: 1.5;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  width: 260px;
  z-index: 50;
  text-align: left;
}
.insuranceBox .tooltipWrapper:hover .tooltipText,
.insuranceBox .tooltipWrapper:focus .tooltipText { display: block; }


/* =========================================================
   TABLET RESULT CARDS - 768px to 1023px
   At 768px+ the form is only 480px wide but insuranceContent
   is already nowrap, so 4 items get squished. Fix: widen the
   form to 760px in quiz-active mode and tighten card internals.
   ========================================================= */
@media (min-width: 768px) and (max-width: 1023px) {
  body.quiz-active #form { max-width: 760px; }

  .insuranceContent { gap: 14px; flex-wrap: nowrap; }

  .logoSection img  { max-width: 160px; }

  .highLights       { font-size: 13px; flex: 1 1 0; min-width: 0; }
  .highLights ul li { margin: 3px 0; }

  .reviewButton     { min-width: 140px; font-size: 14px; padding: 9px 16px; }

  .rating-line .ratingPercentage { font-size: 15px; }
  .rating-line p    { font-size: 12px; }
