/* ==========================================================================
   E-NETT — version moderne : page Estimation (/estimation/)
   Simulateur complet en trois étapes (js/pages/estimation.js) : progression au trait vert, cartes de choix,
   curseur des heures, puces (vitres, machine, durée), panneau de prix collant (≥ 1100 px), barre de prix en bas
   d’écran (< 1100 px), résultat et demande. Puis méthode de calcul et étapes suivantes.
   Couleurs relatives au thème de la section (--fg, --bg, --muted, --line, --panel, --field-line).
   ========================================================================== */

.est-section { padding-top: clamp(32px, 5vh, 56px); }
.est-nojs { margin-bottom: 32px; }

/* ---------- Progression : trois segments, le trait vert avance ---------- */
.est-progress { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 clamp(6px, 1vw, 14px); margin-bottom: clamp(30px, 4vw, 56px); }
.est-progress__item { position: relative; display: flex; align-items: baseline; gap: 12px; padding-top: 16px; color: var(--muted); transition: color .4s; }
.est-progress__item::before, .est-progress__item::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; }
.est-progress__item::before { background: var(--line); }
.est-progress__item::after { background: var(--vert); transform: scaleX(0); transform-origin: left center; transition: transform .8s var(--ease-out); }
.est-progress__item[aria-current="step"] { color: var(--fg); }
.est-progress__item[aria-current="step"]::after, .est-progress__item.is-done::after { transform: scaleX(1); }
.est-progress__n { font-family: var(--f-mono); font-size: 12px; letter-spacing: .04em; }
.est-progress__label { font-size: 15.5px; line-height: 1.25; font-weight: 600; font-stretch: 106%; }
.est-progress__item:not([aria-current]):not(.is-done) .est-progress__label { font-weight: 500; }
@media (max-width: 599px) {
  .est-progress__item { flex-direction: column; gap: 2px; padding-top: 12px; }
  .est-progress__label { font-size: 13.5px; }
}

/* ---------- Mise en page : étapes à gauche, panneau de prix collant à droite ---------- */
.est__layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(32px, 4vw, 72px); }
.est__main { min-width: 0; }
.est__aside { display: none; }
@media (min-width: 1100px) {
  .est__layout { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: start; }
  .est__aside { display: block; position: sticky; top: calc(var(--header-h) + 24px); }
  .est[data-step="3"] .est__layout { grid-template-columns: minmax(0, 1fr); }
  .est[data-step="3"] .est__aside { display: none; }
}

