/* ChampiPouss — interface v2 (C3). Palette reprise de l'atlas existant pour
   une continuité visuelle ; voir cadrage-app-v2-2026-09-06.md §5 (C3). */
:root{
  --creme:#F7F5EC; --encre:#1F241C; --doux:#6F7268; --rouille:#B5532A;
  --vert:#4C7A4A; --bord:rgba(31,36,28,.14); --fond2:#EFEDE2;
  --danger:#A8341F; --bas:env(safe-area-inset-bottom,0px);
  --peek:132px;
}
*{box-sizing:border-box}
html,body{height:100%}
body{margin:0;font:14px/1.5 system-ui,-apple-system,"Segoe UI",sans-serif;
  color:var(--encre);background:var(--creme);
  -webkit-tap-highlight-color:transparent;-webkit-text-size-adjust:100%}
h1,h2,h3{font-family:Georgia,serif;margin:0}
a{color:var(--rouille)}
button{font:inherit}
input,select,textarea{font:inherit;color:var(--encre)}
[hidden]{display:none!important}

/* ─── éléments partagés : boutons, champs, cartes ────────────────────── */
.btn{padding:9px 14px;border:1px solid var(--bord);border-radius:7px;
  background:#fff;color:var(--encre);cursor:pointer;font-size:13.5px}
.btn:active{transform:translateY(1px)}
.btn.principal{background:var(--rouille);border-color:var(--rouille);color:#fff}
.btn.discret{border-color:transparent;background:none;color:var(--doux)}
.btn.danger{color:var(--danger);border-color:var(--danger)}
.btn:disabled{opacity:.5;cursor:default}
.champ{width:100%;padding:9px 10px;border:1px solid var(--bord);
  border-radius:7px;background:#fff}
label.champ-l{display:block;font-size:11.5px;color:var(--doux);
  text-transform:uppercase;letter-spacing:.5px;margin:12px 0 5px}
.carte-fiche{background:#fff;border:1px solid var(--bord);border-radius:10px;
  padding:14px;box-shadow:0 1px 3px rgba(31,36,28,.08)}
.erreur{color:var(--danger);font-size:13px;margin-top:8px;line-height:1.4}
.info{color:var(--doux);font-size:12.5px;line-height:1.5}
.voile-chg{position:fixed;inset:0;background:var(--creme);z-index:9000;
  display:flex;align-items:center;justify-content:center;color:var(--doux);
  font-size:13px}

/* ─── page de connexion / invitation (centrée, plein écran) ──────────── */
.page-centree{min-height:100%;min-height:100dvh;display:flex;
  align-items:center;justify-content:center;padding:24px 16px}
.page-centree .cadre{width:100%;max-width:360px}
.page-centree header{text-align:center;margin-bottom:22px}
.page-centree header .sous{color:var(--doux);font-size:12.5px;margin-top:5px}
.page-centree form .btn.principal{width:100%;margin-top:16px}
.lien-bas{text-align:center;margin-top:16px;font-size:13px;color:var(--doux)}

/* ─── coquille applicative (une fois connecté) ────────────────────────── */
#app{height:100%;height:100dvh;display:flex;flex-direction:column;overflow:hidden}
#entete{flex:none;display:flex;align-items:center;gap:10px;
  padding:10px 14px;border-bottom:1px solid var(--bord);background:var(--creme)}
#entete h1{font-size:15px;flex:1;min-width:0;overflow:hidden;
  text-overflow:ellipsis;white-space:nowrap}
#entete .qui{font-size:12px;color:var(--doux)}
#corps{flex:1;display:flex;min-height:0;position:relative}
#carte{flex:1;min-width:0;background:var(--fond2)}
#carte .leaflet-container{font:14px/1.5 system-ui,sans-serif}

/* icône de spot (divIcon SVG) : Leaflet ajoute un fond blanc + bordure
   par défaut aux div-icons, à retirer puisque le SVG a déjà sa forme. */
.icone-spot{background:none!important;border:none!important}

/* panneau de contrôles carte (fond, opacité, espèce biotope) — haut gauche.
   Le zoom Leaflet est repoussé en haut à droite (voir initCarte) pour ne
   pas se superposer à ce panneau. */
#controles-carte{position:absolute;left:8px;top:8px;z-index:610;
  display:flex;flex-direction:column;gap:3px;background:#fff;
  border:1px solid var(--bord);border-radius:9px;padding:7px;
  box-shadow:0 1px 3px rgba(31,36,28,.12);width:172px}
