/* FeuCoord — UI terrain : boutons énormes, contrastes forts, zéro fioriture.
   Palette issue des maquettes : bleu remplissage #185FA5, rouge reprise #A32D2D,
   vert bénévole #3B6D11, CTA rouge #E24B4A. */

:root {
  --bleu: #185FA5;
  --bleu-pale: #E6F1FB;
  --bleu-fonce: #0C447C;
  --rouge: #A32D2D;
  --rouge-cta: #E24B4A;
  --vert: #3B6D11;
  --vert-ok: #1D9E75;
  --vert-pale: #EAF3DE;
  --vert-fonce: #27500A;
  --ambre-bg: #FAEEDA;
  --ambre-fg: #633806;
  --surface: #FFFFFF;
  --surface-2: #F4F3EF;
  --border: #DDDBD3;
  --text: #1C1C1A;
  --text-2: #55544F;
  --text-3: #8A897F;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--surface-2);
  color: var(--text);
  font-size: 17px;
  line-height: 1.45;
  -webkit-text-size-adjust: 100%;
}

/* ---------- structure mobile ---------- */

.app {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.app-header .brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 18px;
  color: inherit;
  text-decoration: none;
}

.brand-flame { color: #D85A30; font-size: 22px; }

.net-badge {
  font-size: 13px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--vert-pale);
  color: var(--vert-fonce);
  white-space: nowrap;
}

.net-badge.offline { background: #F9E2E2; color: #7C1D1D; }

/* Bandeau sécurité permanent */
.safety-banner {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  background: var(--ambre-bg);
  color: var(--ambre-fg);
  padding: 8px 14px;
  font-size: 13.5px;
  line-height: 1.35;
}

.app-main { flex: 1; display: flex; flex-direction: column; }

/* ---------- carte ---------- */

#map { width: 100%; flex: 1; min-height: 46dvh; background: #E8EDDE; }

.map-wrap { position: relative; display: flex; flex-direction: column; flex: 1; }

.map-legend {
  position: absolute;
  bottom: 10px;
  left: 10px;
  z-index: 800;
  background: rgba(255, 255, 255, 0.94);
  border-radius: 8px;
  padding: 6px 10px;
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: #444;
}

.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 4px; }
.dot-bleu { background: var(--bleu); }
.dot-vert { background: var(--vert); }
.dot-rouge { background: var(--rouge); }

