/* =========================================================
   Estimate calculator: uses tokens from styles.css
   ========================================================= */
.calc-page { background: var(--cream); min-height: 100vh; }
body.calc-page { padding-top: calc(var(--header-h) + 4px); } /* header + progress bar */
.calc-header { justify-content: space-between; }
.calc-progress { height: 4px; background: rgba(255,255,255,.08); }
#calc-progress-bar { height: 100%; width: 0; background: var(--orange); transition: width .35s ease; }

.calc-main { padding: 40px 16px 80px; }
.calc { max-width: 600px; margin: 0 auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.calc-back {
  display: inline-flex; align-items: center; gap: 6px;
  background: none; border: 0; padding: 4px 0; margin-bottom: 14px; cursor: pointer;
  font: 600 14px var(--font); color: var(--muted);
}
.calc-back:hover { color: var(--orange-dark); }
.calc-back .icon { width: 16px; height: 16px; }

.calc-q { font-size: clamp(26px, 4.6vw, 34px); font-weight: 900; letter-spacing: -0.02em; line-height: 1.15; }
.calc-sub { margin-top: 8px; color: var(--muted); font-size: 16px; }
.calc-step > .calc-q + * { margin-top: 26px; }
.calc-step > .calc-sub + * { margin-top: 22px; }

.calc-error { margin-top: 14px; color: #b42318; font-weight: 600; font-size: 15px; }
.calc-hint { margin-top: 12px; color: var(--muted); font-size: 14.5px; }
.calc-hint.center { text-align: center; }
.calc-continue { width: 100%; margin-top: 24px; }

/* ---------- Option cards ---------- */
.opt-list { display: grid; gap: 12px; }
.opt-grid { grid-template-columns: repeat(3, 1fr); }
.opt {
  display: flex; align-items: center; gap: 14px; width: 100%;
  padding: 16px 18px; text-align: left; cursor: pointer;
  background: #fff; border: 1.5px solid var(--line); border-radius: 14px;
  font: inherit; color: var(--text);
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.opt:hover { border-color: #d6c9b8; box-shadow: 0 4px 14px rgba(0,0,0,.05); }
.opt.is-selected { border-color: var(--orange); background: #fff6f0; box-shadow: 0 0 0 3px rgba(232,96,28,.12); }
.opt-text { display: flex; flex-direction: column; min-width: 0; }
.opt-text strong { font-size: 16.5px; font-weight: 700; }
.opt-text small { font-size: 14px; color: var(--muted); margin-top: 2px; }
.opt-center { justify-content: center; text-align: center; }
.opt-center .opt-text strong { font-size: 18px; }

.opt-radio {
  width: 22px; height: 22px; border-radius: 50%; flex: none;
  border: 2px solid #cfc6b8; transition: border .15s;
}
.opt.is-selected .opt-radio { border: 7px solid var(--orange); }
.opt-check {
  width: 22px; height: 22px; border-radius: 6px; flex: none;
  display: grid; place-items: center;
  border: 2px solid #cfc6b8; color: transparent; transition: background .15s, border-color .15s;
}
.opt-check .icon { width: 14px; height: 14px; stroke-width: 3; }
.is-selected .opt-check { background: var(--orange); border-color: var(--orange); color: #fff; }

.opt-icon {
  width: 44px; height: 44px; border-radius: 12px; flex: none;
  display: grid; place-items: center;
  background: var(--orange-soft); color: var(--orange);
}
.opt-icon .icon { width: 24px; height: 24px; }

/* house-size grid cards */
.opt-grid .opt { flex-direction: column; justify-content: flex-end; text-align: center; gap: 10px; padding: 18px 10px; min-height: 150px; }
.opt-grid .opt-text { align-items: center; }
.opt-house { height: 64px; display: flex; align-items: flex-end; justify-content: center; color: var(--orange); }
.opt-house .icon { width: calc(64px * var(--s)); height: calc(64px * var(--s)); stroke-width: 1.6; }

/* yes / no */
.yesno { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.yesno .opt { padding: 22px; }

/* ---------- Room counters ---------- */
.counter-list { display: grid; gap: 10px; }
.counter-row {
  display: flex; align-items: center; gap: 10px;
  background: #fff; border: 1.5px solid var(--line); border-radius: 14px;
  padding-right: 12px; transition: border-color .15s, background .15s;
}
.counter-row.is-selected { border-color: var(--orange); background: #fff6f0; }
.counter-toggle {
  flex: 1; display: flex; align-items: center; gap: 14px;
  background: none; border: 0; padding: 12px 6px 12px 18px; cursor: pointer;
  font: inherit; color: var(--text); text-align: left;
}
.counter-toggle strong { font-size: 16.5px; font-weight: 700; }
.counter-toggle .opt-icon { width: 38px; height: 38px; border-radius: 10px; }
.counter-toggle .opt-icon .icon { width: 21px; height: 21px; }
.counter-summary {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin-top: 16px; padding: 14px 18px; border-radius: 12px;
  background: var(--ink); color: #fff; font-size: 15px;
}
.counter-summary span:last-child { color: var(--muted-dark); }

/* ---------- Stepper ---------- */
.stepper { display: inline-flex; align-items: center; gap: 4px; }
.stepper button {
  display: grid; place-items: center; cursor: pointer;
  background: #fff; border: 1.5px solid var(--line); color: var(--ink);
  transition: border-color .15s, color .15s;
}
.stepper button:hover:not(:disabled) { border-color: var(--orange); color: var(--orange); }
.stepper button:disabled { opacity: .35; cursor: default; }
.stepper-sm button { width: 34px; height: 34px; border-radius: 9px; }
.stepper-sm .icon { width: 16px; height: 16px; }
.stepper-val { min-width: 30px; text-align: center; font-weight: 800; font-size: 17px; }
.stepper-lg { display: flex; justify-content: center; gap: 14px; }
.stepper-lg button { width: 60px; height: 60px; border-radius: 14px; }
.stepper-input {
  width: 120px; height: 60px; text-align: center;
  font: 800 28px var(--font); color: var(--ink);
  border: 1.5px solid var(--line); border-radius: 14px; background: #fff;
  -moz-appearance: textfield;
}
.stepper-input::-webkit-outer-spin-button, .stepper-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper-input:focus, .calc-input:focus, .calc-select:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px rgba(232,96,28,.15); }

/* ---------- Select / input ---------- */
.select-wrap { display: block; position: relative; }
.select-wrap::after {
  content: ""; position: absolute; right: 20px; top: 50%; width: 10px; height: 10px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: translateY(-70%) rotate(45deg); pointer-events: none;
}
.calc-select, .calc-input {
  width: 100%; height: 58px; padding: 0 18px;
  font: 600 17px var(--font); color: var(--ink);
  background: #fff; border: 1.5px solid var(--line); border-radius: 14px;
  appearance: none; -webkit-appearance: none;
}
.calc-input { letter-spacing: .12em; font-size: 20px; }

/* ---------- Quote ---------- */
.quote-price {
  background: var(--ink); color: #fff; border-radius: 18px; padding: 28px; text-align: center;
}
.quote-price span { display: block; font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--orange); }
.quote-price strong { display: block; margin-top: 8px; font-size: clamp(30px, 6vw, 42px); font-weight: 900; }
.quote-price.is-pending strong { font-size: 24px; }
.quote-price small { display: block; margin-top: 8px; color: var(--muted-dark); font-size: 15px; }
.quote-note {
  margin-top: 14px; padding: 14px 18px; border-radius: 12px;
  background: #fff4e5; border: 1.5px solid #f5c58b; color: #7a3d00; font-size: 15px; font-weight: 600;
}
.quote-note strong { font-weight: 800; }
.zip-note { margin-top: 12px; }
.quote-note[hidden] { display: none; }

/* Result screen is a bit wider on a computer; still one column */
.calc.is-wide { max-width: 760px; }

/* Next step: photos (main) + call / text (secondary) */
.quote-next {
  margin-top: 16px; padding: 26px 28px; text-align: center;
  background: #fff; border: 1.5px solid var(--line); border-radius: 18px;
}
.quote-next h2 { font-size: 22px; font-weight: 900; letter-spacing: -0.01em; }
.quote-next > p { margin-top: 6px; color: var(--muted); font-size: 16px; }
.quote-main { width: 100%; margin-top: 18px; }
.quote-talk {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line);
}
.quote-next > .quote-talk:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.quote-talk > span { font-weight: 700; }
.quote-phone { font-size: 17px; letter-spacing: .01em; user-select: text; -webkit-user-select: text; cursor: text; }
.quote-talk-btns { display: flex; gap: 10px; }
.quote-talk-btns .btn { padding: 10px 20px; font-size: 15px; border-width: 1.5px; }

/* Project details: closed by default, each answer can be edited on its own */
.quote-summary { margin-top: 16px; background: #fff; border: 1.5px solid var(--line); border-radius: 14px; padding: 0 20px; }
.quote-summary summary {
  display: flex; align-items: center; gap: 12px; cursor: pointer; padding: 16px 0;
  font-weight: 800; list-style: none;
}
.quote-summary summary::-webkit-details-marker { display: none; }
.quote-summary summary small { margin-left: auto; font-size: 14px; font-weight: 700; color: var(--orange-dark); }
.quote-summary summary::after {
  content: ""; width: 8px; height: 8px; flex: none; margin: 0 4px 4px 0;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(45deg); transition: transform .2s;
}
.quote-summary[open] summary::after { transform: rotate(-135deg); margin-bottom: -4px; }
.quote-summary ul { list-style: none; margin: 0 0 10px; padding: 0; }
.quote-summary li {
  display: grid; grid-template-columns: 160px 1fr auto; align-items: center; gap: 14px;
  padding: 10px 0; border-top: 1px solid var(--line); font-size: 14.5px;
}
.quote-summary li span { color: var(--muted); }
.qs-edit {
  background: none; border: 0; padding: 4px 2px; cursor: pointer;
  font: 700 14px var(--font); color: var(--orange-dark); text-decoration: underline; text-underline-offset: 3px;
}
.qs-edit:hover { color: var(--orange); }
.calc-restart {
  display: block; margin: 20px auto 0; background: none; border: 0; cursor: pointer;
  font: 600 15px var(--font); color: var(--muted); text-decoration: underline;
}
.calc-restart:hover { color: var(--orange-dark); }

/* Photos & written details form under the result */
.calc-send { max-width: 760px; margin: 48px auto 0; scroll-margin-top: calc(var(--header-h) + 40px); }
.calc-send[hidden] { display: none; }
.calc-send h2 { font-size: 26px; font-weight: 900; text-transform: uppercase; letter-spacing: -0.02em; }
.calc-send > p { margin: 10px 0 20px; color: var(--muted); font-size: 16px; }
.calc-send .project-form { box-shadow: 0 16px 40px rgba(0,0,0,.08); border: 1.5px solid var(--line); }

@media (max-width: 560px) {
  .calc-main { padding-top: 28px; }
  .opt-grid { grid-template-columns: repeat(2, 1fr); }
  .quote-next { padding: 22px 18px; }
  .quote-talk { flex-direction: column; align-items: stretch; text-align: center; }
  .quote-talk-btns .btn { flex: 1; }
  .quote-summary { padding: 0 16px; }
  .quote-summary li { grid-template-columns: 1fr auto; gap: 2px 12px; }
  .quote-summary li span { grid-column: 1; }
  .quote-summary li strong { grid-column: 1; }
  .qs-edit { grid-column: 2; grid-row: 1 / span 2; }
}
