/* ════════════════════════════════════════════════════════════════════
   ResiFort Buyer Pre-Qual V1 · apply.resifort.com
   ────────────────────────────────────────────────────────────────────
   Brand tokens lifted verbatim from
   PROJECTS/resifort-website/generated/homepage-current.html :13-58
   Lock date: 2026-05-07 (Build-05 V1 Session 1 open)
   Re-render-pass reservation: per V1 spec §STYLE GUIDE BLOCKER, refresh
   if homepage tokens drift before V1 ships.
   ════════════════════════════════════════════════════════════════════ */

:root {
  --rf-primary: #0D6B6E;
  --rf-primary-dark: #094B4D;
  --rf-secondary: #C8963E;
  --rf-bg: #F8F6F1;
  --rf-bg-surface: #FFFFFF;
  --rf-text: #1A1A2E;
  --rf-text-secondary: #697080;
  --rf-text-on-dark: #FFFFFF;
  --rf-cta: #0D6B6E;
  --rf-cta-hover: #094B4D;
  --rf-gold: #C8963E;
  --rf-gold-hover: #B58532;
  --rf-gold-text: #094B4D;
  --rf-border: #D1D5DB;
  --rf-border-light: #E5E7EB;
  --rf-radius-sm: 4px;
  --rf-radius-md: 6px;
  --rf-radius-lg: 8px;
  --rf-radius-xl: 12px;
  --rf-radius-2xl: 20px;
  --rf-shadow-card: 0 2px 8px rgba(0,0,0,0.08);
  --rf-shadow-hover: 0 4px 16px rgba(0,0,0,0.12);
  --rf-shadow-panel: 0 24px 60px -20px rgba(2, 26, 27, 0.25);
  --rf-shadow-lift: 0 10px 15px -3px rgba(0,0,0,0.10);
  --rf-gradient-hero: linear-gradient(135deg, #021A1B 0%, #062D2F 50%, #0A4547 100%);
  --rf-gradient-text: linear-gradient(to right, #0D6B6E, #C8963E);
  --rf-font-heading: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --rf-font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --rf-font-serif: 'Playfair Display', serif;
  --rf-container-max: 1400px;
  --rf-form-card-max: 720px;
  --rf-space-section: 80px;

  /* Form-specific tokens (V1 additions) */
  --rf-input-bg: #FFFFFF;
  --rf-input-border: #D1D5DB;
  --rf-input-border-focus: #0D6B6E;
  --rf-input-shadow-focus: 0 0 0 3px rgba(13, 107, 110, 0.12);
  --rf-pill-bg: #FFFFFF;
  --rf-pill-border: #D1D5DB;
  --rf-pill-border-active: #0D6B6E;
  --rf-pill-bg-active: rgba(13, 107, 110, 0.06);
}

/* ─── Reset + base ────────────────────────────────────────────────── */

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

html { scroll-behavior: smooth; }

body {
  /* Session 4: sticky-footer flex pattern. body is flex-column at min-height
     100vh; .rf-wizard claims remaining vertical space (flex: 1) so the slim
     footer always sits at the viewport bottom — even on short steps like
     Step 1's transition screen, the thank-you / submitted state, or a Step 9
     post-submit render. Without this, the footer floats halfway up the
     viewport on short content with empty whitespace below it. */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  font-family: var(--rf-font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--rf-text);
  background: var(--rf-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; display: block; }
a { color: inherit; }
button { font-family: inherit; cursor: pointer; }

/* Headings (Plus Jakarta Sans per D16). Color inherits so hero (dark) and
   form card (light) both render correctly without per-element overrides. */
h1, h2, h3, h4, h5 {
  font-family: var(--rf-font-heading);
  font-weight: 700;
  line-height: 1.15;
  color: inherit;
}

/* Make sure [hidden] always wins over component display rules */
[hidden] { display: none !important; }

.rf-eyebrow {
  font-family: var(--rf-font-heading);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--rf-secondary);
  margin-bottom: 16px;
}

/* WCAG anchor (Codex Pass-2 HIGH, Rafael 2026-05-07): gold #C8963E on the
   dark teal hero gradient measures ~6.3:1 at the dark end (#021A1B, where the
   eyebrow actually sits) and ~4.03:1 at the light end (#0A4547). Brand wants
   gold preserved; text-shadow halo anchors the eyebrow visually so legibility
   is bulletproof regardless of where on the gradient it visually lands. Soft
   dark glow + tight outline = brand-consistent without 90s drop-shadow look. */
.rf-hero--funnel .rf-eyebrow {
  text-shadow:
    0 0 1px rgba(0, 0, 0, 0.6),
    0 1px 8px rgba(0, 0, 0, 0.45);
}

.rf-gradient-italic {
  font-style: italic;
  font-family: var(--rf-font-serif);
  font-weight: 400;
  background: var(--rf-gradient-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  display: inline-block;
  padding: 0 0.15em 0.08em 0.03em;
}

/* WCAG fix (Codex Pass-1 HIGH): gradient italic on dark hero gradient
   produced 1.71-4.03:1 contrast, fails AA. On dark hero surfaces, swap to
   a high-contrast warm cream (~16:1 on #021A1B). Light surfaces still get
   the teal-to-gold gradient. */
.rf-hero--funnel .rf-gradient-italic {
  background: none;
  -webkit-background-clip: initial;
  background-clip: initial;
  color: #F0E6D6;
  -webkit-text-fill-color: #F0E6D6;
}

.rf-required { color: #B45309; font-weight: 600; }
.rf-optional { color: var(--rf-text-secondary); font-size: 12px; font-weight: 500; margin-left: 6px; }

/* ─── Funnel chrome · slim header ─────────────────────────────────── */

.rf-funnel-header {
  background: var(--rf-bg);
  border-bottom: 1px solid var(--rf-border-light);
  padding: 14px 0;
}
.rf-funnel-header__inner {
  max-width: var(--rf-container-max);
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.rf-funnel-header__brand {
  display: inline-flex; align-items: center; gap: 12px;
  text-decoration: none;
  cursor: default;  /* Session 3: brand mark is decorative on the funnel; no nav until resifort.com homepage ships */
  line-height: 1;   /* Session 4 OCD-fix: collapse box height to glyph height so flex-center actually centers the visible text, not the leading-padded box */
}
.rf-funnel-header__logo {
  font-family: var(--rf-font-heading);
  font-weight: 700; font-size: 20px;
  color: var(--rf-text);  /* Session 4: dark charcoal per Rafael 2026-05-07 — wordmark reads as primary; standalone shield icon dropped pending style-guide v2.X logo lockup refresh */
  letter-spacing: -0.5px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
}
.rf-funnel-header__divider {
  width: 1px; height: 16px;  /* Session 4 OCD-fix: 16px reads better proportionally between 20px logo + 12px brokerage caps than the prior 20px */
  background: var(--rf-border);
  align-self: center;
}
.rf-funnel-header__brokerage {
  font-size: 12px; color: var(--rf-text-secondary);
  font-weight: 500;
  line-height: 1;
  display: inline-flex;
  align-items: center;
}
.rf-funnel-header__safety {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--rf-text-secondary);
  font-weight: 500;
}
.rf-funnel-header__safety svg { color: var(--rf-primary); }

/* ─── Hero (funnel variant) ──────────────────────────────────────── */

.rf-hero--funnel {
  background: var(--rf-gradient-hero);
  color: var(--rf-text-on-dark);
  padding: 56px 20px 64px;
}
.rf-hero__inner {
  max-width: 880px;
  margin: 0 auto;
  text-align: center;
}
.rf-hero__h1 {
  font-size: clamp(28px, 5vw, 44px);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}
.rf-hero__sub {
  font-size: clamp(15px, 2.2vw, 17px);
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.86);
  margin: 0 auto 24px;
  max-width: 640px;
}
/* Glassmorphic trust pills (Rafael polish-pass): each authority claim sits in
   its own pill with subtle gold ring + ambient gold glow + backdrop blur,
   matching the homepage hero treatment. Replaces the old bullet-separator
   pattern (which intentionally hid the first dot, leading to a "missing
   bullet" read on the lead claim). All three pills now carry equal visual
   weight + a leading gold dot with a soft halo. */
.rf-hero__trust {
  list-style: none;
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.92);
  padding: 0;
  margin: 0;
}
.rf-hero__trust li {
  position: static;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px 7px 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(200, 150, 62, 0.32);
  border-radius: 999px;
  -webkit-backdrop-filter: blur(8px) saturate(120%);
  backdrop-filter: blur(8px) saturate(120%);
  box-shadow:
    0 0 14px rgba(200, 150, 62, 0.16),
    0 1px 0 rgba(255, 255, 255, 0.10) inset;
  transition: background 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  white-space: nowrap;
}
.rf-hero__trust li:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(200, 150, 62, 0.55);
  box-shadow:
    0 0 22px rgba(200, 150, 62, 0.32),
    0 1px 0 rgba(255, 255, 255, 0.14) inset;
}
.rf-hero__trust li::before {
  content: '';
  position: static;
  transform: none;
  width: 6px;
  height: 6px;
  background: var(--rf-secondary);
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 6px rgba(200, 150, 62, 0.7);
}
/* Override the prior :first-child rule that was hiding the bullet — now ALL
   three pills carry the gold dot + halo for equal visual weight. */
.rf-hero__trust li:first-child {
  padding-left: 14px;
}
.rf-hero__trust li:first-child::before {
  display: inline-block;
}

/* ─── Sticky progress bar ─────────────────────────────────────────── */

.rf-progress {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.94);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rf-border-light);
}
.rf-progress__inner {
  max-width: var(--rf-form-card-max);
  margin: 0 auto;
  padding: 12px 20px;
}
/* Session 4: row wraps the step-label + Start-over button so they sit on
   opposite ends of the sticky progress bar. The track stays full-width below. */
