/* =============================================================
   Vex Recovery — loans.css
   Loan Partners & Affiliates page + 5-step application wizard
   Rides on global.css (tokens, nav, footer, buttons)
   ============================================================= */

:root {
  --red:    #E5344A;
  --amber:  #FFD166;
}

/* ── Affiliate banner (very top, above hero) ──────────────── */
.affiliate-banner {
  background: var(--surface);
  border-bottom: 0.5px solid var(--border);
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
  padding: 0.6rem clamp(1rem, 5vw, 2.5rem);
  line-height: 1.5;
}
.affiliate-banner strong { color: var(--navy); font-weight: 600; }
.affiliate-banner a { font-weight: 600; }

/* ── Hero ─────────────────────────────────────────────────────
   The wizard lives INSIDE the hero so step 1 is on screen without scrolling.

   Mobile-first (default): one column, document order — short headline, then the
   form, then the full sub-copy / CTAs / trust note. We never lead cold with a
   form asking someone about money, but we also don't make them scroll to it.

   Desktop (>=1024px, override below): two columns — copy left, wizard card
   floating right over the slash-motif / heroCanvas background.
   ─────────────────────────────────────────────────────────── */
.loan-hero {
  position: relative;
  padding-block: clamp(1.75rem, 5vw, 4rem);
  background: var(--white);
}
.loan-hero .container { position: relative; z-index: 1; }
.loan-hero h1 { max-width: 18ch; }

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;   /* collapses to one column below 1024px */
  gap: 1.5rem;
  align-items: start;
}
/* .hero-left dissolves on mobile (display:contents) so its children order
   independently around the form — headline, then form, then the rest of the copy.
   On desktop it becomes a real flex column so the left side is ONE grid item:
   that is what removes the huge gap, because a spanning grid item distributes its
   height into intrinsically-sized rows and was inflating row 1 far beyond the
   headline. */
.hero-left { display: contents; }
.hero-head      { order: 1; }
.hero-form      { order: 2; }
.hero-copy-rest { order: 3; }

.hero-head h1 { margin-bottom: 0; }
.loan-hero-lede {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--muted);
  max-width: 46ch;
  margin: 0.75rem 0 0;
}
/* Anchor target for every #apply link (nav, mobile overlay, footer, hero CTA). */
.hero-form { scroll-margin-top: calc(var(--nav-h) + 12px); }
.hero-form .wizard {
  border-radius: calc(var(--radius) + 4px);
  box-shadow: 0 18px 44px rgba(11, 31, 59, 0.13), 0 2px 8px rgba(11, 31, 59, 0.06);
}

@media (min-width: 1024px) {
  .hero-grid {
    /* The form is the point of the page, so give it the larger share. The copy
       column is short while the wizard grows tall on later steps (step 5 is the
       worst), so a wide left column just becomes a big empty gutter. */
    grid-template-columns: minmax(0, 0.72fr) minmax(0, 1fr);
    column-gap: clamp(1.5rem, 3vw, 2.5rem);
    row-gap: 0;
    align-items: start;
  }
  .hero-left {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    grid-column: 1;
    align-self: start;
  }
  /* No explicit row placement, and the form does NOT span rows. That is the
     whole fix: a spanning item distributes its height into intrinsically-sized
     rows, so a 1075px-tall step-5 form was inflating row 1 to 522px against a
     232px headline and stranding the copy 290px below it. */
  .hero-copy-rest .loan-hero-sub { max-width: 34ch; }
  .loan-hero h1 { max-width: 14ch; }
  .hero-form { grid-column: 2; align-self: start; }
  .hero-form .wizard { margin: 0; }
}

.loan-hero-sub {
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--muted);
  max-width: 52ch;
  margin: 1rem 0 1.75rem;
}
.loan-hero-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: center; }
.loan-hero-note {
  display: flex; align-items: center; gap: 0.4rem;
  font-size: 0.85rem; color: var(--dim); margin-top: 1.25rem;
}
.loan-hero-note .ti { color: var(--green); font-size: 1rem; }

