/*
 * estimator.css — The generic estimator page (wizard, inputs, result)
 * ═══════════════════════════════════════════════════════════════════════
 * PATH: public/css/estimator.css
 * ROLE: Styles app/Views/public/estimator/shell.php and every trade fragment
 *       built from its classes. The pattern is kitchen's estimator (step
 *       indicator → one card per step → result + gate), rebuilt on the iSpec
 *       tokens. State never lives in a class: steps use the `hidden`
 *       attribute, the indicator data-state="active|done|upcoming", the
 *       result panel data-state="idle|loading|ready|error", breakdown rows
 *       data-kind="item|subtotal|total", a chosen option card :has(:checked),
 *       a slider band description the `hidden` attribute (per-trade script).
 * TOKENS: --ink --ink-soft --muted --ground --paper --line --teal --teal-bright
 *       --teal-deep --teal-tint --band --display --serif --ease, all from
 *       css/site-shell.css (load that first).
 * USED BY: app/Views/public/estimator/shell.php (styles section)
 * RELATED: css/lead-gate.css (the gate card's form), public/js/estimator.js
 * Created: 2026-10-07
 * Last Modified: 2026-10-09 — benchmarks' live "your estimate" line (.benchmark-our-estimate), as on the flooring tree
 * Last Modified: 2026-10-08 — schedule list/summary rules removed with the section (owner)
 * Last Modified: 2026-10-07
 * Last Modified: 2026-10-08 — doors rebuild: range slider + readout + band
 *       descriptions, a toggle with a name and a detail line, the result
 *       card's range note, the benchmarks block after the result.
 * Last Modified: 2026-10-08 — gate card actions row: the printable-estimate
 *       button and a Start over button (the outline nav-button look, Back's
 *       hover), same height, stacked full width on phones.
 * Last Modified: 2026-10-08 — quote-only result: the reason line under "Quote only"
 *       in the figure area (.estimate-quote-only-reason).
 */

/* ── page frame ──────────────────────────────────────── */
.estimator-page {
  width: min(880px, 92vw);
  margin-inline: auto;
  padding: clamp(2rem, 5vw, 3.5rem) 0 clamp(3rem, 6vw, 5rem);
  overflow-x: clip;
}
.estimator-header {
  margin-bottom: 1.75rem;
  text-align: center;
}
.estimator-eyebrow {
  margin: 0 0 .5rem;
  font-family: var(--display);
  font-weight: 600;
  font-size: .74rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--teal-deep);
}
.estimator-title {
  margin: 0 0 .75rem;
  font-family: var(--display);
  font-stretch: 112%;
  font-weight: 800;
  font-size: clamp(1.75rem, 3.6vw, 2.5rem);
  letter-spacing: -.01em;
  color: var(--ink);
}
.estimator-lead {
  max-width: 40rem;
  margin: 0 auto;
  font-family: var(--serif);
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--muted);
}
.estimator-noscript {
  padding: 1rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  font-family: var(--serif);
}

/* ── step indicator (built by estimator.js) ──────────── */
/* estimator.js fills this list after load; min-height reserves its one row
   (32px number + the button's padding) so the form below does not shift. */
.estimator-progress {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .5rem 1.25rem;
  min-height: calc(32px + .5rem);
  margin: 0 0 1.5rem;
  padding: 0;
  list-style: none;
  scroll-margin-top: calc(var(--nav-h, 76px) + 1rem);
}
.estimator-progress-step {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .25rem;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.estimator-progress-number {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--line);
  color: var(--muted);
  font-family: var(--display);
  font-weight: 800;
  font-size: .85rem;
  transition: background .2s var(--ease), color .2s var(--ease);
}
.estimator-progress-label {
  font-family: var(--display);
  font-size: .72rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}
.estimator-progress-step[data-state="active"] .estimator-progress-number {
  background: var(--teal);
  color: var(--band);
}
.estimator-progress-step[data-state="active"] .estimator-progress-label {
  color: var(--teal-deep);
  font-weight: 700;
}
.estimator-progress-step[data-state="done"] .estimator-progress-number {
  background: var(--teal-deep);
  color: #fff;
}
.estimator-progress-step:focus-visible {
  outline: 2px solid var(--teal-deep);
  outline-offset: 2px;
  border-radius: 999px;
}

/* ── step cards ──────────────────────────────────────── */
.estimator-step {
  margin-bottom: 1.25rem;
  padding: clamp(1.25rem, 3vw, 2rem);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
}
.estimator-step-title {
  margin: 0 0 .5rem;
  padding-bottom: .65rem;
  border-bottom: 2px solid var(--teal);
  font-family: var(--display);
  font-stretch: 112%;
  font-weight: 800;
  font-size: clamp(1.15rem, 2vw, 1.4rem);
  color: var(--ink);
}
.estimator-hint,
.estimator-note {
  margin: .5rem 0 1.25rem;
  font-family: var(--serif);
  font-size: .95rem;
  line-height: 1.55;
  color: var(--muted);
}
.estimator-note:empty {
  display: none;
}

