/* Jetons de couleur, clair et sombre. Contrastes texte >= 4.5:1 (WCAG AA). */
:root {
  --fond: #f6f7f5; --surface: #ffffff; --texte: #1c2024; --doux: #555d69; --trait: #d9dcd6;
  --accent: #1d57b3; --accent-texte: #ffffff; --accent-doux: #e7eefa;
  --ok: #1a7431; --ok-doux: #e6f4ea; --attente: #8a5a00; --attente-doux: #fdf3dc;
  --erreur: #b3261e; --erreur-doux: #fce8e6; --neutre: #5b636e;
  --rayon: 10px; --ombre: 0 1px 2px rgb(0 0 0 / .06);
  --largeur: 68rem; --largeur-formulaire: 40rem;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fond: #121417; --surface: #1b1e23; --texte: #e8e9e6; --doux: #a6adb8; --trait: #30343b;
    --accent: #7aaaff; --accent-texte: #0b1a33; --accent-doux: #1c2a44;
    --ok: #6fd28a; --ok-doux: #15291c; --attente: #f0c35a; --attente-doux: #2e2511;
    --erreur: #ff8a80; --erreur-doux: #331a18; --neutre: #a6adb8;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 1rem/1.55 system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--fond); color: var(--texte); display: flex; flex-direction: column; min-height: 100vh; }
a { color: var(--accent); text-underline-offset: .15em; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }
.evitement { position: absolute; left: -999px; top: .5rem; background: var(--surface); padding: .5rem 1rem; z-index: 10; }
.evitement:focus { left: .5rem; }

/* En-tete et navigation */
.entete { background: var(--surface); border-bottom: 1px solid var(--trait); }
.entete-interne { max-width: var(--largeur); margin: 0 auto; padding: .6rem 1rem; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.marque { font-weight: 700; color: var(--texte); text-decoration: none; margin-right: auto; }
nav#navigation { display: flex; align-items: center; gap: .25rem; flex-wrap: wrap; }
nav#navigation > a:not(.bouton) { color: var(--texte); text-decoration: none; padding: .45rem .7rem; border-radius: 8px; }
nav#navigation > a:not(.bouton):hover { background: var(--accent-doux); }
nav#navigation > a[aria-current="page"] { background: var(--accent-doux); color: var(--accent); font-weight: 600; }
.menu-compte { position: relative; margin-left: .5rem; }
.menu-compte summary { cursor: pointer; padding: .45rem .8rem; border: 1px solid var(--trait); border-radius: 999px; list-style: none; }
.menu-compte summary::-webkit-details-marker { display: none; }
.menu-compte summary::after { content: " ▾"; color: var(--doux); }
.menu-deroulant { position: absolute; right: 0; top: calc(100% + .3rem); background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon); box-shadow: 0 8px 24px rgb(0 0 0 / .12); min-width: 12rem; padding: .3rem; z-index: 5; display: grid; }
.menu-deroulant a { padding: .5rem .7rem; border-radius: 6px; color: var(--texte); text-decoration: none; }
.menu-deroulant a:hover { background: var(--accent-doux); }
.bouton-menu { display: none; }
@media (max-width: 52rem) {
  .js .bouton-menu { display: inline-block; font: inherit; padding: .45rem .8rem; border: 1px solid var(--trait); border-radius: 8px; background: var(--surface); color: var(--texte); }
  .js nav#navigation { display: none; width: 100%; flex-direction: column; align-items: stretch; }
  .js nav#navigation.ouvert { display: flex; }
  .menu-compte { margin: .5rem 0 0; }
  .menu-deroulant { position: static; box-shadow: none; margin-top: .3rem; }
}

/* Bandeau d'echeance */
.bandeau { border-bottom: 1px solid var(--trait); }
.bandeau p { max-width: var(--largeur); margin: 0 auto; padding: .7rem 1rem; display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; }
.bandeau.attention { background: var(--attente-doux); }
.bandeau.erreur { background: var(--erreur-doux); }

main { flex: 1; width: 100%; max-width: var(--largeur); margin: 0 auto; padding: 1.75rem 1rem 3rem; }
h1 { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem); line-height: 1.2; margin: 0 0 .5rem; }
h2 { font-size: 1.25rem; margin: 2rem 0 .75rem; }
h3 { font-size: 1.05rem; margin: 0 0 .5rem; }
.chapeau { color: var(--doux); font-size: 1.1rem; max-width: 48rem; margin-top: 0; }
.aide, .note { color: var(--doux); font-size: .9rem; margin: .25rem 0 0; }
.fil { font-size: .9rem; margin-bottom: 1rem; color: var(--doux); }

