/* ============================================================
   ProxGrid — quote tool
   Loaded after site.css; inherits its tokens.
   ============================================================ */

/* The hidden attribute must outrank every display rule in this file.
   Without this, any element given `display:` below stays on screen when
   JS sets .hidden = true — which is exactly what kept the map's loading
   panel permanently covering the map. */
[hidden] { display: none !important; }

/* ---------- Shell ---------- */
.quote-section { padding: 88px 0; border-bottom: 1px solid var(--rule); }

/* The estimator is a two-panel tool, not prose — it earns more width
   than the 1240px reading column the rest of the site uses. */
.container-wide { max-width: 1680px; }

.quote-shell {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--rule);
  border-radius: 4px;
  overflow: hidden;
  background: var(--bg);
  box-shadow: 0 2px 24px rgba(0,0,0,0.04);
}

/* ---------- Map side ---------- */
.quote-map-side {
  position: relative;
  background: var(--bg-dark);
  border-right: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
}

.quote-map-head {
  padding: 24px 32px 20px;
  border-bottom: 1px solid var(--rule-dark);
  background: var(--bg-dark);
}
.quote-map-title {
  font-size: 1.05rem; font-weight: 700; color: #fff; margin-bottom: 6px;
}
.quote-map-hint {
  font-size: 0.85rem; line-height: 1.6; color: rgba(240,244,248,0.45);
}

.quote-search-wrap { position: relative; margin-top: 16px; }
.quote-search {
  width: 100%; padding: 12px 14px 12px 40px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--r);
  color: #fff; font-family: var(--font); font-size: 0.93rem;
  outline: none; transition: border-color 0.2s, background 0.2s;
}
.quote-search::placeholder { color: rgba(255,255,255,0.3); }
.quote-search:focus { border-color: var(--blue-light); background: rgba(255,255,255,0.09); }
.quote-search-icon {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  color: rgba(255,255,255,0.35); pointer-events: none; line-height: 0;
}

.quote-map-frame { position: relative; flex: 1; min-height: 420px; }
#quoteMap { position: absolute; inset: 0; background: var(--bg-mid); }

/* Map loading / error states */
.map-state {
  position: absolute; inset: 0; z-index: 2;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 12px;
  padding: 40px; text-align: center;
  background: var(--bg-mid);
}
.map-state-title {
  font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.18em;
  text-transform: uppercase; color: rgba(255,255,255,0.3);
}
.map-state-msg { font-size: 0.88rem; line-height: 1.7; color: rgba(255,255,255,0.4); max-width: 380px; }

/* Pinned location readout */
.quote-pin {
  padding: 18px 32px;
  border-top: 1px solid var(--rule-dark);
  background: var(--bg-dark);
  display: grid; grid-template-columns: 18px 1fr; gap: 12px; align-items: start;
}
.quote-pin[hidden] { display: none; }
.quote-pin-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--blue-light); margin-top: 5px;
  box-shadow: 0 0 0 4px rgba(74,184,224,0.18);
}
.quote-pin-label {
  font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.18em;
  text-transform: uppercase; color: rgba(255,255,255,0.3); margin-bottom: 4px;
}
.quote-pin-address { font-size: 0.9rem; line-height: 1.55; color: rgba(255,255,255,0.85); }

/* ---------- Form side ---------- */
.quote-form-side {
  display: flex; flex-direction: column;
  background: var(--bg);
  background-image: var(--dots); background-size: var(--dots-size);
}
.quote-form-scroll { flex: 1; padding: 36px 40px; }

.quote-field { margin-bottom: 30px; }
.quote-field:last-child { margin-bottom: 0; }

.quote-label {
  display: block;
  font-family: var(--mono); font-size: 0.64rem;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ink-faint); margin-bottom: 12px;
}
.quote-label .req { color: var(--blue); }

.quote-help {
  font-size: 0.82rem; line-height: 1.6; color: var(--ink-faint); margin-top: 8px;
}