/* ── inputs ──────────────────────────────────────────── */
.estimator-field {
  display: grid;
  gap: .3rem;
  margin-bottom: 1.25rem;
}
.estimator-label {
  margin: 0 0 .35rem;
  padding: 0;
  font-family: var(--display);
  font-weight: 600;
  font-size: .72rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}
.estimator-input {
  width: 100%;
  max-width: 16rem;
  padding: .65rem .8rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--ground);
  font-family: var(--serif);
  font-size: 1rem;
  color: var(--ink);
}
.estimator-input:focus {
  outline: none;
  border-color: var(--teal-deep);
  box-shadow: 0 0 0 3px var(--teal-tint);
}
.option-group {
  margin: 0 0 1.25rem;
  padding: 0;
  border: 0;
  min-width: 0;
}
.option-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: .75rem;
}
.option-card {
  position: relative;
  display: grid;
  gap: .25rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--ground);
  cursor: pointer;
  transition: border-color .2s var(--ease), background .2s var(--ease);
}
.option-card-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.option-card:has(.option-card-input:checked) {
  border-color: var(--teal-deep);
  background: var(--teal-tint);
}
.option-card:has(.option-card-input:focus-visible) {
  outline: 2px solid var(--teal-deep);
  outline-offset: 2px;
}
.option-card-name {
  font-family: var(--display);
  font-weight: 700;
  color: var(--ink);
}
.option-card-detail {
  font-family: var(--serif);
  font-size: .9rem;
  line-height: 1.45;
  color: var(--muted);
}
.estimator-toggle {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  margin: 0 0 .75rem;
  font-family: var(--serif);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--ink-soft);
  cursor: pointer;
}
.estimator-toggle input {
  margin-top: .3rem;
  flex: 0 0 auto;
}
.estimator-toggle-text {
  display: grid;
  gap: .2rem;
}
.estimator-toggle-name {
  color: var(--ink);
}
.estimator-toggle-detail {
  font-size: .9rem;
  line-height: 1.45;
  color: var(--muted);
}

/* ── range slider (a per-trade script keeps the readout + band note) ── */
.estimator-slider-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: .25rem 1rem;
}
.estimator-slider-readout {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.15rem;
  font-variant-numeric: tabular-nums;
  color: var(--teal-deep);
}
.estimator-slider {
  width: 100%;
  min-height: 44px;
  margin: 0;
  accent-color: var(--teal-deep);
  cursor: pointer;
}
.estimator-slider:focus-visible {
  outline: 2px solid var(--teal-deep);
  outline-offset: 2px;
}
.slider-band-notes {
  margin: .25rem 0 0;
  padding: 0;
  list-style: none;
}
.slider-band-note {
  padding: .85rem 1rem;
  border-left: 4px solid var(--teal);
  border-radius: 8px;
  background: var(--ground);
  font-family: var(--serif);
  font-size: .97rem;
  line-height: 1.55;
  color: var(--ink-soft);
}

/* ── step navigation (built by estimator.js) ─────────── */
.estimator-step-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .8rem;
  margin-top: 1.5rem;
}
.estimator-step-nav > :only-child[data-nav-kind="next"] {
  margin-left: auto;
}
.estimator-nav-button {
  display: inline-flex;
  align-items: center;
  padding: .75rem 1.4rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  font-family: var(--display);
  font-weight: 600;
  font-size: .76rem;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease);
}
.estimator-nav-button[data-nav-kind="next"] {
  border-color: var(--teal);
  background: var(--teal);
  color: var(--band);
}
.estimator-nav-button[data-nav-kind="next"]:hover,
.estimator-nav-button[data-nav-kind="next"]:focus-visible {
  border-color: var(--teal-bright);
  background: var(--teal-bright);
}
.estimator-nav-button[data-nav-kind="back"]:hover,
.estimator-nav-button[data-nav-kind="back"]:focus-visible,
.estimate-gate-restart:hover,
.estimate-gate-restart:focus-visible {
  border-color: var(--teal-deep);
  color: var(--teal-deep);
}

/* ── gate card actions: printable estimate first, Start over beside it ── */
.estimate-gate-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: .8rem;
}
/* Start over stays above the lead form once the card is opened. */
.estimate-gate-actions + .estimate-gate-form {
  margin-top: 1.25rem;
}
/* lead-gate.css .contact-btn padding, so the two buttons match when they stack on phones */
.estimate-gate-restart {
  justify-content: center;
  padding: .8rem 1.5rem;
}

