/* Franc-Plein : identité visuelle (vert sapin des Franches-Montagnes, ambre du mazout et de la chaleur) */
:root {
    color-scheme: light;
    --fond: #fbfaf6; --carte: #ffffff; --texte: #1d2a24; --discret: #56645c; --bordure: #dcdcd2;
    --accent: #1f5a43; --accent-fonce: #164532; --lien: #1f5a43; --accent-doux: #e6efe9; --texte-sur-accent: #ffffff;
    --chaud: #c4610f; --chaud-doux: #fbf0e3;
    --succes: #e3f1e5; --erreur: #fbe4e1; --erreur-texte: #a12622; --lancement: #fff7e0; --lancement-bord: #e2b33b;
    --serie-ofs: #2a78d6; --serie-fp: #c4610f; --grille: #e8e7df;
    --ombre: 0 1px 2px rgb(0 0 0 / .05), 0 4px 12px rgb(0 0 0 / .04);
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        color-scheme: dark;
        --fond: #141816; --carte: #1c1f1d; --texte: #ecefe9; --discret: #a9b3ad; --bordure: #313833;
        --accent: #2f7a59; --accent-fonce: #3a8e69; --lien: #7fd0a8; --accent-doux: #1f2c25; --texte-sur-accent: #ffffff;
        --chaud: #d06f22; --chaud-doux: #2a2018;
        --succes: #1d2e22; --erreur: #3a1f1d; --erreur-texte: #f19a93; --lancement: #2b2615; --lancement-bord: #8a6d1f;
        --serie-ofs: #3987e5; --serie-fp: #d06f22; --grille: #2a2f2c;
        --ombre: none;
    }
}
:root[data-theme="dark"] {
    color-scheme: dark;
    --fond: #141816; --carte: #1c1f1d; --texte: #ecefe9; --discret: #a9b3ad; --bordure: #313833;
    --accent: #2f7a59; --accent-fonce: #3a8e69; --lien: #7fd0a8; --accent-doux: #1f2c25; --texte-sur-accent: #ffffff;
    --chaud: #d06f22; --chaud-doux: #2a2018;
    --succes: #1d2e22; --erreur: #3a1f1d; --erreur-texte: #f19a93; --lancement: #2b2615; --lancement-bord: #8a6d1f;
    --serie-ofs: #3987e5; --serie-fp: #d06f22; --grille: #2a2f2c;
    --ombre: none;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-size: 1.0625rem;
    color: var(--texte); background: var(--fond); line-height: 1.55; }
a { color: var(--lien); text-underline-offset: .15em; }
a:hover { color: var(--lien); text-decoration-thickness: 2px; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -.01em; }
h1 { font-size: clamp(1.6rem, 4vw, 2.3rem); margin: .2em 0 .5em; }
h2 { font-size: 1.35rem; margin-top: 2rem; }
:focus-visible { outline: 3px solid var(--chaud); outline-offset: 2px; }
code { font-size: .95em; }