.rf-progress__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.rf-progress__label {
  font-family: var(--rf-font-heading);
  font-size: 12px;
  font-weight: 600;
  color: var(--rf-text-secondary);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0;
  display: flex; align-items: center; gap: 8px;
  min-width: 0;  /* allow the label to shrink if the step name is long */
}
/* Tier-3 text link — visually subordinate to the step label, matches the
   footer "Start over" button styling so users encounter the same affordance
   in two places. */
.rf-progress__reset {
  appearance: none;
  background: none;
  border: none;
  border-bottom: 1px dashed var(--rf-primary);
  border-radius: 0;
  padding: 1px 0 1px;
  margin: 0;
  font-family: var(--rf-font-body);
  font-size: 12px;
  font-weight: 500;
  color: var(--rf-primary);
  letter-spacing: 0;
  text-transform: none;
  cursor: pointer;
  flex-shrink: 0;  /* never wrap or shrink — label takes the squeeze */
  transition: color 0.15s ease, border-color 0.15s ease, border-bottom-style 0.15s ease;
}
.rf-progress__reset:hover {
  color: var(--rf-primary-dark);
  border-bottom-style: solid;
  border-bottom-color: var(--rf-primary-dark);
}
.rf-progress__reset:focus-visible {
  outline: 2px solid var(--rf-primary);
  outline-offset: 2px;
}
.rf-progress__dot { color: var(--rf-border); }
.rf-progress__track {
  height: 4px;
  background: var(--rf-border-light);
  border-radius: 2px;
  overflow: hidden;
}
.rf-progress__bar {
  height: 100%;
  background: linear-gradient(90deg, var(--rf-primary), var(--rf-secondary));
  border-radius: 2px;
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ─── Wizard card + step layout ───────────────────────────────────── */

.rf-wizard {
  /* Session 4 polish: symmetric top/bottom padding (was 32/64). Combined with
     footer margin-top: 0 below, the gap between the form card and the slim
     footer compresses from 128px → 32px so short-content steps (transition,
     thank-you) don't show a "big cream gap" before the footer. */
  padding: 32px 16px 32px;
  flex: 1;  /* Claim remaining vertical space so footer pins to bottom on tall viewports + short content */
}
.rf-wizard__card {
  max-width: var(--rf-form-card-max);
  margin: 0 auto;
  background: var(--rf-bg-surface);
  border: 1px solid var(--rf-border-light);
  border-radius: var(--rf-radius-2xl);
  box-shadow: var(--rf-shadow-panel);
  padding: 32px 24px;
}

.rf-step { display: block; }
.rf-step[hidden] { display: none; }

.rf-step__header { margin-bottom: 24px; }
.rf-step__title {
  font-size: clamp(22px, 3.5vw, 28px);
  font-weight: 700;
  margin-bottom: 8px;
}
.rf-step__sub {
  font-size: 15px;
  color: var(--rf-text-secondary);
  line-height: 1.55;
}
.rf-step__sub + .rf-step__sub { margin-top: 8px; }

.rf-step--stub {
  text-align: center;
  padding: 32px 0;
}
.rf-step--stub .rf-step__title { color: var(--rf-text-secondary); }

/* ─── Fieldset grouping ───────────────────────────────────────────── */

.rf-fieldset {
  border: 0;
  padding: 24px 0;
  border-bottom: 1px solid var(--rf-border-light);
}
.rf-fieldset:first-of-type { padding-top: 0; }
.rf-fieldset:last-of-type { border-bottom: 0; }
.rf-fieldset__legend {
  font-family: var(--rf-font-heading);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--rf-primary);
  margin-bottom: 16px;
  display: block;
}

