/* Construction cost planner — styled to the Excello design system (uses app.css tokens). */

.planner { display: grid; gap: 22px; }
.planner__bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 12px; letter-spacing: .04em; color: var(--muted); }
.planner__step { font-weight: 700; color: var(--ink); text-transform: uppercase; letter-spacing: .14em; }
.planner__section { color: var(--terra); font-weight: 600; }
.planner__pct { margin-left: auto; font-variant-numeric: tabular-nums; }
.planner__track { flex: 1 1 100%; height: 3px; background: var(--line); border-radius: 3px; overflow: hidden; }
.planner__track i { display: block; height: 100%; width: 17%; background: var(--terra); transition: width 360ms var(--ease); }

.planner__panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-card); padding: clamp(20px, 3vw, 40px); }

.pstep { display: none; }
.pstep.is-active { display: block; animation: pfade 360ms var(--ease) both; }
@media (prefers-reduced-motion: reduce) { .pstep.is-active { animation: none; } }
@keyframes pfade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.pkick { font-size: 12px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--terra); }
.phead { margin: 10px 0 24px; display: grid; gap: 8px; }
.ptitle { font-size: clamp(24px, 3.2vw, 38px); line-height: 1.08; letter-spacing: -.02em; font-weight: 600; }
.pnote { color: var(--muted); max-width: 64ch; }
.pcard-label { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 700; }

/* step 1 — project cards */
.pcards { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 620px) { .pcards { grid-template-columns: 1fr 1fr; } }
.pcard { position: relative; text-align: left; display: grid; gap: 4px; padding: 20px; border: 1px solid var(--line);
  border-radius: 16px; background: #fff; transition: border-color var(--t2) var(--ease), transform var(--t2) var(--ease), box-shadow var(--t2) var(--ease); }
.pcard:hover { transform: translateY(-3px); box-shadow: 0 16px 36px rgba(23,29,25,.10); }
.pcard.is-active { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink) inset; }
.pcard__num { font-size: 12px; font-weight: 700; color: var(--terra); letter-spacing: .08em; }
.pcard__corner { position: absolute; top: 16px; right: 18px; font-size: 11px; font-weight: 700; letter-spacing: .08em; color: var(--muted); text-transform: uppercase; }
.pcard__check { font-size: 16px; color: var(--terra); line-height: 1; }
.pcard__title { font-size: 19px; font-weight: 600; }
.pcard__sub { font-size: 14px; color: var(--muted); }
.pcard--green.is-active, .pcard--link:hover { border-color: var(--terra); }