/* Bandeau de phase de test */
.bandeau-test { margin: 0; padding: .5rem 1rem; text-align: center; font-size: .9rem; background: var(--chaud); color: #fff; }

/* En-tête et pied */
.entete { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .75rem 1.25rem;
    padding: .75rem 1rem; background: var(--carte); border-bottom: 1px solid var(--bordure); }
.entete nav { display: flex; flex-wrap: wrap; gap: .5rem 1.1rem; align-items: center; }
.entete form { margin: 0; }
.logo { display: inline-flex; align-items: center; gap: .55rem; color: var(--texte); text-decoration: none; font-weight: 800; font-size: 1.25rem; }
.logo svg { width: 34px; height: 34px; flex: none; }
.logo small { display: block; font-weight: 500; font-size: .75rem; color: var(--discret); letter-spacing: 0; }
.logo:hover { color: var(--texte); }
.contenu { max-width: 50rem; margin: 0 auto; padding: 1.5rem 1rem 3rem; }
.contenu.large { max-width: 72rem; }
.pied { background: var(--carte); border-top: 1px solid var(--bordure); margin-top: 2rem; }
.pied-interieur { max-width: 50rem; margin: 0 auto; padding: 1.5rem 1rem; font-size: .9rem; color: var(--discret); }
.pied-interieur nav { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; margin-bottom: .75rem; }

/* Accueil */
.hero { padding: 1rem 0 .5rem; }
.hero p.chapeau { font-size: 1.2rem; color: var(--discret); max-width: 38rem; }
.hero .actions { margin-top: 1.25rem; }
.points-forts { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: .75rem; margin: 1.5rem 0; padding: 0; list-style: none; }
.points-forts li { background: var(--accent-doux); border-radius: .6rem; padding: .8rem 1rem; }
.points-forts strong { display: block; }
.etapes { counter-reset: etape; list-style: none; padding: 0; display: grid; gap: .75rem; }
.etapes li { counter-increment: etape; position: relative; padding: .85rem 1rem .85rem 3.4rem; background: var(--carte);
    border: 1px solid var(--bordure); border-radius: .6rem; }
.etapes li::before { content: counter(etape); position: absolute; left: 1rem; top: .85rem; width: 1.7rem; height: 1.7rem;
    border-radius: 50%; background: var(--accent); color: var(--texte-sur-accent); font-weight: 700; display: grid; place-items: center; font-size: .9rem; }
.tournee-carte { border-left: 4px solid var(--chaud); }
.faq details { background: var(--carte); border: 1px solid var(--bordure); border-radius: .6rem; padding: .75rem 1rem; margin-bottom: .5rem; }
.faq summary { font-weight: 600; cursor: pointer; }

/* Accueil épuré */
.accueil { text-align: center; max-width: 48rem; margin: 0 auto; }
.accueil .logo-accueil { width: 72px; height: 72px; margin-top: 1rem; }
.accueil h1 { margin-top: .5rem; }
.accueil .chapeau { font-size: 1.15rem; color: var(--discret); margin: 0 auto 1.25rem; }
.accueil .points-forts { text-align: left; margin: 1rem 0 2rem; font-size: .95rem; }
@media (min-width: 44rem) { .accueil .points-forts { grid-template-columns: repeat(3, 1fr); } }
.accueil h2 { margin: 1.5rem 0 .75rem; }
.tournee-accueil { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .75rem 1rem;
    text-align: left; background: var(--carte); border: 1px solid var(--bordure); border-left: 5px solid var(--chaud);
    border-radius: .6rem; padding: 1rem 1.25rem; margin-bottom: .75rem; box-shadow: var(--ombre); }
.tournee-accueil p { margin: .1rem 0; }
.tournee-date { font-size: 1.3rem; font-weight: 750; }
.bouton.grand { padding: .8rem 1.5rem; font-size: 1.1rem; }
.liens-accueil { margin: 1.5rem 0 .5rem; display: flex; justify-content: center; flex-wrap: wrap; gap: .5rem; }
.lancement-court { font-size: .92rem; color: var(--discret); background: var(--lancement); border-radius: .5rem; padding: .6rem .9rem; }

.confirmation-inscription { text-align: center; background: var(--succes); border: 2px solid var(--accent); border-radius: .8rem;
    padding: 1.25rem 1.25rem 1rem; margin-bottom: 1.5rem; }
.confirmation-inscription .coche { width: 3rem; height: 3rem; margin: 0 auto .25rem; border-radius: 50%; background: var(--accent);
    color: var(--texte-sur-accent); font-size: 1.8rem; line-height: 3rem; font-weight: 700; }
.confirmation-inscription h1 { margin: .2rem 0; }

.resume-erreurs:focus, .confirmation-inscription:focus { outline: none; }

/* Composants */
.carte { background: var(--carte); border: 1px solid var(--bordure); border-radius: .6rem; padding: 1rem 1.25rem; margin-bottom: 1rem; box-shadow: var(--ombre); }
.carte h2, .carte h3 { margin-top: 0; }
.bouton { display: inline-block; padding: .65rem 1.2rem; background: var(--accent); color: var(--texte-sur-accent); border: 0;
    border-radius: .45rem; font: inherit; font-weight: 650; text-decoration: none; cursor: pointer; line-height: 1.3; }
.bouton:hover { background: var(--accent-fonce); color: var(--texte-sur-accent); }
.bouton.secondaire { background: transparent; color: var(--lien); box-shadow: inset 0 0 0 1.5px var(--lien); }
.bouton.secondaire:hover { background: var(--accent-doux); color: var(--lien); }
.bouton.danger { background: transparent; color: var(--erreur-texte); box-shadow: inset 0 0 0 1.5px var(--erreur-texte); }
.lien { background: none; border: 0; padding: 0; font: inherit; color: var(--lien); text-decoration: underline; cursor: pointer; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.actions form { margin: 0; }
.message { padding: .75rem 1rem; border-radius: .45rem; background: var(--carte); border: 1px solid var(--bordure); }
.message.succes { background: var(--succes); }
.message.erreur { background: var(--erreur); }
.aide, .choix small { color: var(--discret); font-size: .92rem; }
.reference { font-size: .8rem; color: var(--discret); word-break: break-all; }
.statut { font-weight: 650; }
.prix-cle { font-size: 1.45rem; font-weight: 750; margin: .2rem 0; }
.prix-cle small { font-size: .95rem; font-weight: 500; color: var(--discret); }
.avis-lancement { background: var(--lancement); border: 2px solid var(--lancement-bord); border-radius: .6rem; padding: 1rem 1.25rem; margin: 1.5rem 0; }
.avis-lancement h2 { margin-top: 0; font-size: 1.2rem; }
.avance { margin: .75rem 0; padding-top: .75rem; border-top: 1px dashed var(--bordure); }
.avance small { display: block; margin-top: .3rem; }

/* Formulaires */
.formulaire fieldset { border: 1px solid var(--bordure); border-radius: .6rem; background: var(--carte); margin: 0 0 1rem; padding: 1rem 1.25rem; }
.formulaire legend { font-weight: 700; padding: 0 .3rem; }
.formulaire fieldset.question { border: 0; padding: 0; margin: 0 0 1rem; background: none; }
.formulaire fieldset.question legend { font-weight: 600; padding: 0; margin-bottom: .25rem; }
.champ { margin-bottom: 1rem; }
.champ label, .champ .label { display: block; font-weight: 600; margin-bottom: .25rem; }
.champ input, .champ select, .champ textarea { width: 100%; padding: .6rem; font: inherit; color: var(--texte);
    border: 1px solid var(--bordure); border-radius: .4rem; background: var(--fond); }
.choix { display: flex; gap: .6rem; align-items: flex-start; margin: .6rem 0; font-weight: normal; cursor: pointer; }
.choix input { flex: none; width: 1.15rem; height: 1.15rem; margin: .2rem 0 0; accent-color: var(--accent); }
[aria-invalid="true"] { border-color: var(--erreur-texte) !important; }
.erreur-champ { color: var(--erreur-texte); margin: .25rem 0 0; font-size: .92rem; }
.piege { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.resume-erreurs { background: var(--erreur); border: 2px solid var(--erreur-texte); border-radius: .6rem; padding: .75rem 1.25rem; margin-bottom: 1rem; }
.resume-erreurs h2 { margin: 0 0 .25rem; font-size: 1.05rem; color: var(--erreur-texte); }
.resume-erreurs ul { margin: .25rem 0; padding-left: 1.2rem; }
.resume-erreurs a { color: var(--texte); }

/* Tableaux */
.defilement { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .95rem; }
th, td { border: 1px solid var(--bordure); padding: .45rem .55rem; text-align: left; vertical-align: top; }
thead th { background: var(--fond); }
.grille input { width: 6rem; padding: .35rem; font: inherit; color: var(--texte); background: var(--fond); border: 1px solid var(--bordure); border-radius: .3rem; }
.ligne { display: flex; flex-wrap: wrap; gap: 1rem; margin-bottom: .5rem; }
.ligne input { width: 7rem; padding: .35rem; font: inherit; color: var(--texte); background: var(--fond); border: 1px solid var(--bordure); border-radius: .3rem; }

/* Graphique des prix */
.graphique { position: relative; margin: 0; }
.graphique figcaption { margin-bottom: .25rem; }
.graphique svg { width: 100%; height: auto; display: block; overflow: visible; }
.graphique .axe text { fill: var(--discret); font-size: 12px; }
.graphique .grille-ligne { stroke: var(--grille); stroke-width: 1; }
.graphique .serie-ofs { stroke: var(--serie-ofs); stroke-width: 2; fill: none; stroke-linejoin: round; stroke-linecap: round; }
.graphique .point-ofs { fill: var(--serie-ofs); stroke: var(--carte); stroke-width: 2; }
.graphique .point-fp { fill: var(--serie-fp); stroke: var(--carte); stroke-width: 2; }
.graphique .etiquette { fill: var(--texte); font-size: 12px; font-weight: 600; }
.graphique .cible { fill: transparent; cursor: pointer; }
.graphique .cible:focus { outline: none; }
.graphique .cible:focus + .anneau, .graphique .cible:hover + .anneau { stroke: var(--texte); stroke-width: 1.5; fill: none; }
.legende { display: flex; flex-wrap: wrap; gap: .4rem 1.25rem; margin: .5rem 0; font-size: .92rem; color: var(--discret); padding: 0; list-style: none; }
.legende li { display: flex; align-items: center; gap: .45rem; }
.cle-ligne { width: 18px; height: 2px; background: var(--serie-ofs); border-radius: 1px; }
.cle-point { width: 10px; height: 10px; border-radius: 50%; background: var(--serie-fp); }
.infobulle { position: absolute; pointer-events: none; background: var(--carte); color: var(--texte); border: 1px solid var(--bordure);
    border-radius: .4rem; padding: .35rem .55rem; font-size: .85rem; box-shadow: var(--ombre); white-space: nowrap; transform: translate(-50%, -115%); }

/* Admin */
.titre-actions { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem; }
.titre-actions small { font-weight: normal; color: var(--discret); font-size: 1rem; }
.chiffres { columns: 2; }
.alerte { color: var(--erreur-texte); }
.qr svg { width: 220px; height: 220px; background: #fff; padding: .5rem; border-radius: .4rem; }
td.actions { white-space: nowrap; }
form.en-ligne { display: inline; margin-left: .5rem; }
.mois-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); gap: 0 1rem; margin-bottom: 1rem; }

@media (max-width: 34rem) {
    .chiffres { columns: 1; }
    /* Le graphique est réduit de moitié sur mobile : textes agrandis en conséquence */
    .graphique .axe text, .graphique .etiquette { font-size: 21px; }
    .logo small { display: none; }
}
.fournisseur-retenu { background: var(--accent-doux); border-radius: .5rem; padding: .6rem .9rem; margin: .5rem 0; }
.fournisseur-retenu p { margin: .2rem 0; }
form.exclusion { display: flex; flex-wrap: wrap; gap: .4rem; }
form.exclusion select { max-width: 16rem; padding: .35rem; font: inherit; color: var(--texte); background: var(--fond); border: 1px solid var(--bordure); border-radius: .3rem; }
.doublon-avec { margin-top: .4rem; padding: .3rem .5rem; border-left: 3px solid var(--chaud); background: var(--chaud-doux); font-size: .9rem; }
tr.a-verifier td { background: var(--chaud-doux); }
.deja-inscrits { color: var(--accent); font-weight: 600; }
/* Choix de la livraison dans le formulaire : même style que les cartes de l'accueil */
.carte-livraison { display: flex; gap: .9rem; align-items: center; background: var(--carte); border: 1px solid var(--bordure);
    border-left: 5px solid var(--chaud); border-radius: .6rem; padding: .9rem 1.1rem; margin-bottom: .75rem; cursor: pointer;
    box-shadow: var(--ombre); }
.carte-livraison input { flex: none; width: 1.3rem; height: 1.3rem; margin: 0; accent-color: var(--accent); }
.carte-livraison-texte { display: flex; flex-direction: column; gap: .15rem; }
.carte-livraison-texte small { color: var(--discret); }
.carte-livraison:has(input:checked) { border-color: var(--accent); border-left-color: var(--accent); background: var(--accent-doux); }
.carte-livraison.urgente { border-left-color: var(--bordure); box-shadow: none; }
.carte-livraison.urgente .carte-livraison-texte strong { font-weight: 650; }
/* Liste de localités du formulaire */
.combo { position: relative; }
.combo ul { position: absolute; z-index: 10; left: 0; right: 0; top: 100%; margin: .2rem 0 0; padding: .25rem 0; list-style: none;
    background: var(--carte); border: 1px solid var(--bordure); border-radius: .5rem; box-shadow: 0 6px 20px rgb(0 0 0 / .12);
    max-height: 18rem; overflow-y: auto; }
.combo li { padding: .65rem .9rem; font-size: 1.1rem; cursor: pointer; display: flex; justify-content: space-between; gap: 1rem; }
.combo li span { color: var(--discret); font-size: .95rem; white-space: nowrap; }
.combo li[hidden] { display: none; }
.combo li:hover, .combo li.active { background: var(--accent-doux); }
/* Fenêtre de confirmation du site */
.dialogue { border: 0; border-radius: .8rem; padding: 1.5rem; max-width: 26rem; width: calc(100% - 2rem); background: var(--carte);
    color: var(--texte); box-shadow: 0 10px 40px rgb(0 0 0 / .25); }
.dialogue::backdrop { background: rgb(0 0 0 / .45); }
.dialogue p { font-size: 1.1rem; margin: 0 0 1.25rem; }
.urgences { border-left: 5px solid var(--erreur-texte); }
/* Sections repliables de l'admin */
details.repli > summary { cursor: pointer; font-size: 1.05rem; padding: .2rem 0; list-style-position: outside; }
details.repli[open] > summary { margin-bottom: .75rem; }
details.repli .formulaire fieldset { border: 0; padding: 0; background: none; }
.garantie-ok { color: var(--accent); }
.garantie-attente { color: var(--discret); }
.changer-numero { margin-top: .75rem; }
.changer-numero summary { cursor: pointer; color: var(--lien); text-decoration: underline; }
.non-livree { margin: .5rem 0; }
.non-livree summary { cursor: pointer; color: var(--lien); text-decoration: underline; }
.partenaires { margin: 1rem 0 0; font-size: .95rem; color: var(--discret); }
.partenaires p { margin: .2rem 0; }
.recherche-entete { margin: 0; }
.recherche-entete input { padding: .35rem .6rem; font: inherit; font-size: .9rem; border: 1px solid var(--bordure); border-radius: .4rem;
    background: var(--fond); color: var(--texte); width: 13rem; }
.recherche-grande input { flex: 1; min-width: 14rem; padding: .6rem; font: inherit; border: 1px solid var(--bordure); border-radius: .4rem;
    background: var(--fond); color: var(--texte); }
.modification { margin-top: .4rem; padding: .3rem .5rem; border-left: 3px solid var(--accent); background: var(--accent-doux); font-size: .9rem; }
.modification ul { margin: .2rem 0 0; padding-left: 1.1rem; }
.modification del { color: var(--erreur-texte); } .modification ins { text-decoration: none; font-weight: 600; }
.ligne-demande { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .5rem 1rem;
    border-top: 1px solid var(--bordure); padding-top: .6rem; margin-top: .6rem; }
.ligne-demande p { margin: 0; }
.alerte-offre { margin: .3rem 0 0; color: var(--erreur-texte); font-weight: 600; font-size: .9rem; }
.annuler-admin { margin-top: .3rem; font-size: .9rem; }
.annuler-admin summary { cursor: pointer; color: var(--erreur-texte); }
.localites { columns: 2 16rem; padding-left: 1.2rem; } .localites li { break-inside: avoid; margin-bottom: .25rem; }
.sondage-accueil { display: flex; flex-wrap: wrap; gap: .75rem 1.5rem; align-items: center; justify-content: space-between; } .sondage-accueil p { margin: 0; flex: 1 1 18rem; text-align: left; }
.champ .libelle { font-weight: 700; display: block; } .champ input[type=file] { padding: .4rem 0; } .grille td small { display: block; color: var(--discret); }
.toutes-communes { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.lien.lien-danger { color: var(--erreur-texte); font-weight: 700; }
/* Frise des étapes d'une tournée */
.frise { display: flex; gap: .25rem; list-style: none; padding: 0; margin: .75rem 0 1rem; counter-reset: none; }
.frise li { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; text-align: center; position: relative; font-size: .9rem; color: var(--discret); }
.frise li::before { content: ""; position: absolute; top: .85rem; left: -50%; width: 100%; height: 3px; background: var(--bordure); z-index: 0; }
.frise li:first-child::before { display: none; }
.frise-fait::before, .frise-en_cours::before { background: var(--accent) !important; }
.frise-point { position: relative; z-index: 1; width: 1.8rem; height: 1.8rem; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: var(--carte); border: 3px solid var(--bordure); }
.frise-fait .frise-point { background: var(--accent); border-color: var(--accent); color: #fff; }
.frise-en_cours .frise-point { border-color: var(--chaud); color: var(--chaud); }
.frise-en_cours .frise-libelle { font-weight: 700; color: var(--texte); }
.frise-libelle { margin-top: .3rem; line-height: 1.2; }
.a-faire p { margin: .4rem 0; } .a-faire .alerte { color: var(--erreur-texte); font-weight: 700; }
.jauge { width: 100%; height: 1.1rem; accent-color: var(--accent); }
.prochaine-etape { padding: .6rem .8rem; border-radius: 6px; background: var(--accent-doux); } .prochaine-etape.a-vous { background: var(--chaud-doux); border-left: 4px solid var(--chaud); }
.ligne-commune { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; justify-content: space-between; padding: .4rem 0; border-bottom: 1px solid var(--bordure); }
.tableau-de-bord { display: grid; grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr)); gap: 1rem; align-items: start; }
.tableau-de-bord .carte { margin: 0; }
.ligne-en-cours { padding: .4rem 0; border-bottom: 1px solid var(--bordure); } .ligne-en-cours:last-child { border-bottom: 0; }
.ligne-en-cours p { margin: 0 0 .3rem; }
