/* ==========================================================================
   HELOC funnel — styles
   Typography note: the reference design uses Gotham (a licensed typeface).
   Montserrat is used here as a free, closely-matched substitute. If you have
   a Gotham license, swap the --font-* values below.
   ========================================================================== */

:root {
  --blue:        #0000db;
  --blue-dark:   #0000a8;
  --dot:         #3b6bf5;
  --ink:         #222222;
  --ink-strong:  #1e1e24;
  --muted:       #6b6b76;
  --line:        #6b6b76;
  --line-soft:   #dcdce2;
  --track:       #efeff2;
  --tint:        #ecf4fe;
  --error:       #c11a1a;
  --success:     #1a9e4b;

  --font-book: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-bold: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --radius:     12px;
  --radius-lg:  10px;
  --page-max:   1200px;
  --col-main:   688px;
  --shadow-btn: 0 14px 36px 0 rgba(24, 24, 48, 0.10);
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font-book);
  font-size: 16px;
  line-height: 1.4;
  color: var(--ink);
  background: #fff;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Top bar ------------------------------------------------------ */

.topbar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 70px;
  padding: 0 24px;
}

.logo { display: inline-flex; line-height: 0; }
.logo svg { display: block; }

.back {
  position: absolute;
  left: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: background-color .15s ease;
}
.back:hover  { background: var(--track); }
.back:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.back[hidden] { display: none; }

/* ---------- Progress ----------------------------------------------------- */

.progress { height: 3px; background: var(--track); }

.progress__fill {
  height: 100%;
  width: 10%;
  background: var(--blue);
  transition: width .45s cubic-bezier(.4, 0, .2, 1);
}

/* ---------- Page layout -------------------------------------------------- */

.page {
  display: grid;
  grid-template-columns: minmax(0, var(--col-main)) minmax(0, 1fr);
  gap: 24px 72px;
  align-items: start;
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 70px 24px 96px;
}

.col-main { min-width: 0; }
.col-side { min-width: 0; }

h1 {
  margin: 0;
  font-family: var(--font-bold);
  font-weight: 700;
  font-size: 48px;
  line-height: 58px;
  letter-spacing: -1.92px;
  color: var(--ink);
  text-wrap: balance;
}

.sub {
  margin: 8px 0 0;
  font-size: 16px;
  line-height: 24px;
  color: var(--muted);
}

#stepForm { margin-top: 32px; }

/* ---------- Card radio group -------------------------------------------- */

.choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px 24px;
}
.choices[data-cols="1"] { grid-template-columns: minmax(0, 1fr); }

.choice {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 66px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.choice:hover { border-color: var(--blue); box-shadow: 0 4px 14px rgba(24, 24, 48, .06); }
.choice:has(input:focus-visible) { outline: 2px solid var(--blue); outline-offset: 2px; }
.choice:has(input:checked) { border-color: var(--blue); background: #fbfbff; }

.choice input {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
}

.choice__dot {
  flex: none;
  width: 24px;
  height: 24px;
  border: 1px solid var(--line);
  border-radius: 50%;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.choice:has(input:checked) .choice__dot {
  border-color: var(--blue);
  border-width: 7px;
}

.choice__emoji { flex: none; font-size: 18px; line-height: 1; }
.choice__label { font-size: 16px; }

/* ---------- Fields ------------------------------------------------------- */

.fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px 24px;
}
.fields[data-cols="1"] { grid-template-columns: minmax(0, 1fr); }

.field { display: flex; flex-direction: column; min-width: 0; }
.field--full { grid-column: 1 / -1; }

.field > label {
  margin-bottom: 8px;
  font-size: 12px;
  letter-spacing: -0.48px;
  color: var(--ink-strong);
}

.field input,
.field select {
  width: 100%;
  padding: 24px 20px;
  font-family: var(--font-book);
  font-size: 16px;
  line-height: 16px;
  letter-spacing: -0.64px;
  color: var(--ink-strong);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color .15s ease, box-shadow .15s ease;
}

.field select {
  appearance: none;
  color: var(--muted);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b6b76' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M6 9l6 6 6-6'/></svg>");
  background-repeat: no-repeat;
  background-position: right 20px center;
  background-size: 18px;
  padding-right: 48px;
  cursor: pointer;
}
.field select:valid { color: var(--ink-strong); }
.field select option[value=""] { color: var(--muted); }

.field input::placeholder { color: var(--muted); opacity: 1; }

.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0, 0, 219, .12);
}

.field[data-invalid] input,
.field[data-invalid] select { border-color: var(--error); }

.field__error {
  margin-top: 6px;
  font-size: 12px;
  letter-spacing: -0.24px;
  color: var(--error);
}
.field:not([data-invalid]) .field__error { display: none; }

.field__hint {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--muted);
}

/* ---------- Floating labels (label sits inside the input) ---------------- */

.field--float { position: relative; }

.field--float input {
  padding: 32px 20px 14px;   /* same 66px box, text pushed below the label */
}

.field--float > label {
  position: absolute;
  top: 23px;
  left: 21px;
  margin: 0;
  font-size: 16px;
  line-height: 1;
  letter-spacing: -0.64px;
  color: var(--muted);
  pointer-events: none;
  transform-origin: left top;
  transition: top .15s ease, font-size .15s ease, letter-spacing .15s ease;
}

.field--float input:focus + label,
.field--float input:not(:placeholder-shown) + label {
  top: 13px;
  font-size: 11px;
  letter-spacing: -0.2px;
}

.field--float input:focus + label { color: var(--blue); }

.field--float[data-invalid] > label { color: var(--error); }

.manual-link {
  margin: 14px 0 0;
  font-size: 14px;
  color: var(--muted);
}
.manual-link button {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: var(--blue);
  text-decoration: underline;
  cursor: pointer;
}

