/* Bricolage Grotesque (police du logo), auto-hébergée — licence OFL : ../fonts/bricolage-grotesque/LICENSE.txt
   Police variable : graisses 200 à 800. */
@font-face {
    font-family: 'Bricolage Grotesque';
    font-style: normal;
    font-display: swap;
    font-weight: 200 800;
    src: url('../fonts/bricolage-grotesque/bricolage-grotesque-latin-ext-wght-normal.woff2') format('woff2-variations');
    unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
    font-family: 'Bricolage Grotesque';
    font-style: normal;
    font-display: swap;
    font-weight: 200 800;
    src: url('../fonts/bricolage-grotesque/bricolage-grotesque-latin-wght-normal.woff2') format('woff2-variations');
    unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

:root {
    --fond: #f4f2ee;   /* couleurs du logo */
    --surface: #ffffff;
    --texte: #1c1f24;
    --texte-doux: #5c636b;
    --accent: #e8622c;
    --accent-fonce: #c4430f;
    --bord: #ddd8cf;
    --rayon: 10px;

    /* Polices */
    --police-titre: 'Bricolage Grotesque', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

    /* Couleurs des prises */
    --p-depart: #22c55e;
    --p-main: #ffffff;
    --p-pied: #facc15;
    --p-top: #ef4444;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    background: var(--fond);
    color: var(--texte);
    line-height: 1.5;
}

a { color: var(--accent-fonce); }

/* --- En-tête ------------------------------------------------------------ */

.entete {
    display: flex; flex-wrap: wrap; gap: .5rem 1rem;
    align-items: center; justify-content: space-between;
    padding: .75rem 1rem;
    background: var(--texte); color: #fff;
}
.entete a { color: #fff; text-decoration: none; }
.entete nav { display: flex; flex-wrap: wrap; gap: .25rem 1rem; align-items: center; }
.logo { display: flex; align-items: center; }
.logo svg { display: block; height: 36px; width: auto; }
.logo-symbole { display: none; }
@media (max-width: 480px) {
    .logo-complet { display: none; }
    .logo-symbole { display: block; }
}
.pseudo { opacity: .7; }

.contenu { max-width: 1100px; margin: 0 auto; padding: 1rem; }

h1 { font-size: 1.6rem; margin: .5rem 0 1rem; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
h2 { font-size: 1.15rem; margin: 0 0 .75rem; }
h1, h2, h3 { font-family: var(--police-titre); letter-spacing: -0.01em; line-height: 1.2; }
h1 { font-weight: 700; }
h2, h3 { font-weight: 650; }

.titre-actions { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; justify-content: space-between; }
.fil { margin: 0; }
.vide, .aide, .meta, small { color: var(--texte-doux); }

/* --- Boutons et formulaires -------------------------------------------- */

.btn, button[type=submit] {
    display: inline-block; border: 0; cursor: pointer;
    background: var(--accent); color: #fff; font: inherit; font-weight: 600;
    padding: .6rem 1.1rem; border-radius: var(--rayon); text-decoration: none;
}
.btn:hover { background: var(--accent-fonce); }
.btn-petit { padding: .3rem .8rem; }
.btn-grand { width: 100%; padding: .9rem; font-size: 1.1rem; }
.btn-secondaire { background: #fff; color: var(--texte); border: 1px solid var(--bord); }
.btn-danger { background: #b42318; }
.btn-lien { background: none; border: 0; color: var(--accent-fonce); cursor: pointer; font: inherit; }

.carte-form, .etape {
    background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon);
    padding: 1.25rem; margin-bottom: 1rem;
}
.carte-form { max-width: 440px; margin: 1rem auto; }

form label { display: block; font-weight: 600; margin: .75rem 0 .25rem; }
form label.case, .filtres label { font-weight: normal; }
input[type=text], input[type=email], input[type=password], input[type=file], select, textarea {
    width: 100%; font: inherit; padding: .55rem .7rem;
    border: 1px solid var(--bord); border-radius: 8px; background: #fff;
}
textarea { min-height: 5rem; }
form > div, .etape > div { margin-bottom: .5rem; }
ul:has(> li > .form-error), form ul { color: #b42318; padding-left: 1.2rem; margin: .25rem 0; }
#voie_systeme { display: flex; gap: 1.5rem; }
#voie_systeme label { display: inline; font-weight: normal; margin-left: .3rem; }

.flash { padding: .75rem 1rem; border-radius: var(--rayon); margin-bottom: 1rem; }
.flash-success { background: #dcfce7; color: #14532d; }
.flash-error { background: #fee2e2; color: #7f1d1d; }

/* --- Filtres ------------------------------------------------------------ */

.filtres {
    display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end;
    background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon);
    padding: .75rem 1rem; margin-bottom: 1.25rem;
}
.filtres label { margin: 0; }
.filtres select { width: auto; min-width: 7rem; }
.plage { display: flex; gap: .5rem; border: 0; padding: 0; margin: 0; }

/* --- Listes ------------------------------------------------------------- */

.grille-voies {
    list-style: none; padding: 0; margin: 0;
    display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.carte-voie a {
    display: block; text-decoration: none; color: inherit;
    background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon); overflow: hidden;
}
.carte-voie a:hover { box-shadow: 0 4px 14px rgba(0,0,0,.1); }
.carte-infos { padding: .6rem .8rem; display: grid; grid-template-columns: auto 1fr; gap: 0 .6rem; align-items: center; }
.carte-infos small { grid-column: 2; }
.carte-infos .badge { grid-row: span 2; }

.liste-secteurs { list-style: none; padding: 0; display: grid; gap: .5rem; }
.liste-secteurs a {
    display: flex; justify-content: space-between; text-decoration: none; color: inherit;
    background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon); padding: .8rem 1rem;
}

/* --- Badge de cotation -------------------------------------------------- */

.badge {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 2.4rem; height: 2.4rem; padding: 0 .5rem; border-radius: 999px;
    font-weight: 800; font-size: .95rem; color: #fff;
    background: var(--couleur); border: 2px solid rgba(0,0,0,.15);
}
.badge-couleur { font-size: 0; min-width: 1.8rem; height: 1.8rem; padding: 0; }
.badge-fr { text-shadow: 0 1px 1px rgba(0,0,0,.35); }

/* --- Photo + prises ----------------------------------------------------- */

.photo-voie { position: relative; margin: 0; line-height: 0; background: #222; }
.photo-voie img { width: 100%; height: auto; display: block; }
.photo-voie svg { position: absolute; inset: 0; width: 100%; height: 100%; }
/* Pas d'object-fit/crop : le SVG doit couvrir exactement l'image pour rester aligné. */
.photo-voie.grande { border-radius: var(--rayon); overflow: hidden; }

.prise { fill: none; }
.prise-depart { stroke: var(--p-depart); }
.prise-main { stroke: var(--p-main); }
.prise-pied { stroke: var(--p-pied); }
.prise-top { stroke: var(--p-top); }

.legende { display: flex; flex-wrap: wrap; gap: 1rem; list-style: none; padding: 0; }
.pastille {
    display: inline-block; width: .9rem; height: .9rem; border-radius: 50%;
    border: 3px solid currentColor; vertical-align: -2px; background: #555;
}
.pastille.prise-depart { color: var(--p-depart); }
.pastille.prise-main { color: var(--p-main); }
.pastille.prise-pied { color: var(--p-pied); }
.pastille.prise-top { color: var(--p-top); }

/* --- Éditeur ------------------------------------------------------------ */

.barre-outils {
    display: flex; flex-wrap: wrap; gap: .4rem; align-items: center;
    position: sticky; top: 0; z-index: 2;
    background: var(--surface); padding: .5rem 0;
}
.outil {
    font: inherit; cursor: pointer; padding: .45rem .75rem;
    border: 1px solid var(--bord); border-radius: 999px; background: #fff;
}
.outil[aria-pressed=true] { background: var(--texte); color: #fff; border-color: var(--texte); }
.taille { display: flex; align-items: center; gap: .4rem; margin: 0 0 0 .5rem; font-weight: normal; }
.taille input { width: 6rem; }

.editeur { border-radius: var(--rayon); overflow: hidden; }
.editeur-vide {
    margin: 0; padding: 3rem 1rem; text-align: center; color: var(--texte-doux);
    border: 2px dashed var(--bord); border-radius: var(--rayon);
}
.photo-voie.edition svg { cursor: crosshair; touch-action: none; }
.compteur { margin: .5rem 0 0; color: var(--texte-doux); }

[hidden] { display: none !important; }

@media (max-width: 600px) {
    h1 { font-size: 1.35rem; }
    .filtres select { min-width: 0; }
}

/* Modification et croix */
.actions { display: flex; gap: .5rem; align-items: center; }
.actions form { margin: 0; }
.flash-info { background: #e0f2fe; color: #0c4a6e; }
.croix { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--bord); }
.croix form { margin: .5rem 0; }

/* Suppression d'une voie validée */
.zone-danger { margin-top: 2rem; padding: 1rem; border: 1px solid #f3b4ae; border-radius: var(--rayon); background: #fff5f4; }
.zone-danger h2 { margin-top: 0; color: #b42318; font-size: 1.1rem; }
.zone-danger form { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.zone-danger label { flex-basis: 100%; }
.zone-danger input[type=text] { flex: 1 1 12rem; }

/* Mises à jour */
.bandeau-maj { background: var(--accent); color: #fff; text-align: center; padding: .5rem 1rem; }
.bandeau-maj a { color: #fff; font-weight: 600; }
.carte-form-large { background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 1.25rem; margin-bottom: 1rem; }
.notes-version { background: var(--fond); border-radius: var(--rayon); padding: .75rem 1rem; }
.journal { margin: 0; padding-left: 1.25rem; }
.pied { max-width: 1100px; margin: 2rem auto 1rem; padding: 0 1rem; color: var(--texte-doux); font-size: .85rem; }