/* ── How it works ─────────────────────────────────────────── */
.how-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-top: 1.75rem;
}
.how-card { position: relative; }
.how-step {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(26,109,216,.08); color: var(--blue);
  font-weight: 700; font-size: 0.95rem; margin-bottom: 0.85rem;
}
.how-card h3 { font-size: 1rem; margin-bottom: 0.4rem; }
.how-card p { font-size: 0.9rem; line-height: 1.6; }

/* ── Trust strip ──────────────────────────────────────────── */
.trust-strip { background: var(--surface); }
.trust-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem; text-align: center;
}
.trust-item { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; }
.trust-item .ti { font-size: 1.6rem; color: var(--blue); }
.trust-item h3 { font-size: 0.95rem; }
.trust-item p { font-size: 0.85rem; line-height: 1.55; max-width: 32ch; }

/* ── Disclosure block ─────────────────────────────────────── */
.disclosure-block {
  border: 0.5px solid var(--border);
  border-left: 3px solid var(--blue);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-top: 1.5rem;
}
.disclosure-block h3 { font-size: 0.9rem; margin-bottom: 0.5rem; }
.disclosure-block p { font-size: 0.85rem; line-height: 1.6; margin-bottom: 0.5rem; }
.disclosure-block p:last-child { margin-bottom: 0; }

/* ── FAQ ──────────────────────────────────────────────────── */
.faq-list { margin-top: 1.5rem; max-width: 760px; }
.faq-item { border-bottom: 0.5px solid var(--border); }
.faq-q {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; width: 100%; text-align: left;
  padding: 1.1rem 0; font-size: 0.98rem; font-weight: 600; color: var(--navy);
  background: none;
}
.faq-q .ti { color: var(--blue); font-size: 1.1rem; transition: transform 0.2s; flex-shrink: 0; }
.faq-item.open .faq-q .ti { transform: rotate(45deg); }
.faq-a {
  max-height: 0; overflow: hidden;
  transition: max-height 0.28s ease, padding 0.28s ease;
}
.faq-item.open .faq-a { max-height: 320px; padding-bottom: 1.1rem; }
.faq-a p { font-size: 0.9rem; line-height: 1.65; }

/* =============================================================
   WIZARD
   ============================================================= */
/* The wizard now sits in the hero (see .hero-grid); there is no longer a separate
   .wizard-section wrapper. */
.wizard {
  max-width: 640px; margin: 0 auto;
  background: var(--white);
  border: 0.5px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* Progress */
.wiz-progress { padding: 1.25rem 1.5rem 0; }
.wiz-progress-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 0.6rem;
}
.wiz-progress-head .step-label { font-size: 0.8rem; font-weight: 600; color: var(--navy); }
.wiz-progress-head .step-name { font-size: 0.8rem; color: var(--dim); }
.wiz-track { height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; }
.wiz-fill { height: 100%; width: 20%; background: var(--blue); border-radius: 2px; transition: width 0.35s ease; }