/* Job type radio cards */
.job-options { display: flex; flex-direction: column; gap: 10px; }
.job-option {
  display: block; position: relative; cursor: pointer;
  border: 1px solid var(--rule); border-radius: var(--r);
  background: #fff; padding: 16px 18px 16px 46px;
  transition: border-color 0.2s, background 0.2s;
}
.job-option:hover { border-color: #c4c4bd; }
.job-option input { position: absolute; opacity: 0; pointer-events: none; }
.job-option::before {
  content: ''; position: absolute; left: 18px; top: 19px;
  width: 15px; height: 15px; border-radius: 50%;
  border: 1.5px solid #c4c4bd; background: #fff;
  transition: border-color 0.2s;
}
.job-option::after {
  content: ''; position: absolute; left: 22.5px; top: 23.5px;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--blue); transform: scale(0); transition: transform 0.15s var(--ease);
}
.job-option:has(input:checked) { border-color: var(--blue); background: #f4f9fc; }
.job-option:has(input:checked)::before { border-color: var(--blue); }
.job-option:has(input:checked)::after { transform: scale(1); }
.job-option:has(input:focus-visible) { outline: 2px solid var(--blue-light); outline-offset: 2px; }
.job-option-label { font-size: 0.93rem; font-weight: 600; color: var(--ink); display: block; }
.job-option-desc { font-size: 0.82rem; line-height: 1.55; color: var(--ink-mid); margin-top: 4px; }

/* Yes/No segmented control */
.yesno { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.yesno-opt {
  position: relative; cursor: pointer; text-align: center;
  border: 1px solid var(--rule); border-radius: var(--r); background: #fff;
  padding: 13px 16px; font-size: 0.9rem; font-weight: 600; color: var(--ink-mid);
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}
.yesno-opt:hover { border-color: #c4c4bd; }
.yesno-opt input { position: absolute; opacity: 0; pointer-events: none; }
.yesno-opt:has(input:checked) { border-color: var(--blue); background: #f4f9fc; color: var(--ink); }
.yesno-opt:has(input:focus-visible) { outline: 2px solid var(--blue-light); outline-offset: 2px; }

/* Warning shown when public access = yes */
.access-warning {
  margin-top: 14px; padding: 14px 16px;
  border-left: 2px solid var(--blue);
  background: #f0f6fa; border-radius: 0 var(--r) var(--r) 0;
  font-size: 0.85rem; line-height: 1.65; color: var(--ink-mid);
}
.access-warning[hidden] { display: none; }
.access-warning strong { color: var(--ink); font-weight: 600; }

/* Inputs */
.quote-input, .quote-textarea {
  width: 100%; padding: 12px 14px;
  background: #fff; border: 1px solid var(--rule);
  border-radius: var(--r); color: var(--ink);
  font-family: var(--font); font-size: 0.93rem;
  outline: none; transition: border-color 0.2s;
}
.quote-input:focus, .quote-textarea:focus { border-color: var(--blue); }
.quote-textarea { resize: vertical; min-height: 110px; line-height: 1.6; }
.quote-input::placeholder, .quote-textarea::placeholder { color: var(--ink-faint); }

/* Checkbox */
.quote-check {
  display: flex; align-items: flex-start; gap: 12px; cursor: pointer;
  padding: 16px 18px; border: 1px solid var(--rule);
  border-radius: var(--r); background: #fff; transition: border-color 0.2s, background 0.2s;
}
.quote-check:hover { border-color: #c4c4bd; }
.quote-check input { position: absolute; opacity: 0; pointer-events: none; }
.quote-check-box {
  width: 17px; height: 17px; flex-shrink: 0; margin-top: 1px;
  border: 1.5px solid #c4c4bd; border-radius: 3px; background: #fff;
  display: flex; align-items: center; justify-content: center;
  transition: border-color 0.2s, background 0.2s;
}
.quote-check-box svg { opacity: 0; transform: scale(0.6); transition: opacity 0.15s, transform 0.15s var(--ease); }
.quote-check:has(input:checked) { border-color: var(--blue); background: #f4f9fc; }
.quote-check:has(input:checked) .quote-check-box { border-color: var(--blue); background: var(--blue); }
.quote-check:has(input:checked) .quote-check-box svg { opacity: 1; transform: scale(1); }
.quote-check:has(input:focus-visible) { outline: 2px solid var(--blue-light); outline-offset: 2px; }
.quote-check-text { font-size: 0.9rem; line-height: 1.55; color: var(--ink); }
.quote-check-sub { font-size: 0.82rem; color: var(--ink-mid); margin-top: 3px; }

/* ---------- Footer bar ---------- */
.quote-foot {
  border-top: 1px solid var(--rule);
  background: var(--bg);
  padding: 20px 40px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  margin-top: auto;
}
.quote-foot-note {
  font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--ink-faint); line-height: 1.6;
}
.quote-submit {
  padding: 15px 34px; font-size: 0.88rem;
  border: none; cursor: pointer; flex-shrink: 0;
}
.quote-submit:disabled { opacity: 0.35; cursor: not-allowed; }

.quote-error {
  font-size: 0.85rem; color: #9b1c1c; line-height: 1.5;
  padding: 12px 48px 0; font-family: var(--mono);
}
.quote-error[hidden] { display: none; }

/* ---------- Result overlay ---------- */
.result-overlay {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(9,16,28,0.75);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s var(--ease);
  overflow-y: auto;
}
.result-overlay.open { opacity: 1; pointer-events: auto; }

.result-card {
  position: relative;
  width: 100%; max-width: 520px;
  background: var(--bg); border-radius: 4px;
  overflow-x: hidden; overflow-y: auto;
  transform: translateY(14px) scale(0.985);
  transition: transform 0.35s var(--ease);
  max-height: 100%;
}
.result-overlay.open .result-card { transform: none; }

.result-head {
  padding: 28px 32px 24px;
  background: var(--bg-dark);
  border-bottom: 1px solid var(--rule-dark);
}
.result-head .eyebrow { margin-bottom: 12px; }
.result-title {
  font-size: 1.35rem; font-weight: 300; color: #fff;
  letter-spacing: -0.02em; line-height: 1.25;
}
.result-title strong { font-weight: 700; }

.result-close {
  position: absolute; top: 18px; right: 18px; z-index: 2;
  width: 32px; height: 32px; border-radius: var(--r);
  background: rgba(255,255,255,0.08); border: none; cursor: pointer;
  color: rgba(255,255,255,0.6);
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, color 0.2s;
}
.result-close:hover { background: rgba(255,255,255,0.16); color: #fff; }

/* Job summary strip */
.result-summary {
  padding: 20px 32px;
  border-bottom: 1px solid var(--rule);
  background: var(--bg-off);
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 20px;
}
.rs-item {}
.rs-label {
  font-family: var(--mono); font-size: 0.58rem; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--ink-faint); margin-bottom: 3px;
}
.rs-value { font-size: 0.88rem; color: var(--ink); font-weight: 600; line-height: 1.4; }
.rs-item.wide { grid-column: 1 / -1; }
.rs-item.wide .rs-value { font-weight: 500; font-size: 0.85rem; }

/* Price zone — blurred until revealed */
.result-price-zone { position: relative; }

.price-panel {
  padding: 32px;
  transition: filter 0.45s var(--ease), opacity 0.45s var(--ease);
}
.price-panel.blurred {
  filter: blur(11px);
  opacity: 0.55;
  user-select: none;
  pointer-events: none;
}

.price-total-label {
  font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--ink-faint); margin-bottom: 8px;
}
.price-total {
  font-size: 2.6rem; font-weight: 800; letter-spacing: -0.035em;
  color: var(--ink); line-height: 1; margin-bottom: 4px;
}
.price-gst {
  font-family: var(--mono); font-size: 0.66rem;
  letter-spacing: 0.1em; color: var(--ink-faint); text-transform: uppercase;
}

.price-lines { margin-top: 24px; border-top: 1px solid var(--rule); }
.price-line {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 11px 0; border-bottom: 1px solid var(--rule);
  font-size: 0.86rem;
}
.price-line-label { color: var(--ink-mid); }
.price-line-amt { font-family: var(--mono); color: var(--ink); font-weight: 500; white-space: nowrap; }

.price-meta {
  margin-top: 20px; font-size: 0.78rem; line-height: 1.7; color: var(--ink-faint);
}
.price-ref {
  font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.12em;
  color: var(--ink-mid); margin-top: 14px;
}

/* Gate form sitting over the blur */
.gate {
  position: absolute; inset: 0; z-index: 2;
  display: flex; flex-direction: column; justify-content: center;
  padding: 28px 32px;
  background: linear-gradient(180deg, rgba(249,249,247,0.55) 0%, rgba(249,249,247,0.88) 45%, rgba(249,249,247,0.97) 100%);
}
.gate[hidden] { display: none; }

/* No price teaser to sit over (prices not shown yet): the form takes
   its own place in the card instead of overlaying the summary */
.price-panel[hidden] + .gate { position: static; background: none; }
.gate-title { font-size: 1.05rem; font-weight: 700; color: var(--ink); margin-bottom: 6px; }
.gate-sub { font-size: 0.86rem; line-height: 1.6; color: var(--ink-mid); margin-bottom: 20px; }

.gate-fields { display: flex; flex-direction: column; gap: 12px; }
.gate-field { display: flex; flex-direction: column; gap: 5px; }
.gate-field label {
  font-family: var(--mono); font-size: 0.6rem;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-faint);
}
.gate-field input {
  padding: 11px 13px; background: #fff;
  border: 1px solid var(--rule); border-radius: var(--r);
  font-family: var(--font); font-size: 0.92rem; color: var(--ink);
  outline: none; transition: border-color 0.2s;
}
.gate-field input:focus { border-color: var(--blue); }

.gate-submit { width: 100%; justify-content: center; margin-top: 16px; border: none; cursor: pointer; }
.gate-submit:disabled { opacity: 0.4; cursor: not-allowed; }

.gate-error {
  font-size: 0.82rem; color: #9b1c1c; margin-top: 10px;
  font-family: var(--mono); line-height: 1.5;
}
.gate-error[hidden] { display: none; }

.gate-privacy {
  font-size: 0.74rem; line-height: 1.6; color: var(--ink-faint); margin-top: 14px;
}
.gate-privacy a { color: var(--blue); }

/* Manual-review result */
.manual-panel { padding: 32px; }
.manual-icon { color: var(--blue); margin-bottom: 18px; }
.manual-title { font-size: 1.15rem; font-weight: 700; color: var(--ink); margin-bottom: 12px; }
.manual-body { font-size: 0.9rem; line-height: 1.75; color: var(--ink-mid); margin-bottom: 14px; }
.manual-reason {
  padding: 14px 16px; background: var(--bg-off);
  border-left: 2px solid var(--blue); border-radius: 0 var(--r) var(--r) 0;
  font-size: 0.85rem; line-height: 1.6; color: var(--ink-mid); margin-bottom: 18px;
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .quote-shell { grid-template-columns: 1fr; min-height: 0; }
  .quote-map-side { border-right: none; border-bottom: 1px solid var(--rule); }
  #quoteMap { min-height: 340px; }
  .quote-foot { position: static; }
}

@media (max-width: 768px) {
  .quote-map-head { padding: 20px 24px 18px; }
  .quote-pin { padding: 16px 24px; }
  .quote-form-scroll { padding: 32px 24px; }
  .quote-foot { padding: 16px 24px; flex-direction: column; align-items: stretch; gap: 14px; }
  .quote-submit { width: 100%; justify-content: center; }
  .quote-error { padding: 12px 24px 0; }
  .result-overlay { padding: 0; align-items: flex-start; }
  .result-card { max-width: none; border-radius: 0; min-height: 100%; }
  .result-summary { grid-template-columns: 1fr; }
  .price-total { font-size: 2.1rem; }
}

/* Fallback for browsers without :has() — always show the control borders
   rather than leaving selection invisible. */
@supports not selector(:has(*)) {
  .job-option input:checked ~ .job-option-label { color: var(--blue); }
  .yesno-opt input:checked ~ span { color: var(--blue); font-weight: 700; }
}

/* ============================================================
   Page header actions
   ============================================================ */
.ph-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 36px; }

/* ============================================================
   Calendar
   ============================================================ */
.cal { position: relative; }

.cal-trigger {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px; background: #fff;
  border: 1px solid var(--rule); border-radius: var(--r);
  font-family: var(--font); font-size: 0.93rem; color: var(--ink);
  cursor: pointer; text-align: left; transition: border-color 0.2s;
}
.cal-trigger:hover { border-color: #c4c4bd; }
.cal-trigger[aria-expanded="true"] { border-color: var(--blue); }
.cal-trigger.empty { color: var(--ink-faint); }
.cal-trigger svg { flex-shrink: 0; color: var(--ink-faint); }

.cal-panel {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 20;
  border: 1px solid var(--rule); border-radius: 4px;
  background: #fff; padding: 16px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.10);
}

.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.cal-month { font-size: 0.92rem; font-weight: 700; color: var(--ink); }
.cal-nav {
  width: 30px; height: 30px; flex-shrink: 0;
  border: 1px solid var(--rule); background: #fff; border-radius: var(--r);
  cursor: pointer; color: var(--ink-mid);
  display: flex; align-items: center; justify-content: center;
  transition: border-color 0.2s, color 0.2s, opacity 0.2s;
}
.cal-nav:hover:not(:disabled) { border-color: var(--blue); color: var(--blue); }
.cal-nav:disabled { opacity: 0.28; cursor: not-allowed; }

.cal-dows { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; margin-bottom: 6px; }
.cal-dow {
  text-align: center; font-family: var(--mono); font-size: 0.56rem;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint); padding: 4px 0;
}

.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }

.cal-day {
  aspect-ratio: 1 / 1; border: none; background: none; border-radius: var(--r);
  font-family: var(--font); font-size: 0.85rem; color: var(--ink);
  cursor: pointer; position: relative;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.cal-day:hover:not(:disabled):not(.selected) { background: var(--bg-off); }
.cal-day:disabled { color: #d0d0c9; cursor: not-allowed; }
.cal-day.blank { visibility: hidden; pointer-events: none; }
/* Weekends carry a loading — surfaced here so the price isn't a surprise */
.cal-day.weekend:not(:disabled):not(.selected) { color: var(--blue); font-weight: 600; }
.cal-day.today::after {
  content: ''; position: absolute; bottom: 5px;
  width: 3px; height: 3px; border-radius: 50%; background: currentColor;
}
.cal-day.selected { background: var(--blue); color: #fff; font-weight: 700; }
.cal-day:focus-visible { outline: 2px solid var(--blue-light); outline-offset: 1px; }

.cal-foot {
  margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--rule);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.cal-legend {
  font-size: 0.72rem; color: var(--ink-faint);
  display: flex; align-items: center; gap: 7px;
}
.cal-legend i { width: 7px; height: 7px; border-radius: 50%; background: var(--blue); display: block; flex-shrink: 0; }
.cal-clear {
  background: none; border: none; cursor: pointer; padding: 4px;
  font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--ink-mid); transition: color 0.2s;
}
.cal-clear:hover { color: var(--blue); }

/* ============================================================
   Gallery
   ============================================================ */
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.gallery-item { margin: 0; }
.gallery-item img {
  width: 100%; height: 260px; object-fit: cover; display: block;
  border-radius: 3px; filter: saturate(0.85) contrast(1.04);
}
.gallery-item figcaption {
  margin-top: 12px;
  font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--ink-faint); line-height: 1.5;
}
.gallery-note {
  margin-top: 24px; text-align: center;
  font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--ink-faint); font-style: italic;
}

/* ============================================================
   Responsive overrides for the contained layout
   ============================================================ */
@media (max-width: 1024px) {
  .quote-shell { grid-template-columns: 1fr; }
  .quote-map-side { border-right: none; border-bottom: 1px solid var(--rule); }
  .quote-map-frame { min-height: 360px; }
  .gallery { grid-template-columns: 1fr 1fr; }
  .gallery-item:last-child { grid-column: 1 / -1; }
  .gallery-item:last-child img { height: 220px; }
}

@media (max-width: 768px) {
  .quote-section { padding: 56px 0; }
  .quote-form-scroll { padding: 28px 22px; }
  .quote-foot { padding: 18px 22px; }
  .quote-map-head { padding: 20px 22px 18px; }
  .quote-pin { padding: 16px 22px; }
  .quote-error { padding: 12px 22px 0; }
  .quote-map-frame { min-height: 300px; }
  .ph-actions { gap: 10px; }
  .ph-actions .btn { flex: 1; justify-content: center; min-width: 150px; }
  .gallery { grid-template-columns: 1fr; }
  .gallery-item img, .gallery-item:last-child img { height: 200px; }
}

/* ============================================================
   Address autocomplete dropdown
   Fed by /api/places (Places API New, proxied server-side).
   ============================================================ */
.ac-list {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 30;
  background: #fff; border: 1px solid var(--rule); border-radius: var(--r);
  box-shadow: 0 14px 34px rgba(0,0,0,0.22);
  max-height: 292px; overflow-y: auto;
}
.ac-item {
  display: block; width: 100%; text-align: left;
  padding: 11px 14px; border: none; background: none; cursor: pointer;
  font-family: var(--font); border-bottom: 1px solid var(--rule);
  transition: background 0.12s;
}
.ac-item:last-child { border-bottom: none; }
.ac-item:hover, .ac-item.active { background: #f0f6fa; }
.ac-primary { display: block; font-size: 0.9rem; color: var(--ink); font-weight: 600; line-height: 1.35; }
.ac-secondary { display: block; font-size: 0.78rem; color: var(--ink-mid); margin-top: 2px; line-height: 1.35; }
.ac-empty {
  padding: 14px; font-size: 0.85rem; color: var(--ink-faint); text-align: center;
}

/* ============================================================
   Callback flip card
   ============================================================ */
.flipcard { perspective: 1400px; }

.flipcard-inner {
  position: relative;
  transition: transform 0.55s var(--ease), height 0.4s var(--ease);
  transform-style: preserve-3d;
}
.flipcard.flipped .flipcard-inner { transform: rotateY(180deg); }

.flipcard-face {
  border: 1px solid var(--rule); border-radius: 4px; background: #fff;
  padding: 24px;
  -webkit-backface-visibility: hidden; backface-visibility: hidden;
}
/* The back sits on top of the front and is rotated away until flipped.
   Do NOT add overflow here — any value other than visible flattens the
   3D context, which kills backface-visibility and leaves the back face
   sitting on top of the front, unmirrored. Height is synced in JS. */
.flipcard-back {
  /* top/left/right but NOT bottom: the height must stay natural so JS can
     measure it. inset:0 would stretch it to the height JS just set, and
     the container could never grow to fit the form. */
  position: absolute; top: 0; left: 0; right: 0;
  transform: rotateY(180deg);
}

/* ---- Front ---- */
.flipcard-front { text-align: center; }
.flipcard-icon {
  width: 44px; height: 44px; margin: 0 auto 14px;
  border-radius: 50%; background: #f0f6fa; color: var(--blue);
  display: flex; align-items: center; justify-content: center;
}
.flipcard-title { font-size: 1rem; font-weight: 700; color: var(--ink); margin-bottom: 6px; }
.flipcard-sub {
  font-size: 0.86rem; line-height: 1.6; color: var(--ink-mid);
  max-width: 340px; margin: 0 auto 18px;
}
.flipcard-btn { width: 100%; justify-content: center; }
.flipcard-book { margin-top: 10px; text-decoration: none; }
.cb-alt { display: block; margin-top: 12px; text-align: center; font-size: 0.8rem; color: var(--ink-mid); text-decoration: none; }
.cb-alt:hover { color: var(--blue); text-decoration: underline; }

/* ---- Back ---- */
.flipcard-back-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; margin-bottom: 16px;
}
.flipcard-back-title { font-size: 0.95rem; font-weight: 700; color: var(--ink); }
.flipcard-cancel {
  background: none; border: none; cursor: pointer; padding: 2px;
  font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--ink-faint); transition: color 0.2s;
}
.flipcard-cancel:hover { color: var(--ink); }