/* ─── Field base ──────────────────────────────────────────────────── */

.rf-field {
  display: block;
  margin-bottom: 16px;
  border: 0;
  padding: 0;
}
.rf-field:last-child { margin-bottom: 0; }
.rf-field__label {
  display: block;
  font-family: var(--rf-font-heading);
  font-size: 14px;
  font-weight: 600;
  color: var(--rf-text);
  margin-bottom: 8px;
  line-height: 1.4;
}
.rf-field__hint {
  display: block;
  font-size: 12px;
  color: var(--rf-text-secondary);
  margin-top: 6px;
}
/* Session 4: inline-style hint for multi-select groups — sits between legend
   and pill stack with a tighter top margin + light italics so the buyer reads
   it as a guidance line, not a label. */
.rf-field__hint--inline {
  margin: 4px 0 10px;
  font-style: italic;
  font-size: 12px;
  color: var(--rf-text-secondary);
}
.rf-field--anchor {
  background: rgba(13, 107, 110, 0.06);
  border: 1px solid rgba(13, 107, 110, 0.18);
  border-radius: var(--rf-radius-lg);
  padding: 14px 16px;
}
.rf-field__anchor-display {
  font-family: var(--rf-font-heading);
  font-size: 16px;
  font-weight: 700;
  color: var(--rf-primary-dark);
  margin: 0;
}