/* Steps */
.wiz-body { padding: 1.5rem; }
.wiz-step { display: none; }
.wiz-step.active { display: block; animation: fadeIn 0.25s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.wiz-step h2 { font-size: 1.2rem; margin-bottom: 0.3rem; }
.wiz-step .step-sub { font-size: 0.9rem; color: var(--muted); margin-bottom: 1.25rem; }

/* Form fields */
.field { margin-bottom: 1.1rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.field label {
  display: block; font-size: 0.82rem; font-weight: 600;
  color: var(--navy); margin-bottom: 0.4rem;
}
.field label .req { color: var(--red); }
.field .hint { font-size: 0.75rem; color: var(--dim); margin-top: 0.3rem; }

.field input,
.field select {
  width: 100%; font-family: var(--font); font-size: 0.95rem;
  color: var(--text); background: var(--white);
  border: 0.5px solid #C5D0E0; border-radius: var(--radius-sm);
  padding: 11px 13px; transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus,
.field select:focus {
  outline: none; border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(26,109,216,.12);
}
.field input.invalid,
.field select.invalid { border-color: var(--red); }
.field .error-msg {
  display: none; font-size: 0.75rem; color: var(--red); margin-top: 0.3rem;
}
.field.show-error .error-msg { display: block; }
.field.show-error input,
.field.show-error select { border-color: var(--red); }

/* Loan amount slider */
.amount-display {
  text-align: center; font-size: 2.4rem; font-weight: 700;
  color: var(--navy); letter-spacing: -0.02em; margin-bottom: 0.25rem;
}
.amount-range-labels {
  display: flex; justify-content: space-between;
  font-size: 0.78rem; color: var(--dim); margin-top: 0.5rem;
}
input[type="range"].amount-slider {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 6px; border-radius: 3px;
  background: var(--border); padding: 0; border: none; box-shadow: none;
}
input[type="range"].amount-slider:focus { box-shadow: none; }
input[type="range"].amount-slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--blue); cursor: pointer;
  border: 3px solid var(--white); box-shadow: 0 2px 6px rgba(26,109,216,.4);
}
input[type="range"].amount-slider::-moz-range-thumb {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--blue); cursor: pointer;
  border: 3px solid var(--white); box-shadow: 0 2px 6px rgba(26,109,216,.4);
}

/* Choice pills (credit score, residence, etc.) */
/* Fixed 2 columns, deliberately NOT auto-fit. Every choice group on this form has
   either 2 or 4 options, so 2 columns gives a clean 2-up or 2x2 at every width.
   auto-fit re-flowed to 3-across when the hero form column got wider, wrapping the
   4-option groups as an ugly 3+1. */
.choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; }
.choice {
  position: relative; cursor: pointer;
}
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice span {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; text-align: center; min-height: 46px; padding: 0.5rem 0.75rem;
  font-size: 0.88rem; font-weight: 500; color: var(--navy);
  border: 0.5px solid #C5D0E0; border-radius: var(--radius-sm);
  transition: all 0.15s;
}
.choice input:checked + span {
  border-color: var(--blue); background: rgba(26,109,216,.06);
  color: var(--blue); font-weight: 600;
  box-shadow: 0 0 0 1px var(--blue);
}
/* Two-line pill: label + secondary range (credit bands). */
.choice span strong { font-weight: 600; font-size: 0.88rem; line-height: 1.2; }
.choice span small  { font-size: 0.72rem; font-weight: 400; line-height: 1.2; color: var(--dim); }
.choice input:checked + span small { color: var(--blue); }

/* Address autocomplete (Google Places, custom-styled to match) */
.addr-field { position: relative; }
.addr-suggest {
  display: none; position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 30;
  background: var(--white); border: 0.5px solid var(--border); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg); max-height: 240px; overflow-y: auto;
}
/* .wizard clips its own overflow (rounded card), so the suggestion list is kept
   short enough to sit inside the card on the address step rather than be cut off. */
.addr-suggest.open { display: block; }
.addr-item {
  padding: 11px 13px; font-size: 0.9rem; color: var(--navy);
  cursor: pointer; transition: background 0.12s, color 0.12s;
  border-bottom: 0.5px solid var(--border);
}
.addr-item:last-of-type { border-bottom: none; }
.addr-item:hover { background: rgba(26,109,216,.06); color: var(--blue); }
.addr-foot {
  padding: 6px 13px; font-size: 0.68rem; color: var(--dim);
  text-align: right; border-top: 0.5px solid var(--border); background: var(--surface);
}

/* Resolved address, echoed back for confirmation */
.addr-resolved {
  display: flex; gap: 0.6rem; align-items: flex-start;
  background: rgba(26,109,216,.05); border: 0.5px solid rgba(26,109,216,.25);
  border-radius: var(--radius-sm); padding: 0.8rem 1rem; margin: 0 0 0.9rem;
}
.addr-resolved .ti { color: var(--blue); font-size: 1.1rem; flex-shrink: 0; margin-top: 1px; }
.addr-resolved-label {
  display: block; font-size: 0.7rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.04em; color: var(--dim); margin-bottom: 2px;
}
.addr-resolved p { font-size: 0.88rem; line-height: 1.5; color: var(--navy); margin: 0; }

