/* DA crete.direct appliquee a un sujet grave.
 *
 * Regle de couleur qui gouverne tout le fichier : le lagon et le bleu nuit sont
 * le chrome de l'interface, le rouge et l'orange sont RESERVES aux donnees de
 * feu. Le corail #ED7A5C, pourtant dans la palette de marque, ne sert nulle part
 * ici : trop proche des codes d'alerte pour servir de couleur d'accent.
 */

:root {
  --lagon: #00C2D4;
  --lagon-clair: #16cfe0;
  --lagon-fonce: #009fb0;
  --nuit: #07374A;
  --encre: #0B3954;
  --or: #FFC83D;
  --texte-clair: #E8F4F6;

  /* Reservees aux foyers et a la fumee. */
  --feu-vif: #E4322B;
  --feu-jour: #F07818;
  --feu-ancien: #B08A4A;
  --fumee: #6B7280;

  --pied: 92px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--nuit);
  color: var(--texte-clair);
  /* Corps en police systeme : Baloo est faite pour les titres, pas pour lire
     une heure ou une puissance a cote d'une autre. */
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.45;
}

body { display: flex; flex-direction: column; }

/* --- Barre --- */

.barre {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: linear-gradient(120deg, var(--nuit), #0a4a63);
  border-bottom: 1px solid rgba(0, 194, 212, .35);
  flex: 0 0 auto;
}

.marque {
  font-family: 'Baloo 2', system-ui, sans-serif;
  font-weight: 800;
  font-size: 20px;
  color: var(--texte-clair);
  text-decoration: none;
  letter-spacing: -.01em;
}
.marque .point { color: var(--or); }

.rubrique {
  font-family: 'Baloo 2', system-ui, sans-serif;
  font-weight: 600;
  font-size: 15px;
  color: var(--lagon-clair);
  padding: 1px 9px;
  border: 1px solid rgba(22, 207, 224, .45);
  border-radius: 999px;
}

.etat {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: rgba(232, 244, 246, .82);
}

.pastille {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--fumee);
  flex: 0 0 auto;
}
.pastille.ok { background: #3FB950; }
.pastille.degrade { background: var(--or); }
.pastille.hs { background: var(--feu-vif); }

.langues { display: flex; gap: 4px; }
.langues button {
  background: none;
  border: 1px solid rgba(232, 244, 246, .25);
  color: rgba(232, 244, 246, .7);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 12px;
  cursor: pointer;
}
.langues button.actif { border-color: var(--lagon); color: var(--texte-clair); }

/* --- Carte --- */

main { position: relative; flex: 1 1 auto; min-height: 0; }
#carte { position: absolute; inset: 0; background: #0a2b3a; }

.leaflet-container { font: inherit; background: #0a2b3a; }
.leaflet-control-attribution {
  background: rgba(7, 55, 74, .82) !important;
  color: rgba(232, 244, 246, .75) !important;
  font-size: 11px;
}
.leaflet-control-attribution a { color: var(--lagon-clair) !important; }

/* --- Etat vide : le seul endroit ou la chevre a sa place --- */

.vide {
  position: absolute;
  z-index: 500;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: min(400px, calc(100% - 32px));
  padding: 22px 24px 26px;
  text-align: center;
  background: rgba(7, 55, 74, .93);
  border: 1px solid rgba(0, 194, 212, .35);
  border-radius: 18px;
  backdrop-filter: blur(3px);
}
.chevre { width: 86px; height: 99px; margin-bottom: 6px; }
.vide-titre {
  font-family: 'Baloo 2', system-ui, sans-serif;
  font-weight: 700;
  font-size: 19px;
  margin: 0 0 8px;
}
.vide-detail { margin: 0; font-size: 13px; color: rgba(232, 244, 246, .75); }

/* --- Panneau foyer --- */

.panneau {
  position: absolute;
  z-index: 600;
  top: 12px; right: 12px;
  width: min(320px, calc(100% - 24px));
  max-height: calc(100% - 24px);
  overflow-y: auto;
  padding: 16px 18px 18px;
  background: rgba(7, 55, 74, .96);
  border: 1px solid rgba(0, 194, 212, .4);
  border-radius: 16px;
}
.panneau h2 {
  font-family: 'Baloo 2', system-ui, sans-serif;
  font-weight: 700;
  font-size: 18px;
  margin: 0 0 12px;
}
.fermer {
  position: absolute; top: 8px; right: 10px;
  background: none; border: none;
  color: rgba(232, 244, 246, .6);
  font-size: 22px; line-height: 1; cursor: pointer;
}

.fiche { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 0 0 12px; }
.fiche dt { font-size: 12px; color: rgba(232, 244, 246, .6); }
.fiche dd { margin: 0; font-variant-numeric: tabular-nums; }

.note { font-size: 12px; color: rgba(232, 244, 246, .62); margin: 0 0 12px; }

.action {
  width: 100%;
  padding: 9px 12px;
  background: var(--lagon-fonce);
  border: 1px solid var(--lagon);
  border-radius: 10px;
  color: var(--texte-clair);
  font-family: 'Baloo 2', system-ui, sans-serif;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
}
.action:hover { background: var(--lagon); }
.action[disabled] { opacity: .55; cursor: default; }

.panache { margin-top: 12px; }
.panache-ligne { margin: 0 0 8px; font-size: 13px; }
.limites { margin: 0; padding-left: 16px; font-size: 11.5px; color: rgba(232, 244, 246, .6); }
.limites li { margin-bottom: 3px; }

/* --- Legende --- */

.legende {
  position: absolute;
  z-index: 500;
  left: 12px; bottom: 12px;
  padding: 11px 14px;
  background: rgba(7, 55, 74, .9);
  border: 1px solid rgba(0, 194, 212, .3);
  border-radius: 12px;
  max-width: 240px;
}
.legende h2 {
  font-family: 'Baloo 2', system-ui, sans-serif;
  font-weight: 600;
  font-size: 13px;
  margin: 0 0 6px;
  color: rgba(232, 244, 246, .8);
}
.legende ul { list-style: none; margin: 0 0 6px; padding: 0; font-size: 12.5px; }
.legende li { display: flex; align-items: center; gap: 7px; margin-bottom: 3px; }
.puce { width: 22px; height: 22px; flex: 0 0 auto; display: flex; align-items: center; }
.puce svg { display: block; }
.puce.cone {
  width: 13px; height: 13px; margin: 0 4px;
  background: rgba(156, 163, 175, .35);
  border-radius: 50%;
}

/* Un marqueur de foyer est un picto seul : ni fond, ni cadre, ni ombre. */
.foyer { background: none; border: none; }
.foyer svg { filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .55)); }
.legende .note { margin: 0; font-size: 11px; }

/* --- Pied --- */

.pied {
  flex: 0 0 auto;
  padding: 9px 16px 11px;
  background: #051f2b;
  border-top: 1px solid rgba(0, 194, 212, .25);
  font-size: 12.5px;
}
.avertissement { margin: 0 0 4px; }
.avertissement strong { color: var(--or); }
.liens { margin: 0 0 3px; display: flex; gap: 14px; flex-wrap: wrap; }
.liens a { color: var(--lagon-clair); }
.provenance { margin: 0; font-size: 11.5px; color: rgba(232, 244, 246, .55); }

@media (max-width: 640px) {
  .legende { display: none; }
  .rubrique { display: none; }
  .panneau { top: auto; bottom: 12px; right: 12px; left: 12px; width: auto; max-height: 58%; }
}
