:root {
  --fond: #f6f7f9;
  --carte: #ffffff;
  --texte: #16181d;
  --discret: #646b78;
  --bord: #e3e6eb;
  --accent: #2a6df4;
  --accent-texte: #ffffff;
  --ok: #157a4a;
  --ok-fond: #e3f5ec;
  --attente: #8a5a00;
  --attente-fond: #fdf1d8;
  --erreur: #b42318;
  --erreur-fond: #fdecea;
  --rayon: 12px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fond: #111318;
    --carte: #1a1d24;
    --texte: #eceef2;
    --discret: #9aa1ad;
    --bord: #2b2f38;
    --accent: #5b8ff9;
    --ok: #4cc38a;
    --ok-fond: #15291f;
    --attente: #f0b54a;
    --attente-fond: #2d2414;
    --erreur: #f97066;
    --erreur-fond: #2f1715;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--fond);
  color: var(--texte);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); }
h1 { font-size: 1.7rem; margin: 0 0 1rem; letter-spacing: -0.01em; }
h2 { font-size: 1.1rem; margin: 1.5rem 0 .75rem; }
.carte h2:first-child { margin-top: 0; }
h3 { font-size: 1rem; margin: 0 0 .25rem; }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; }
pre { background: var(--fond); border: 1px solid var(--bord); border-radius: 8px; padding: .6rem .8rem; overflow-x: auto; }
small, .discret { color: var(--discret); }

/* En-tête */
.entete {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding: .9rem clamp(16px, 4vw, 40px);
  background: var(--carte); border-bottom: 1px solid var(--bord);
}
.logo { display: flex; align-items: center; gap: .6rem; font-weight: 700; color: var(--texte); text-decoration: none; }
.pastille { width: 14px; height: 14px; border-radius: 4px; background: var(--accent); }
nav { display: flex; align-items: center; gap: .25rem; flex-wrap: wrap; }
nav a, .lien {
  color: var(--discret); text-decoration: none; padding: .4rem .7rem; border-radius: 8px;
  font: inherit; background: none; border: 0; cursor: pointer;
}
nav a:hover, .lien:hover { color: var(--texte); background: var(--fond); }
nav a.actif { color: var(--texte); background: var(--fond); font-weight: 600; }
nav form { margin: 0; }
nav a.bouton { color: var(--accent-texte); }