.cb-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cb-field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.cb-field label {
  font-family: var(--mono); font-size: 0.6rem;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-faint);
}
.cb-field input, .cb-field select {
  padding: 11px 13px; background: #fff;
  border: 1px solid var(--rule); border-radius: var(--r);
  font-family: var(--font); font-size: 0.92rem; color: var(--ink);
  outline: none; transition: border-color 0.2s; width: 100%;
}
.cb-field input:focus, .cb-field select:focus { border-color: var(--blue); }
.cb-field select {
  cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7' viewBox='0 0 12 7'%3E%3Cpath fill='%231976b2' d='M6 7L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center;
}
.cb-submit { width: 100%; justify-content: center; margin-top: 4px; border: none; cursor: pointer; }
.cb-submit:disabled { opacity: 0.4; cursor: not-allowed; }
.cb-error {
  font-size: 0.8rem; color: #9b1c1c; margin: 4px 0 8px;
  font-family: var(--mono); line-height: 1.5;
}

/* ---- Confirmation ---- */
.cb-done { text-align: center; padding: 8px 0 4px; }
.cb-done-tick {
  width: 46px; height: 46px; margin: 0 auto 14px;
  border-radius: 50%; background: #e9f5ee; color: #1a7a4a;
  display: flex; align-items: center; justify-content: center;
}
.cb-done-title { font-size: 1rem; font-weight: 700; color: var(--ink); margin-bottom: 6px; }
.cb-done-sub { font-size: 0.88rem; line-height: 1.6; color: var(--ink-mid); }
.cb-done-ref {
  margin-top: 12px;
  font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--ink-faint);
}