/* ── result ──────────────────────────────────────────── */
.estimate-range {
  margin: 1rem 0 1.5rem;
  padding: 1.5rem;
  border-radius: 10px;
  background: var(--band);
  color: #fff;
  text-align: center;
}
.estimate-range-label {
  margin: 0;
  font-family: var(--display);
  font-size: .72rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--teal-bright);
}
.estimate-range-figure {
  margin: .35rem 0;
  font-family: var(--display);
  font-stretch: 112%;
  font-weight: 800;
  font-size: clamp(1.75rem, 5vw, 2.6rem);
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}
.estimate-range-typical,
.estimate-status {
  margin: 0;
  font-family: var(--serif);
  font-size: .95rem;
  color: rgba(255, 255, 255, .78);
}
.estimate-status:empty,
.estimate-range-typical:empty {
  display: none;
}
.estimate-quote-only-reason {
  max-width: 36rem;
  margin: .5rem auto 0;
  font-family: var(--serif);
  font-size: 1rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, .88);
}
.estimate-range-note {
  margin: .75rem 0 0;
  padding-top: .75rem;
  border-top: 1px solid rgba(255, 255, 255, .18);
  font-family: var(--serif);
  font-size: .95rem;
  color: var(--teal-bright);
}
.estimate-result[data-state="loading"] .estimate-range-figure {
  opacity: .55;
}
.estimate-result[data-state="error"] .estimate-status {
  color: #ffd4d8;
}
.estimate-flags {
  margin: 0 0 1.25rem;
  padding: .9rem 1.1rem .9rem 2rem;
  border-left: 4px solid #b02a37;
  border-radius: 8px;
  background: #fdf2f3;
  font-family: var(--serif);
  color: #8a222c;
}
.estimate-section-title {
  margin: 1.75rem 0 .75rem;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--ink);
}
.estimate-breakdown {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.estimate-line {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: .6rem 1rem;
  border-bottom: 1px solid var(--line);
  font-family: var(--serif);
  font-size: .97rem;
  color: var(--ink-soft);
}
.estimate-line:last-child {
  border-bottom: 0;
}
.estimate-line-amount {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.estimate-line[data-kind="subtotal"] {
  background: var(--ground);
  font-weight: 600;
  color: var(--ink);
}
.estimate-line[data-kind="total"] {
  background: var(--teal-tint);
  font-family: var(--display);
  font-weight: 700;
  color: var(--ink);
}
.estimate-list {
  margin: 0;
  padding-left: 1.25rem;
  font-family: var(--serif);
  font-size: .97rem;
  line-height: 1.6;
  color: var(--ink-soft);
}
.estimate-disclaimer {
  margin: 1.75rem 0 0;
  padding: 1rem 1.1rem;
  border-left: 4px solid var(--teal);
  border-radius: 8px;
  background: var(--ground);
  font-family: var(--serif);
  font-size: .95rem;
  line-height: 1.55;
  color: var(--ink-soft);
}

/* ── benchmarks (optional per-trade partial after the result) ── */
.estimate-benchmarks {
  margin-top: 1.25rem;
  padding: clamp(1.25rem, 3vw, 2rem);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
}
.estimate-benchmarks-title {
  margin: 0 0 .5rem;
  padding-bottom: .65rem;
  border-bottom: 2px solid var(--teal);
  font-family: var(--display);
  font-stretch: 112%;
  font-weight: 800;
  font-size: clamp(1.15rem, 2vw, 1.4rem);
  color: var(--ink);
}
.benchmark-group {
  margin-bottom: 1.25rem;
}
.benchmark-heading {
  margin: 1.25rem 0 .5rem;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--ink);
}
.benchmark-text {
  margin: 0 0 .75rem;
  font-family: var(--serif);
  font-size: .97rem;
  line-height: 1.6;
  color: var(--ink-soft);
}
.benchmark-our-estimate {
  padding: .85rem 1rem;
  border-left: 4px solid var(--teal);
  border-radius: 8px;
  background: var(--ground);
  color: var(--ink);
}
.benchmark-sources {
  margin: 0;
  padding-left: 1.25rem;
  font-family: var(--serif);
  font-size: .9rem;
  line-height: 1.55;
  color: var(--muted);
}
.benchmark-sources li {
  margin-bottom: .35rem;
}
.benchmark-sources a {
  color: var(--teal-deep);
  overflow-wrap: anywhere;
}

@media (max-width: 560px) {
  .estimator-progress-label {
    display: none;
  }
  .estimator-step-nav {
    flex-direction: column-reverse;
  }
  .estimator-step-nav > :only-child[data-nav-kind="next"] {
    margin-left: 0;
  }
  .estimator-nav-button {
    justify-content: center;
  }
  /* lead-gate.css makes the printable button full width here; Start over stacks under it */
  .estimate-gate-restart {
    width: 100%;
  }
}
@media (prefers-reduced-motion: reduce) {
  .estimator-progress-number,
  .option-card,
  .estimator-nav-button {
    transition: none;
  }
}