#controles-carte select{width:100%;border:1px solid var(--bord);border-radius:6px;
  padding:4px 5px;font-size:12px;background:#fff;margin-bottom:2px}
#controles-carte input[type="range"]{width:100%;margin:1px 0 4px}
#controles-carte .etiq{font-size:9.5px;color:var(--doux);text-transform:uppercase;
  letter-spacing:.4px}

/* chips départements — haut droite, sous le zoom Leaflet */
#deps-chips{position:absolute;right:8px;top:84px;z-index:610;
  display:flex;flex-wrap:wrap;gap:4px;max-width:132px;justify-content:flex-end}
.chip-dep{font-size:10.5px;padding:3px 7px;border-radius:11px;
  border:1px solid var(--bord);background:#fff;color:var(--doux);cursor:pointer;
  box-shadow:0 1px 2px rgba(31,36,28,.1)}
.chip-dep[aria-pressed="true"]{background:var(--rouille);border-color:var(--rouille);color:#fff}

/* bouton géolocalisation, calé sur le style de l'atlas */
#ici{position:absolute;right:8px;bottom:8px;z-index:610;width:38px;height:38px;
  border-radius:50%;border:1px solid var(--bord);background:#fff;
  display:flex;align-items:center;justify-content:center;cursor:pointer;
  box-shadow:0 1px 3px rgba(31,36,28,.15)}
#ici.actif{opacity:.6}

/* tiroir latéral (bureau) / bas d'écran (mobile) */
aside#tiroir{width:360px;flex:none;border-left:1px solid var(--bord);
  display:flex;flex-direction:column;background:var(--creme);min-height:0}
#onglets{flex:none;display:flex;border-bottom:1px solid var(--bord)}
#onglets button{flex:1;padding:11px 4px;border:none;background:none;
  color:var(--doux);font-size:12.5px;font-weight:600;letter-spacing:.2px;
  border-bottom:2px solid transparent;cursor:pointer}
#onglets button.actif{color:var(--rouille);border-color:var(--rouille)}
.panneau{flex:1;overflow-y:auto;-webkit-overflow-scrolling:touch;padding:12px 14px}

/* liste des spots */
.liste-spots{list-style:none;margin:0;padding:0}
.liste-spots li{border-bottom:1px solid var(--bord);padding:11px 2px;
  cursor:pointer}
.liste-spots li:hover{background:rgba(31,36,28,.03)}
.liste-spots .nom{font-weight:600;font-size:13.5px}
.liste-spots .meta{color:var(--doux);font-size:11.5px;margin-top:2px}
.pastille-r{display:inline-block;width:8px;height:8px;border-radius:50%;
  margin-right:5px}