/* ---------- Consent / disclosure ---------------------------------------- */

/* Sits below the submit button, close enough to read as one unit with it. */
.consent { margin-top: 20px; max-width: 620px; }

.consent__row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.consent__row input[type="checkbox"] {
  flex: none;
  width: 20px;
  height: 20px;
  margin: 1px 0 0;
  accent-color: var(--success);
  cursor: pointer;
}

.consent__row label {
  font-family: var(--font-bold);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.28px;
  cursor: pointer;
}

.disclosure {
  margin: 12px 0 0;
  font-size: 12px;
  line-height: 18px;
  color: var(--muted);
}
.disclosure + .disclosure { margin-top: 10px; }

.disclosure a {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.disclosure a:hover { color: var(--blue); }

/* ---------- Button ------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 300px;
  min-height: 64px;
  margin-top: 32px;
  padding: 22px 40px;
  font-family: var(--font-bold);
  font-weight: 700;
  font-size: 14px;
  line-height: 19px;
  letter-spacing: -0.56px;
  color: #fff;
  background: var(--blue);
  border: 0;
  border-radius: 9999px;
  box-shadow: var(--shadow-btn);
  cursor: pointer;
  transition: background-color .15s ease, transform .1s ease;
}
/* Final step: button hugs the last field, consent block follows below it. */
.btn--tight { margin-top: 24px; }

.btn:hover  { background: var(--blue-dark); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* ---------- Sidebar ------------------------------------------------------ */

.tip {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 24px;
  background: var(--tint);
  border-radius: var(--radius-lg);
}

.tip__head {
  display: flex;
  align-items: center;
  gap: 16px;
}

.tip__avatar {
  display: block;
  flex: none;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 2px solid #fff;
  overflow: hidden;
}

.tip__title {
  font-family: var(--font-bold);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.32px;
}

.tip__body {
  margin: 0;
  font-size: 14px;
  line-height: 22px;
  font-style: italic;
  color: var(--muted);
}
.tip__body strong { color: var(--muted); font-weight: 700; font-style: italic; }

.review { padding-top: 32px; }
.tip + .review { margin-top: 32px; border-top: 1px solid var(--line-soft); }

.stars { display: flex; gap: 3px; }
.stars span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: #00b67a;
  color: #fff;
  font-size: 13px;
  line-height: 1;
}

.review__title {
  margin: 16px 0 0;
  font-family: var(--font-bold);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.32px;
}

.review__body {
  margin: 12px 0 0;
  font-size: 15px;
  line-height: 24px;
  color: var(--muted);
}

.review__author {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
}

.review__initials {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #eef1f6;
  color: var(--blue);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .3px;
}

.review__name { font-weight: 700; font-size: 14px; }

/* ---------- Success screen ---------------------------------------------- */

.done { max-width: 560px; }

.done__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  margin-bottom: 24px;
  border-radius: 50%;
  background: var(--tint);
  color: var(--blue);
  font-size: 30px;
}

.summary {
  margin: 32px 0 0;
  padding: 24px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  font-size: 14px;
}
.summary dl { display: grid; grid-template-columns: auto 1fr; gap: 10px 24px; margin: 0; }
.summary dt { color: var(--muted); }
.summary dd { margin: 0; text-align: right; font-weight: 500; }

/* ---------- Legal pages -------------------------------------------------- */

.legal {
  max-width: 820px;
  margin: 0 auto;
  padding: 48px 24px 96px;
}
.legal h1 { font-size: 40px; line-height: 48px; letter-spacing: -1.4px; }
.legal .updated { margin: 12px 0 0; font-size: 14px; color: var(--muted); }
.legal h2 {
  margin: 40px 0 0;
  font-family: var(--font-bold);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.5px;
}
.legal h3 {
  margin: 24px 0 0;
  font-family: var(--font-bold);
  font-weight: 700;
  font-size: 15px;
}
.legal p, .legal li { font-size: 15px; line-height: 26px; color: #3c3c46; }
.legal p { margin: 12px 0 0; }
.legal ul, .legal ol { margin: 12px 0 0; padding-left: 22px; }
.legal li { margin-top: 6px; }
.legal a { color: var(--blue); }

.legal .notice {
  margin-top: 24px;
  padding: 16px 20px;
  background: var(--tint);
  border-radius: var(--radius-lg);
  font-size: 14px;
  line-height: 22px;
}

.legal table {
  width: 100%;
  margin-top: 16px;
  border-collapse: collapse;
  font-size: 14px;
}
.legal th, .legal td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
}
.legal th { font-weight: 700; background: #fafafc; }

.partner-list {
  columns: 3 200px;
  column-gap: 32px;
  margin-top: 16px;
  padding: 0;
  list-style: none;
}
.partner-list li {
  break-inside: avoid;
  padding: 5px 0;
  font-size: 14px;
  line-height: 20px;
  border-bottom: 1px solid #f0f0f4;
}

.table-scroll { overflow-x: auto; }

.legal-footer {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--line-soft);
  font-size: 14px;
  color: var(--muted);
}
.legal-footer a { margin-right: 20px; }

/* ---------- Responsive --------------------------------------------------- */

@media (max-width: 1000px) {
  .page {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    padding: 24px 24px 64px;
  }
  h1 { font-size: 30px; line-height: 34px; letter-spacing: -1.2px; }
  .col-side { margin-top: 56px; }
  .tip { padding: 16px 24px; }
  .choices,
  .fields { grid-template-columns: minmax(0, 1fr); }
  .btn { width: 100%; min-width: 0; }
  .legal h1 { font-size: 30px; line-height: 36px; }
  .partner-list { columns: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
