/* ============================================================
   ESTIMATEUR D'AIDES — design sobre & professionnel
   Palette : vert institutionnel #107a57 (confiance/rénovation),
   ardoise #14283c. Mobile-first (artisans en RDV sur tablette).
   ============================================================ */
:root {
  --vert: #107a57; --vert-clair: #e8f5ef; --ardoise: #14283c;
  --gris: #5b6b7b; --fond: #f4f6f8; --bord: #dde4ea; --orange: #b45309;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--fond); color: var(--ardoise);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
}
#app { max-width: 860px; margin: 0 auto; padding: 20px 14px 40px; }
h2 { margin: 0 0 4px; font-size: 21px; }
.sous { color: var(--gris); margin: 0 0 16px; font-size: 14px; }

/* Étapes */
.etapes { display: flex; align-items: center; gap: 8px; margin-bottom: 18px; }
.etape { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--gris); font-weight: 600; white-space: nowrap; }
.etape .num { width: 24px; height: 24px; border-radius: 50%; background: #cfd8e0; color: #fff; display: grid; place-items: center; font-size: 12px; }
.etape.active { color: var(--vert); } .etape.active .num { background: var(--vert); }
.etape.fait .num { background: var(--ardoise); }
.trait { flex: 1; height: 2px; background: var(--bord); }

/* Cartes & formulaires */
.carte { background: #fff; border: 1px solid var(--bord); border-radius: 14px; padding: 22px; box-shadow: 0 1px 3px rgba(20,40,60,.05); }
.carte.centre { text-align: center; padding: 50px 20px; }
.carte.erreur { border-color: #f0b4b4; background: #fff8f8; }
.carte.maintenance { text-align: center; font-size: 17px; padding: 50px; }
.grille { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; }
.champ label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 5px; }
input, select { width: 100%; padding: 10px 12px; border: 1px solid var(--bord); border-radius: 8px; font-size: 15px; background: #fff; }
input:focus, select:focus { outline: 2px solid var(--vert); border-color: transparent; }
.hint { font-size: 12px; color: var(--gris); margin-top: 4px; }
.hint.ok { color: var(--vert); font-weight: 600; }
.segments { display: flex; border: 1px solid var(--bord); border-radius: 8px; overflow: hidden; margin-bottom: 6px; }
.segments button { flex: 1; padding: 9px 6px; border: 0; background: #fff; cursor: pointer; font-size: 13.5px; font-weight: 600; color: var(--gris); }
.segments button.on { background: var(--vert); color: #fff; }

/* Gestes */
.cat { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--gris); font-weight: 700; margin: 16px 0 8px; }
.gestes { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 8px; }
.geste { display: flex; align-items: center; gap: 8px; padding: 11px 12px; border: 1.5px solid var(--bord); border-radius: 10px; cursor: pointer; font-size: 14px; font-weight: 600; background: #fff; transition: all .12s; position: relative; }
.geste:hover { border-color: var(--vert); }
.geste.on { border-color: var(--vert); background: var(--vert-clair); }
.geste .ic { font-size: 18px; }
.geste.exclu { border-style: dashed; }
.badge-exclu { position: absolute; top: -8px; right: 8px; background: var(--orange); color: #fff; font-size: 10px; padding: 1px 7px; border-radius: 8px; font-weight: 700; }
.params { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 12px; padding: 10px 12px; background: var(--vert-clair); border-radius: 8px; margin-top: -2px; }
.params label { font-size: 12.5px; font-weight: 600; display: flex; flex-direction: column; gap: 3px; min-width: 160px; flex: 1; }

/* Boutons */
.actions { display: flex; justify-content: space-between; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
.actions.res { justify-content: flex-end; }
.btn { padding: 12px 20px; border-radius: 9px; border: 1px solid var(--bord); background: #fff; font-size: 15px; font-weight: 700; cursor: pointer; color: var(--ardoise); }
.btn.primaire { background: var(--vert); border-color: var(--vert); color: #fff; }
.btn.primaire:hover { background: #0c6146; }
.btn.primaire:disabled { opacity: .45; cursor: not-allowed; }
.btn.presentation { background: var(--ardoise); border-color: var(--ardoise); color: #fff; }

/* Résultats */
.entete-res { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.pastille { padding: 5px 12px; border-radius: 20px; font-size: 12.5px; font-weight: 700; color: var(--c); background: color-mix(in srgb, var(--c) 12%, white); border: 1px solid color-mix(in srgb, var(--c) 35%, white); }
.tableau { width: 100%; border-collapse: collapse; font-size: 14px; }
.tableau th { text-align: left; padding: 9px 10px; background: var(--fond); font-size: 12.5px; border-bottom: 2px solid var(--bord); }
.tableau td { padding: 10px; border-bottom: 1px solid var(--bord); vertical-align: top; }
.tableau tfoot td { font-weight: 800; background: var(--vert-clair); border-bottom: 0; }
.tableau .note { font-size: 11.5px; color: var(--gris); font-weight: 400; margin-top: 2px; }
.tableau .non { color: #b0bcc7; }
.synthese { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; margin-top: 16px; }
.synthese .bloc { border: 1px solid var(--bord); border-radius: 10px; padding: 13px 15px; }
.synthese .bloc span { display: block; font-size: 12.5px; color: var(--gris); font-weight: 600; }
.synthese .bloc strong { font-size: 21px; }
.synthese .aides { background: var(--vert-clair); border-color: #bfe3d3; }
.synthese .aides strong { color: var(--vert); }
.synthese .rac { background: var(--ardoise); border-color: var(--ardoise); }
.synthese .rac span { color: #a9bccd; } .synthese .rac strong { color: #fff; }
.ptz { margin-top: 12px; padding: 12px 14px; background: #eef4fb; border: 1px solid #cfdff2; border-radius: 10px; font-size: 14px; }
.ptz select { width: auto; padding: 4px 8px; margin-left: 6px; font-size: 13px; }
.tva-note, .cee-note { margin-top: 10px; font-size: 12.5px; color: var(--gris); }
.deadline { display: flex; gap: 10px; align-items: flex-start; background: #fff7e6; border: 1px solid #f2ce8a; border-radius: 12px; padding: 13px 15px; margin-bottom: 12px; font-size: 14px; }
.deadline .src { font-size: 11.5px; color: var(--orange); margin-top: 2px; }

/* Fiabilité */
.fiabilite { margin-top: 16px; padding: 14px 16px; border: 1px dashed var(--bord); border-radius: 10px; font-size: 12px; color: var(--gris); display: flex; flex-direction: column; gap: 4px; background: #fff; }
.fiabilite .ok { color: var(--vert); font-weight: 700; }
.fiabilite .ko { color: #c0392b; font-weight: 700; }
.fiabilite .disc { font-style: italic; }

/* Loader */
.loader { width: 38px; height: 38px; border: 4px solid var(--bord); border-top-color: var(--vert); border-radius: 50%; margin: 0 auto 14px; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- MODE PRÉSENTATION ---------- */
.no-scroll { overflow: hidden; }
.overlay-pres { position: fixed; inset: 0; background: linear-gradient(160deg, #0e1f30, #14283c 55%, #0f3527); z-index: 100; overflow-y: auto; color: #fff; }
.overlay-pres .fermer, .overlay-gate .fermer { position: absolute; top: 14px; right: 16px; background: rgba(255,255,255,.12); border: 0; color: inherit; width: 38px; height: 38px; border-radius: 50%; font-size: 17px; cursor: pointer; z-index: 2; }
.pres-contenu { max-width: 780px; margin: 0 auto; padding: 46px 22px 30px; text-align: center; }
.pres-titre { font-size: 15px; text-transform: uppercase; letter-spacing: .14em; color: #7fd4b4; font-weight: 700; margin-bottom: 26px; }
.pres-comparatif { display: flex; justify-content: center; align-items: flex-end; gap: 26px; margin-bottom: 28px; }
.pres-comparatif .col { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.pres-comparatif .lib { font-size: 13px; color: #9fb3c4; font-weight: 600; }
.barre-ext { width: 74px; height: 150px; background: rgba(255,255,255,.07); border-radius: 8px; display: flex; align-items: flex-end; overflow: hidden; }
.barre { width: 100%; border-radius: 8px 8px 0 0; transition: height 1.2s cubic-bezier(.2,.8,.3,1); }
.barre.b1 { background: #5b6b7b; }
.barre.b2 { background: linear-gradient(180deg, #2fbe8b, #107a57); }
.pres-comparatif .val { font-size: 19px; font-weight: 800; }
.pres-comparatif .val.accent { color: #4fe0ac; }
.pres-comparatif .fleche { font-size: 26px; color: #7fd4b4; padding-bottom: 70px; }
.pres-gros .lib { font-size: 14px; color: #9fb3c4; font-weight: 600; }
.compteur { font-size: clamp(46px, 9vw, 74px); font-weight: 900; color: #4fe0ac; letter-spacing: -.02em; line-height: 1.1; }
.pres-gros .four { font-size: 15px; color: #cfe6db; margin-top: 2px; }
.pres-mens { margin-top: 14px; font-size: 18px; }
.pres-mens strong { color: #4fe0ac; }
.pres-details { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 26px; }
.puce { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); padding: 8px 14px; border-radius: 22px; font-size: 13.5px; }
.puce span { color: #7fd4b4; font-weight: 700; margin-left: 6px; }
.pres-deadline { margin-top: 20px; background: rgba(242,180,64,.14); border: 1px solid rgba(242,180,64,.4); color: #ffd88a; padding: 11px 16px; border-radius: 10px; font-size: 14px; }
.pres-pied { margin-top: 30px; font-size: 10.5px; color: #7d92a5; max-width: 560px; margin-inline: auto; }

/* ---------- GATE PDF ---------- */
.overlay-gate { position: fixed; inset: 0; background: rgba(14,25,38,.55); z-index: 100; display: grid; place-items: center; padding: 16px; overflow-y: auto; }
.gate { position: relative; background: #fff; border-radius: 16px; padding: 26px; max-width: 440px; width: 100%; }
.gate .fermer { color: var(--ardoise); background: var(--fond); }
.gate h3 { margin: 0 0 4px; }
.gate label { display: block; font-size: 13px; font-weight: 600; margin-top: 12px; }
.gate input { margin-top: 4px; }
.gate .consent { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; font-size: 12.5px; color: var(--gris); }
.gate .consent input { width: auto; margin-top: 2px; }
.gate .btn { width: 100%; margin-top: 16px; }
.gate .rgpd { font-size: 11px; color: var(--gris); margin-top: 10px; text-align: center; }

@media (max-width: 560px) {
  .etape { font-size: 0; gap: 0; } /* mobile : numéros seuls */
  .etape .num { font-size: 12px; }
  .pres-comparatif { gap: 14px; }
  .barre-ext { width: 58px; height: 120px; }
  .pres-comparatif .fleche { padding-bottom: 55px; }
}