@media (max-width: 480px) {
  .cb-row { grid-template-columns: 1fr; gap: 0; }
}

/* The flip is decorative; without motion just swap the faces. */
@media (prefers-reduced-motion: reduce) {
  .flipcard-inner { transition: none; }
  .flipcard.flipped .flipcard-inner { transform: none; }
  .flipcard.flipped .flipcard-front { display: none; }
  .flipcard-back { position: static; transform: none; display: none; }
  .flipcard.flipped .flipcard-back { display: block; }
}

/* ============================================================
   Job photo upload
   ============================================================ */
.dropzone {
  border: 1.5px dashed var(--rule); border-radius: 4px;
  background: #fff; padding: 26px 20px; text-align: center;
  cursor: pointer; transition: border-color 0.2s, background 0.2s;
}
.dropzone:hover { border-color: var(--blue); background: #f8fbfd; }
.dropzone:focus-visible { outline: 2px solid var(--blue-light); outline-offset: 2px; }
.dropzone.dragover {
  border-color: var(--blue); background: #eef6fb; border-style: solid;
}
.dropzone.full { opacity: 0.5; pointer-events: none; }

.dropzone-icon { color: var(--ink-faint); margin-bottom: 10px; line-height: 0; }
.dropzone:hover .dropzone-icon, .dropzone.dragover .dropzone-icon { color: var(--blue); }
.dropzone-text { font-size: 0.9rem; color: var(--ink-mid); }
.dropzone-text strong { color: var(--blue); font-weight: 700; }
.dropzone-meta {
  margin-top: 6px;
  font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--ink-faint);
}

