/* Home Equity Select Royal Indigo & Plus Jakarta Sans theme with direct multi-step flow */

:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --navy: #131629;
  --ink: #14172b;
  --muted: #525866;
  --line: #dce0ec;
  --card-border: #d5d9e8;
  --accent: #4f46e5;
  --accent-dark: #4338ca;
  --accent-soft: #eef2ff;
  --accent-ring: rgba(79, 70, 229, 0.16);
  --blue-btn: #4f46e5;
  --blue-btn-hover: #4338ca;
  --focus: #4f46e5;
  --error: #b42318;
  --font: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --display: "Plus Jakarta Sans", Inter, -apple-system, BlinkMacSystemFont, sans-serif;
  --serif: "Plus Jakarta Sans", Inter, -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: hidden; max-width: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 1rem/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  max-width: 100%;
}
main { flex: 1; }
a { color: var(--blue-btn); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }
.wrap { max-width: 1060px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 780px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; background: var(--surface); padding: 8px 12px; z-index: 50; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.config-warning { background: var(--error); color: #fff; padding: 12px 16px; font-weight: 600; text-align: center; }

/* Dark Navy Top Header (matches LendingTree & review-desktop.png) */
.site-header {
  background: var(--navy);
  color: #ffffff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.header-bar {
  max-width: 820px;
  min-height: 66px;
  margin: 0 auto;
  padding: 8px 20px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
}
.header-left {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}
.header-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #ffffff;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.15s ease;
}
.header-back:hover { background: rgba(255, 255, 255, 0.1); }
.header-back:active { transform: translateX(-2px); }
.header-back svg { width: 22px; height: 22px; }
.header-back-link {
  color: #e2e8f0;
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 600;
}
.header-back-link:hover { color: #ffffff; text-decoration: underline; }

.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: #ffffff;
  line-height: 1.15;
  text-align: center;
}
.brand-title {
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: #ffffff;
}
.brand-title span {
  font-weight: 700;
  color: #a5b4fc;
}
.brand-powered {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
  font-size: 0.75rem;
  color: #cbd5e1;
  font-weight: 500;
}
.brand-powered img {
  height: 18px;
  width: auto;
  display: block;
  filter: brightness(0) invert(1);
}
.logo-fallback { font-weight: 700; color: #fff; }

.header-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
}
.header-phone {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #e2e8f0;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
}
.header-phone:hover { color: #ffffff; }
.phone-icon { width: 16px; height: 16px; color: var(--green); }
.header-disclosures {
  color: #cbd5e1;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
}
.header-disclosures:hover { color: #ffffff; text-decoration: underline; }

/* Funnel Container & Progress Bar */
.flow {
  padding: 22px 16px 40px;
}
.flow-shell {
  max-width: 680px;
  margin: 0 auto;
  text-align: center;
}
.progress-wrap {
  margin: 0 auto 10px;
}
.progress {
  max-width: 380px;
  height: 5px;
  background: #e2e5f1;
  border-radius: 999px;
  margin: 0 auto 24px;
  overflow: hidden;
}
.progress span {
  display: block;
  height: 100%;
  width: 8%;
  background: linear-gradient(90deg, #6366f1, var(--accent));
  border-radius: 999px;
  transition: width 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
.eyebrow {
  margin: 0 0 10px;
  font: 700 0.78rem/1.2 var(--display);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  text-align: center;
}

/* Step Fieldset & Question Heading */
fieldset.step {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
  animation: stepFadeIn 0.18s ease-out;
}
@keyframes stepFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
legend {
  display: contents;
}
legend h1 {
  font-family: var(--display);
  font-size: clamp(1.65rem, 3.1vw, 2.15rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin: 0 auto 28px;
  max-width: 580px;
  text-align: center;
}
legend h1:focus { outline: none; }
.step-sub {
  margin: -14px auto 24px;
  font-size: 1.0625rem;
  color: var(--muted);
  text-align: center;
}
.step1-question {
  margin: -14px auto 24px;
  font-size: 1.15rem;
  font-weight: 500;
  color: #333e48;
  text-align: center;
}

/* Auto-Advance Choice Stack (Royal Indigo soft icon badges + right chevrons) */
.choice-stack {
  max-width: 370px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.choice-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 62px;
  padding: 12px 18px;
  background: var(--surface);
  border: 1.5px solid var(--card-border);
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(20, 23, 43, 0.05);
  cursor: pointer;
  text-align: left;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease, transform 0.12s ease;
}
.choice-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}
.choice-icon {
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--accent-soft);
  display: grid;
  place-items: center;
  color: var(--accent);
  transition: background-color 0.15s ease, color 0.15s ease;
}
.choice-icon svg {
  width: 22px;
  height: 22px;
}
.choice-label {
  flex: 1;
  font-family: var(--display);
  font-size: 0.96875rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.35;
}
.choice-card::after {
  content: "›";
  flex: none;
  font-size: 1.35rem;
  font-weight: 500;
  line-height: 1;
  color: #94a3b8;
  transition: transform 0.15s ease, color 0.15s ease;
}
.choice-card:hover {
  border-color: var(--accent);
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.1);
  transform: translateY(-1px);
}
.choice-card:hover::after {
  color: var(--accent);
  transform: translateX(2px);
}
.choice-card:active {
  transform: scale(0.992);
}
.choice-card:has(input:checked),
.choice-card.is-selected {
  border-color: var(--accent);
  background: #f5f7ff;
  box-shadow: 0 0 0 3px var(--accent-ring), 0 4px 12px rgba(79, 70, 229, 0.1);
}
.choice-card:has(input:checked) .choice-icon,
.choice-card.is-selected .choice-icon {
  background: var(--accent);
  color: #ffffff;
}
.choice-card:has(input:checked)::after,
.choice-card.is-selected::after {
  color: var(--accent);
  transform: translateX(2px);
}
.choice-card:has(input:focus-visible) {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

/* Interactive Range Sliders (matches LendingTree 05.jpg, 06.jpg, 07.jpg, 13.jpg) */
.slider-box {
  max-width: 440px;
  margin: 4px auto 0;
  padding: 0 6px;
  text-align: center;
}
.slider-readout {
  display: block;
  font-family: var(--display);
  font-size: clamp(1.45rem, 2.7vw, 1.85rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0 auto 24px;
  line-height: 1.25;
}
.lt-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent) var(--pct, 38%), #d5d9e8 var(--pct, 38%));
  outline: none;
  margin: 8px 0 12px;
  padding: 0;
  border: 0;
  cursor: pointer;
}
.lt-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #ffffff;
  border: 2.5px solid var(--accent);
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.28);
  cursor: grab;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.lt-slider::-webkit-slider-thumb:hover {
  transform: scale(1.06);
  box-shadow: 0 3px 10px rgba(15, 31, 46, 0.28);
}
.lt-slider::-webkit-slider-thumb:active {
  cursor: grabbing;
  transform: scale(1.1);
}
.lt-slider::-moz-range-thumb {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid var(--ink);
  box-shadow: 0 2px 6px rgba(15, 31, 46, 0.22);
  cursor: grab;
}
.slider-ends {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--muted);
  margin-top: 4px;
}
.bk-followup {
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.bk-title {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 12px;
}

/* Text / ZIP / Contact Inputs (matches LendingTree 03.jpg, 14.jpg, 15.jpg, 16.jpg) */
.input-box {
  max-width: 390px;
  margin: 0 auto;
  text-align: left;
}
.field-group + .field-group {
  margin-top: 18px;
}
.field-label {
  display: block;
  font-size: 0.9375rem;
  font-weight: 500;
  color: #334155;
  margin-bottom: 7px;
}
.input-wrap {
  position: relative;
}
.input-box input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
.input-box select {
  width: 100%;
  height: 54px;
  padding: 10px 14px;
  font: inherit;
  font-size: 1.0625rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid #94a3b8;
  border-radius: 6px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input-box input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):focus,
.input-box select:focus {
  outline: none;
  border-color: var(--blue-btn);
  box-shadow: 0 0 0 3px rgba(11, 99, 190, 0.16);
}
.icon-input {
  position: relative;
}
.icon-input .input-leading-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  color: #475569;
  pointer-events: none;
}
.icon-input input {
  padding-left: 44px !important;
}
.zip-state-badge {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  pointer-events: none;
}
.state-fallback {
  margin-top: 16px;
}
[aria-invalid="true"] {
  border-color: var(--error) !important;
}
.field-error {
  color: var(--error);
  font-weight: 600;
  font-size: 0.9375rem;
  margin: 6px 0 0;
}
.field-error:empty { display: none; }
.email-suggest {
  margin: 8px 0 0;
  font-size: 0.9375rem;
  color: var(--muted);
}
.email-suggest .link {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-weight: 700;
  color: var(--blue-btn);
  text-decoration: underline;
  cursor: pointer;
}
.out-of-area {
  background: #fff5f5;
  border: 1px solid #fecaca;
  border-left: 4px solid var(--error);
  color: #7f1d1d;
  padding: 13px 15px;
  border-radius: 7px;
  margin-top: 16px;
  font-size: 0.9375rem;
  line-height: 1.5;
}

/* Rounded Pill Continue / Submit Button (matches LendingTree 03.jpg, 05.jpg, 14.jpg, 16.jpg) */
.btn-continue {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: 340px;
  min-height: 54px;
  margin: 26px auto 0;
  padding: 12px 28px;
  background: linear-gradient(180deg, #5b52f0, var(--accent));
  color: #ffffff;
  border: 0;
  border-radius: 999px;
  font: 700 1.0625rem var(--display);
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(79, 70, 229, 0.28);
  transition: background-color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}
.btn-continue:hover {
  background: linear-gradient(180deg, #4f46e5, var(--accent-dark));
  box-shadow: 0 8px 22px rgba(79, 70, 229, 0.36);
}
.btn-continue:active { transform: translateY(1px); }
.btn-continue:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

/* Step 13 LendingTree-style Pre-Submit Notice & Post-Button Terms Block */
.pre-submit-notice {
  margin: 14px auto 0;
  font-size: 0.78rem;
  line-height: 1.48;
  color: #4b5563;
  text-align: center;
}
.lt-terms {
  max-width: 660px;
  margin: 26px auto 0;
  text-align: left;
  font-size: 0.76rem;
  line-height: 1.58;
  color: #4b5563;
}
.lt-terms-intro {
  margin: 0 0 8px;
  color: #374151;
}
.lt-terms ul {
  margin: 0;
  padding-left: 18px;
}
.lt-terms li + li {
  margin-top: 8px;
}
.lt-terms strong {
  color: var(--ink);
  font-weight: 600;
}
.lt-terms a {
  color: var(--blue-btn);
  text-decoration: underline;
}
.error {
  color: var(--error);
  font-weight: 600;
  margin: 14px auto 0;
  text-align: center;
}
.error:empty { display: none; }

/* Step 1 Trust Block (matches LendingTree 01.jpg) */
.step1-trust {
  margin: 42px auto 8px;
  max-width: 480px;
  text-align: center;
}
.step1-trust-title {
  margin: 0 0 18px;
  font-size: 1.05rem;
  font-weight: 400;
  color: #333e48;
}
.step1-trust-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.step1-trust-grid strong {
  display: block;
  font-family: var(--display);
  font-size: clamp(0.95rem, 2.7vw, 1.15rem);
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 3px;
  white-space: nowrap;
}
.step1-trust-grid span {
  font-size: 0.8125rem;
  color: #55606b;
}
.step1-trustpilot {
  margin-top: 22px;
  min-height: 28px;
  display: flex;
  justify-content: center;
  align-items: center;
}
.step1-trustpilot .trustpilot-widget {
  width: 100%;
}

/* Reassurance Lines on Steps 2-12 (matches LendingTree 02.jpg-15.jpg) */
.reassurance {
  max-width: 300px;
  margin: 26px auto 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
  color: #374151;
  font-size: 0.875rem;
}
.reassurance p {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 9px;
}
.reassurance svg {
  width: 18px;
  height: 18px;
  flex: none;
  color: #374151;
}

/* Thank You Confirmation */
#thanks {
  outline: none;
  text-align: center;
  max-width: 540px;
  margin: 16px auto 0;
  padding: 28px 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(15, 31, 46, 0.06);
}
#thanks h2 {
  font-family: var(--serif);
  font-size: 1.75rem;
  margin: 0 0 14px;
  color: var(--ink);
}
#thanks p { margin: 0 0 14px; color: var(--muted); font-size: 1.0625rem; }
#thanks .micro { font-size: 0.9375rem; color: var(--muted); margin-top: 12px; }
.thanks-icon {
  width: 76px;
  height: 76px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 8px var(--accent-soft);
  display: grid;
  place-items: center;
}
.thanks-icon svg {
  width: 44px;
  height: 44px;
  fill: none;
  stroke: #ffffff;
  stroke-width: 4.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.thanks-icon .tc { stroke: none; }

/* Minimal Footer (exact 2-part LendingTree structure: centered links + left-aligned legal paragraph) */
.site-footer {
  background: transparent;
  padding: 6px 20px 32px;
  color: #767676;
}
.footer-minimal {
  max-width: 780px;
  margin: 0 auto;
  padding-top: 22px;
  border-top: 1px solid #d4d9df;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 4px 7px;
  margin: 0 0 14px;
  font-size: 0.72rem;
}
.footer-links a {
  color: var(--blue-btn);
  text-decoration: none;
  font-weight: 500;
}
.footer-links a:hover { text-decoration: underline; }
.sep { color: #9ca3af; font-weight: 400; }
.footer-copy {
  margin: 0 auto;
  font-size: 0.6875rem;
  line-height: 1.58;
  color: #767676;
  text-align: left;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.footer-copy a {
  color: var(--blue-btn);
  text-decoration: none;
}
.footer-copy a:hover { text-decoration: underline; }

/* Legal Pages (privacy.html, terms.html) */
.legal { padding-top: 32px; padding-bottom: 64px; }
.legal h1 { font-family: var(--serif); font-size: 2.35rem; font-weight: 700; margin: 0 0 16px; }
.legal h2 { font-family: var(--display); font-size: 1.3rem; margin-top: 28px; color: var(--ink); }

/* Bot trap */
.hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

@media (max-width: 640px) {
  .header-bar {
    padding: 8px 12px;
    min-height: 56px;
    gap: 8px;
  }
  .brand-title { font-size: 1.125rem; }
  .brand-powered { font-size: 0.65rem; gap: 5px; }
  .brand-powered img { height: 13px; }
  .phone-text { display: none; }
  .header-phone {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    justify-content: center;
  }
  .header-right { gap: 8px; }
  .header-disclosures { font-size: 0.75rem; }
  .flow { padding: 16px 14px 28px; }
  .progress { max-width: 100%; margin: 0 auto 18px; }
  .eyebrow { font-size: 0.72rem; margin-bottom: 8px; }
  legend h1 {
    font-size: clamp(1.38rem, 5.8vw, 1.65rem);
    line-height: 1.22;
    margin-bottom: 20px;
    padding: 0 2px;
  }
  .step-sub { font-size: 0.95rem; margin: -10px auto 18px; }
  .choice-stack { max-width: 100%; gap: 10px; }
  .choice-card { min-height: 58px; padding: 11px 14px; gap: 12px; }
  .choice-icon { width: 36px; height: 36px; }
  .choice-label { font-size: 0.9375rem; }
  .slider-box { max-width: 100%; padding: 0 2px; }
  .slider-readout { font-size: 1.45rem; margin-bottom: 18px; }
  .input-box { max-width: 100%; }
  .btn-continue { max-width: 100%; min-height: 52px; margin-top: 22px; }
  .step1-trust { margin: 28px auto 4px; max-width: 100%; }
  .step1-trust-title { font-size: 0.95rem; margin-bottom: 14px; }
  .step1-trust-grid { gap: 6px; }
  .step1-trust-grid strong { font-size: 0.92rem; }
  .step1-trust-grid span { font-size: 0.75rem; }
  .consent { padding: 14px; font-size: 0.9375rem; gap: 10px; }
  .site-footer { padding: 4px 14px 28px; }
}