.fc-marker { display: grid; place-items: center; border-radius: 50%; color: #fff; font-weight: 700; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.4); font-size: 15px; }
.fc-marker.point { background: var(--bleu); }
.fc-marker.point.ravito { background: #B4690E; }
.fc-marker.point.ferme, .fc-marker.point.a_sec { background: var(--text-3); }
.dot-ravito { background: #B4690E; }
.fc-marker.reprise { background: var(--rouge); }
.fc-marker.moi { background: var(--vert); }
.fc-marker.benevole { background: var(--vert); opacity: .9; }
.fc-marker.demande { background: #B4690E; }

/* ---------- boutons ---------- */

button, .btn {
  font: inherit;
  border: none;
  border-radius: 12px;
  padding: 14px 18px;
  font-size: 17px;
  font-weight: 600;
  background: var(--bleu);
  color: #fff;
  cursor: pointer;
  touch-action: manipulation;
  text-decoration: none;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
}

button:active, .btn:active { transform: scale(.98); }
button:disabled { opacity: .5; }

.btn-block { display: flex; width: 100%; }
.btn-secondary { background: var(--surface); color: var(--text); border: 1.5px solid var(--border); }
.btn-danger { background: var(--rouge-cta); }
.btn-success { background: var(--vert-ok); }
.btn-ghost { background: transparent; color: var(--bleu-fonce); min-height: 40px; padding: 8px 10px; font-weight: 500; }
.btn-sm { min-height: 44px; padding: 10px 14px; font-size: 15px; }

/* Gros bouton fixe « REPRISE DE FEU » */
.fire-cta {
  position: sticky;
  bottom: 0;
  z-index: 900;
  padding: 10px 14px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(transparent, var(--surface-2) 30%);
}

.fire-cta .btn-danger {
  width: 100%;
  font-size: 20px;
  padding: 20px;
  border-radius: 16px;
  box-shadow: 0 4px 14px rgba(226, 75, 74, .45);
}

/* ---------- panneaux / cartes ---------- */

.panel { padding: 12px 14px; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 10px;
}

.card h3 { margin: 0 0 4px; font-size: 16px; }
.muted { color: var(--text-2); font-size: 14px; }
.small { font-size: 13px; color: var(--text-3); }

.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stack { display: flex; flex-direction: column; gap: 10px; }

.badge {
  font-size: 13px;
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.badge-vert { background: var(--vert-pale); color: var(--vert-fonce); }
.badge-bleu { background: var(--bleu-pale); color: var(--bleu-fonce); }
.badge-rouge { background: #F9E2E2; color: #7C1D1D; }
.badge-gris { background: var(--surface-2); color: var(--text-3); }
.badge-ambre { background: var(--ambre-bg); color: var(--ambre-fg); }

/* Toggle */
.toggle { position: relative; width: 52px; height: 30px; border-radius: 999px; background: var(--border); transition: background .15s; flex: none; border: none; min-height: 30px; padding: 0; }
.toggle.on { background: var(--vert-ok); }
.toggle::after {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: #fff;
  transition: left .15s;
  box-shadow: 0 1px 3px rgba(0,0,0,.3);
}
.toggle.on::after { left: 25px; }

/* Bannière demande SDIS */
.request-banner {
  background: var(--bleu-fonce);
  color: #fff;
  padding: 14px;
  border-radius: 14px;
  margin: 10px 14px 0;
  box-shadow: 0 4px 14px rgba(12, 68, 124, .4);
}

.request-banner .actions { display: flex; gap: 10px; margin-top: 12px; }
.request-banner .actions > * { flex: 1; }

/* ---------- formulaires ---------- */

label { display: block; font-weight: 600; margin: 14px 0 6px; font-size: 15px; }
input, select, textarea {
  width: 100%;
  font: inherit;
  padding: 13px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  min-height: 50px;
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(24, 95, 165, .35); border-color: var(--bleu); }

.form-page { max-width: 480px; margin: 0 auto; width: 100%; padding: 18px 16px 40px; }
.error-box { background: #F9E2E2; color: #7C1D1D; border-radius: 10px; padding: 12px 14px; margin: 10px 0; }
.ok-box { background: var(--vert-pale); color: var(--vert-fonce); border-radius: 10px; padding: 12px 14px; margin: 10px 0; }

/* file d'attente offline */
.sync-status { font-size: 13px; color: var(--text-2); padding: 6px 14px; }
.sync-status .pending { color: #B4690E; font-weight: 600; }

/* ---------- vue desktop commandement ---------- */

.pc-layout { display: flex; flex-direction: column; height: 100dvh; }
.pc-body { flex: 1; display: flex; min-height: 0; }
.pc-map { width: 58%; position: relative; display: flex; }
.pc-map #map { height: 100%; min-height: 0; }
.pc-side { width: 42%; border-left: 1px solid var(--border); background: var(--surface); display: flex; flex-direction: column; min-height: 0; }
.pc-tabs { display: flex; border-bottom: 1px solid var(--border); }
.pc-tabs button {
  flex: 1; border-radius: 0; background: none; color: var(--text-2);
  border-bottom: 3px solid transparent; font-size: 15px; min-height: 48px; font-weight: 600;
}
.pc-tabs button.active { color: var(--bleu-fonce); border-bottom-color: var(--bleu); }
.pc-panel { flex: 1; overflow-y: auto; padding: 12px; }
.pc-footer {
  display: flex; gap: 18px; padding: 8px 14px; border-top: 1px solid var(--border);
  background: var(--surface); font-size: 14px; color: var(--text-2); flex-wrap: wrap;
}
.pc-footer strong { color: var(--text); }

.report-photo { width: 100%; max-width: 320px; border-radius: 10px; display: block; margin: 8px 0; }

@media (max-width: 900px) {
  .pc-body { flex-direction: column; }
  .pc-map, .pc-side { width: 100%; }
  .pc-map { height: 45dvh; }
}

/* nav bas de page (liens rôle) */
.role-nav { display: flex; gap: 8px; padding: 8px 14px; flex-wrap: wrap; }
