/* Price estimator (/estimate/), on top of site.css, sections.css and service.css.
   Both themes come from the site.css tokens; the result card is a carbon band in either theme. */

.est-hero { padding-bottom: clamp(36px, 5vw, 64px); }
.est-title { max-width: 18ch; }

.est-main { padding-block: clamp(36px, 5vw, 64px) clamp(56px, 8vw, 104px); }
.est-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: clamp(24px, 4vw, 56px); align-items: start; }

/* the inputs */
.est-form { display: grid; background: var(--surface); border: 1px solid var(--border); border-radius: calc(var(--r) * 2); box-shadow: var(--shadow); min-width: 0; }
.est-step { margin: 0; padding: clamp(20px, 3vw, 30px); border: 0; border-bottom: 1px dashed var(--border); min-width: 0; }
.est-step legend { float: left; width: 100%; display: flex; align-items: baseline; gap: 12px; margin-bottom: 16px; padding: 0; font: 700 1.2rem/1.2 var(--font-display); letter-spacing: -.01em; }
.est-step legend + * { clear: both; }
.est-num { font: 500 .74rem/1 var(--font-mono); letter-spacing: .12em; color: var(--accent-text); }
.est-submit { justify-self: start; margin: clamp(20px, 3vw, 30px); }

.est-products { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.est-product { position: relative; display: flex; align-items: center; gap: 14px; padding: 16px; border: 1px solid var(--border); border-radius: var(--r); background: var(--bg); cursor: pointer; transition: border-color .2s, background .2s; min-width: 0; }
.est-product:hover { border-color: var(--fg); }
.est-product input, .est-unit input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.est-product:has(input:checked) { border-color: var(--fg); box-shadow: inset 0 0 0 1px var(--fg); background: var(--surface); }
.est-product:has(input:focus-visible), .est-unit:has(input:focus-visible), .est-extra:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.est-product .tile-icon { grid-template-columns: repeat(3, 9px); gap: 3px; flex: none; }
.est-product .tile-icon i { width: 9px; height: 9px; border-radius: 2px; }
.est-product-text { display: grid; gap: 2px; min-width: 0; }
.est-product-name { font: 700 1rem/1.25 var(--font-display); }
.est-product-price { font-size: .8rem; color: var(--muted); }

.est-area { display: flex; align-items: stretch; gap: 10px; flex-wrap: wrap; }
.est-area input[type="text"] { flex: 1 1 200px; min-width: 0; font: 700 clamp(1.4rem, 2.6vw, 1.8rem)/1.2 var(--font-display); letter-spacing: -.01em; color: var(--fg); background: var(--bg); border: 1px solid var(--border); border-radius: var(--r); padding: 12px 16px; font-variant-numeric: tabular-nums; }
.est-area input[type="text"]::placeholder { color: var(--muted); opacity: .7; font-weight: 500; }
.est-area input[type="text"]:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgb(226 85 59 / .22); }
.est-area.has-error input[type="text"] { border-color: var(--error); }
.est-units { display: inline-flex; padding: 4px; border: 1px solid var(--border); border-radius: 999px; background: var(--bg); align-self: center; }
.est-unit { position: relative; cursor: pointer; }
.est-unit span { display: block; padding: 10px 16px; border-radius: 999px; font: 500 .9rem/1 var(--font-body); color: var(--muted); transition: background .2s, color .2s; }
.est-unit:has(input:checked) span { background: var(--fg); color: var(--bg); }
.est-hint { margin: 12px 0 0; }
.est-field-error { margin-top: 10px; }

.est-extras { display: grid; gap: 8px; }
.est-extras[hidden] { display: none; }
.est-extra { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 14px 16px; border: 1px dashed var(--border); border-radius: var(--r); background: var(--bg); cursor: pointer; transition: border-color .2s; }
.est-extra:hover, .est-extra:has(input:checked) { border-color: var(--fg); border-style: solid; }
.est-extra input { width: 18px; height: 18px; margin: 3px 0 0; accent-color: var(--laterite-deep); }
.est-extra-text { display: grid; gap: 2px; min-width: 0; }
.est-extra-name { font-weight: 600; }
.est-extra-rate { color: var(--muted); white-space: nowrap; padding-top: 2px; }
.est-none { margin: 0; }