.pastille-r.rien{background:#C9C6B8}
.pastille-r.debut{background:#C9A24C}
.pastille-r.pleine{background:var(--vert)}
.pastille-r.fin{background:#8B6F47}
.bouton-ajout-spot{position:sticky;bottom:0;width:100%;margin-top:10px}

/* fiche spot */
#fiche-spot .titre{display:flex;align-items:flex-start;gap:8px}
#fiche-spot .titre h2{flex:1;font-size:16px}
#fiche-spot .coords{color:var(--doux);font-size:11.5px;margin:2px 0 10px}
.segment-resultat{display:flex;gap:6px;margin-top:6px}
.segment-resultat button{flex:1;padding:10px 2px;border:1px solid var(--bord);
  border-radius:7px;background:#fff;font-size:12px;cursor:pointer;
  display:flex;flex-direction:column;align-items:center;gap:4px}
.segment-resultat button[aria-pressed="true"]{border-color:var(--rouille);
  background:rgba(181,83,42,.08);color:var(--rouille);font-weight:600}
/* « rien » n'est pas un bouton en retrait : même gabarit que les autres
   (cadrage §2 règle 1 — aussi facile à saisir qu'un succès). */

.liste-obs{list-style:none;margin:10px 0 0;padding:0}
.liste-obs li{display:flex;align-items:center;gap:8px;padding:8px 2px;
  border-bottom:1px solid var(--bord);font-size:12.5px}
.liste-obs .date{color:var(--doux);width:76px;flex:none}
.liste-obs .note{color:var(--doux);flex:1;overflow:hidden;text-overflow:ellipsis;
  white-space:nowrap}
.liste-obs button.discret{margin-left:auto}

.onglet-a-venir{color:var(--doux);font-size:13px;line-height:1.6;
  padding:6px 2px}

/* ─── mobile : carte + tiroir en tiroir coulissant depuis le bas ───────── */
@media (max-width:720px){
  #corps{flex-direction:column}
  aside#tiroir{width:auto;border-left:none;border-top:1px solid var(--bord);
    position:absolute;left:0;right:0;bottom:0;
    height:calc(100% - 54px);max-height:calc(100% - 54px);
    transform:translateY(calc(100% - var(--peek) - var(--bas)));
    transition:transform .22s ease;border-radius:14px 14px 0 0;
    box-shadow:0 -2px 10px rgba(31,36,28,.15);z-index:600}
  aside#tiroir.ouvert{transform:translateY(0)}
  #poignee{flex:none;padding:9px 0 4px;text-align:center;cursor:pointer}
  #poignee::before{content:"";display:inline-block;width:34px;height:4px;
    border-radius:2px;background:var(--bord)}
  #corps.tiroir-ouvert #carte{pointer-events:none}
}

/* ─── calques météo / biotope (chantier C2 branché) ──────────────────── */
.calque-ligne{display:flex;align-items:center;gap:7px;cursor:pointer;
  font-size:12.5px;margin:0}
.calque-bloc{border-bottom:1px solid var(--bord);padding:9px 0}
.calque-bloc:last-child{border-bottom:none}
.calque-reglages{margin:6px 0 2px 22px}
input[type="range"]{width:100%;accent-color:var(--rouille);margin:4px 0}
.calque-legende{display:flex;align-items:center;gap:8px;margin-top:6px;
  font-size:11px;color:var(--doux)}
.calque-legende .barre{flex:1;height:8px;border-radius:4px;border:1px solid var(--bord)}
.calque-legende-cat{display:flex;flex-direction:column;gap:4px;margin-top:6px;
  font-size:11px;color:var(--doux)}
.calque-legende-cat span{display:flex;align-items:center;gap:6px}
.calque-legende-cat i{width:9px;height:9px;border-radius:50%;flex:none;display:inline-block}

/* couches météo : rendu lissé, légende à paliers fixes, bulle au clic */
.choix-jour{display:flex;gap:6px}
.choix-jour .btn{flex:none;padding:6px 11px}
.legende-paliers{margin-top:6px;font-size:11px;color:var(--doux)}
.legende-paliers .cases{display:flex;border:1px solid var(--bord);border-radius:3px;overflow:hidden}
.legende-paliers .cases i{flex:1;height:10px}
.legende-paliers .bornes{display:flex;justify-content:space-between;margin-top:2px}
/* une case de plus que de bornes : les bornes tombent entre les cases */
.legende-paliers .bornes.alignees{position:relative;display:block;height:1.4em}
.legende-paliers .bornes.alignees span{position:absolute;top:0;white-space:nowrap}
.legende-paliers .bornes.alignees span.fin{left:auto;right:0}
.legende-symb{display:flex;align-items:center;gap:7px;font-size:11px;color:var(--doux);margin-top:5px}
.legende-symb b{width:22px;height:11px;flex:none}
.symb-fenetre{border:2px solid var(--rouille);
  background:repeating-linear-gradient(-45deg,var(--rouille) 0 1px,transparent 1px 5px)}
.symb-attente{border:2px dotted var(--rouille)}
.symb-indet{background:repeating-linear-gradient(45deg,#addd8e 0 3px,#6a8a55 3px 4px)}
.bulle-meteo .bulle{font-size:12.5px;min-width:240px}
.bulle-meteo .jour{color:var(--doux);font-size:11.5px;margin-bottom:4px}
.bulle-meteo h3{font:600 13.5px system-ui,sans-serif;margin:0 0 4px}
.bulle-meteo table{border-collapse:collapse;width:100%}
.bulle-meteo td{padding:3px 4px;vertical-align:top;border-top:1px solid var(--bord)}
.bulle-meteo td.c{width:16px;font-weight:700;text-align:center}
.bulle-meteo .ok{color:#2a7a35}.bulle-meteo .ko{color:var(--danger)}.bulle-meteo .nsp{color:var(--doux)}
.bulle-meteo .seuil{color:var(--doux);font-size:11px}
.bulle-meteo .etat{margin-top:5px}
.bulle-meteo .ligne-valeur{padding:2px 0}
.bulle-meteo .pied{color:var(--doux);font-size:10.5px;margin-top:6px}

/* biotope : score dans la bulle, symbole des départements non vérifiés */
.bulle-meteo .ligne-bio{padding-top:5px;margin-top:5px;border-top:1px solid var(--bord)}
.bulle-meteo .ligne-bio:first-child{border-top:none;margin-top:0;padding-top:0}
.symb-indet-inline{display:inline-block;width:18px;height:9px;vertical-align:middle;
  background:repeating-linear-gradient(45deg,#fec44f 0 3px,#8a6a2a 3px 4px)}

/* déclenchement d'un spot (liste et fiche) et bloc des alertes */
.declenche{font-size:11.5px;color:var(--rouille);font-weight:600;margin-top:2px}
.declenche.clos{color:var(--doux);font-weight:400}
#fiche-spot .declenche{margin:0 0 10px}
.bloc-alertes{margin-top:18px;padding-top:12px;border-top:1px solid var(--bord)}
.bloc-alertes h3{font-size:13px;margin-bottom:4px}
.alertes-boutons{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}

/* champ de mot de passe avec bouton « Afficher / Masquer » intégré */
.champ-mdp{position:relative}
.champ-mdp .champ{padding-right:84px}
.voir-mdp{position:absolute;right:4px;top:50%;transform:translateY(-50%);
  border:none;background:none;color:var(--rouille);font-size:12.5px;font-weight:600;
  padding:6px 8px;cursor:pointer;border-radius:5px}
.voir-mdp:focus-visible{outline:2px solid var(--rouille)}

/* ─── page de connexion : présentation + formulaire sur fond de sous-bois ── */
.page-accueil{min-height:100%;min-height:100dvh;display:flex;align-items:center;
  justify-content:center;gap:48px;padding:32px 20px;
  background:var(--creme) url("../img/sous-bois.svg") center bottom / cover no-repeat}
.accueil-presentation{max-width:440px}
.accueil-logo{width:72px;height:72px;border-radius:18px;display:block;margin-bottom:14px;
  box-shadow:0 2px 8px rgba(31,36,28,.18)}
.accueil-presentation h1{font-size:34px;line-height:1.1}
.accroche{font:italic 19px/1.4 Georgia,serif;color:var(--rouille);margin:8px 0 6px}
.accroche em{font-style:normal;font-weight:600}
.accueil-sous{color:var(--encre);margin:0 0 16px;opacity:.85}
.accueil-points{list-style:none;margin:0;padding:0;display:grid;gap:10px}
.accueil-points li{background:rgba(255,255,255,.72);border:1px solid var(--bord);
  border-radius:10px;padding:9px 12px;font-size:13.5px;line-height:1.45;
  -webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px)}
.accueil-points b{color:var(--rouille)}
.accueil-carte{width:100%;max-width:360px;background:rgba(255,255,255,.94);
  border:1px solid var(--bord);border-radius:14px;padding:22px 22px 18px;
  box-shadow:0 6px 24px rgba(31,36,28,.14)}
.accueil-carte header{text-align:left;margin-bottom:6px}
.accueil-carte h2{font-size:18px}
.accueil-carte form .btn.principal{width:100%;margin-top:16px}
@media (max-width:820px){
  .page-accueil{flex-direction:column;justify-content:flex-start;gap:20px;padding:24px 16px 120px}
  .accueil-presentation{text-align:center}
  .accueil-logo{margin:0 auto 10px;width:60px;height:60px}
  .accueil-presentation h1{font-size:28px}
  .accueil-points{text-align:left;order:2}
  /* sur téléphone, le formulaire passe juste sous l'accroche, avant les points */
  .accueil-presentation{display:contents}
  .accueil-logo,.accueil-presentation h1,.accroche,.accueil-sous{order:0}
  .accueil-carte{order:1}
}