/* "Enter address manually" escape hatch */
.addr-manual-line { margin: -0.35rem 0 1.1rem; }
.link-btn {
  background: none; border: none; padding: 0;
  font-family: var(--font); font-size: 0.8rem; color: var(--blue);
  text-decoration: underline; cursor: pointer;
}
.link-btn:hover { color: var(--navy); }

/* "(optional)" marker in a field label */
.field label .opt { font-weight: 400; color: var(--dim); }

/* Secure note on sensitive step */
.secure-note {
  display: flex; gap: 0.6rem; align-items: flex-start;
  background: rgba(0,201,136,.06); border: 0.5px solid rgba(0,201,136,.25);
  border-radius: var(--radius-sm); padding: 0.85rem 1rem; margin-bottom: 1.25rem;
}
.secure-note .ti { color: var(--green); font-size: 1.15rem; flex-shrink: 0; margin-top: 1px; }
.secure-note p { font-size: 0.82rem; line-height: 1.55; color: var(--muted); margin: 0; }
.secure-note strong { color: var(--navy); }

/* Consent checkboxes */
.consent { display: flex; gap: 0.65rem; align-items: flex-start; margin-bottom: 0.9rem; }
.consent input[type="checkbox"] {
  width: 18px; height: 18px; margin-top: 2px; flex-shrink: 0;
  accent-color: var(--blue); cursor: pointer;
}
.consent label { font-size: 0.8rem; line-height: 1.55; color: var(--muted); font-weight: 400; margin: 0; cursor: pointer; }
.consent.required-consent label::after { content: " *"; color: var(--red); }

/* Footer / nav buttons */
.wiz-footer {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: 1.25rem 1.5rem; border-top: 0.5px solid var(--border);
  background: var(--white);
}
.wiz-footer .btn-back { visibility: hidden; }
.wiz-footer.has-back .btn-back { visibility: visible; }

/* Geofence block screen */
.geo-block, .wiz-result {
  text-align: center; padding: 2.5rem 1.5rem;
}
.geo-block .ti, .wiz-result .ti-big {
  font-size: 2.6rem; margin-bottom: 0.75rem;
}
.geo-block .ti { color: var(--amber); }
.wiz-result .ti-success { color: var(--green); }
.wiz-result .ti-error { color: var(--red); }
.geo-block h2, .wiz-result h2 { margin-bottom: 0.5rem; }
.geo-block p, .wiz-result p { font-size: 0.92rem; color: var(--muted); max-width: 42ch; margin: 0 auto 0.5rem; }

/* Loading state */
.wiz-loading { text-align: center; padding: 3rem 1.5rem; }
.spinner {
  width: 38px; height: 38px; margin: 0 auto 1.25rem;
  border: 3px solid var(--border); border-top-color: var(--blue);
  border-radius: 50%; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Hidden utility */
.hidden { display: none !important; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 720px) {
  .how-grid, .trust-grid { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
}

/* Masked / formatted secure inputs (SSN).
   The brand sans renders U+2022 with uneven sidebearings, so a run of bullets
   looks lumpy — the first two read tighter than the rest. A monospace stack gives
   every glyph the same advance width, so "•••-••-1111" and "123-45-6789" both sit
   on an even rhythm. Tabular figures keep the digits aligned too. */
.field input.masked-input {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.06em;
}

/* City / State / ZIP on ONE line, in the order a US address is written.
   .field-row is a generic 2-up grid, which wrapped ZIP onto its own row. These
   proportions give City the room it needs, State enough for the longest name in
   the select, and ZIP just enough for 5+4. Collapses to stacked on narrow
   viewports so it stays usable on a phone. */
.field-row.addr-csz { grid-template-columns: minmax(0, 2fr) minmax(0, 1.25fr) minmax(0, 1fr); }
@media (max-width: 560px) {
  .field-row.addr-csz { grid-template-columns: 1fr; }
}
