/* Réception du 22 août — socle visuel.
   Mobile d'abord : tout est pensé pour un pouce sur un écran de 375 px. */

:root {
  --creme: #fdf8f2;
  --creme-fonce: #f5ebdd;
  --encre: #2f2a26;
  --encre-doux: #6b6058;
  --terre: #c1613a;
  --terre-clair: #e5a184;
  --terre-pale: #fbeee7;
  --vert: #4a7c59;
  --vert-pale: #e8f2ea;
  --ambre: #b5761f;
  --ambre-pale: #fdf2e0;
  --bord: #e6d9c9;
  --ombre: 0 2px 10px rgba(78, 58, 40, .09);
  --rayon: 14px;
  --touche: 52px; /* hauteur minimale d'une cible tactile */
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--creme);
  color: var(--encre);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

/* --- photo du lieu en fond ---------------------------------------------
   Deux couches fixes derrière tout le contenu :
   1. la photo, en `position: fixed` plutôt qu'en background-attachment
      (iOS ignore `fixed` sur les fonds et provoque des sauts au défilement) ;
   2. un voile crème, presque transparent en haut — on veut voir la rivière —
      puis franc dès qu'on descend, pour que le formulaire reste lisible.
   Le voile est la condition de lisibilité : ne pas le retirer. */
body::before,
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
}
body::before {
  background: url('/img/lieu-mobile.jpg') center 20% / cover no-repeat;
}
body::after {
  z-index: -1;
  background:
    linear-gradient(
      to bottom,
      rgba(253, 248, 242, .42) 0%,
      rgba(253, 248, 242, .80) 20%,
      rgba(253, 248, 242, .94) 40%,
      rgba(253, 248, 242, .965) 100%
    );
}

@media (min-width: 820px) {
  body::before { background-image: url('/img/lieu.jpg'); }
}

/* Le fond est décoratif : s'il ne charge pas, la couleur crème reste. */
@media print {
  body::before, body::after { display: none; }
}

h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; font-weight: 700; }
h1 { font-size: 1.6rem; letter-spacing: -.01em; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
a { color: var(--terre); }

.enveloppe {
  max-width: 560px;
  margin: 0 auto;
  padding: 0 18px calc(24px + env(safe-area-inset-bottom));
}

/* --- boutons --- */
.bouton {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--touche);
  padding: 14px 20px;
  border: 0; border-radius: var(--rayon);
  background: var(--terre); color: #fff;
  font: inherit; font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: transform .08s ease, background .15s ease, opacity .15s ease;
}
.bouton:active { transform: scale(.985); }
.bouton[disabled] { opacity: .45; cursor: not-allowed; }
.bouton.large { width: 100%; }
.bouton.secondaire { background: transparent; color: var(--encre-doux); border: 1.5px solid var(--bord); }
.bouton.discret {
  background: none; color: var(--encre-doux); min-height: 44px; padding: 10px 12px;
  font-weight: 500; text-decoration: underline; text-underline-offset: 3px;
}

/* --- champs --- */
.champ {
  width: 100%; min-height: var(--touche);
  padding: 13px 15px;
  border: 1.5px solid var(--bord); border-radius: var(--rayon);
  background: #fff; color: var(--encre);
  font: inherit;
}
.champ:focus { outline: 2.5px solid var(--terre-clair); outline-offset: 1px; border-color: var(--terre-clair); }
textarea.champ { min-height: 120px; resize: vertical; }

/* --- carte informative --- */
.carte {
  background: #fff; border: 1.5px solid var(--bord);
  border-radius: var(--rayon); padding: 16px; box-shadow: var(--ombre);
}

.discret { color: var(--encre-doux); font-size: .92rem; }
.centre { text-align: center; }
.pile { display: grid; gap: 10px; }

.badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: .78rem; font-weight: 600; background: var(--creme-fonce); color: var(--encre-doux);
}
.badge.alerte { background: var(--ambre-pale); color: var(--ambre); }
.badge.ok { background: var(--vert-pale); color: var(--vert); }

.invisible { display: none !important; }

/* --- carte Leaflet --- */
.carte-geo {
  height: 230px; border-radius: var(--rayon); overflow: hidden;
  border: 1.5px solid var(--bord); background: var(--creme-fonce);
}
.leaflet-container { font: inherit; background: var(--creme-fonce); }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