/* Inputs + selects + textareas — universal styling for ALL form inputs so
   number / date / month / text-with-numeric-inputmode all share the same
   brand font, padding, border, and focus halo (Rafael polish-pass: number
   and date inputs were falling back to browser defaults — wrong font, tight
   padding, no focus state). */
.rf-field input[type="text"],
.rf-field input[type="email"],
.rf-field input[type="tel"],
.rf-field input[type="number"],
.rf-field input[type="date"],
.rf-field input[type="month"],
.rf-field select,
.rf-field textarea,
.rf-explain {
  width: 100%;
  padding: 12px 14px;
  font-family: var(--rf-font-body);
  font-size: 16px;
  color: var(--rf-text);
  background: var(--rf-input-bg);
  border: 1px solid var(--rf-input-border);
  border-radius: var(--rf-radius-lg);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  -webkit-appearance: none;
  -moz-appearance: textfield;     /* Hide the FF number spinner — looks heavy + clashes with brand */
  appearance: none;
  line-height: 1.4;
}
/* Hide WebKit/Blink number spinners (consistent w/ FF rule above). */
.rf-field input[type="number"]::-webkit-outer-spin-button,
.rf-field input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.rf-field input:focus,
.rf-field select:focus,
.rf-field textarea:focus,
.rf-explain:focus {
  outline: none;
  border-color: var(--rf-input-border-focus);
  box-shadow: var(--rf-input-shadow-focus);
}
/* Placeholder polish — clearly grayed + slightly smaller so it reads as
   hint text rather than already-entered value. Applied to ALL form fields. */
.rf-field input::placeholder,
.rf-field textarea::placeholder,
.rf-debt-row__inputs input::placeholder,
.rf-debt-row__single::placeholder,
.rf-debt-row__describe::placeholder,
.rf-explain::placeholder {
  color: var(--rf-text-secondary);
  opacity: 0.55;
  font-size: 14px;
  font-weight: 400;
  font-family: var(--rf-font-body);
}

/* Currency input — adds a $ prefix via inline SVG background so any
   <input data-rf-currency> reads as money without wrapping markup.
   The buyer types digits + commas (auto-formatted on blur via JS);
   the prefix is purely visual + sits inside the input padding. */
.rf-field input[data-rf-currency],
.rf-debt-row__inputs input[data-rf-currency],
.rf-debt-row__single[data-rf-currency] {
  padding-left: 32px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='16' viewBox='0 0 12 16' fill='none'><text x='0' y='12' font-family='Inter,sans-serif' font-size='14' font-weight='600' fill='%23697080'>$</text></svg>");
  background-repeat: no-repeat;
  background-position: 12px center;
  background-size: 12px 16px;
}
.rf-field textarea,
.rf-explain {
  resize: vertical;
  min-height: 72px;
  margin-top: 12px;
}
.rf-field select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23697080' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}

.rf-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 480px) {
  .rf-grid-2 { grid-template-columns: 1fr; }
}

/* ─── Pill (radio) ────────────────────────────────────────────────── */

.rf-enum-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
}
.rf-enum-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.rf-yn {
  display: flex;
  gap: 8px;
}
.rf-yn .rf-pill { flex: 1; }

.rf-pill {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 14px;
  background: var(--rf-pill-bg);
  border: 1px solid var(--rf-pill-border);
  border-radius: var(--rf-radius-lg);
  font-size: 14px;
  font-weight: 500;
  color: var(--rf-text);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
  text-align: center;
  line-height: 1.3;
  min-height: 48px;
}
.rf-pill input[type="radio"],
.rf-pill input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.rf-pill:hover { border-color: var(--rf-primary); }
.rf-pill:has(input:checked) {
  border-color: var(--rf-pill-border-active);
  background: var(--rf-pill-bg-active);
  box-shadow: 0 0 0 1px var(--rf-pill-border-active) inset;
  font-weight: 600;
}
.rf-pill:focus-within {
  outline: 2px solid var(--rf-primary);
  outline-offset: 2px;
}

.rf-pill--yn { font-weight: 600; }

/* Pill that contains an inline amount input (e.g., "Rental income · $/mo").
   Checkbox + label on left, number input on right, single-row + responsive. */
.rf-pill--with-amount {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  text-align: left;
  justify-content: stretch;
  margin-bottom: 8px;
}
.rf-pill--with-amount span { text-align: left; }
/* Type-agnostic so the polish-pass swap from type=number → type=text
   inputmode=numeric keeps the same compact pill-amount styling. */