/* Messages */
.messages:empty { display: none; }
.message { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; padding: .75rem 1rem; border-radius: var(--rayon); margin-bottom: 1rem; border: 1px solid; }
.message p { margin: 0; }
.message.succes { background: var(--ok-doux); border-color: var(--ok); }
.message.erreur { background: var(--erreur-doux); border-color: var(--erreur); }
.message.info { background: var(--accent-doux); border-color: var(--accent); }
.fermer { background: none; border: none; font-size: 1.3rem; line-height: 1; cursor: pointer; color: var(--texte); padding: 0 .25rem; }

/* Surfaces */
.carte, .offre, .document, .encart { background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon); padding: 1.25rem; box-shadow: var(--ombre); }
.encart { margin: 1rem 0; }
.encart.important { border: 2px solid var(--attente); background: var(--attente-doux); }
.encart.danger { border-color: var(--erreur); }
.grille { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1rem; margin: 1rem 0; }
.chiffre { font-size: 1.6rem; font-weight: 700; margin: .25rem 0; }
.vide { text-align: center; padding: 2rem 1rem; color: var(--doux); background: var(--surface); border: 1px dashed var(--trait); border-radius: var(--rayon); }
.vide p { margin: .25rem 0 1rem; }

/* Boutons */
.bouton { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: .6rem 1.1rem; min-height: 2.75rem; border-radius: 8px; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-texte); text-decoration: none; font: inherit; font-weight: 600; cursor: pointer; }
.bouton:hover { filter: brightness(1.08); }
.bouton.secondaire { background: transparent; color: var(--accent); }
.bouton.danger { background: var(--erreur); border-color: var(--erreur); color: #fff; }
.bouton.petit { padding: .3rem .75rem; min-height: 2.25rem; font-size: .9rem; }
.bouton:disabled { opacity: .5; cursor: not-allowed; }
.lien { background: none; border: none; padding: 0; font: inherit; color: var(--accent); text-decoration: underline; cursor: pointer; }
.lien.danger { color: var(--erreur); }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-top: 1rem; }
button.copier { font: inherit; font-size: .85rem; padding: .2rem .6rem; border: 1px solid var(--trait); border-radius: 6px; background: var(--surface); color: var(--accent); cursor: pointer; white-space: nowrap; }
button.copier.copie { color: var(--ok); border-color: var(--ok); }

/* Etats : icone + texte */
.etat { display: inline-flex; gap: .3rem; align-items: center; font-weight: 600; font-size: .9rem; padding: .1rem .55rem; border-radius: 999px; white-space: nowrap; }
.etat.ok { color: var(--ok); background: var(--ok-doux); }
.etat.attente { color: var(--attente); background: var(--attente-doux); }
.etat.erreur { color: var(--erreur); background: var(--erreur-doux); }
.etat.neutre { color: var(--neutre); background: var(--fond); border: 1px solid var(--trait); }

/* Jauges */
.jauge { height: .5rem; background: var(--fond); border: 1px solid var(--trait); border-radius: 999px; overflow: hidden; margin: .4rem 0; }
.jauge span { display: block; height: 100%; background: var(--accent); }

