:root {
  --encre: #15171a;
  --texte: #2b2f36;
  --gris: #6b7280;
  --trait: #e3e5e8;
  --fond-doux: #f6f7f8;
  --accent: #15171a;
  --ok: #17663a;
  --ok-fond: #e8f5ec;
  --attente: #8a5a00;
  --attente-fond: #fdf3dc;
  --erreur: #a3261b;
  --erreur-fond: #fbeae8;
  --rayon: 10px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0; background: #fff; color: var(--texte);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--encre); }
h1, h2 { color: var(--encre); line-height: 1.2; }
h1 { font-size: clamp(1.7rem, 3vw, 2.3rem); margin: 0 0 .6rem; letter-spacing: -.01em; }
h2 { font-size: 1.25rem; margin: 0 0 1rem; display: flex; align-items: center; gap: .6rem; }
small { color: var(--gris); font-size: .85em; }
code { background: var(--fond-doux); padding: .1em .35em; border-radius: 4px; }

.bandeau {
  display: flex; align-items: baseline; gap: 1rem; padding: 1rem clamp(1rem, 4vw, 2.5rem);
  border-bottom: 1px solid var(--trait);
}
.bandeau span { color: var(--gris); font-size: .9rem; }
.logo { font-weight: 700; font-size: 1.15rem; text-decoration: none; color: var(--encre); }

main { max-width: 980px; margin: 0 auto; padding: 2rem clamp(1rem, 4vw, 2rem) 8rem; }
main.etroit { max-width: 860px; padding-bottom: 3rem; }

.intro p { font-size: 1.08rem; max-width: 46rem; }
.atouts { padding-left: 1.1rem; margin: 1rem 0 1.4rem; }
.atouts li { margin: .35rem 0; }
.grille-details, .outils details { border: 1px solid var(--trait); border-radius: var(--rayon); padding: .8rem 1rem; }
summary { cursor: pointer; font-weight: 600; color: var(--encre); }
.tarifs { border-collapse: collapse; margin: 1rem 0 .4rem; min-width: 60%; }
.tarifs th, .tarifs td { padding: .45rem .9rem; border-bottom: 1px solid var(--trait); text-align: right; }
.tarifs th:first-child { text-align: left; }
.produits dt { font-weight: 600; margin-top: .7rem; color: var(--encre); }
.produits dd { margin: .15rem 0 0; }

.etape { margin-top: 2.6rem; }
.num {
  display: inline-grid; place-items: center; width: 1.8rem; height: 1.8rem; border-radius: 50%;
  background: var(--encre); color: #fff; font-size: .95rem;
}
.aide { color: var(--gris); font-size: .92rem; margin: .5rem 0; }

input, select, textarea, button { font: inherit; color: inherit; }
input:not([type]), input[type=text], input[type=email], select, textarea {
  width: 100%; padding: .6rem .7rem; border: 1px solid #cfd3d8; border-radius: 8px; background: #fff;
}
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible {
  outline: 2px solid var(--encre); outline-offset: 2px;
}
textarea.l-html { font-family: ui-monospace, Consolas, monospace; font-size: .88rem; }
label { display: block; font-size: .92rem; font-weight: 500; color: var(--encre); }
label > input, label > select, label > textarea { margin-top: .3rem; font-weight: 400; }
label.case { display: flex; gap: .5rem; align-items: center; font-weight: 400; }
label.case input { width: auto; margin: 0; }

button {
  padding: .6rem 1rem; border-radius: 8px; border: 1px solid #cfd3d8; background: #fff; cursor: pointer;
}
button:hover:not(:disabled) { border-color: var(--encre); }
button:disabled { opacity: .45; cursor: not-allowed; }
button.principal { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
button.principal:hover:not(:disabled) { background: #000; }
button.danger { color: var(--erreur); border-color: var(--erreur); }
.lien-bouton { border: 0; background: none; padding: .3rem 0; color: var(--gris); text-decoration: underline; }
.lien-bouton:hover { color: var(--encre); }

.analyse { display: flex; gap: .6rem; }
.analyse input { flex: 1; }

.domaine { border: 1px solid var(--trait); border-radius: var(--rayon); padding: 1rem; margin-top: 1rem; }
.domaine-tete { display: flex; flex-wrap: wrap; align-items: end; gap: 1rem; }
.domaine-tete .dom-nom { font-size: 1.1rem; color: var(--encre); margin-right: auto; align-self: center; }
.domaine-tete label { min-width: 13rem; }
.dom-alerte { color: var(--attente); font-size: .9rem; margin: .5rem 0 0; }
.dom-alerte:empty { display: none; }
.compteurs { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .8rem; margin-top: 1rem; }
.compteur {
  display: flex; justify-content: space-between; align-items: center; gap: .6rem;
  border: 1px solid var(--trait); border-radius: 8px; padding: .7rem .8rem; background: var(--fond-doux);
}
.compteur > div:first-child { display: flex; flex-direction: column; }
.compteur b { color: var(--encre); }
.compteur .dispo { color: var(--ok); }
.compteur.vide .dispo { color: var(--gris); }
.plusmoins { display: flex; align-items: center; gap: .4rem; }
.plusmoins button { width: 2.2rem; height: 2.2rem; padding: 0; font-size: 1.2rem; line-height: 1; }
.plusmoins output { min-width: 1.6rem; text-align: center; font-weight: 700; font-size: 1.1rem; }

.outils { display: grid; gap: .7rem; margin-bottom: 1.2rem; }
.choix-ligne { display: flex; flex-wrap: wrap; gap: .8rem; align-items: end; margin: .7rem 0; }
.choix-ligne > label { flex: 1 1 11rem; }
.choix-ligne > label.large, label.large { flex: 3 1 18rem; }

.ligne { border: 1px solid var(--trait); border-radius: var(--rayon); margin: .6rem 0; background: #fff; }
.ligne-tete {
  width: 100%; display: flex; align-items: center; gap: .8rem; text-align: left; border: 0;
  border-radius: var(--rayon); padding: .8rem 1rem; background: none;
}
.ligne-tete:hover { background: var(--fond-doux); }
.l-num { font-weight: 700; color: var(--gris); }
.l-resume { flex: 1; color: var(--encre); }
.l-prix { font-weight: 600; min-width: 5rem; text-align: right; }
.ligne-corps { padding: 0 1rem 1rem; border-top: 1px solid var(--trait); }
.ligne-corps > label { margin: .7rem 0; }
.l-fourni > label { margin: .7rem 0; }
.l-apercu { width: 100%; height: 360px; border: 1px solid var(--trait); border-radius: 8px; margin: .5rem 0; }
.l-vignette { max-width: 260px; border-radius: 8px; display: block; margin-top: .5rem; }
.ligne-pied { display: flex; gap: 1.2rem; justify-content: flex-end; }

.etat { font-size: .8rem; font-weight: 600; padding: .2rem .55rem; border-radius: 999px; white-space: nowrap; }
.etat-pret, .etat-publiee { background: var(--ok-fond); color: var(--ok); }
.etat-incomplet, .etat-a_attribuer, .etat-attribution_manuelle, .etat-a_rediger, .etat-a_valider, .etat-attente_paiement {
  background: var(--attente-fond); color: var(--attente);
}
.etat-erreur, .etat-refusee, .etat-annulee { background: var(--erreur-fond); color: var(--erreur); }
.erreurs { color: var(--erreur); font-size: .92rem; padding-left: 1.1rem; }
.erreurs:empty { display: none; }
#generales p { margin: .3rem 0; }

.coordonnees { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; margin-bottom: 1rem; }

.total {
  position: fixed; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-between; align-items: center;
  gap: 1rem; padding: .9rem clamp(1rem, 4vw, 2.5rem); background: #fff; border-top: 1px solid var(--trait);
  box-shadow: 0 -4px 18px rgba(0, 0, 0, .05);
}
.total b { font-size: 1.3rem; color: var(--encre); }
.total #pretes { color: var(--gris); font-size: .9rem; }

/* suivi et administration */
.suivi { width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: .95rem; }
.suivi th, .suivi td { text-align: left; padding: .55rem .5rem; border-bottom: 1px solid var(--trait); vertical-align: top; }
.suivi td a { word-break: break-all; }
.note { background: var(--attente-fond); color: var(--attente); padding: .7rem 1rem; border-radius: 8px; }
.note.ok { background: var(--ok-fond); color: var(--ok); }
.petit { color: var(--gris); font-size: .88rem; }
.actions form { margin: 1rem 0; }
.ligne-form { display: flex; gap: .7rem; align-items: end; flex-wrap: wrap; }
.ligne-form label { flex: 1 1 18rem; }
.bloc-form label { margin: .6rem 0; }
.apercu { border-top: 1px solid var(--trait); margin-top: 2rem; padding-top: 1rem; }
.apercu img { max-width: 100%; }
.une { border-radius: 8px; }

@media (max-width: 640px) {
  .analyse { flex-direction: column; }
  .total { flex-direction: column; align-items: stretch; }
  .total button { width: 100%; }
  .l-resume { font-size: .92rem; }
}
