/* Sentiers Lac-Beauport — direction « forêt boréale »
   Palette : sapin profond, brume, accent orange balise de sentier */

:root {
  --sapin: #14281f;
  --sapin-2: #1d3a2c;
  --brume: #f2efe7;
  --creme: #faf8f2;
  --encre: #1c2420;
  --mousse: #5c7a63;
  --blaze: #e8622c;           /* orange balise, comme les marqueurs peints sur les arbres */
  --blaze-dark: #c94e1d;

  --sec: #3f7d4e;
  --humide: #a3a13a;
  --boueux: #8a5a2e;
  --neige-tapee: #6fa8c9;
  --enneige: #a9c8dd;
  --ferme: #c0392b;

  --radius: 14px;
  --shadow: 0 8px 28px rgba(20, 40, 31, .18);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  font-family: 'Archivo', sans-serif;
  color: var(--encre);
  background: var(--sapin);
  overflow: hidden;
}

#map { position: fixed; inset: 0; z-index: 0; background: #dfe8df; }

/* --- En-tête flottant --- */
.brand {
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  left: 12px;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--sapin);
  color: var(--creme);
  padding: 10px 16px 10px 12px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.brand .blaze {
  width: 14px; height: 34px;
  background: var(--blaze);
  border-radius: 3px;
  flex: none;
}
.brand h1 {
  font-family: 'Fraunces', serif;
  font-weight: 700;
  font-size: 1.05rem;
  margin: 0;
  letter-spacing: .01em;
}
.brand .tagline {
  margin: 0;
  font-size: .72rem;
  opacity: .75;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.panel-toggle {
  margin-left: 6px;
  border: 1px solid rgba(250,248,242,.3);
  background: transparent;
  color: var(--creme);
  font: 600 .78rem 'Archivo', sans-serif;
  padding: 7px 12px;
  border-radius: 999px;
  cursor: pointer;
  display: none;
}

/* --- Panneau latéral --- */
.panel {
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  right: 12px;
  bottom: 12px;
  z-index: 900;
  width: 320px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scrollbar-width: thin;
  padding-bottom: 4px;
}
.card {
  background: var(--creme);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px;
  border-top: 4px solid var(--sapin-2);
}
.card h2 {
  font-family: 'Fraunces', serif;
  font-size: 1rem;
  margin: 0 0 10px;
  color: var(--sapin);
}
.card h2 .loc { font-family: 'Archivo'; font-size: .7rem; font-weight: 600; color: var(--mousse); text-transform: uppercase; letter-spacing: .08em; margin-left: 6px; }
.muted { color: #7a837c; }
.small { font-size: .8rem; }
.stamp { font-size: .72rem; color: #93a096; margin: 8px 0 0; }

/* Météo */
.weather-card { border-top-color: var(--blaze); }
.weather-main { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.weather-temp { font-family: 'Fraunces', serif; font-size: 2.4rem; font-weight: 700; color: var(--sapin); line-height: 1; }
.weather-cond { font-size: .9rem; color: var(--mousse); font-weight: 600; }
.weather-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 14px; font-size: .82rem; }
.weather-grid dt { color: #7a837c; }
.weather-grid dd { margin: 0; font-weight: 600; }
.weather-grid > div { display: flex; justify-content: space-between; gap: 8px; }

/* Moustiques */
.mosquito { display: flex; align-items: center; gap: 12px; }
.dots { display: flex; gap: 5px; }
.dots i {
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #e3ddd0;
  transition: background .3s;
}
.dots i.on { background: var(--blaze); }
.dots i.on.lvl4, .dots i.on.lvl5 { background: var(--ferme); }
.mosquito-label { font-weight: 700; font-size: .9rem; color: var(--sapin); }

/* Liste des sentiers */
.trail-list { list-style: none; margin: 0; padding: 0; }
.trail-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 4px;
  border-bottom: 1px solid #ece7da;
  cursor: pointer;
  border-radius: 6px;
}
.trail-list li:last-child { border-bottom: 0; }
.trail-list li:hover { background: #f2eee2; }
.trail-dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.trail-name { flex: 1; font-size: .88rem; font-weight: 600; }
.trail-meta { font-size: .72rem; color: #7a837c; }
.trail-closed .trail-name { text-decoration: line-through; color: var(--ferme); }
.badge-ferme {
  font-size: .62rem; font-weight: 700; color: #fff;
  background: var(--ferme); border-radius: 4px; padding: 2px 6px;
  text-transform: uppercase; letter-spacing: .05em;
}

/* Légende */
.legend ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; font-size: .8rem; }
.legend i { display: inline-block; width: 22px; height: 5px; border-radius: 3px; background: var(--c); margin-right: 8px; vertical-align: middle; }
.legend i.dashed { background: repeating-linear-gradient(90deg, var(--c) 0 5px, transparent 5px 9px); }

/* --- Bouton signaler --- */
.report-btn {
  position: fixed;
  bottom: max(18px, env(safe-area-inset-bottom));
  left: 16px;
  z-index: 1000;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--blaze);
  color: #fff;
  border: 0;
  font: 700 .95rem 'Archivo', sans-serif;
  padding: 14px 20px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(232, 98, 44, .45);
  transition: transform .15s, background .2s;
}
.report-btn:hover { background: var(--blaze-dark); transform: translateY(-2px); }

/* --- Modale --- */
.modal {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(20, 40, 31, .55);
  backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.modal-box {
  background: var(--creme);
  border-radius: var(--radius);
  padding: 22px 24px;
  width: min(440px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  border-top: 5px solid var(--blaze);
}
.modal-box h2 { font-family: 'Fraunces', serif; margin: 0 0 4px; color: var(--sapin); }
.modal-close {
  position: absolute; top: 10px; right: 14px;
  border: 0; background: none; font-size: 1.6rem;
  color: #93a096; cursor: pointer; line-height: 1;
}
form label { display: block; font-size: .78rem; font-weight: 700; color: var(--sapin); margin: 14px 0 5px; text-transform: uppercase; letter-spacing: .05em; }
form select, form textarea, form input[type=file], form input[type=text], form input[type=password] {
  width: 100%;
  font: 400 .92rem 'Archivo', sans-serif;
  padding: 10px 12px;
  border: 1.5px solid #d8d2c2;
  border-radius: 9px;
  background: #fff;
  color: var(--encre);
}
form select:focus, form textarea:focus { outline: 2px solid var(--blaze); border-color: transparent; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.pos-row { display: flex; gap: 8px; }
.btn-secondary {
  flex: 1;
  border: 1.5px solid var(--sapin-2);
  background: transparent;
  color: var(--sapin);
  font: 600 .82rem 'Archivo', sans-serif;
  padding: 9px 10px;
  border-radius: 9px;
  cursor: pointer;
}
.btn-secondary:hover, .btn-secondary.active { background: var(--sapin-2); color: var(--creme); }
.pos-status { margin: 6px 0 0; }
.pos-status.ok { color: var(--sec); font-weight: 600; }
.btn-primary {
  width: 100%;
  margin-top: 18px;
  border: 0;
  background: var(--blaze);
  color: #fff;
  font: 700 .95rem 'Archivo', sans-serif;
  padding: 13px;
  border-radius: 10px;
  cursor: pointer;
}
.btn-primary:hover { background: var(--blaze-dark); }
.btn-primary[disabled] { opacity: .55; cursor: wait; }
.form-error { color: var(--ferme); font-size: .85rem; font-weight: 600; margin: 12px 0 0; }
.form-success { text-align: center; padding: 10px 0; }
.form-success p { font-weight: 600; color: var(--sec); }

/* Indice « clique sur la carte » */
.pick-hint {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1500;
  background: var(--sapin);
  color: var(--creme);
  font: 600 .9rem 'Archivo', sans-serif;
  padding: 12px 18px;
  border-radius: 999px;
  box-shadow: var(--shadow);
  pointer-events: none;
  animation: pulse 1.6s infinite;
}
@keyframes pulse { 50% { opacity: .7; } }

/* Marqueurs de signalement */
.report-marker {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  background: var(--creme);
  border: 2.5px solid var(--blaze);
  border-radius: 50% 50% 50% 6px;
  font-size: 15px;
  box-shadow: 0 3px 10px rgba(0,0,0,.3);
}
.report-marker.t-fermeture { border-color: var(--ferme); }
.leaflet-popup-content-wrapper { border-radius: 12px; font-family: 'Archivo', sans-serif; }
.popup-type { font-weight: 700; color: var(--sapin); font-family: 'Fraunces', serif; font-size: 1rem; }
.popup-trail { font-size: .75rem; color: var(--mousse); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.popup-photo { width: 100%; border-radius: 8px; margin-top: 6px; }
.popup-date { font-size: .72rem; color: #93a096; margin-top: 4px; }

/* --- Mobile --- */
@media (max-width: 720px) {
  .panel-toggle { display: inline-block; }
  .panel {
    top: auto;
    left: 12px; right: 12px;
    bottom: 76px;
    max-height: 46vh;
    transition: transform .25s, opacity .25s;
  }
  .panel.hidden-mobile { transform: translateY(20px); opacity: 0; pointer-events: none; }
  .brand h1 { font-size: .92rem; }
  .report-btn { left: auto; right: 16px; }
}

/* --- Météo périmée --- */
.stale-badge {
  display: inline-block;
  background: #b3801f;
  color: #fff;
  font-size: .68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  margin-right: 6px;
  text-transform: uppercase;
  letter-spacing: .03em;
}

/* --- Bandeau de message admin --- */
.site-banner {
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 1200;
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(560px, calc(100vw - 24px));
  background: var(--blaze);
  color: #fff;
  font: 600 .92rem 'Archivo', sans-serif;
  padding: 12px 14px;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(20, 40, 31, .35);
  border-left: 6px solid var(--blaze-dark);
}
.site-banner svg { flex: none; }
.site-banner span { flex: 1; }
.site-banner button {
  flex: none;
  border: 0; background: none; color: #fff;
  font-size: 1.4rem; line-height: 1; cursor: pointer; opacity: .85;
}
.site-banner button:hover { opacity: 1; }
@media (max-width: 720px) {
  .site-banner { top: auto; bottom: max(76px, calc(env(safe-area-inset-bottom) + 76px)); }
}

/* --- Bouton « Afficher tous les sentiers » --- */
.show-all {
  position: fixed;
  bottom: max(20px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  background: var(--sapin);
  color: var(--creme);
  border: 1.5px solid var(--mousse);
  font: 700 .85rem 'Archivo', sans-serif;
  padding: 10px 18px;
  border-radius: 999px;
  box-shadow: var(--shadow);
  cursor: pointer;
}
.show-all:hover { background: var(--sapin-2); }
