/* ============================================================
   buyers.css — affordability and the buying road
   ============================================================ */
.afford { padding: calc(var(--nav-height) + 3rem) 0 clamp(3rem, 6vw, 5rem); background: linear-gradient(135deg, var(--color-sage) 0%, #3c4f3d 55%, var(--color-ocean) 140%); color: rgba(255,255,255,0.88); }
.afford .breadcrumb, .afford .breadcrumb a { color: rgba(255,255,255,0.75); }
.afford__grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: clamp(2rem, 6vw, 6rem); align-items: center; }
.afford__title { font-size: clamp(3rem, 7vw, 5.6rem); color: #fff; line-height: 0.95; margin: 0.5rem 0 1rem; }
.afford .lead { color: rgba(255,255,255,0.88); margin-bottom: 2rem; max-width: 30rem; }
.afford__form { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.afford__field--wide { grid-column: 1 / -1; }
.afford__field > span { display: flex; justify-content: space-between; align-items: baseline; font-size: 0.9rem; font-weight: 600; margin-bottom: 0.4rem; }
.afford__pay-out { font-family: var(--font-display); font-size: 2rem; font-weight: 500; color: #fff; }
.afford__field select, .afford__field input[type=number] { width: 100%; padding: 0.8rem 0.9rem; border-radius: var(--radius); border: 1px solid rgba(255,255,255,0.3); background: rgba(255,255,255,0.1); color: #fff; font: inherit; }
.afford__field select option { color: var(--color-ink); }
.afford__field input[type=range] { width: 100%; accent-color: var(--color-earth-light); height: 32px; }
.afford__field :focus-visible { outline: 3px solid var(--color-earth-light); outline-offset: 2px; }
.afford__result { padding: 2rem 2.2rem; border-radius: var(--radius-lg); background: rgba(20,24,22,0.35); border: 1px solid rgba(255,255,255,0.18); backdrop-filter: blur(6px); }
.afford__label { font-size: 1rem; margin-bottom: 0.2rem; }
.afford__price { font-family: var(--font-display); font-size: clamp(3.2rem, 7vw, 5.4rem); color: #fff; line-height: 1; margin-bottom: 1rem; font-variant-numeric: tabular-nums; }
.afford__note { font-size: 0.85rem; color: rgba(255,255,255,0.7); margin-bottom: 1.5rem; }
.afford-homes__empty { font-size: 1rem; }
.afford-homes__empty a { color: var(--color-ocean); border-bottom: 1px solid currentColor; }

.road { background: var(--color-warm-white); }
.road__grid { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: clamp(2rem, 6vw, 6rem); align-items: start; }
.road__intro { position: sticky; top: calc(var(--nav-now) + 2rem); }
.road__intro p { margin: 0.8rem 0 1.6rem; }
.road__steps { list-style: none; position: relative; padding-left: 3.25rem; --road: 0; }
.road__steps::before, .road__steps::after { content: ''; position: absolute; left: 14px; top: 0.6rem; bottom: 0.6rem; width: 2px; border-radius: 2px; }
.road__steps::before { background: var(--color-rule); }
.road__steps::after { background: var(--color-sage); transform-origin: top; transform: scaleY(var(--road)); }
.road__step { position: relative; padding-bottom: 2.6rem; }
.road__step:last-child { padding-bottom: 0; }
.road__dot { position: absolute; left: calc(-3.25rem + 6px); top: 0.35rem; width: 18px; height: 18px; border-radius: 50%; background: var(--color-warm-white); border: 2px solid var(--color-ink-20); z-index: 1; transition: background 0.4s var(--ease), border-color 0.4s var(--ease), transform 0.4s var(--ease); }
.road__step.is-reached .road__dot { background: var(--color-sage); border-color: var(--color-sage); transform: scale(1.15); }
/* the moment a step is reached its dot sends out one ring, like a drop on still water */
.road__step.is-reached .road__dot::after { content: ''; position: absolute; inset: -3px; border-radius: 50%; border: 2px solid var(--color-sage); animation: roadRing 0.9s ease-out forwards; }
@keyframes roadRing { from { transform: scale(0.6); opacity: 0.9; } to { transform: scale(2.4); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .road__step.is-reached .road__dot::after { animation: none; display: none; } }
.road__step h3 { font-size: 1.9rem; margin-bottom: 0.35rem; color: var(--color-ink-40); transition: color 0.4s var(--ease); }
.road__step.is-reached h3 { color: var(--color-ink); }
.road__step p { max-width: 34rem; }

@media (max-width: 900px) {
  .afford__grid, .road__grid { grid-template-columns: 1fr; }
  .road__intro { position: static; }
}
@media (max-width: 560px) { .afford__form { grid-template-columns: 1fr 1fr; } .afford__form .afford__field:last-child { grid-column: 1 / -1; } }
@media (prefers-reduced-motion: reduce) { .road__steps::after { transform: none; } .road__step h3 { color: var(--color-ink); } }

/* The ruler (buyers.js): a dot per home for sale on a price line. The
   budget line sweeps as the payment moves; homes under it light up. */
.ruler { margin: 0.4rem 0 1.4rem; }
.ruler__track { position: relative; height: 34px; }
.ruler__track::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 2px; margin-top: -1px; background: rgba(255,255,255,0.18); border-radius: 2px; }
.ruler__fill { position: absolute; left: 0; top: 50%; height: 2px; margin-top: -1px; width: var(--at, 0%); background: var(--color-earth-light, #c8a77a); border-radius: 2px; transition: width 0.45s cubic-bezier(.2,.8,.2,1); }
.ruler__line { position: absolute; top: 0; bottom: 0; left: var(--at, 0%); width: 2px; margin-left: -1px; background: var(--color-warm-white); border-radius: 2px; box-shadow: 0 0 12px rgba(255,255,255,0.6); transition: left 0.45s cubic-bezier(.2,.8,.2,1); }
.ruler__dot {
  position: absolute; top: 50%; width: 14px; height: 14px; margin: calc(-7px + (var(--i) - 1) * 9px) 0 0 -7px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.5); background: transparent;
  transition: background 0.35s var(--ease), border-color 0.35s var(--ease), transform 0.45s cubic-bezier(.3,1.6,.5,1);
}
.ruler__dot.is-in { background: #a9bf9c; border-color: #a9bf9c; transform: scale(1.25); }
.ruler__dot.is-coast.is-in { background: #8dbed6; border-color: #8dbed6; }
.ruler__ends { display: flex; justify-content: space-between; font-size: 0.78rem; color: rgba(255,255,255,0.6); margin-top: 0.3rem; }
.ruler__said { font-size: 0.95rem; color: #fff; margin: 0.6rem 0 0; }
@media (prefers-reduced-motion: reduce) { .ruler__fill, .ruler__line, .ruler__dot { transition: none; } }
.ruler__key { display: flex; align-items: center; gap: 0.4rem; font-size: 0.78rem; color: rgba(255,255,255,0.65); margin: 0.35rem 0 0; }
.ruler__key i { width: 9px; height: 9px; border-radius: 50%; background: #a9bf9c; }
.ruler__key i.is-al { background: #8dbed6; margin-left: 0.6rem; }

/* The same payment in both places (buyers.js sides) */
.afford__split { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem; margin: 0.2rem 0 1.4rem; }
.afford__split[hidden] { display: none; }
.afford__side { display: grid; grid-template-columns: 64px 1fr; gap: 0.7rem; align-items: center; padding: 0.7rem; border-radius: var(--radius); background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.16); color: #fff; transition: background var(--transition-fast), border-color var(--transition-fast); }
.afford__side:hover { background: rgba(255,255,255,0.16); border-color: rgba(255,255,255,0.35); }
.afford__side-pic { display: block; width: 64px; height: 48px; border-radius: 6px; overflow: hidden; background: rgba(255,255,255,0.12); }
.afford__side-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.afford__side.is-empty:not(.is-near) .afford__side-pic img { display: none; }
.afford__side.is-near { border-style: dashed; border-color: rgba(255,255,255,0.4); cursor: pointer; }
.afford__side.is-near .afford__side-pic img { opacity: 0.55; filter: saturate(0.6); }
.afford__side.is-near .afford__side-top { color: #fff; text-decoration: underline; text-decoration-color: rgba(255,255,255,0.5); text-underline-offset: 3px; }
.afford__side-body { display: grid; gap: 0.05rem; min-width: 0; }
.afford__side-body b { font-size: 0.82rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.afford__side--ga b { color: #cfe0c6; } .afford__side--al b { color: #b7dbe7; }
.afford__side-n { font-family: var(--font-display); font-size: 1.25rem; line-height: 1.1; color: #fff; }
.afford__side-top { font-size: 0.8rem; color: rgba(255,255,255,0.8); line-height: 1.35; }
@media (max-width: 520px) { .afford__split { grid-template-columns: 1fr; } }

.afford__lens-note { margin: 0.6rem 0 0; font-size: 0.82rem; color: var(--color-earth-light); }
.afford__lens-note[hidden] { display: none; }

/* Send the payment to someone: the numbers travel in the link */
.afford__share { display: flex; align-items: center; flex-wrap: wrap; gap: 0.6rem 1rem; margin-top: 1rem; }
.afford__share .sms-instead { margin: 0; }
.afford__share-copy { font-size: 0.9rem; color: var(--color-on-brand, #c9d6d3); border-bottom: 1px solid currentColor; padding-bottom: 1px; }
.afford__share .sms-instead { color: var(--color-mark); border-color: rgba(255,255,255,0.4); }
.afford__share .sms-instead:hover { color: #fff; border-color: #fff; }
