/* Feu Vert Travaux — feuille unique.
   Le vocabulaire visuel vient du plan cadastral : papier legerement chaud,
   traits fins, aplat sable du bati, et trois couleurs qui portent une
   information (rien / declarer / permis) plutot qu'une decoration. */

:root {
  --papier: #f2f1ec;
  --papier-clair: #fbfaf7;
  --encre: #17201c;
  --encre-douce: #5c635d;
  --trait: #cfcdc2;
  --trait-fort: #a8a59a;
  --sable: #e7e0ce;

  --vert: #2e6b4e;
  --vert-fond: #e3ece5;
  /* Couleur d'accent de ce projet : bleu ardoise profond (registre, plan, visa). */
  --accent: #1c4e6b;
  --accent-sombre: #163d54;
  --accent-fond: #dfeaf0;
  --ambre: #8a5a05;
  --ambre-fond: #f2e8d3;
  --brique: #93372b;
  --brique-fond: #f0e0dc;
  --ardoise: #2a5470;
  --ardoise-fond: #dfe7ec;

  --serif: Georgia, "Iowan Old Style", "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --marge: 20px;
  --large: 640px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--papier);
  color: var(--encre);
  font: 17px/1.6 var(--sans);
  font-variant-numeric: tabular-nums;
  padding-bottom: 64px;
}

.enveloppe {
  max-width: var(--large);
  margin: 0 auto;
  padding-left: var(--marge);
  padding-right: var(--marge);
}

h1, h2, h3 { font-family: var(--serif); font-weight: 400; letter-spacing: -0.01em; }

h1 { font-size: 2rem; line-height: 1.2; margin: 0 0 14px; }
h2 { font-size: 1.45rem; line-height: 1.25; margin: 0 0 12px; }
h3 { font-size: 1.1rem; line-height: 1.3; margin: 0 0 8px; }

p { margin: 0 0 14px; max-width: 62ch; }

a { color: var(--encre); text-decoration-color: var(--trait-fort); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--encre); }

:focus-visible { outline: 2px solid var(--encre); outline-offset: 2px; }

/* --- Ligne de cote : le separateur du plan, avec ses deux traits d'extremite --- */
.cote {
  position: relative;
  height: 1px;
  border: 0;
  background: var(--trait);
  margin: 40px 0;
}
.cote::before, .cote::after {
  content: "";
  position: absolute;
  top: -4px;
  width: 1px;
  height: 9px;
  background: var(--trait);
}
.cote::before { left: 0; }
.cote::after { right: 0; }

/* --- En-tete --- */
.entete {
  border-bottom: 1px solid var(--trait);
  background: var(--papier-clair);
}
.entete .enveloppe {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding-top: 14px;
  padding-bottom: 14px;
  flex-wrap: wrap;
}
.marque { font-family: var(--serif); font-size: 1.05rem; margin: 0; }
.marque-suite { margin: 0; font-size: 0.85rem; color: var(--encre-douce); }

/* --- Outil --- */
.outil { padding-top: 32px; }
.chapo { color: var(--encre-douce); font-size: 1.02rem; }

.bloc-outil {
  background: var(--papier-clair);
  border: 1px solid var(--trait);
  padding: 20px var(--marge) 22px;
  margin: 22px 0 0;
}

.compteur {
  font-size: 0.8rem;
  color: var(--encre-douce);
  margin: 0 0 4px;
  letter-spacing: 0.02em;
}

.demande { font-family: var(--serif); font-size: 1.22rem; line-height: 1.3; margin: 0 0 4px; }
.aide { font-size: 0.88rem; color: var(--encre-douce); margin: 0 0 16px; }

.choix { display: grid; gap: 8px; margin: 0 0 4px; }