.rf-pill--with-amount input.rf-pill__amount {
  width: 110px;
  padding: 8px 12px;
  font-family: var(--rf-font-body);
  font-size: 14px;
  color: var(--rf-text);
  border: 1px solid var(--rf-input-border);
  border-radius: var(--rf-radius-md);
  background: var(--rf-input-bg);
}
.rf-pill--with-amount input.rf-pill__amount:focus {
  outline: none;
  border-color: var(--rf-input-border-focus);
  box-shadow: var(--rf-input-shadow-focus);
}
@media (max-width: 480px) {
  .rf-pill--with-amount {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .rf-pill--with-amount input.rf-pill__amount { width: 100%; }
}

/* "Why we ask" expander */
.rf-why {
  font-size: 13px;
  margin-bottom: 12px;
  background: rgba(13, 107, 110, 0.04);
  border: 1px solid rgba(13, 107, 110, 0.12);
  border-radius: var(--rf-radius-md);
  padding: 8px 12px;
}
.rf-why summary {
  font-weight: 600;
  color: var(--rf-primary);
  cursor: pointer;
  list-style: none;
  display: inline-flex; align-items: center; gap: 6px;
}
/* Swap the Unicode ⓘ (rendered chunky/pixelated from system font on Windows)
   for an inline-SVG info-circle that scales crisp at any DPI. Color follows
   currentColor → matches the teal "Why we ask" text via the surrounding rule. */
.rf-why summary::before {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230D6B6E' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='10'/><line x1='12' y1='16' x2='12' y2='12'/><line x1='12' y1='8' x2='12.01' y2='8'/></svg>");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  vertical-align: -1px;
}
.rf-why[open] summary { margin-bottom: 6px; }
.rf-why p { color: var(--rf-text-secondary); line-height: 1.55; }

/* TCPA mini disclaimer */
.rf-tcpa-mini {
  font-size: 12px;
  line-height: 1.55;
  color: var(--rf-text-secondary);
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid var(--rf-border-light);
  border-radius: var(--rf-radius-md);
  padding: 10px 12px;
  margin-bottom: 16px;
}

/* ─── Buttons (CTA hierarchy: Tier 1 gold, Tier 2 teal, ghost) ────── */

.rf-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  font-family: var(--rf-font-heading);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.15;
  border: 1px solid transparent;
  border-radius: var(--rf-radius-lg);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
  text-align: center;
  box-sizing: border-box;
  min-height: 48px;
  white-space: nowrap;
}
.rf-btn:focus-visible { outline: 2px solid var(--rf-primary); outline-offset: 2px; }
.rf-btn__arrow { flex-shrink: 0; transition: transform 0.2s ease; }
.rf-btn:hover .rf-btn__arrow { transform: translateX(4px); }

.rf-btn--gold {
  background: var(--rf-gold);
  color: var(--rf-gold-text);
  box-shadow: 0 4px 14px rgba(200, 150, 62, 0.45);
}
.rf-btn--gold:hover {
  background: var(--rf-gold-hover);
  box-shadow: 0 6px 18px rgba(200, 150, 62, 0.55);
  transform: translateY(-1px);
}

.rf-btn--secondary {
  background: transparent;
  color: var(--rf-primary);
  border-color: var(--rf-primary);
}
.rf-btn--secondary:hover {
  background: var(--rf-primary);
  color: var(--rf-text-on-dark);
}

.rf-btn--ghost {
  background: transparent;
  color: var(--rf-text-secondary);
  border-color: var(--rf-border);
}
.rf-btn--ghost:hover {
  border-color: var(--rf-text);
  color: var(--rf-text);
}

/* Step CTA row */
.rf-step__cta {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding-top: 16px;
}
.rf-step__cta .rf-btn { width: 100%; }
.rf-step__cta-note {
  font-size: 12px;
  color: var(--rf-text-secondary);
  text-align: center;
  margin-top: 4px;
}
.rf-step--stub .rf-step__cta {
  flex-direction: row;
  justify-content: center;
  flex-wrap: wrap;
}
.rf-step--stub .rf-step__cta .rf-btn { width: auto; min-width: 140px; }
/* WCAG fix (Codex Pass-1 MEDIUM): stack stub CTA buttons under 480px so
   Back + Continue don't overflow on 320px viewports. */
@media (max-width: 480px) {
  .rf-step--stub .rf-step__cta { flex-direction: column; align-items: stretch; }
  .rf-step--stub .rf-step__cta .rf-btn { width: 100%; min-width: 0; }
}

/* ─── Transition Screen (Step 1.5) ────────────────────────────────── */

