/* styles/estimator.css — component styles for the shared estimator mount
   (ticket 036). Every rule is scoped under .estimator-mount so the same
   stylesheet ships on surfaces with their own design: linked from index.html
   next to styles.css, inlined at build into the /vendre/ and /acheter/
   landing pages (whose own layout CSS must not leak into the mount, nor the
   mount's into them). Consumes the styles/theme.css tokens. */

.estimator-mount {
  display: block;
  scroll-margin-top: 24px;
}

/* Neutralize the host page's typography inside the mount. */
.estimator-mount h1, .estimator-mount h2, .estimator-mount p { margin-top: 0; }
.estimator-mount p { max-width: none; }

.estimator-mount h2 {
  font-family: var(--serif);
  font-size: 30px;
  letter-spacing: -.01em;
}

.estimator-mount .eyebrow {
  font-family: var(--sans);
  text-transform: uppercase;
  letter-spacing: .16em;
  font-size: 12px;
  color: var(--ochre);
  margin: 0 0 14px;
}

.estimator-mount [hidden] {
  display: none !important;
}

.estimator-mount section {
  border-top: 0;
  padding: 0;
}

.estimator-mount .card {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: 28px;
  padding: 30px;
}

.estimator-mount .estimator {
  display: grid;
  grid-template-columns: .8fr 1.6fr;
  gap: 28px;
  margin-bottom: 24px;
}

.estimator-mount .hint, .estimator-mount .disclaimer {
  color: var(--muted);
  line-height: 1.55;
  font-size: 15px;
}

/* Confirmation that the typed/handed-off address resolved to a cadastral
   section — the hand-off path selects the BAN match without a user click. */
.estimator-mount .resolved-hint {
  margin: -6px 0 14px;
  color: var(--river);
  font-size: 14px;
  font-weight: 600;
}

/* Visible BAN-empty feedback (029 review P0: never a silent dead-end). */
.estimator-mount .address-noresult {
  margin: -6px 0 14px;
  font-size: 14px;
}

.estimator-mount .grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

/* Expert-fields accordion (ticket 039) — ＋/－ summary in --river, per the
   029-validated prototype (prototype-stopgaps.html surface 2). */
.estimator-mount details.acc {
  margin-top: 4px;
  border-top: 1px dashed var(--line);
  padding-top: 14px;
}
.estimator-mount details.acc > summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--river);
  list-style: none;
  font-size: 14px;
}
.estimator-mount details.acc > summary::-webkit-details-marker { display: none; }
.estimator-mount details.acc > summary::before { content: "＋ "; font-weight: 800; }
.estimator-mount details.acc[open] > summary::before { content: "－ "; }
.estimator-mount details.acc > .grid { margin-top: 14px; }

.estimator-mount label {
  display: grid;
  gap: 8px;
  font-size: 13px;
  letter-spacing: .02em;
  color: var(--ink);
}

.estimator-mount input, .estimator-mount select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 13px;
  background: var(--panel);
  font: inherit;
  color: var(--ink);
}

.estimator-mount button {
  margin-top: 22px;
  width: 100%;
  border: 0;
  border-radius: 16px;
  padding: 16px 18px;
  background: var(--river-deep);
  color: #f3efe4;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.estimator-mount button:hover { opacity: .9; }

/* Keyboard path stays visible on every control (029 review P0). */
.estimator-mount :focus-visible {
  outline: 3px solid var(--ochre);
  outline-offset: 2px;
}

.estimator-mount .result {
  background: var(--river-deep);
  color: #f3efe4;
}

.estimator-mount .result .eyebrow, .estimator-mount .result .disclaimer { color: #cfe0da; }

.estimator-mount #range {
  font-family: var(--serif);
  font-size: clamp(34px, 5vw, 58px);
  margin-bottom: 10px;
}

.estimator-mount #strategy {
  color: #cfe0da;
  line-height: 1.6;
}

.estimator-mount .tiers {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 24px 0;
}

.estimator-mount .tiers div {
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 18px;
  padding: 18px;
}

.estimator-mount .tiers span {
  display: block;
  color: #9fb8b1;
  font-size: 13px;
  margin-bottom: 8px;
}

.estimator-mount .tiers strong {
  font-size: 22px;
}

.estimator-mount input[readonly] {
  background: var(--bar-track);
  color: var(--ink-soft);
}

.estimator-mount .lead-gate {
  margin-top: 26px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(135deg, var(--panel), var(--ground));
}

.estimator-mount .lead-gate h3 {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-size: 24px;
  letter-spacing: -.01em;
}

.estimator-mount .lead-gate p:not(.eyebrow) {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.5;
}

.estimator-mount .contact-grid {
  margin-top: 16px;
}

.estimator-mount .timeline-field {
  margin-top: 16px;
}

.estimator-mount .result-locked .tiers,
.estimator-mount .result.result-locked .tiers {
  opacity: .42;
}

.estimator-mount .result-locked #range {
  color: #cfe0da;
}