/* ---------- Étape (fieldset / legend) ---------- */
.est-step { margin: 0; padding: 0; border: 0; min-width: 0; }
.est-step__legend { float: left; width: 100%; padding: 0; margin-bottom: clamp(20px, 2.4vw, 32px); }
.est-step__legend ~ * { clear: both; }
.est-step__count { display: block; font-family: var(--f-mono); font-size: 12px; line-height: 1.4; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.est-step__title { margin-top: 8px; font-size: var(--t-h2-sm); line-height: 1.08; font-weight: 700; font-stretch: 112%; letter-spacing: -.02em; text-wrap: balance; }
.est-step__title:focus { outline: none; }
.est-step__sub { display: block; margin-top: 10px; font-family: var(--f-mono); font-size: 12px; font-weight: 400; line-height: 1.4; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.est-step__sub:empty { display: none; }
.est-hint { margin-top: 16px; font-size: 14.5px; line-height: 1.5; color: var(--muted); }
.est-step .field__error { margin-top: 14px; }

/* ---------- Cartes de choix : secteurs, formules (trait vert en tête de la carte choisie) ---------- */
.est-sector .choice__box, .est-formula .choice__box { position: relative; }
.est-sector .choice__input:checked + .choice__box::before, .est-formula .choice__input:checked + .choice__box::before {
  content: ""; position: absolute; left: -1px; right: -1px; top: -1px; height: 4px; background: var(--vert);
}
.est-sectors { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.est-sector .choice__box { gap: 6px; padding: 16px 18px 18px; }
.est-sector__top { display: flex; justify-content: space-between; gap: 12px; font-family: var(--f-mono); font-size: 11px; line-height: 1.4; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.est-sector .choice__title { margin-top: 4px; font-size: 17px; }
.est-sector .choice__desc { font-size: 14px; }
.choice__input:checked + .choice__box .est-sector__top { color: inherit; opacity: .8; }
@media (max-width: 599px) {
  .est-sectors { grid-template-columns: 1fr; }
  .est-sector .choice__box { padding: 14px 16px 15px; }
}

.est-formulas { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.est-formula .choice__box { gap: 8px; padding: 16px 16px 18px; }
.est-formula__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 8px; }
.est-formula__price { font-family: var(--f-mono); font-size: 12px; letter-spacing: .02em; }
.est-formula__price b { font-size: 21px; font-weight: 400; letter-spacing: -.04em; word-spacing: -.3em; }
.choice__input:checked + .choice__box .tag { border-color: currentColor; }
.est-rec:empty { display: none; }
.est-rec { margin-top: 12px; }
.est-rec b { color: var(--fg); font-weight: 600; }
@media (max-width: 599px) {
  .est-formulas { grid-template-columns: 1fr; }
  .est-formula .choice__box { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; }
  .est-formula__price { grid-column: 2; grid-row: 1; justify-self: end; }
  .est-formula .choice__desc { grid-column: 1 / -1; }
}

/* ---------- Champs de l’étape 2 ---------- */
.est-block { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 30px 24px; align-items: start; }
.est-field--full { grid-column: 1 / -1; }
@media (max-width: 599px) { .est-block { grid-template-columns: minmax(0, 1fr); gap: 26px; } }
.est-days input { max-width: 30rem; }

/* Heures par semaine : valeur, curseur, boutons −/+ */
.est-hours__row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.est-hours__out { font-family: var(--f-mono); font-size: 24px; line-height: 1; font-weight: 400; letter-spacing: -.04em; word-spacing: -.3em; font-variant-numeric: tabular-nums; }
.est-hours__ctrl { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; }
.est-hours__ctrl .range { margin: 0; }
.est-hours__bounds { display: flex; justify-content: space-between; padding: 0 56px; font-family: var(--f-mono); font-size: 11px; letter-spacing: .04em; color: var(--muted); }
.est-hours .field__hint { margin-top: 4px; }
.est-btn {
  display: inline-grid; place-items: center; flex: none; width: 44px; height: 44px;
  border: 1px solid var(--field-line); color: var(--fg); background: var(--field-bg);
  transition: border-color .25s, background-color .25s;
}
.est-btn:hover:not(:disabled) { border-color: var(--fg); background: var(--line-soft); }
.est-btn:disabled { opacity: .35; cursor: not-allowed; }
.est-btn .icon { width: 18px; height: 18px; }

/* Puces : vitres, passage machine, durée */
.est-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.est-chips .opt__box { min-height: 46px; align-items: center; font-size: 15px; white-space: nowrap; }
.est-chips .opt__box b { font-weight: 650; }
.est-chips .opt input:disabled + .opt__box { opacity: .4; cursor: not-allowed; }
.est-included { display: flex; align-items: center; gap: 12px; font-weight: 600; font-stretch: 104%; }
.est-included::before { content: ""; flex: none; width: 18px; height: 3px; background: var(--vert); }
.est-duration { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.est-months { display: inline-flex; align-items: center; border: 1px solid var(--field-line); background: var(--field-bg); }
.est-months .est-btn { border: 0; background: transparent; }
.est-months__out { min-width: 7.2em; text-align: center; font-family: var(--f-mono); font-size: 14px; letter-spacing: -.01em; }

/* Selon la formule (forfait) et la durée (ponctuel) */
.est:not(.is-quote) .when-quote,
.est.is-quote .when-price,
.est:not(.is-once) .when-once,
.est.is-once .when-monthly,
.est.is-once label[data-monthly-only] { display: none; }

/* Navigation */
.est-nav { display: flex; flex-wrap: wrap; gap: 10px; margin-top: clamp(30px, 3.4vw, 44px); padding-top: 24px; border-top: 1px solid var(--line); }
.est-nav__next { margin-left: auto; }
@media (max-width: 599px) { .est-nav .btn { flex: 1 1 auto; justify-content: center; } }

/* ---------- Prix : odomètre (components.css : .odo), « € », « Sur devis » ---------- */
.est-price { min-height: 1.1em; white-space: nowrap; }
.est-price.is-quote { min-height: 0; margin-top: 10px; }
.est-price__cur { font-size: .5em; letter-spacing: 0; }
.est-price__quote { font-family: var(--f-sans); font-size: .62em; font-weight: 700; font-stretch: 118%; letter-spacing: -.03em; }
.est-result__need { margin-top: 12px; font-size: 15.5px; line-height: 1.35; font-weight: 600; font-stretch: 106%; }
.est-result__total { margin-top: 10px; font-family: var(--f-mono); font-size: 13px; letter-spacing: -.01em; }
.est-result__total b { font-weight: 500; }
.est-result__total:empty, .est-result__why:empty, .est-result__need:empty { display: none; }
.est-result__why { margin-top: 16px; font-size: 14.5px; line-height: 1.5; color: var(--muted); }
.est-result__why b { color: var(--fg); font-weight: 600; }
.est-result .estimate-result__lines dd { white-space: normal; }
/* Panneau en direct : vide tant qu’aucun secteur n’est choisi */
.est-result__empty { margin-top: 14px; }
.est-result__empty > p { max-width: 34ch; font-size: 16px; line-height: 1.5; }
.est-rates { margin-top: 22px; }
.est-rates dd { font-family: var(--f-mono); font-size: 13px; }
.est.has-result .est-result__empty { display: none; }
.est:not(.has-result) .est-live :is([data-r-need], [data-r-price], [data-r-unit], [data-r-total], [data-r-lines], [data-r-why]) { display: none; }
.est-assure { margin-top: 16px; }

/* ---------- Étape 3 : résultat et demande ---------- */
.est-final { display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(28px, 4vw, 56px); }
.est-final__result { display: grid; gap: 12px; align-content: start; }
.est-final__edit { justify-self: start; }
.est-contact__title { font-size: var(--t-h3); line-height: 1.15; font-weight: 700; font-stretch: 108%; letter-spacing: -.015em; }
.est-contact__intro { margin-top: 8px; max-width: 52ch; color: var(--muted); }
.est-final__form .form { margin-top: 24px; }
.est-final__form:has(form[hidden]) :is(.est-contact__title, .est-contact__intro) { display: none; }
@media (min-width: 900px) {
  .est-final { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(40px, 5vw, 96px); align-items: start; }
  .est-final__result { position: sticky; top: calc(var(--header-h) + 24px); }
}
@media (max-width: 599px) {
  .est-final__result .est-result { margin-inline: calc(var(--gutter) * -1); }
  .est-final__edit { width: 100%; justify-content: center; }
}

/* ---------- Barre de prix (sous 1100 px) : doublon visuel du panneau ---------- */
.est-bar {
  --fg: var(--craie); --bg: var(--marine); --muted: rgba(243, 244, 241, .74);
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 56;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 12px var(--gutter) max(12px, env(safe-area-inset-bottom));
  background: rgba(5, 28, 49, .97); color: var(--craie); box-shadow: 0 -1px 0 rgba(243, 244, 241, .16);
  transform: translate3d(0, 110%, 0); visibility: hidden;
  transition: transform .45s var(--ease-out), visibility 0s linear .45s;
}
.est-bar.is-visible { transform: none; visibility: visible; transition: transform .45s var(--ease-out), visibility 0s; }
.est-bar__price { display: flex; align-items: baseline; gap: .12em; font-family: var(--f-mono); font-size: 27px; line-height: 1.1; font-weight: 300; letter-spacing: -.05em; font-variant-numeric: tabular-nums; }
.est-bar__meta { display: grid; gap: 2px; min-width: 0; text-align: right; font-size: 12px; line-height: 1.35; color: var(--muted); }
.est-bar__meta span:first-child { font-family: var(--f-mono); font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--fg); }
@media (min-width: 1100px) { .est-bar { display: none; } }
/* Focus clavier et ancres : rien ne s’arrête sous la barre de prix (classe posée par js/pages/estimation.js) */
@media (max-width: 1099px) { html.estbar-on { scroll-padding-bottom: calc(88px + env(safe-area-inset-bottom)); } }
@media (max-width: 1099px) { .est:not([data-step="3"]) { padding-bottom: 76px; } }
@media (max-width: 380px) { .est-bar__price { font-size: 23px; } }

/* ---------- 01 Méthode de calcul ---------- */
.est-method { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 clamp(20px, 2.6vw, 40px); border-top: 1px solid var(--fg); }
.est-method > li { padding: 22px 0 26px; border-bottom: 1px solid var(--line); }
.est-method__n { display: block; font-family: var(--f-mono); font-size: 12px; color: var(--muted); }
.est-method__title { margin-top: 14px; font-size: var(--t-h3); line-height: 1.15; font-weight: 700; font-stretch: 108%; letter-spacing: -.015em; text-wrap: balance; }
.est-method p { margin-top: 10px; font-size: 16px; line-height: 1.55; color: var(--muted); }
.est-method__foot { margin-top: clamp(24px, 3vw, 36px); display: grid; gap: 12px; }
.est-method__foot .price-note { margin-top: 0; max-width: 80ch; color: var(--muted); }
.est-method__tel { font-size: 17px; }
@media (max-width: 1099px) { .est-method { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 599px) { .est-method { grid-template-columns: minmax(0, 1fr); } }

@media (prefers-reduced-motion: reduce) {
  .est-bar, .est-bar.is-visible, .est-progress__item::after { transition: none; }
}