/* Etapes */
.etapes { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; margin: 0 0 1.5rem; color: var(--doux); }
.etapes li { display: flex; align-items: center; gap: .45rem; }
.etapes .numero { display: inline-grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 50%; border: 2px solid var(--trait); font-size: .85rem; font-weight: 700; }
.etapes .faite .numero { background: var(--ok); border-color: var(--ok); color: var(--surface); }
.etapes li + li::before { content: "›"; color: var(--doux); margin-right: 1rem; }
.etapes { gap: .5rem 1rem; }
.masque { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.etapes .courante { color: var(--texte); font-weight: 600; }
.etapes .courante .numero { border-color: var(--accent); color: var(--accent); }
.premiers-pas ol { list-style: none; padding: 0; margin: .75rem 0 0; display: grid; gap: .5rem; }
.premiers-pas li { display: flex; gap: .6rem; align-items: center; }
.premiers-pas .fait { color: var(--doux); text-decoration: line-through; }
.premiers-pas .indisponible { color: var(--doux); cursor: not-allowed; }

/* Formulaires */
.formulaire { display: grid; gap: 1.1rem; max-width: var(--largeur-formulaire); }
.champ { display: grid; gap: .3rem; min-width: 0; }
.champ label, legend { font-weight: 600; }
input, select { font: inherit; width: 100%; min-width: 0; padding: .55rem .65rem; min-height: 2.75rem; border: 1px solid #8a919c; border-radius: 8px; background: var(--surface); color: var(--texte); }
input[type="checkbox"], input[type="radio"] { width: 1.15rem; height: 1.15rem; min-height: 0; accent-color: var(--accent); flex: none; margin: .2rem 0 0; }
input[type="file"] { border-style: dashed; }
fieldset { border: 1px solid var(--trait); border-radius: var(--rayon); padding: 1rem; margin: 0; display: grid; gap: 1rem; min-width: 0; }
.ligne { display: grid; grid-template-columns: 9rem 1fr 6rem; gap: .75rem; }
.adresse { display: flex; align-items: center; gap: .35rem; }
.adresse input { flex: 1; }
.suffixe { color: var(--doux); white-space: nowrap; }
.mot-de-passe { display: flex; gap: .5rem; }
.force[data-niveau="faible"] { color: var(--erreur); }
.force[data-niveau="correct"] { color: var(--attente); }
.force[data-niveau="solide"] { color: var(--ok); }
.force:empty { display: none; }
.case { display: flex; gap: .6rem; align-items: flex-start; font-weight: 400; }
.choix { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: .75rem; border: none; padding: 0; }
.choix label { display: flex; gap: .6rem; align-items: flex-start; padding: .85rem 1rem; border: 1px solid var(--trait); border-radius: var(--rayon); background: var(--surface); cursor: pointer; font-weight: 400; }
.choix label:has(input:checked) { border: 2px solid var(--accent); background: var(--accent-doux); }
.choix strong { display: block; }
.recap { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; align-items: center; padding: .85rem 1rem; background: var(--accent-doux); border-radius: var(--rayon); }

/* Tableaux */
.tableau { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon); }
th, td { text-align: left; padding: .65rem .75rem; border-bottom: 1px solid var(--trait); vertical-align: top; }
th { font-size: .85rem; color: var(--doux); font-weight: 600; }
tr:last-child td { border-bottom: none; }
.nombre { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tfoot td { font-weight: 600; } tr.total td { font-size: 1.1rem; }
code { font-size: .88rem; word-break: break-all; background: var(--fond); padding: .05rem .3rem; border-radius: 4px; }
.fqdn { display: block; color: var(--doux); font-size: .8rem; }
.recherche { max-width: 22rem; margin: .5rem 0; }
@media (max-width: 40rem) {
  table.adaptatif, table.adaptatif tbody, table.adaptatif tr, table.adaptatif td { display: block; width: 100%; }
  table.adaptatif { border: none; background: none; }
  table.adaptatif thead { position: absolute; left: -999px; }
  table.adaptatif tr { background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon); margin-bottom: .75rem; padding: .4rem .2rem; }
  table.adaptatif td { border: none; display: flex; justify-content: space-between; gap: 1rem; text-align: right; padding: .35rem .75rem; }
  table.adaptatif td::before { content: attr(data-label); font-weight: 600; color: var(--doux); text-align: left; }
  table.adaptatif td.nombre { white-space: normal; }
  /* Valeurs longues (DNS) : le libelle au-dessus, la valeur sur toute la largeur. */
  table.adaptatif.empile td { display: block; text-align: left; }
  table.adaptatif.empile td::before { display: block; margin-bottom: .2rem; }
  table.facture .optionnel { display: none; }
  .ligne { grid-template-columns: 1fr; }
}

/* Tarifs */
.offres { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1rem; margin: 1.5rem 0; align-items: start; }
.offre { position: relative; display: flex; flex-direction: column; }
.offre.vedette { border: 2px solid var(--accent); }
.pastille { position: absolute; top: -.8rem; left: 1.25rem; background: var(--accent); color: var(--accent-texte); font-size: .8rem; font-weight: 700; padding: .15rem .6rem; border-radius: 999px; }
.offre h2 { margin-top: .5rem; }
.prix { font-size: 2rem; font-weight: 800; margin: 0; }
.prix span { font-size: .95rem; font-weight: 400; color: var(--doux); }
.offre ul { padding-left: 0; list-style: none; display: grid; gap: .35rem; }
.offre li::before { content: "✓ "; color: var(--ok); font-weight: 700; }
.offre .bouton { margin-top: auto; }
@media (max-width: 40rem) { .offre.vedette { order: -1; } }
.atouts { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1rem; margin: 2rem 0; }
.atouts div { padding: 1rem; border-left: 3px solid var(--accent); background: var(--surface); border-radius: 0 var(--rayon) var(--rayon) 0; }
details.faq { background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon); padding: .75rem 1rem; margin-bottom: .5rem; }
details.faq summary { cursor: pointer; font-weight: 600; }
details.faq[open] summary { margin-bottom: .5rem; }

/* Document (facture) */
.parties { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 1rem 0; }
@media (max-width: 40rem) { .parties { grid-template-columns: 1fr; } }

.pied { border-top: 1px solid var(--trait); background: var(--surface); color: var(--doux); font-size: .9rem; }
.pied p { max-width: var(--largeur); margin: 0 auto; padding: 1rem; }
.simulation { color: var(--attente); font-weight: 600; }
.htmx-indicator { display: none; } .htmx-request .htmx-indicator, .htmx-request.htmx-indicator { display: inline; }
@media print { .entete, .pied, .bandeau, .actions, .messages, .evitement { display: none !important; } body { background: #fff; } .document { border: none; box-shadow: none; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