.opt {
  display: block;
  width: 100%;
  text-align: left;
  font: inherit;
  color: inherit;
  background: var(--papier);
  border: 1px solid var(--trait);
  border-radius: 2px;
  padding: 12px 14px;
  cursor: pointer;
}
.opt:hover { border-color: var(--trait-fort); background: #f6f4ee; }
.opt:active { background: var(--sable); }
.opt b { font-weight: 600; display: block; }
.opt span { display: block; font-size: 0.85rem; color: var(--encre-douce); margin-top: 2px; }

.champ { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.champ input {
  font: inherit;
  font-variant-numeric: tabular-nums;
  width: 7.5em;
  padding: 11px 12px;
  border: 1px solid var(--trait-fort);
  border-radius: 2px;
  background: var(--papier);
  color: inherit;
}
.champ .unite { color: var(--encre-douce); }

.bouton {
  font: inherit;
  font-weight: 600;
  color: var(--papier-clair);
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 2px;
  padding: 12px 20px;
  cursor: pointer;
}
.bouton:hover { background: var(--accent-sombre); }
.bouton[disabled] { opacity: 0.4; cursor: not-allowed; }

.lien-nu {
  font: inherit;
  font-size: 0.88rem;
  color: var(--encre-douce);
  background: none;
  border: 0;
  padding: 6px 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.barre-nav { margin-top: 14px; min-height: 22px; }

/* --- Resultat --- */
.resultat { margin-top: 22px; }

.verdict {
  border: 1px solid var(--trait);
  border-left: 5px solid var(--encre-douce);
  background: var(--papier-clair);
  padding: 18px var(--marge) 20px;
}
.verdict[data-v="rien"] { border-left-color: var(--vert); background: var(--vert-fond); }
.verdict[data-v="dp"] { border-left-color: var(--ambre); background: var(--ambre-fond); }
.verdict[data-v="pc"] { border-left-color: var(--brique); background: var(--brique-fond); }
.verdict[data-v="mairie"] { border-left-color: var(--ardoise); background: var(--ardoise-fond); }

.verdict .rappel { font-size: 0.85rem; color: var(--encre-douce); margin: 0 0 6px; }
.verdict h2 { margin-bottom: 10px; }
.verdict[data-v="rien"] h2 { color: var(--vert); }
.verdict[data-v="dp"] h2 { color: var(--ambre); }
.verdict[data-v="pc"] h2 { color: var(--brique); }
.verdict[data-v="mairie"] h2 { color: var(--ardoise); }
.verdict p:last-child { margin-bottom: 0; }

.sources { font-size: 0.88rem; color: var(--encre-douce); margin: 14px 0 0; }
.sources li { margin-bottom: 4px; }
.sources ul { margin: 6px 0 0; padding-left: 18px; }

/* Regle graduee : les seuils du projet, et ou il tombe */
.regle-graduee { margin: 18px 0 4px; }
.regle-graduee .titre-graduee { font-size: 0.8rem; color: var(--encre-douce); margin: 0 0 5px; }
.regle-graduee .barre { display: flex; height: 28px; border: 1px solid var(--trait-fort); }
.regle-graduee .zone {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  font-size: 0.74rem;
  color: var(--papier-clair);
  border-right: 1px solid var(--trait-fort);
  overflow: hidden;
  white-space: nowrap;
}
.regle-graduee .zone:last-child { border-right: 0; }
.regle-graduee .zone:not(.active) { opacity: 0.28; }
.regle-graduee .zone.active { font-weight: 600; }
.regle-graduee .zone[data-v="rien"] { background: var(--vert); }
.regle-graduee .zone[data-v="dp"] { background: var(--ambre); }
.regle-graduee .zone[data-v="pc"] { background: var(--brique); }
.regle-graduee .position { font-size: 0.88rem; margin: 8px 0 0; }

.doute {
  border: 1px solid var(--trait);
  border-left: 5px solid var(--ardoise);
  background: var(--ardoise-fond);
  padding: 14px var(--marge);
  margin-top: 14px;
}
.doute h3 { margin-bottom: 6px; }
.doute ul { margin: 0; padding-left: 18px; }
.doute li { margin-bottom: 6px; }
.doute li:last-child { margin-bottom: 0; }

.notes { margin-top: 14px; font-size: 0.92rem; color: var(--encre-douce); }
.notes li { margin-bottom: 6px; }
.suite { margin-top: 18px; }

/* --- Offres --- */
.offres { display: grid; gap: 14px; margin-top: 20px; }

.offre {
  background: var(--papier-clair);
  border: 1px solid var(--trait);
  padding: 20px var(--marge) 22px;
  display: flex;
  flex-direction: column;
}
.offre.principale { border-color: var(--accent); border-width: 2px; }
.offre h3 { margin-bottom: 4px; }
.offre .prix {
  font-family: var(--serif);
  font-size: 2.1rem;
  line-height: 1;
  margin: 10px 0 2px;
}
.offre .prix small { font-size: 0.85rem; font-family: var(--sans); color: var(--encre-douce); margin-left: 5px; }
.offre .pour { font-size: 0.92rem; color: var(--encre-douce); margin-bottom: 14px; }
.offre ul { margin: 0 0 18px; padding-left: 18px; font-size: 0.95rem; }
.offre li { margin-bottom: 5px; }
.offre .bouton { margin-top: auto; width: 100%; }
.offre .apres { font-size: 0.82rem; color: var(--encre-douce); margin: 10px 0 0; text-align: center; }

.offre .sous-titre {
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--encre-douce);
  margin: 0 0 6px;
}
.offre ul + .sous-titre { margin-top: 2px; }

.franchise {
  border-left: 3px solid var(--trait-fort);
  padding-left: 14px;
  margin: 24px 0 0;
  font-size: 0.95rem;
  color: var(--encre-douce);
}

/* --- Planche d'exemple (DPC4) --- */
.planche { margin: 20px 0 0; }
.planche img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--trait-fort);
  background: #fff;
}
.planche figcaption {
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--encre-douce);
  margin-top: 10px;
  max-width: 62ch;
}
.planche .dit { display: block; margin-top: 6px; }
.planche figcaption > a { display: inline-block; margin-top: 6px; }

