/* ==========================================================================
   SPUR HOMES — Budget Estimator
   Step wizard + animated results dashboard
   ========================================================================== */

.estimator {
  position: relative;
  max-width: 940px;
  margin-inline: auto;
}

/* --- Progress ------------------------------------------------------------ */
.wizard-progress {
  display: grid;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}
.wizard-progress__meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-4);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-fg-muted);
}
.wizard-progress__meta b { color: var(--olive-700); font-variant-numeric: tabular-nums; }
.wizard-progress__track {
  height: 6px;
  border-radius: var(--radius-pill);
  background: var(--olive-100);
  overflow: hidden;
}
.wizard-progress__fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--olive-500), var(--olive-700));
  transition: width var(--dur-slow) var(--ease-out);
}

/* Step dots — horizontal scroll on mobile rather than cramming */
.wizard-steps {
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-2);
  overflow-x: auto;
  scrollbar-width: none;
}
.wizard-steps::-webkit-scrollbar { display: none; }
.wizard-steps li { list-style: none; margin: 0; }
.wizard-steps__dot {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 36px;
  padding: 0 var(--space-3);
  border-radius: var(--radius-pill);
  background: transparent;
  border: 1px solid transparent;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-fg-subtle);
  white-space: nowrap;
}
.wizard-steps__dot[data-state="current"] {
  background: var(--olive-100);
  border-color: var(--olive-300);
  color: var(--olive-800);
}
.wizard-steps__dot[data-state="done"] { color: var(--olive-600); }
.wizard-steps__dot[data-state="done"]::before {
  content: "";
  width: 14px; height: 14px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8.5 6.5 12 13 4' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center / contain;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8.5 6.5 12 13 4' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center / contain;
}

/* --- Step panels --------------------------------------------------------- */
.wizard-card {
  padding: clamp(1.5rem, 3.5vw, 3rem);
  border-radius: var(--radius-2xl);
}

.wizard-step { display: none; }
.wizard-step.is-active { display: block; }

.wizard-step__head { margin-bottom: var(--space-6); }
.wizard-step__kicker {
  display: block;
  margin-bottom: var(--space-2);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--gold-700);
}
.wizard-step__title { margin: 0 0 var(--space-3); font-size: var(--text-2xl); }
.wizard-step__help { margin: 0; color: var(--color-fg-muted); max-width: 58ch; }

/* --- Option cards -------------------------------------------------------- */
.options { display: grid; gap: var(--space-3); }
@media (min-width: 560px) { .options--2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 720px) { .options--3 { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) { .options--4 { grid-template-columns: repeat(4, 1fr); } }

.option { position: relative; display: block; }
.option input {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.option__body {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  height: 100%;
  min-height: 92px;
  padding: var(--space-5);
  border: 1.5px solid var(--color-border-strong);
  border-radius: var(--radius-lg);
  background: rgba(255, 253, 249, 0.66);
  transition:
    border-color var(--dur-base) var(--ease-out),
    background-color var(--dur-base) var(--ease-out),
    transform var(--dur-fast) var(--ease-out),
    box-shadow var(--dur-base) var(--ease-out);
}
.option:hover .option__body { border-color: var(--olive-400); transform: translateY(-2px); }
.option input:focus-visible + .option__body {
  outline: 3px solid var(--color-ring);
  outline-offset: 2px;
}
.option input:checked + .option__body {
  border-color: var(--olive-600);
  background: var(--olive-50);
  box-shadow: var(--shadow-md), inset 0 0 0 1px var(--olive-400);
}
.option__title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-md);
  font-weight: 700;
  color: var(--ink-900);
  line-height: 1.3;
}
.option__desc { font-size: var(--text-sm); color: var(--color-fg-muted); line-height: 1.5; }
.option__icon { color: var(--olive-600); flex: none; }
.option__icon svg { width: 24px; height: 24px; }

/* Selected tick */
.option__tick {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  display: grid;
  place-items: center;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--olive-600);
  color: #fff;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity var(--dur-fast) var(--ease-out), transform var(--dur-base) var(--ease-spring);
}
.option input:checked ~ .option__tick { opacity: 1; transform: scale(1); }
.option__tick svg { width: 12px; height: 12px; }

/* Style options carry photography */
.option--visual .option__body { padding: 0; overflow: hidden; min-height: 0; }
.option--visual .option__media { aspect-ratio: 16 / 10; background: var(--sand-300); }
.option--visual .option__media img { width: 100%; height: 100%; object-fit: cover; }
.option--visual .option__text { padding: var(--space-4) var(--space-5) var(--space-5); display: grid; gap: var(--space-2); }