.estimator-mount .form-status {
  min-height: 22px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.estimator-mount button:disabled {
  cursor: wait;
  opacity: .62;
}

.estimator-mount .address-field {
  position: relative;
  margin-bottom: 18px;
}

.estimator-mount .address-input-wrap {
  position: relative;
}

.estimator-mount .address-input-wrap input {
  padding-right: 44px;
}

.estimator-mount .spinner {
  position: absolute;
  right: 14px;
  top: 50%;
  width: 18px;
  height: 18px;
  margin-top: -9px;
  border: 2px solid var(--line);
  border-top-color: var(--river);
  border-radius: 50%;
  animation: estimator-spin .7s linear infinite;
}

@keyframes estimator-spin {
  to { transform: rotate(360deg); }
}

/* The suggestion listbox is a self-contained component and now appears in TWO
   contexts: inside .estimator-mount (hero + panels) and inside the .cta cards of
   the /vendre/ and /acheter/ landings, which sit outside the mount. The rules are
   therefore keyed on the component class alone rather than the mount scope. */
.address-suggestions {
  position: absolute;
  z-index: 10;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  max-height: 240px;
  overflow-y: auto;
}

.address-suggestions li + li {
  margin-top: 2px;
}

.address-suggestions button {
  all: unset;
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 14px;
  cursor: pointer;
}

.address-suggestions button:hover,
.address-suggestions button:focus,
.address-suggestions li.is-active button {
  background: var(--ground);
}

.estimator-mount .address-block {
  margin: -6px 0 18px;
  padding: 12px 16px;
  border-radius: 14px;
  background: #fdeeee;
  border: 1px solid #f3c9c9;
  color: #8a2323;
  font-size: 14px;
  line-height: 1.5;
}

.estimator-mount .manual-fallback-hint {
  grid-column: 1 / -1;
  margin: -4px 0 0;
}

/* ---- Address-first hero on `/` (029 variant C — one page) ---- */
.estimator-mount .hero-cta {
  background: var(--river-deep);
  color: #f3efe4;
  border-radius: 28px;
  padding: 30px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
  scroll-margin-top: 24px;
}
.estimator-mount .hero-cta h2 { color: #fbf8ef; margin-bottom: 6px; }
.estimator-mount .hero-sub { color: #cfe0da; margin: 0 0 18px; max-width: 54ch; }
/* position:relative anchors the absolutely-positioned suggestions dropdown, the
   same way .address-field does for the panel inputs. The display stays the
   `grid` of the base label rule — overriding it to block collapses the 8px gap
   and the input rides up onto the « Adresse du bien » text. */
.estimator-mount .hero-address { color: #cfe0da; margin-bottom: 12px; position: relative; }
.estimator-mount .hero-dual {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
/* Same ochre-soft/#2a1a0a pairing as the teaser CTA (plain ochre is below AA). */
.estimator-mount .hero-dual button {
  margin-top: 0;
  background: var(--ochre-soft);
  color: #2a1a0a;
}
.estimator-mount .hero-dual button.ghost {
  background: transparent;
  color: #f3efe4;
  border: 1.5px solid #cfe0da;
}
.estimator-mount .reassure {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin: 14px 0 0;
  font-size: 13px;
  color: #cfe0da;
}
.estimator-mount .reassure span::before {
  content: "✓ ";
  color: var(--ochre-soft);
  font-weight: 800;
}

.estimator-mount .back-link {
  all: unset;
  cursor: pointer;
  display: inline-block;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 13px;
}
.estimator-mount .back-link:hover { color: var(--ink); }

.estimator-mount .opt { color: var(--muted); font-weight: 400; }
.estimator-mount .price-field { position: relative; }
.estimator-mount .field-help { display: block; margin-top: 6px; font-size: 12px; color: var(--muted); line-height: 1.4; }

/* ---- Buyer verdict card (shared result panel) ---- */
.estimator-mount .verdict-card {
  border-radius: 18px;
  padding: 20px;
  margin-bottom: 22px;
  border: 1px solid rgba(255,255,255,.2);
}
.estimator-mount .verdict-card.good { background: rgba(74, 190, 130, .16); border-color: rgba(74,190,130,.5); }
.estimator-mount .verdict-card.fair { background: rgba(217, 190, 111, .16); border-color: rgba(217,190,111,.5); }
.estimator-mount .verdict-card.high { background: rgba(224, 128, 96, .18); border-color: rgba(224,128,96,.5); }
.estimator-mount .verdict-band {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
  background: rgba(255,255,255,.14);
  color: #fff;
}
.estimator-mount .verdict-ecart {
  font-family: var(--serif);
  font-size: 46px;
  line-height: 1;
  letter-spacing: -.03em;
  margin: 4px 0 8px;
}
.estimator-mount .verdict-card.good .verdict-ecart { color: #8fe0b0; }
.estimator-mount .verdict-card.fair .verdict-ecart { color: #ecd18a; }
.estimator-mount .verdict-card.high .verdict-ecart { color: #f0a488; }
.estimator-mount .verdict-card p { margin: 0; color: #cfe0da; font-size: 14px; }

/* ---- Report download ---- */
.estimator-mount .report-block { margin: 24px 0 8px; }
.estimator-mount #downloadReport {
  margin: 0;
  background: var(--ochre-soft);
  color: #2a1a0a;
}
.estimator-mount #downloadReport:hover { opacity: .92; }
.estimator-mount .report-status { min-height: 20px; margin: 10px 0 0; color: var(--ochre); font-size: 14px; }

/* ===== Consent block (ticket 018 — audit 016 §1/§2 opt-ins) ===== */
.estimator-mount .consent-block {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 12px;
}
.estimator-mount .consent-check {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink);
  cursor: pointer;
}
.estimator-mount .consent-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--river);
  flex: none;
}
.estimator-mount .consent-benefit {
  margin: 0;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bar-track);
  border-left: 3px solid var(--river);
  border-radius: 6px;
}
/* Compacted consent (ticket 040): the « voir le détail » / RGPD folds reuse
   the 039 ＋/－ accordion component, downsized — no new component. The details
   sits OUTSIDE the <label> (accidental-consent guard), indented under the
   checkbox column. */
.estimator-mount .consent-choice {
  display: grid;
  gap: 2px;
}
.estimator-mount .consent-free-line {
  margin: 0;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
}
.estimator-mount .consent-free-line::before {
  content: "✓ ";
  color: var(--river);
}
.estimator-mount .consent-block details.acc {
  margin: 0 0 0 28px;
  padding: 0;
  border-top: 0;
}
.estimator-mount .consent-block details.acc > summary {
  font-size: 12px;
  font-weight: 600;
}
.estimator-mount .consent-block details.acc > p {
  margin: 6px 0 0;
  padding-left: 10px;
  border-left: 2px solid var(--line);
  font-size: 12px;
  line-height: 1.55;
  color: var(--muted);
}
.estimator-mount .consent-block details.consent-rgpd {
  margin-left: 0;
}
.estimator-mount .consent-trust {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}
.estimator-mount .consent-disclosure {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--muted);
}

/* ---- Progress header 1·2·3 (029 locked #4) ---- */
.estimator-mount .progress {
  list-style: none;
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  margin: 0 0 24px;
  padding: 0;
  font-size: 13px;
  color: var(--muted);
}
.estimator-mount .progress .step {
  display: flex;
  align-items: center;
  gap: 7px;
}
.estimator-mount .progress .step + .step::before {
  content: "";
  width: 24px;
  height: 1px;
  background: var(--line);
  margin-right: 10px;
}
.estimator-mount .progress .dot {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--bar-track);
  color: var(--muted);
  font-weight: 700;
  font-size: 12px;
}
.estimator-mount .progress .step.is-active { color: var(--ink); font-weight: 600; }
.estimator-mount .progress .step.is-active .dot { background: var(--river-deep); color: #f3efe4; }

/* ---- Section teaser (030 / audit §5): proof before the coordinates ask ---- */
.estimator-mount .section-teaser {
  background: var(--river-deep);
  color: #f3efe4;
  border-radius: 18px;
  padding: 22px;
  text-align: center;
  margin-top: 26px;
}
.estimator-mount .section-teaser .eyebrow { color: var(--ochre-soft); margin-bottom: 8px; }
.estimator-mount .teaser-proof {
  font-size: 14.5px;
  margin: 0 0 4px;
  color: #f3efe4;
  font-variant-numeric: tabular-nums;
}
/* Decorative fake figure (aria-hidden in the markup) — never legible. */
.estimator-mount .teaser-blur {
  filter: blur(7px);
  user-select: none;
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 700;
  margin: 6px 0 10px;
}
.estimator-mount .teaser-lockline {
  font-size: 13.5px;
  color: #cfe0da;
  margin: 0;
}
/* Unlock CTA (030): same ochre-soft/#2a1a0a pairing as #downloadReport — the
   plain --ochre/#1a1a1a combo sits below AA at this size (029 review P1). */
.estimator-mount .teaser-unlock {
  margin-top: 14px;
  width: auto;
  padding: 12px 22px;
  background: var(--ochre-soft);
  color: #2a1a0a;
}
/* Method cross-link under the unlock CTA (033): the teaser sits on the dark
   result panel, so the link reads in the light-on-dark palette. */
.estimator-mount .teaser-method { margin: 12px 0 0; font-size: 12.5px; }
.estimator-mount .teaser-method a { color: #cfe0da; }

/* ---- Sticky mobile CTA (029 move 5) — mobile only, JS toggles [hidden] ---- */
.estimator-mount .sticky-cta { display: none; }
@media (max-width: 640px) {
  .estimator-mount .sticky-cta {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    padding: 12px 16px;
    background: color-mix(in srgb, var(--panel) 92%, transparent);
    backdrop-filter: blur(8px);
    border-top: 1px solid var(--line);
  }
  .estimator-mount .sticky-cta button { margin-top: 0; }
}

@media (max-width: 820px) {
  .estimator-mount .estimator,
  .estimator-mount .grid,
  .estimator-mount .tiers,
  .estimator-mount .hero-dual { grid-template-columns: 1fr; }
  .estimator-mount .card { padding: 22px; border-radius: 22px; }
}