/* --- Listes de details --- */
.detail { margin-top: 8px; }
.detail dt { font-weight: 600; margin-top: 14px; }
.detail dd { margin: 4px 0 0; color: var(--encre-douce); }

.pieces { margin: 0; padding-left: 18px; }
.pieces li { margin-bottom: 6px; }
.pieces b { font-weight: 600; }

/* --- Fenetre d'attente --- */
dialog {
  border: 1px solid var(--encre);
  border-radius: 2px;
  background: var(--papier-clair);
  color: var(--encre);
  padding: 0;
  width: min(440px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
}
dialog::backdrop { background: rgba(23, 32, 28, 0.45); }
.dedans { padding: 22px var(--marge) 20px; }
.dedans h2 { font-size: 1.3rem; }
.dedans form { display: flex; gap: 8px; margin: 16px 0 8px; flex-wrap: wrap; }
.dedans input[type="email"] {
  font: inherit;
  flex: 1 1 180px;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid var(--trait-fort);
  border-radius: 2px;
  background: var(--papier);
  color: inherit;
}
.mention { font-size: 0.82rem; color: var(--encre-douce); margin: 0; }
.merci { color: var(--accent); font-weight: 600; }
.fermer { margin-top: 16px; }

/* --- Ce que ca coute a une mission --- */
.repere {
  background: var(--accent-fond);
  border-left: 3px solid var(--accent);
  padding: 16px var(--marge) 18px;
  margin-top: 20px;
}
.repere h3 { margin-bottom: 8px; }
.repere ul { margin: 0 0 12px; padding-left: 18px; font-size: 0.95rem; }
.repere li { margin-bottom: 5px; }
.repere p:last-child { margin-bottom: 0; }

/* --- Tableau comparatif (deborde en largeur sur telephone) --- */
/* La page du comparatif s'elargit pour que le tableau tienne en entier sur un ecran. */
.page-large { --large: 1040px; }

.cadre-tableau {
  overflow-x: auto;
  margin: 18px 0 8px;
  border: 1px solid var(--trait);
  background: var(--papier-clair);
}
table.comparatif {
  border-collapse: separate;
  border-spacing: 0;
  min-width: 1000px;
  font-size: 0.9rem;
}
table.comparatif th, table.comparatif td {
  border-right: 1px solid var(--trait);
  border-bottom: 1px solid var(--trait);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
  min-width: 170px;
}
table.comparatif thead th {
  background: var(--sable);
  font-weight: 600;
  font-size: 0.85rem;
}
/* Premiere colonne figee : sur telephone, on garde le nom de la ligne en vue. */
table.comparatif thead th:first-child,
table.comparatif tbody th {
  position: sticky;
  left: 0;
  z-index: 1;
  width: 130px;
  min-width: 130px;
  font-weight: 600;
  background: var(--sable);
  box-shadow: 1px 0 0 var(--trait-fort);
}
table.comparatif tbody th { background: var(--papier); }
table.comparatif col.nous, table.comparatif .nous { background: var(--accent-fond); }
table.comparatif .absent { color: var(--encre-douce); }
.sous-tableau { font-size: 0.85rem; color: var(--encre-douce); }

/* --- Pied --- */
.pied {
  border-top: 1px solid var(--trait);
  margin-top: 44px;
  padding-top: 18px;
  font-size: 0.85rem;
  color: var(--encre-douce);
}
.pied p { margin-bottom: 8px; }

@media (min-width: 620px) {
  body { font-size: 18px; }
  h1 { font-size: 2.5rem; }
  .offres { grid-template-columns: 1fr 1fr; align-items: stretch; }
  .offres.une { grid-template-columns: minmax(0, 420px); }
  .bloc-outil, .verdict, .offre, .doute { padding-left: 26px; padding-right: 26px; }
}

@media (prefers-reduced-motion: no-preference) {
  .opt, .bouton { transition: background-color 120ms ease, border-color 120ms ease; }
}