/* Mise en page */
.page { max-width: 1040px; margin: 0 auto; padding: 2rem 16px 4rem; }
.page.moyenne { max-width: 720px; }
.page.etroite { max-width: 420px; }
.carte { background: var(--carte); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 1.25rem; margin-bottom: 1rem; }
.titre-ligne { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.titre-ligne h1 { margin: 0; }

/* Boutons */
.bouton {
  display: inline-block; background: var(--accent); color: var(--accent-texte); border: 0; border-radius: 10px;
  padding: .7rem 1.2rem; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
}
.bouton:hover { filter: brightness(1.08); }
.bouton.petit { padding: .4rem .8rem; }
.bouton.secondaire { background: transparent; color: var(--texte); border: 1px solid var(--bord); }

/* Formulaires */
.formulaire { display: flex; flex-direction: column; gap: 1rem; }
.formulaire h2 { margin: .5rem 0 -.25rem; }
label { display: flex; flex-direction: column; gap: .35rem; font-weight: 500; }
label small { font-weight: 400; }
input, textarea {
  font: inherit; color: var(--texte); background: var(--fond);
  border: 1px solid var(--bord); border-radius: 8px; padding: .6rem .7rem; width: 100%;
}
input:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.formulaire .bouton { align-self: flex-start; }
.deux { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.aide { border-left: 4px solid var(--accent); }

/* Messages */
.message { padding: .75rem 1rem; border-radius: 10px; margin-bottom: 1rem; }
.message.ok { background: var(--ok-fond); color: var(--ok); }
.message.erreur { background: var(--erreur-fond); color: var(--erreur); }
.message.info { background: var(--attente-fond); color: var(--attente); }

/* États et statuts */
.etat, .statut { display: inline-block; padding: .2rem .65rem; border-radius: 999px; font-size: .85rem; font-weight: 600; }
.etat.ok, .statut.validee, .statut.copy { background: var(--ok-fond); color: var(--ok); }
.etat.attente, .statut.en_attente { background: var(--attente-fond); color: var(--attente); }
.etat.inactif, .statut.refusee { background: var(--erreur-fond); color: var(--erreur); }

/* Tableau de bord */
.chiffres { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.chiffre { display: flex; flex-direction: column; gap: .2rem; }
.chiffre span { color: var(--discret); font-size: .9rem; }
.chiffre strong { font-size: 2rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.chiffre a { font-size: .9rem; }
.chiffre.alerte { border-color: var(--attente); }
.barres { display: flex; align-items: flex-end; gap: 6px; height: 160px; }
.barre { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; }
.barre .valeur { width: 100%; max-width: 32px; min-height: 2px; background: var(--accent); border-radius: 4px 4px 0 0; }
.barre span { font-size: .75rem; color: var(--discret); }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .55rem .5rem; border-bottom: 1px solid var(--bord); white-space: nowrap; }
th { color: var(--discret); font-weight: 500; font-size: .85rem; }
tbody tr:last-child td { border-bottom: 0; }
.defile { overflow-x: auto; }

/* Demandes */
.demande { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.actions { display: flex; gap: .5rem; }
.actions form { margin: 0; }

/* Installation */
.etapes { list-style: none; padding: 0; counter-reset: etape; }
.etapes li { position: relative; padding: 0 0 1.25rem 3rem; counter-increment: etape; }
.etapes li::before {
  content: counter(etape); position: absolute; left: 0; top: 0; width: 2rem; height: 2rem; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700; background: var(--carte); border: 1px solid var(--bord);
}
.etapes li.fait::before { content: "✓"; background: var(--ok-fond); color: var(--ok); border-color: transparent; }

/* Accueil */
.hero { padding: 3rem 0 2rem; max-width: 680px; }
.hero h1 { font-size: clamp(2rem, 5vw, 2.8rem); line-height: 1.15; }
.hero p { font-size: 1.15rem; color: var(--discret); margin-bottom: 1.5rem; }
.trois { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }

@media (max-width: 760px) {
  .chiffres { grid-template-columns: 1fr 1fr; }
  .trois, .deux { grid-template-columns: 1fr; }
  .barre span { font-size: .65rem; }
}

/* Choix du type de groupe */
.choix { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.option { flex-direction: row; align-items: flex-start; gap: .6rem; padding: .9rem; border: 1px solid var(--bord); border-radius: 10px; cursor: pointer; font-weight: 400; }
.option:has(input:checked) { border-color: var(--accent); background: var(--fond); }
.option input { width: auto; margin-top: .3rem; }
.option span { display: flex; flex-direction: column; gap: .2rem; }

/* Capture de dépôt */
.demande .infos { flex: 1; min-width: 180px; }
.capture img { display: block; width: 96px; height: 96px; object-fit: cover; border-radius: 8px; border: 1px solid var(--bord); }
@media (max-width: 760px) { .choix { grid-template-columns: 1fr; } }
.chiffres.trois-chiffres { grid-template-columns: repeat(3, 1fr); margin-bottom: 1rem; }
@media (max-width: 760px) { .chiffres.trois-chiffres { grid-template-columns: 1fr; } }

/* Icônes */
.icone { flex-shrink: 0; vertical-align: -0.2em; }
nav a, .lien { display: inline-flex; align-items: center; gap: .4rem; }
.bouton { display: inline-flex; align-items: center; gap: .45rem; }
h2 { display: flex; align-items: center; gap: .5rem; }
h2 .icone { color: var(--accent); }
.chiffre span { display: flex; align-items: center; gap: .4rem; }
.chiffre span .icone { color: var(--accent); }
.chiffre.alerte span .icone { color: var(--attente); }
.pastille-icone {
  display: inline-grid; place-items: center; width: 44px; height: 44px; margin-bottom: .75rem;
  border-radius: 12px; background: var(--fond); color: var(--accent);
}
.vide { display: flex; align-items: center; gap: .6rem; }
.vide .icone { color: var(--ok); }
.avec-icone { display: flex; align-items: center; gap: .4rem; }
.option b { display: inline-flex; align-items: center; gap: .3rem; }
.logo-image { display: block; }
@media (max-width: 760px) { .masque-mobile { display: none; } }

/* Abonnement */
.offre form { margin: 1rem 0 .5rem; }
.offre h2 { margin: 0 0 .25rem; }
.prix { margin: 0 0 1rem; }
.prix strong { font-size: 2.2rem; }
.avantages { list-style: none; padding: 0; margin: 0 0 .5rem; display: grid; gap: .45rem; }
.avantages li { display: flex; align-items: center; gap: .5rem; }
.avantages .icone { color: var(--ok); }