/* --- Range slider -------------------------------------------------------- */
.range-field { display: grid; gap: var(--space-4); }
.range-field__value {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 600;
  color: var(--olive-700);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.range-field__value small {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-fg-muted);
  margin-left: var(--space-2);
}
.range-field input[type="range"] {
  width: 100%;
  height: 44px;
  margin: 0;
  background: transparent;
  accent-color: var(--olive-600);
  cursor: pointer;
}
.range-field__scale {
  display: flex;
  justify-content: space-between;
  font-size: var(--text-sm);
  color: var(--color-fg-muted);
  font-variant-numeric: tabular-nums;
}

/* --- Wizard footer ------------------------------------------------------- */
.wizard-nav {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-7);
  padding-top: var(--space-5);
  border-top: 1px solid var(--color-border);
}
.wizard-nav__spacer { margin-left: auto; }
.wizard-nav__hint { font-size: var(--text-sm); color: var(--color-fg-muted); }
@media (max-width: 560px) {
  .wizard-nav { flex-wrap: wrap; }
  .wizard-nav .btn { flex: 1 1 auto; }
  .wizard-nav__hint { flex-basis: 100%; order: 3; }
}

/* --- Results dashboard --------------------------------------------------- */
.result { display: none; }
.result.is-visible { display: block; }

.result__hero {
  display: grid;
  gap: var(--space-7);
  align-items: center;
  padding: clamp(1.75rem, 4vw, 3rem);
  border-radius: var(--radius-2xl);
}
@media (min-width: 820px) { .result__hero { grid-template-columns: auto 1fr; gap: var(--space-8); } }

/* Circular confidence gauge */
.gauge { position: relative; width: 214px; height: 214px; margin-inline: auto; }
.gauge svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.gauge__track { fill: none; stroke: var(--olive-100); stroke-width: 14; }
.gauge__bar {
  fill: none;
  stroke: url(#gaugeGradient);
  stroke-width: 14;
  stroke-linecap: round;
  stroke-dasharray: var(--circ, 597);
  stroke-dashoffset: var(--circ, 597);
  transition: stroke-dashoffset 1400ms var(--ease-out);
}
.gauge__center {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
  gap: 2px;
}
.gauge__pct {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 600;
  line-height: 1;
  color: var(--olive-700);
  font-variant-numeric: tabular-nums;
}
.gauge__label {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-fg-muted);
}

.result__figure { display: grid; gap: var(--space-2); }
.result__range {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: var(--space-3);
  font-family: var(--font-display);
  font-size: var(--text-4xl);
  font-weight: 600;
  line-height: 1;
  color: var(--ink-900);
  font-variant-numeric: tabular-nums;
}
.result__range span { color: var(--olive-700); }
.result__range em {
  font-family: var(--font-sans);
  font-style: normal;
  font-size: var(--text-lg);
  font-weight: 500;
  color: var(--color-fg-muted);
}
.result__package {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

/* Package and style wrap as whole phrases, never mid-name. */
.result__eyebrow { flex-wrap: wrap; row-gap: 2px; }
.result__eyebrow > span { white-space: nowrap; }

/* Cost breakdown bars */
.breakdown { display: grid; gap: var(--space-4); }
.breakdown__row { display: grid; gap: var(--space-2); }
.breakdown__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-4);
  font-size: var(--text-base);
}
.breakdown__name { font-weight: 600; color: var(--ink-800); }
.breakdown__amount { color: var(--olive-700); font-weight: 700; font-variant-numeric: tabular-nums; }
.breakdown__track {
  height: 12px;
  border-radius: var(--radius-pill);
  background: var(--olive-100);
  overflow: hidden;
}
.breakdown__fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--olive-400), var(--olive-700));
  transition: width 900ms var(--ease-out);
}
.breakdown__note { font-size: var(--text-sm); color: var(--color-fg-muted); }

/* Recommendation tiles */
.result__tiles {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}
.result-tile {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-5);
  border-radius: var(--radius-lg);
}
.result-tile__label {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-fg-muted);
}
.result-tile__value {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--ink-900);
  line-height: 1.2;
}
.result-tile__note { font-size: var(--text-sm); color: var(--color-fg-muted); }

.result__advice { display: grid; gap: var(--space-3); }
.result__advice li {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: var(--space-3);
  align-items: start;
  margin: 0;
  font-size: var(--text-base);
  color: var(--ink-700);
}
.result__advice svg { width: 24px; height: 24px; color: var(--olive-600); margin-top: 1px; }

.result__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-6);
}

.result__disclaimer {
  margin-top: var(--space-5);
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-md);
  background: var(--sand-300);
  font-size: var(--text-sm);
  color: var(--ink-600);
}

/* Print-friendly report */
@media print {
  .site-header, .site-footer, .floating-actions, .sticky-cta,
  .scroll-progress, .wizard-card, .result__actions, .cursor-dot, .cursor-ring { display: none !important; }
  body { background: #fff; }
  body::before { display: none; }
  .glass, .glass--solid { background: #fff !important; box-shadow: none !important; border: 1px solid #ddd; backdrop-filter: none !important; }
  .result { display: block !important; }
}