/* Thumbnails */
.thumbs {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 10px; margin-top: 14px;
}
.thumbs:empty { display: none; }

.thumb {
  position: relative; aspect-ratio: 1 / 1;
  border-radius: 3px; overflow: hidden;
  border: 1px solid var(--rule); background: var(--bg-off);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Upload progress veil */
.thumb-progress {
  position: absolute; inset: 0;
  background: rgba(11,20,34,0.55);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.1em;
}
.thumb.done .thumb-progress { display: none; }
.thumb.failed .thumb-progress { background: rgba(155,28,28,0.75); }

.thumb-remove {
  position: absolute; top: 4px; right: 4px; z-index: 2;
  width: 22px; height: 22px; border-radius: 50%;
  border: none; cursor: pointer;
  background: rgba(11,20,34,0.72); color: #fff;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
.thumb-remove:hover { background: rgba(155,28,28,0.9); }

.upload-error {
  font-size: 0.82rem; color: #9b1c1c; margin-top: 10px;
  font-family: var(--mono); line-height: 1.5;
}


/* ============================================================
   Job type accordion

   Six flat radio buttons was a wall of choices. One collapsible
   section per category keeps the panel scannable, and each option
   carries its own notice inline rather than in a shared box.
   ============================================================ */
.job-cat { border: 1px solid var(--rule); border-radius: var(--r); background: #fff; margin-bottom: 10px; }
.job-cat:last-child { margin-bottom: 0; }
.job-cat.is-open { border-color: #c8c8c1; }

.job-cat-head {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; background: none; border: none; cursor: pointer;
  font-family: var(--font); text-align: left;
  transition: background 0.15s;
}
.job-cat-head:hover { background: var(--bg-off); }
.job-cat-head:focus-visible { outline: 2px solid var(--blue-light); outline-offset: -2px; }

.job-cat-name {
  font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--ink-mid); flex-shrink: 0;
}
/* Shows the chosen option while its section is collapsed */
.job-cat-chosen {
  flex: 1; text-align: right; font-size: 0.85rem; font-weight: 600;
  color: var(--blue); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.job-cat.is-open .job-cat-chosen { display: none; }
.job-cat-chev {
  flex-shrink: 0; color: var(--ink-faint);
  transition: transform 0.25s var(--ease);
}
.job-cat.is-open .job-cat-chev { transform: rotate(180deg); }
.job-cat:not(.is-open) .job-cat-chosen:empty + .job-cat-chev { margin-left: auto; }

.job-cat-body { display: none; padding: 0 10px 10px; }
.job-cat.is-open .job-cat-body { display: block; }

/* Options inside a section */
.job-cat .job-option { margin-bottom: 8px; }
.job-cat .job-option:last-child { margin-bottom: 0; }

/* Notice attached to the option it describes */
.job-option-notice {
  display: none;
  margin-top: 12px; padding: 12px 14px;
  border-left: 2px solid var(--ink-faint);
  background: var(--bg-off); border-radius: 0 var(--r) var(--r) 0;
  font-size: 0.83rem; line-height: 1.65; color: var(--ink-mid);
}
.job-option.is-selected .job-option-notice { display: block; }
.job-option-notice.referral { border-left-color: var(--blue); background: #eef6fb; }

/* ============================================================
   Focus guidance

   Travel from Northgate is part of every price, so the location is
   genuinely the first input — not just a preferred order. The map
   carries a focus ring and the question panel is held back until a
   pin exists; once it does, the ring moves to the questions so it is
   obvious where to look next.

   The callback card sits outside the gate on purpose: asking for a
   call back should never require setting a location first.
   ============================================================ */

.quote-map-side, .quote-form-side { position: relative; }

/* The ring is drawn on a pseudo-element so it never affects layout */
.quote-map-side::after,
.quote-form-side::after {
  content: ''; position: absolute; inset: 0;
  pointer-events: none; z-index: 9;
  box-shadow: inset 0 0 0 0 rgba(25,118,178,0);
  transition: box-shadow 0.45s var(--ease);
}
.quote-shell:not(.has-location) .quote-map-side::after {
  box-shadow: inset 0 0 0 2px var(--blue);
  animation: ringPulse 2.6s ease-in-out infinite;
}
.quote-shell.has-location .quote-form-side::after {
  box-shadow: inset 0 0 0 2px var(--blue);
}

@keyframes ringPulse {
  0%, 100% { box-shadow: inset 0 0 0 2px rgba(25,118,178,0.9); }
  50%      { box-shadow: inset 0 0 0 3px rgba(74,184,224,0.55); }
}

/* Questions are held back until there is a pin */
.form-gated,
.quote-shell:not(.has-location) .quote-foot {
  transition: filter 0.45s var(--ease), opacity 0.45s var(--ease);
}
.quote-shell:not(.has-location) .form-gated,
.quote-shell:not(.has-location) .quote-foot {
  filter: blur(3px);
  opacity: 0.45;
  pointer-events: none;
  user-select: none;
}

/* Explains the blur rather than leaving it looking broken */
.form-lock {
  position: absolute; inset: 0; z-index: 10;
  display: flex; align-items: center; justify-content: center;
  padding: 32px; text-align: center;
  background: linear-gradient(180deg, rgba(249,249,247,0.55) 0%, rgba(249,249,247,0.8) 100%);
  transition: opacity 0.4s var(--ease), visibility 0.4s;
}
.quote-shell.has-location .form-lock { opacity: 0; visibility: hidden; }

.form-lock-inner { max-width: 300px; }
.form-lock-inner svg { color: var(--blue); margin-bottom: 12px; }
.form-lock-title { font-size: 1rem; font-weight: 700; color: var(--ink); margin-bottom: 8px; }
.form-lock-sub { font-size: 0.86rem; line-height: 1.65; color: var(--ink-mid); }

/* On a stacked layout the map sits above the questions anyway, so the
   blur only adds confusion — keep the ring, drop the veil. */
@media (max-width: 1024px) {
  .quote-shell:not(.has-location) .form-gated,
  .quote-shell:not(.has-location) .quote-foot {
    filter: none; opacity: 1; pointer-events: auto; user-select: auto;
  }
  .form-lock { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .quote-shell:not(.has-location) .quote-map-side::after { animation: none; }
}

/* Date and time of day sit side by side */
.quote-when { display: grid; grid-template-columns: 1.35fr 1fr; gap: 14px; align-items: start; }
.quote-when select.quote-input {
  cursor: pointer; appearance: none; padding-right: 34px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7' viewBox='0 0 12 7'%3E%3Cpath fill='%231976b2' d='M6 7L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center;
}
@media (max-width: 520px) {
  .quote-when { grid-template-columns: 1fr; gap: 18px; }
}

/* ------------------------------------------------------------
   "Partner" tag on referral job types.

   Pinned to the top-right rather than left inline: it sits after the
   description in the DOM, so inline it would run straight on from the
   end of that sentence. The option gets matching right padding so a
   long label cannot slide underneath it.
   ------------------------------------------------------------ */
.job-option:has(.job-option-tag) { padding-right: 84px; }

.job-option-tag {
  position: absolute; top: 15px; right: 14px;
  font-family: var(--mono); font-size: 0.52rem;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-faint);
  border: 1px solid var(--rule); border-radius: 2px;
  padding: 3px 7px; background: var(--bg-off);
  white-space: nowrap; line-height: 1;
}
.job-option.is-selected .job-option-tag {
  border-color: var(--blue); color: var(--blue); background: #fff;
}

/* Without :has(), fall back to reserving the space on every option —
   harmless, and better than a tag overlapping the label. */
@supports not selector(:has(*)) {
  .job-option { padding-right: 84px; }
}

/* ============================================================
   Three-step form

   Splits the question panel into Job type → When → Details so only
   one decision is on screen at a time. The Get Price button is hidden
   until the last step, so there is never a second competing CTA.
   ============================================================ */
.steps {
  display: flex; align-items: center; gap: 0;
  list-style: none; margin: 0 0 26px; padding: 0;
}
.step { flex: 1; position: relative; }

/* Connector line between the numbered markers */
.step:not(:last-child)::after {
  content: ''; position: absolute; top: 15px; left: calc(50% + 18px); right: calc(-50% + 18px);
  height: 1.5px; background: var(--rule); transition: background 0.3s var(--ease);
}
.step.is-done:not(:last-child)::after { background: var(--blue); }

.step-btn {
  width: 100%; display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: none; border: none; padding: 0; cursor: default;
  font-family: var(--font);
}
.step.is-done .step-btn { cursor: pointer; }
.step-btn:focus-visible { outline: 2px solid var(--blue-light); outline-offset: 3px; border-radius: var(--r); }

.step-num {
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--rule); background: #fff;
  font-family: var(--mono); font-size: 0.78rem; font-weight: 500;
  color: var(--ink-faint);
  transition: border-color 0.25s, background 0.25s, color 0.25s;
  position: relative; z-index: 1;
}
.step.is-current .step-num { border-color: var(--blue); background: var(--blue); color: #fff; font-weight: 700; }
.step.is-done .step-num { border-color: var(--blue); background: #fff; color: var(--blue); }
/* Completed steps show a tick instead of the number */
.step.is-done .step-num { font-size: 0; }
.step.is-done .step-num::after {
  content: '✓'; font-family: var(--font); font-size: 0.85rem; font-weight: 700; line-height: 1;
}

.step-label {
  font-family: var(--mono); font-size: 0.56rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--ink-faint); text-align: center;
  transition: color 0.25s;
}
.step.is-current .step-label { color: var(--ink); font-weight: 600; }
.step.is-done .step-label { color: var(--blue); }

.step-panel[hidden] { display: none; }
.step-panel.is-active { animation: stepIn 0.32s var(--ease); }
@keyframes stepIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

.step-title {
  font-size: 1.08rem; font-weight: 700; color: var(--ink);
  letter-spacing: -0.015em; margin-bottom: 18px;
}

.step-nav {
  display: flex; align-items: center; gap: 12px;
  margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--rule);
}
.step-back {
  background: none; border: none; cursor: pointer; padding: 10px 4px;
  font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--ink-mid); transition: color 0.2s;
}
.step-back:hover { color: var(--ink); }
.step-next { margin-left: auto; border: none; cursor: pointer; }
.step-next:disabled { opacity: 0.35; cursor: not-allowed; }

/* Get Price only exists on the last step */
.quote-foot { display: none; }
.quote-form-side.on-last-step .quote-foot { display: flex; }

@media (max-width: 420px) {
  .step-label { font-size: 0.5rem; letter-spacing: 0.1em; }
  .step:not(:last-child)::after { left: calc(50% + 16px); right: calc(-50% + 16px); }
}

@media (prefers-reduced-motion: reduce) {
  .step-panel.is-active { animation: none; }
}

/* ------------------------------------------------------------
   Separate the step flow from the callback card.

   The card is a different offer, not the next thing in the sequence,
   so it needs real air above it — otherwise Continue and "Call me
   about this job" read as two buttons in the same flow.
   ------------------------------------------------------------ */
.form-gated { margin-bottom: 38px; }

.step-nav { margin-top: 30px; padding-top: 22px; }

/* Panel heights are locked in JS to the tallest step, so moving
   between steps does not resize the whole shell. The transition keeps
   any remaining adjustment from snapping. */
.step-panel { transition: min-height 0.25s var(--ease); }