.rf-transition .rf-step__header {
  text-align: center;
  margin-bottom: 32px;
}
.rf-transition__check {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: rgba(13, 107, 110, 0.10);
  color: var(--rf-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.rf-path-cards {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.rf-path-card {
  position: relative;
  background: var(--rf-bg);
  border: 1px solid var(--rf-border-light);
  border-radius: var(--rf-radius-xl);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.rf-path-card--primary {
  background: linear-gradient(180deg, #FFFDF7 0%, #FFFAF0 100%);
  border-color: rgba(200, 150, 62, 0.45);
  box-shadow: 0 4px 18px rgba(200, 150, 62, 0.12);
}
.rf-path-card__badge {
  position: absolute;
  top: 16px; right: 16px;
  font-family: var(--rf-font-heading);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--rf-gold-text);
  background: var(--rf-gold);
  padding: 4px 8px;
  border-radius: var(--rf-radius-sm);
}
/* Reserve space at the right edge of the title so wrapped lines never slide
   under the absolute-positioned badge. Scoped via :has() so it only applies
   on cards that actually carry a badge. */
.rf-path-card:has(> .rf-path-card__badge) .rf-path-card__title {
  padding-right: 88px;
}
.rf-path-card__title {
  font-size: 17px;
  font-weight: 700;
  color: var(--rf-text);
}
.rf-path-card__body {
  font-size: 14px;
  line-height: 1.55;
  color: var(--rf-text-secondary);
}
.rf-path-card .rf-btn {
  margin-top: 6px;
  align-self: flex-start;
}
@media (max-width: 480px) {
  .rf-path-card .rf-btn { width: 100%; align-self: stretch; }
  /* Mobile: badge demotes from absolute corner to in-flow top chip. Markup
     already has badge before title, so this naturally stacks the badge above
     the title without any HTML change. Title gets back its full width. */
  .rf-path-card__badge {
    position: static;
    align-self: flex-start;
    margin-bottom: 4px;
  }
  .rf-path-card:has(> .rf-path-card__badge) .rf-path-card__title {
    padding-right: 0;
  }
}

/* ─── Step 6 · debt rows + totals (Sections F + G) ────────────────── */

.rf-debt-row {
  margin-bottom: 14px;
}
.rf-debt-row:last-child { margin-bottom: 0; }
.rf-debt-row__label {
  font-family: var(--rf-font-heading);
  font-size: 14px;
  font-weight: 600;
  color: var(--rf-text);
  margin-bottom: 8px;
  display: block;
  line-height: 1.4;
}
.rf-debt-row__inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-items: center;
}
/* Type-agnostic so currency inputs (type="text" inputmode="numeric") inherit
   the same look as the original type="number" inputs after the polish-pass
   swap to comma-friendly text inputs. */
.rf-debt-row__inputs input,
.rf-debt-row__single,
.rf-debt-row__describe {
  width: 100%;
  padding: 10px 12px;
  font-family: var(--rf-font-body);
  font-size: 14px;
  color: var(--rf-text);
  background: var(--rf-input-bg);
  border: 1px solid var(--rf-input-border);
  border-radius: var(--rf-radius-md);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  -webkit-appearance: none;
  -moz-appearance: textfield;
  appearance: none;
  line-height: 1.4;
}
.rf-debt-row__inputs input::-webkit-outer-spin-button,
.rf-debt-row__inputs input::-webkit-inner-spin-button,
.rf-debt-row__single::-webkit-outer-spin-button,
.rf-debt-row__single::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.rf-debt-row__inputs input:focus,
.rf-debt-row__single:focus,
.rf-debt-row__describe:focus {
  outline: none;
  border-color: var(--rf-input-border-focus);
  box-shadow: var(--rf-input-shadow-focus);
}
.rf-debt-row__describe {
  margin-top: 8px;
}
.rf-debt-row__placeholder {
  font-size: 12px;
  color: var(--rf-text-secondary);
  font-style: italic;
  text-align: center;
  padding: 10px 12px;
  border: 1px dashed var(--rf-border);
  border-radius: var(--rf-radius-md);
  background: rgba(0, 0, 0, 0.02);
}
@media (max-width: 480px) {
  .rf-debt-row__inputs { grid-template-columns: 1fr; }
}

.rf-totals-row {
  margin-top: 14px;
  padding: 14px 16px;
  background: rgba(13, 107, 110, 0.06);
  border: 1px solid rgba(13, 107, 110, 0.18);
  border-radius: var(--rf-radius-lg);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
}
.rf-totals-row__label {
  font-family: var(--rf-font-heading);
  font-size: 14px;
  font-weight: 700;
  color: var(--rf-primary-dark);
}
.rf-totals-row__value {
  font-family: var(--rf-font-heading);
  font-size: 18px;
  font-weight: 800;
  color: var(--rf-primary-dark);
}

/* ─── Step 8 · document checklist + acknowledge ───────────────────── */

.rf-doclist {
  margin-bottom: 12px;
}
.rf-doclist__group {
  margin-bottom: 18px;
}
.rf-doclist__group:last-child {
  margin-bottom: 0;
}
.rf-doclist__group h4 {
  font-family: var(--rf-font-heading);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--rf-primary);
  margin-bottom: 8px;
}
.rf-doclist__group ul {
  list-style: none;
  padding-left: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.rf-doclist__group li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--rf-text);
}
.rf-doclist__group li::before {
  content: '\2610';
  color: var(--rf-primary);
  flex-shrink: 0;
  font-size: 16px;
  line-height: 1.4;
}

.rf-acknowledge {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
  padding: 14px 16px;
  background: rgba(13, 107, 110, 0.04);
  border: 1px solid rgba(13, 107, 110, 0.18);
  border-radius: var(--rf-radius-md);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
  margin-top: 16px;
}
.rf-acknowledge:has(input:checked) {
  border-color: var(--rf-primary);
  background: rgba(13, 107, 110, 0.08);
}
.rf-acknowledge input[type="checkbox"] {
  margin-top: 2px;
  width: 18px;
  height: 18px;
  accent-color: var(--rf-primary);
  cursor: pointer;
}
.rf-acknowledge span {
  font-size: 14px;
  line-height: 1.55;
  color: var(--rf-text);
}

/* ─── Step 9 · review block + full TCPA ──────────────────────────── */

.rf-review {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 24px;
}
.rf-review__empty {
  font-size: 13px;
  color: var(--rf-text-secondary);
  font-style: italic;
  text-align: center;
}
.rf-review__section {
  background: var(--rf-bg);
  border: 1px solid var(--rf-border-light);
  border-radius: var(--rf-radius-lg);
  padding: 16px 18px;
}
.rf-review__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.rf-review__title {
  font-family: var(--rf-font-heading);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--rf-primary);
  line-height: 1.2;
}
.rf-review__edit {
  font-family: var(--rf-font-heading);
  font-size: 13px;
  font-weight: 600;
  color: var(--rf-primary);
  background: transparent;
  border: 0;
  padding: 4px 0 2px;
  border-bottom: 1px dashed var(--rf-primary);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, border-bottom-style 0.15s ease;
  line-height: 1.3;
}
.rf-review__edit:hover {
  color: var(--rf-primary-dark);
  border-bottom-style: solid;
  border-bottom-color: var(--rf-primary-dark);
}
.rf-review__list {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
.rf-review__row {
  display: grid;
  grid-template-columns: minmax(120px, 36%) 1fr;
  gap: 12px;
  font-size: 14px;
  align-items: baseline;
  line-height: 1.5;
}
.rf-review__row dt {
  color: var(--rf-text-secondary);
  font-weight: 500;
}
.rf-review__row dd {
  color: var(--rf-text);
  font-weight: 600;
  word-break: break-word;
}
@media (max-width: 480px) {
  .rf-review__row {
    grid-template-columns: 1fr;
    gap: 2px;
  }
  .rf-review__row dt { font-size: 12px; }
}

.rf-tcpa-full {
  border: 0;
  padding: 0;
  margin-bottom: 16px;
  background: rgba(13, 107, 110, 0.04);
  border: 1px solid rgba(13, 107, 110, 0.18);
  border-radius: var(--rf-radius-lg);
  padding: 18px 20px;
}
.rf-tcpa-full .rf-fieldset__legend {
  margin-bottom: 12px;
}
.rf-tcpa-full__text {
  font-size: 14px;
  line-height: 1.6;
  color: var(--rf-text);
  margin-bottom: 14px;
}
.rf-tcpa-full__text a {
  color: var(--rf-primary);
  border-bottom: 1px dashed var(--rf-primary);
  text-decoration: none;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.rf-tcpa-full__text a:hover {
  color: var(--rf-primary-dark);
  border-bottom-style: solid;
  border-bottom-color: var(--rf-primary-dark);
}
.rf-tcpa-full__consent {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
  padding: 12px 14px;
  background: var(--rf-bg-surface);
  border: 1px solid var(--rf-border);
  border-radius: var(--rf-radius-md);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.rf-tcpa-full__consent:has(input:checked) {
  border-color: var(--rf-primary);
  background: rgba(13, 107, 110, 0.04);
}
.rf-tcpa-full__consent input[type="checkbox"] {
  margin-top: 2px;
  width: 18px;
  height: 18px;
  accent-color: var(--rf-primary);
  cursor: pointer;
}
.rf-tcpa-full__consent span {
  font-size: 13px;
  line-height: 1.55;
  color: var(--rf-text);
}

/* ─── Cloudflare Turnstile (Step 9 spam check) ─────────────────────
   Widget itself is a 300x65 iframe rendered by Cloudflare's script.
   Wrapper centers it horizontally + adds vertical breathing room
   between the TCPA fieldset and the submit-button row. Inline error
   appears below the widget when buyer hits Submit without a token. */
.rf-turnstile-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin: 20px 0 8px;
}
.rf-turnstile-error {
  margin: 0;
  font-size: 13px;
  color: var(--rf-danger, #B0263F);
  font-weight: 500;
  text-align: center;
}

/* ─── Slim funnel footer (Block 12) ───────────────────────────────── */

.rf-footer-slim {
  background: var(--rf-bg);
  border-top: 1px solid var(--rf-border-light);
  padding: 24px 16px;
  margin-top: 0;  /* Session 4 polish: removed (was 32px) — wizard padding-bottom now provides the gap; eliminates double-padding before footer */
}
.rf-footer-slim__inner {
  max-width: var(--rf-container-max);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  font-size: 12px;
  color: var(--rf-text-secondary);
}
.rf-footer-slim__brand { font-weight: 600; }
.rf-footer-slim__nav { display: inline-flex; gap: 16px; }
.rf-footer-slim__nav a {
  color: var(--rf-text-secondary);
  text-decoration: none;
  border-bottom: 1px dashed var(--rf-border);
  padding-bottom: 1px;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.rf-footer-slim__nav a:hover {
  color: var(--rf-primary-dark);
  border-bottom-style: solid;
  border-bottom-color: var(--rf-primary-dark);
}
/* Session 4: "Start over" button — visually matches the legal links so the
   row reads as a uniform tier-3 footer nav. Uses button element for proper
   semantics (not an anchor, since it triggers JS rather than navigates). */
.rf-footer-slim__reset {
  appearance: none;
  background: none;
  border: none;
  border-bottom: 1px dashed var(--rf-border);
  border-radius: 0;
  padding: 0 0 1px;
  margin: 0;
  font: inherit;
  font-size: inherit;
  color: var(--rf-text-secondary);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, border-bottom-style 0.15s ease;
}
.rf-footer-slim__reset:hover {
  color: var(--rf-primary-dark);
  border-bottom-style: solid;
  border-bottom-color: var(--rf-primary-dark);
}
.rf-footer-slim__reset:focus-visible {
  outline: 2px solid var(--rf-primary);
  outline-offset: 2px;
}

/* ─── Responsive · ≥768px ─────────────────────────────────────────── */

@media (min-width: 768px) {
  .rf-hero--funnel { padding: 80px 32px 88px; }
  .rf-wizard { padding: 48px 24px 48px; }  /* Session 4 polish: symmetric (was 48/96) — pairs with footer margin-top: 0 */
  .rf-wizard__card { padding: 48px 56px; }
  .rf-funnel-header { padding: 18px 0; }
  .rf-funnel-header__inner { padding: 0 32px; }
  /* Buttons row centered (Rafael polish-pass) so Back + Continue share equal
     visual weight in the wizard step-through (vs the classic right-justified
     desktop form-footer convention). Note still flex-wraps to its own line
     below so the submit button isn't squeezed when its content exceeds the
     200px floor (e.g., "Submit my pre-qualification" + arrow ≈ 215px).
     flex-shrink:0 on the buttons themselves locks in content-derived width. */
  .rf-step__cta {
    flex-direction: row;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px 12px;
  }
  .rf-step__cta .rf-btn {
    width: auto;
    min-width: 200px;
    flex-shrink: 0;
  }
  .rf-step__cta-note {
    width: 100%;
    text-align: center;
    margin-top: 0;
  }
}

@media (min-width: 1024px) {
  .rf-path-card { padding: 24px 28px; }
}

/* ─── Session 3 polish ────────────────────────────────────────────────
   Small button + Step 8 save panel + email-invalid soft state + print
   stylesheet for the document checklist save flow. */

.rf-btn--sm {
  padding: 8px 14px;
  font-size: 14px;
  min-height: 36px;
  gap: 8px;
}

.rf-doclist__save {
  margin-top: 16px;
  padding: 16px 20px;
  background: var(--rf-bg-soft, #F8F6F1);
  border: 1px dashed var(--rf-input-border);
  border-radius: var(--rf-radius-md);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.rf-doclist__save-hint {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--rf-text);
}
.rf-doclist__save-note {
  font-size: 12px;
  color: var(--rf-text-secondary);
  line-height: 1.4;
  max-width: 380px;
}

/* Email soft-warning: applied by JS on focusout when value is non-empty
   but doesn't match a basic email pattern. Visual hint only — does NOT
   block submit (HTML5 type=email gating handles the hard rule). */
.rf-input--invalid {
  border-color: #C0392B !important;
  box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.12) !important;
}
.rf-input-hint {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: #C0392B;
  line-height: 1.4;
}

/* Print stylesheet: when buyer hits Print on Step 8, give them a clean
   single-page (or short multi-page) checklist with no chrome. The doc
   list itself is the only content that should appear. */
@media print {
  /* Hide everything by default; selectively show the doc list region. */
  body * { visibility: hidden; }
  .rf-doclist, .rf-doclist *,
  .rf-step[data-step="8"] > .rf-step__header, .rf-step[data-step="8"] > .rf-step__header * {
    visibility: visible;
  }
  /* Reset positioning so the visible block starts at the top of the page. */
  body {
    background: #FFFFFF;
    margin: 0;
    padding: 24px;
  }
  .rf-step[data-step="8"] {
    display: block !important;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 0;
  }
  .rf-step[data-step="8"] > .rf-step__header { margin-bottom: 16px; }
  .rf-doclist { display: block; padding: 0; }
  .rf-doclist__group { page-break-inside: avoid; margin-bottom: 14px; }
  .rf-doclist__group h4 { font-size: 13px; font-weight: 700; margin: 0 0 6px; color: #094B4D; }
  .rf-doclist__group ul { margin: 0; padding-left: 20px; }
  .rf-doclist__group li { font-size: 12px; line-height: 1.5; margin-bottom: 3px; }
  /* Don't print the save panel, acknowledge box, or CTAs. */
  .rf-doclist__save, .rf-acknowledge, .rf-step__cta { display: none !important; }
}