/* step 2 — finishes */
.pfinishes { display: grid; gap: 12px; }
.pfin { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 16px; text-align: left;
  padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px; background: #fff; transition: border-color var(--t2) var(--ease), box-shadow var(--t2) var(--ease); }
.pfin:hover { border-color: color-mix(in srgb, var(--ink) 30%, var(--line)); }
.pfin.is-active { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink) inset; }
.pfin.is-pending { opacity: .55; cursor: not-allowed; }
.pfin__num { font-size: 12px; font-weight: 700; color: var(--terra); }
.pfin__body { display: grid; gap: 2px; }
.pfin__title { font-weight: 600; font-size: 16px; }
.pfin__desc { font-size: 13.5px; color: var(--muted); }
.pfin__rate { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pfin__tick { color: var(--terra); font-weight: 700; width: 1em; }

/* step 3 — site */
.psite { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 620px) { .psite { grid-template-columns: 1fr 1fr; } }
.psite__card { border: 1px solid var(--line); border-radius: 14px; padding: 18px; background: #fff; }
.pland { font-size: 34px; font-weight: 600; letter-spacing: -.02em; margin: 8px 0 12px; }
.pland small { font-size: 14px; color: var(--muted); font-weight: 500; }
.psite__card input[type=range] { width: 100%; accent-color: var(--terra); }
.pland__scale { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 6px; }
.pfloors { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.pfloor-btn { width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 10px; font-weight: 600; background: #fff; transition: all var(--t2) var(--ease); }
.pfloor-btn.is-active { background: var(--ink); color: var(--inverse); border-color: var(--ink); }
.proof { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.proof__btn { padding: 10px 14px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; font-weight: 500; background: #fff; transition: all var(--t2) var(--ease); }
.proof__btn.is-active { background: var(--ink); color: var(--inverse); border-color: var(--ink); }
.psite__strip { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; margin-top: 16px; padding: 16px 0 0; border-top: 1px solid var(--line); }
.psite__strip strong { display: block; font-size: 20px; font-weight: 600; margin-top: 4px; }

/* step 4 — rooms */
.pfloor-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.pfloor-tab { padding: 9px 14px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; font-weight: 500; background: #fff; }
.pfloor-tab.is-active { background: var(--ink); color: var(--inverse); border-color: var(--ink); }
.prooms { display: grid; gap: 10px; }
.proom { display: grid; grid-template-columns: 1.4fr auto auto auto; gap: 12px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.proom__type { min-height: 42px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; background: #fff; }
.proom__sizes { display: flex; gap: 4px; }
.proom__size { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 12.5px; background: #fff; }
.proom__size.is-active { background: var(--ink); color: var(--inverse); border-color: var(--ink); }
.proom__stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.proom__btn { width: 34px; height: 40px; font-size: 16px; background: #fff; }
.proom__qty { width: 48px; height: 40px; border: 0; border-inline: 1px solid var(--line); text-align: center; font: inherit; }
.proom__rm { width: 36px; height: 36px; border-radius: 8px; color: var(--muted); font-size: 18px; }
.proom__rm:hover { color: #a3341f; }
.proom-add { margin-top: 12px; padding: 10px 16px; border: 1px dashed var(--line); border-radius: 10px; font-weight: 600; color: var(--terra); background: #fff; }
.prooms__total { margin-top: 16px; font-size: 14px; color: var(--muted); }
.prooms__total strong { color: var(--ink); font-size: 16px; }

/* step 5 — materials */
.pmaterials { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 620px) { .pmaterials { grid-template-columns: 1fr 1fr; } }
.pmat { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.pmat__label { font-weight: 600; flex: 1; }
.pmat__select { min-height: 42px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; background: #fff; }
.pmat__toggle input { width: 20px; height: 20px; accent-color: var(--terra); }

/* estimate */
.pest { display: grid; gap: 18px; }
.pest__cost { display: grid; gap: 6px; }
.pest__eyebrow { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--terra); font-weight: 700; }
.pest__big { font-size: clamp(36px, 6vw, 60px); line-height: 1; letter-spacing: -.03em; font-weight: 600; }
.pest__range { color: var(--muted); font-size: 15px; }
.pest__kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.pest__kpi { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; background: #fff; }
.pest__kpi span { font-size: 12px; color: var(--muted); display: block; }
.pest__kpi strong { font-size: 18px; font-weight: 600; }
.pest__card { border: 1px solid var(--line); border-radius: 14px; padding: 18px; background: #fff; }
.pest__h { font-size: 18px; font-weight: 600; margin: 4px 0 10px; }
.pest__rows { display: grid; gap: 8px; }
.pest__row { display: flex; justify-content: space-between; gap: 16px; font-size: 14.5px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.pest__row:last-child { border-bottom: 0; }
.pest__row span:last-child { font-weight: 600; font-variant-numeric: tabular-nums; }
.pest__important { font-size: 13px; color: var(--muted); background: #f7f6ee; border: 1px solid var(--line); border-left: 3px solid var(--terra); border-radius: var(--r); padding: 14px 16px; }
.pest__plan { background: var(--olive); color: var(--inverse); border-radius: var(--r-card); padding: 22px; display: grid; gap: 10px; }
.pest__plan .pest__eyebrow { color: #e6c3ab; }
.pest__plan-head { font-size: clamp(20px, 3vw, 28px); font-weight: 600; letter-spacing: -.01em; }
.pest__plan-text { color: #d7ddd7; max-width: 56ch; }
.pest__phone { font-size: 20px; font-weight: 600; color: var(--inverse); text-decoration: underline; text-underline-offset: 3px; }

.pest-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.psend { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line); }

/* nav */
.planner__nav { display: flex; align-items: center; gap: 12px; margin-top: 4px; }
.pnav-back, .pnav-save { padding: 10px 16px; border: 1px solid var(--line); border-radius: var(--r); font-weight: 600; font-size: 13px; background: #fff; }
.pnav-back[disabled] { opacity: .4; cursor: default; }
.pnav-save { margin-left: auto; }
.planner__foot { margin-top: 12px; font-size: 12.5px; color: var(--muted); }

.ptoast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: var(--inverse); padding: 12px 20px; border-radius: 10px; font-size: 13px; z-index: 80; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.ptoast[hidden] { display: none; }

@media (max-width: 560px) {
  .pfin { grid-template-columns: auto 1fr; }
  .pfin__rate { grid-column: 2; }
  .proom { grid-template-columns: 1fr; }
  .psite__strip { grid-template-columns: 1fr; }
}
/* ---- print / save-as-PDF: a clean branded estimate sheet ---- */
.printonly { display: none !important; }
.pest__doc { justify-content: space-between; align-items: flex-end; gap: 16px;
  padding-bottom: 14px; margin-bottom: 20px; border-bottom: 2px solid var(--ink); }
.pest__doc-brand { display: grid; gap: 2px; }
.pest__doc-brand strong { font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.pest__doc-brand span { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--terra); font-weight: 700; }
.pest__doc-meta { display: grid; gap: 2px; text-align: right; font-size: 11px; color: var(--muted); }
.pest__doc-foot { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin-top: 20px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 10.5px; color: var(--muted); }

@media print {
  @page { size: A4; margin: 16mm 14mm; }
  html, body { background: #fff !important; }
  /* Print ONLY the estimate: hide everything, reveal the estimate, lift to top.
     Robust against whatever the site header/footer markup happens to be. */
  body * { visibility: hidden !important; }
  #estimate, #estimate * { visibility: visible !important; }
  #estimate { position: absolute !important; left: 0; top: 0; width: 100%; margin: 0 !important; padding: 0 !important; }
  .printonly { display: flex !important; }
  .pest__doc { display: flex !important; }
  .pest__doc-foot { display: flex !important; }
  .pest { gap: 14px; color: #000; }
  .pest__big { font-size: 34px; }
  .pest__plan { background: #fff !important; color: #000 !important; border: 1px solid var(--line); padding: 14px; }
  .pest__plan .pest__eyebrow { color: var(--terra) !important; }
  .pest__plan-text, .pest__range, .pest__kpi span { color: #333 !important; }
  .pest__phone { color: #000 !important; }
  .pest__card, .pest__kpi, .pest__important { border-color: #ccc !important; break-inside: avoid; }
  .pest__big, .pest__cost { break-after: avoid; }
}