/* the result: a carbon band in both themes, so the tokens are redefined for what sits inside it */
.est-result { position: sticky; top: 96px; min-width: 0; scroll-margin-top: 88px; }
.est-card { --bg: var(--band-bg); --fg: var(--band-fg); --muted: var(--band-muted); --border: var(--band-border); --surface: transparent;
  --accent-text: color-mix(in srgb, var(--laterite) 65%, var(--paper)); --error: var(--accent-text); --tile-off: var(--band-border); --tile-on: var(--band-muted);
  display: grid; gap: 16px; padding: clamp(22px, 3vw, 32px); background: var(--band-bg); color: var(--fg); border-radius: calc(var(--r) * 2); box-shadow: var(--shadow); min-width: 0;
  background-image: linear-gradient(color-mix(in srgb, var(--band-border) 55%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--band-border) 55%, transparent) 1px, transparent 1px);
  background-size: 32px 32px; background-position: -1px -1px; }
.est-card p { margin: 0; }
.est-range { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; font: 800 clamp(1.7rem, 3.2vw, 2.5rem)/1.08 var(--font-display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.est-to { font: 500 .8rem/1 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.est-amount { white-space: nowrap; }
.est-for { color: var(--muted); }
.est-for b { color: var(--fg); font-weight: 600; }
.est-sums { display: grid; margin: 4px 0 0; border-top: 1px solid var(--border); }
.est-sums > div { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 4px 16px; padding: 10px 0; border-bottom: 1px dashed var(--border); }
.est-sums dt { color: var(--muted); font-size: .92rem; }
.est-sums dd { margin: 0; font-size: .92rem; font-variant-numeric: tabular-nums; text-align: right; }
.est-sums .est-total dt, .est-sums .est-total dd { color: var(--fg); font-weight: 600; }

.est-breakdown summary { cursor: pointer; font-weight: 600; font-size: .92rem; color: var(--accent-text); list-style-position: inside; }
.est-breakdown summary:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 3px; }
.est-breakdown[open] summary { margin-bottom: 12px; }
.est-table-wrap { border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; }
.est-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.est-table th { font: 500 .7rem/1.2 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--fg); }
.est-table td { padding: 10px 14px; border-bottom: 1px dashed var(--border); vertical-align: top; }
.est-table tbody tr:last-child td { border-bottom: 0; }
.est-table tfoot td { border-top: 1px solid var(--fg); border-bottom: 0; font-weight: 600; }
.est-table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.est-line-name { font-weight: 600; }
.est-line-sub { display: block; margin-top: 2px; font-size: .76rem; color: var(--muted); }
.est-tag { display: inline-block; padding: 1px 7px; border: 1px solid var(--accent-text); border-radius: 999px; font-size: .66rem; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-text); vertical-align: 1px; }
.est-band { margin-top: 10px !important; }
.est-disclaimer { padding: 12px 14px; border-left: 3px solid var(--accent); background: color-mix(in srgb, var(--band-fg) 6%, transparent); font-size: .9rem; color: var(--fg); }
.est-ask { justify-self: start; }
.est-motif { margin: 6px 0 4px; }
.est-wait { font: 700 1.3rem/1.25 var(--font-display); }
.est-limit { color: var(--error); }
.est-card .errorlist { color: var(--error); }

.est-empty { display: grid; justify-items: start; gap: 12px; max-width: 560px; padding: clamp(24px, 4vw, 40px); background: var(--surface); border: 1px solid var(--border); border-radius: calc(var(--r) * 2); }
.est-empty p { margin: 0; }

.est-proposal { padding-top: clamp(56px, 8vw, 96px); border-top: 1px solid var(--border); scroll-margin-top: 72px; }
.est-proposal[hidden] { display: none; }
.est-sends { margin-top: 24px; }

@media (max-width: 960px) {
  .est-grid { grid-template-columns: 1fr; }
  .est-result { position: static; }
}
@media (max-width: 560px) {
  .est-products { grid-template-columns: 1fr; }
  .est-extra { grid-template-columns: auto minmax(0, 1fr); }
  .est-extra-rate { grid-column: 2; padding-top: 0; }
  .est-units { align-self: flex-start; }
  .est-submit { justify-self: stretch; justify-content: center; }
  .est-table th, .est-table td { padding: 10px; }
}
