/* AmiCalSP - application de tournée
   Pensée pour le dehors : gros boutons, fort contraste, une main libre. */

:root {
  /* Thème « sapeurs-pompiers » : noir de l'écusson, rouge incendie, or des lauriers */
  --beton: #F3F1ED;
  --papier: #FFFFFF;
  --marine: #18181B;
  --marine-2: #2C2C31;
  --nuit: #111113;
  --rouge: #C8102E;
  --rouge-fonce: #9E0B22;
  --rouge-pale: #FBE9EC;
  --or: #C9A24B;
  --jaune: #F2C230;
  --trait: #DAD6D0;
  --gris: #5F5F66;
  --vert: #2E7D4F;

  --s-a_faire: #8A93A0;
  --s-donne: #2E7D4F;
  --s-boite_lettres: #1F6FB2;
  --s-deja_donne: #6BAF7F;
  --s-spv_don: #A87B00;
  --s-spv_offert: #3E7C8C;
  --s-absent: #E0A100;
  --s-repasser: #D9822B;
  --s-refus: #C8102E;
  --s-inhabitee: #6E5A9E;

  --rayon: 10px;
  --titre: "Barlow Condensed", "Arial Narrow", sans-serif;
  --texte: "Barlow", system-ui, sans-serif;
  --haut: env(safe-area-inset-top, 0px);
  --bas: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body {
  font: 400 17px/1.45 var(--texte);
  color: var(--marine);
  background: var(--beton);
  min-height: 100vh;
}
[hidden] { display: none !important; }
h1, h2, h3 { font-family: var(--titre); font-weight: 700; line-height: 1.1; margin: 0; }
:focus-visible { outline: 3px solid var(--jaune); outline-offset: 2px; }
.visuel-cache { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.livree {
  height: 8px;
  background: repeating-linear-gradient(-45deg, var(--rouge) 0 12px, var(--jaune) 12px 24px);
}

/* ---------- En-tête ---------- */
.entete {
  position: sticky; top: 0; z-index: 1000;
  background: var(--marine); color: #fff;
  padding-top: var(--haut);
}
.entete-ligne { display: flex; align-items: center; gap: .5rem; padding: .6rem 1rem; min-height: 3.4rem; }
.entete-titre { font-size: 1.7rem; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.entete-retour {
  font: 400 2.2rem/1 var(--texte); color: #fff; background: none; border: 0;
  width: 2.6rem; height: 2.6rem; margin-left: -.6rem; cursor: pointer;
}
.pastille-sync {
  font: 600 .85rem var(--texte); border: 0; border-radius: 999px;
  padding: .4rem .8rem; cursor: pointer; white-space: nowrap;
  background: var(--jaune); color: var(--marine);
}
.pastille-sync.hors-ligne { background: var(--marine-2); color: #fff; box-shadow: inset 0 0 0 1px #8A93A0; }
.pastille-sync.erreur { background: var(--rouge); color: #fff; }

.ecran { padding: 1rem 1rem calc(2rem + var(--bas)); max-width: 40rem; margin: 0 auto; }

/* ---------- Boutons et champs ---------- */
.btn {
  font: 600 1rem/1 var(--texte); padding: .85rem 1.1rem; min-height: 3rem;
  border-radius: var(--rayon); border: 1px solid var(--trait);
  background: var(--papier); color: var(--marine); cursor: pointer;
}
.btn-rouge { background: var(--rouge); border-color: var(--rouge); color: #fff; }
.btn-rouge:active { background: var(--rouge-fonce); }
.btn-large { width: 100%; font-size: 1.1rem; min-height: 3.5rem; }
.btn-lien { font: 500 1rem var(--texte); background: none; border: 0; padding: .5rem 0; color: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.btn:disabled { opacity: .5; }

label { display: block; font-weight: 500; margin-bottom: 1rem; }
input[type=email], input[type=password], input[type=text] {
  display: block; width: 100%; margin-top: .35rem;
  font: 400 1.1rem var(--texte); color: var(--marine);
  padding: .8rem .9rem; border: 1px solid var(--trait); border-radius: var(--rayon); background: var(--papier);
}
.erreur { color: var(--rouge); font-weight: 600; min-height: 1.4em; margin: .3rem 0 .8rem; }

/* ---------- Connexion ---------- */
.connexion { padding-top: 8vh; }
.connexion h2 { font-size: 2.6rem; }
.connexion .sous { color: var(--gris); margin: .3rem 0 2rem; }

/* ---------- Accueil ---------- */
.bonjour { font-size: 2rem; margin: .5rem 0 .2rem; }
.sous { color: var(--gris); margin: 0 0 1.4rem; }
.bandeau {
  border-left: 4px solid var(--jaune); background: #FFF6D6;
  padding: .9rem 1rem; margin-bottom: 1.2rem; border-radius: 0 var(--rayon) var(--rayon) 0;
}
.bandeau.rouge { border-left-color: var(--rouge); background: #FBE7EA; }
.bandeau.vert { border-left-color: var(--vert); background: #E5F2EA; }
.bandeau p { margin: 0 0 .5rem; }
.bandeau p:last-child { margin-bottom: 0; }
.bandeau ul { margin: .3rem 0 .6rem; padding-left: 1.2rem; }

.equipe-titre { font-size: 1.5rem; margin: 1.6rem 0 .2rem; }
.coequipiers { color: var(--gris); margin: 0 0 .8rem; }

.secteur-carte {
  display: block; width: 100%; text-align: left; cursor: pointer;
  background: var(--papier); border: 1px solid var(--trait); border-left: 8px solid var(--couleur, var(--marine));
  border-radius: var(--rayon); padding: 1rem 1.1rem; margin-bottom: .8rem;
  font: inherit; color: inherit;
}
.secteur-carte h3 { font-size: 1.5rem; margin-bottom: .3rem; }
.secteur-carte .meta { color: var(--gris); font-size: .95rem; }
.barre-avancement { display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: #E3E6EA; margin: .6rem 0 .4rem; }
.barre-avancement span { display: block; height: 100%; }

.liens-bas { display: flex; flex-direction: column; align-items: flex-start; gap: .3rem; margin-top: 2rem; }

/* ---------- Écran secteur ---------- */
.resume { display: flex; flex-wrap: wrap; gap: .4rem .9rem; margin: 0 0 .9rem; font-size: .95rem; }
.resume span { display: flex; align-items: center; gap: .35rem; }
.point { display: inline-block; width: .8rem; height: .8rem; border-radius: 50%; flex: none; }

.onglets { display: grid; grid-template-columns: 1fr 1fr; background: #E3E6EA; border-radius: var(--rayon); padding: 4px; margin-bottom: .9rem; }
.onglets button { font: 600 1rem var(--texte); border: 0; background: none; padding: .65rem; border-radius: 7px; color: var(--marine); cursor: pointer; }
.onglets button[aria-pressed="true"] { background: var(--papier); box-shadow: 0 1px 2px rgba(17,17,19,.2); }

.filtres { display: flex; flex-wrap: wrap; gap: .45rem; margin-bottom: .9rem; padding-bottom: .2rem; }
.filtres button {
  font: 500 .95rem var(--texte); white-space: nowrap; cursor: pointer;
  border: 1px solid var(--trait); background: var(--papier); color: var(--marine);
  border-radius: 999px; padding: .5rem .8rem;
}
.filtres button[aria-pressed="true"] { background: var(--marine); border-color: var(--marine); color: #fff; }

.rue { margin-bottom: 1.1rem; }
.rue h3 { font-family: var(--texte); font-weight: 600; font-size: 1rem; color: var(--gris); margin: 0 0 .4rem; }
.adresses { list-style: none; padding: 0; margin: 0; background: var(--papier); border: 1px solid var(--trait); border-radius: var(--rayon); overflow: hidden; }
.adresses li + li { border-top: 1px solid var(--trait); }
.adresse {
  display: flex; align-items: center; gap: .8rem; width: 100%;
  font: inherit; color: inherit; text-align: left; background: none; border: 0;
  padding: .85rem 1rem; min-height: 3.4rem; cursor: pointer;
}
.adresse .num { font-family: var(--titre); font-weight: 700; font-size: 1.4rem; min-width: 2.6rem; }
.adresse .lib { flex: 1; min-width: 0; }
.adresse .lib small { display: block; color: var(--gris); }
.etiquette { font-size: .85rem; font-weight: 600; padding: .2rem .6rem; border-radius: 999px; color: #fff; white-space: nowrap; }
.etiquette.attente::after { content: " •"; }
.e-a_faire { background: none; color: var(--gris); border: 1px solid var(--trait); }
.e-donne { background: var(--s-donne); }
.e-boite_lettres { background: var(--s-boite_lettres); }
.e-deja_donne { background: var(--s-deja_donne); }
.e-spv_don { background: var(--s-spv_don); }
.e-spv_offert { background: var(--s-spv_offert); }
.e-absent { background: var(--s-absent); color: var(--marine); }
.e-repasser { background: var(--s-repasser); }
.e-refus { background: var(--s-refus); }
.e-inhabitee { background: var(--s-inhabitee); }
.vide { text-align: center; color: var(--gris); padding: 2rem 1rem; }

.carte-terrain { height: calc(100vh - 15rem - var(--haut) - var(--bas)); min-height: 18rem; border-radius: var(--rayon); border: 1px solid var(--trait); }
.btn-position {
  position: absolute; z-index: 800; right: 10px; bottom: 24px;
  font: 600 .95rem var(--texte); background: var(--papier); color: var(--marine);
  border: 1px solid var(--trait); border-radius: var(--rayon); padding: .65rem .9rem;
  box-shadow: 0 1px 4px rgba(17,17,19,.25); cursor: pointer;
}
.btn-position[aria-pressed="true"] { background: var(--marine); color: #fff; }
.carte-cadre { position: relative; }

/* ---------- Fiche de passage (feuille du bas) ---------- */
.fiche {
  border: 0; padding: 0; margin: auto 0 0; width: 100%; max-width: 100%;
  max-height: 92vh; border-radius: 18px 18px 0 0; color: var(--marine);
  background: var(--papier);
}
.fiche::backdrop { background: rgba(17, 17, 19, .55); }
.fiche form { padding: 1.1rem 1.1rem calc(1.1rem + var(--bas)); max-width: 40rem; margin: 0 auto; }
.fiche-tete { display: flex; align-items: flex-start; gap: 1rem; margin-bottom: 1rem; }
.fiche-tete > div { flex: 1; }
.fiche-tete h2 { font-size: 1.8rem; }
.fiche-detail { color: var(--gris); margin: .2rem 0 0; }
.fiche-fermer { font: 400 2rem/1 var(--texte); background: none; border: 0; color: var(--gris); width: 2.6rem; height: 2.6rem; cursor: pointer; }

fieldset { border: 0; padding: 0; margin: 0; }
legend { font-weight: 600; margin-bottom: .5rem; padding: 0; }
.statuts { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin-bottom: 1rem; }
.statuts legend { grid-column: 1 / -1; }
.statut-choix { margin: 0; }
.statut-choix input, .modes input { position: absolute; opacity: 0; pointer-events: none; }
.statut-choix span {
  display: flex; align-items: center; justify-content: center; min-height: 3.4rem;
  font: 600 1.05rem var(--texte); border: 2px solid var(--trait); border-radius: var(--rayon);
  background: var(--papier); cursor: pointer; text-align: center; padding: .3rem;
}
.s-donne span, .s-boite_lettres span { min-height: 3.8rem; font-size: 1.15rem; }
.statut-choix input:checked + span { color: #fff; border-color: transparent; }
.s-donne input:checked + span { background: var(--s-donne); }
.s-boite_lettres input:checked + span { background: var(--s-boite_lettres); }
.s-deja_donne input:checked + span { background: var(--s-deja_donne); }
.s-absent input:checked + span { background: var(--s-absent); color: var(--marine); }
.s-repasser input:checked + span { background: var(--s-repasser); }
.s-refus input:checked + span { background: var(--s-refus); }
.s-inhabitee input:checked + span { background: var(--s-inhabitee); }
/* Ancien SPV : bouton qui ouvre le choix Don / Offert */
button.statut-choix { padding: 0; border: 0; background: none; font: inherit; cursor: pointer; }
button.statut-choix span { width: 100%; }
.s-spv.actif span { border-color: #A87B00; color: #6B4E00; background: #FBF3DC; }
.choix-spv { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; background: #FBF3DC; border: 2px solid #A87B00; border-radius: var(--rayon); padding: .55rem; }
.choix-spv-titre { grid-column: 1 / -1; margin: 0; font-weight: 600; color: #6B4E00; }
.s-spv_don input:checked + span { background: var(--s-spv_don); }
.s-spv_offert input:checked + span { background: var(--s-spv_offert); }
.statut-choix input:focus-visible + span, .modes input:focus-visible + span { outline: 3px solid var(--jaune); outline-offset: 2px; }

.bloc-don { background: var(--beton); border-radius: var(--rayon); padding: .9rem 1rem; margin-bottom: 1rem; }
.ligne-don { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .8rem; }
.libelle { font-weight: 600; }
.compteur { display: flex; align-items: center; gap: .3rem; }
.compteur button {
  width: 3rem; height: 3rem; font: 600 1.6rem/1 var(--texte); cursor: pointer;
  border: 1px solid var(--trait); border-radius: var(--rayon); background: var(--papier); color: var(--marine);
}
.compteur output { min-width: 2.5rem; text-align: center; font: 700 1.6rem var(--titre); }
.montant { display: flex; align-items: center; gap: .4rem; font-weight: 600; font-size: 1.2rem; }
.montant input { width: 6.5rem; text-align: right; font: 700 1.4rem var(--titre); margin: 0; }
.modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: .4rem; }
.modes label { margin: 0; }
.modes span {
  display: block; text-align: center; padding: .7rem .3rem; cursor: pointer;
  border: 1px solid var(--trait); border-radius: var(--rayon); background: var(--papier); font-weight: 600;
}
.modes input:checked + span { background: var(--marine); border-color: var(--marine); color: #fff; }
.note { margin-bottom: .2rem; }
.note-aide { font-size: .85rem; color: var(--gris); margin: 0 0 .5rem; }

/* ---------- Caisse ---------- */
.caisse-equipe { background: var(--papier); border: 1px solid var(--trait); border-radius: var(--rayon); padding: 1rem 1.1rem; margin-bottom: 1rem; }
.caisse-equipe h3 { font-size: 1.5rem; margin-bottom: .6rem; }
.chiffres { width: 100%; border-collapse: collapse; }
.chiffres td { padding: .45rem 0; border-bottom: 1px solid var(--trait); }
.chiffres tr:last-child td { border-bottom: 0; }
.chiffres td:last-child { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.chiffres .total td { font-size: 1.15rem; border-top: 2px solid var(--marine); }

/* ---------- Notifications ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(1.2rem + var(--bas)); transform: translate(-50%, 1rem);
  background: var(--marine); color: #fff; padding: .85rem 1.2rem; border-radius: var(--rayon);
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 3000;
  width: max-content; max-width: calc(100% - 2rem); text-align: center;
}
.toast.visible { opacity: 1; transform: translate(-50%, 0); }
.toast.erreur { background: var(--rouge); }

@media (prefers-reduced-motion: reduce) { .toast { transition: none; } }

.lien-oubli { text-align: center; margin: 1.2rem 0 0; }
.lien-oubli a { color: var(--marine); }

/* Numéro de bon et note */
.ligne-bon { margin: .9rem 0 0; }
.ligne-bon input { width: 9rem; margin: 0; text-align: right; font: 700 1.2rem var(--titre); }
.aide-bon { margin: .35rem 0 0; font-size: .9rem; color: var(--gris); text-align: right; }
.note { position: relative; }
.note textarea {
  display: block; width: 100%; margin-top: .35rem; resize: vertical; min-height: 3.2rem;
  font: 400 1.05rem/1.35 var(--texte); color: var(--marine);
  padding: .7rem .9rem; border: 1px solid var(--trait); border-radius: var(--rayon); background: var(--papier);
}
.compte-note { position: absolute; right: 0; top: 0; font-size: .85rem; font-weight: 400; color: var(--gris); }

/* Menu de l'en-tête */
.entete-menu {
  display: flex; align-items: center; gap: .5rem;
  font: 600 .95rem var(--texte); color: #fff; background: var(--marine-2);
  border: 1px solid #44444B; border-radius: var(--rayon); padding: .5rem .75rem; cursor: pointer;
}
.entete-menu[aria-expanded="true"] { background: var(--jaune); color: var(--marine); border-color: var(--jaune); }
.burger, .burger::before, .burger::after {
  display: block; width: 1rem; height: 2px; background: currentColor; border-radius: 1px; position: relative;
}
.burger::before, .burger::after { content: ""; position: absolute; left: 0; }
.burger::before { top: -5px; }
.burger::after { top: 5px; }
.menu {
  position: absolute; right: .6rem; top: calc(100% + .3rem); z-index: 1100;
  min-width: 14rem; background: var(--papier); border-radius: var(--rayon);
  box-shadow: 0 8px 24px rgba(17, 17, 19, .25); padding: .35rem 0; overflow: hidden;
}
.menu a, .menu button {
  display: block; width: 100%; text-align: left; font: 500 1.05rem var(--texte); color: var(--marine);
  padding: .85rem 1.1rem; text-decoration: none; background: none; border: 0; cursor: pointer;
}
.menu a:hover, .menu button:hover { background: var(--beton); }
.menu a[aria-current="page"] { font-weight: 600; box-shadow: inset 4px 0 0 var(--rouge); }
.menu #menu-gestion { color: var(--marine); background: #FFF6D6; }
.menu #menu-deconnexion { border-top: 1px solid var(--trait); color: var(--rouge); }

/* Consultation de toute la commune */
#fiche-lecture { margin: 0 0 1rem; }
.adresse .lib small + small { margin-top: .1rem; }

/* ---------- Aide ---------- */
.aide { padding-bottom: 2rem; }
.aide-intro { color: var(--gris); margin: 0 0 1rem; }
.aide-bloc { background: var(--papier); border: 1px solid var(--trait); border-radius: var(--rayon); margin-bottom: .7rem; }
.aide-bloc > summary {
  list-style: none; cursor: pointer; padding: .9rem 1rem; font: 700 1.2rem var(--titre); color: var(--marine);
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
}
.aide-bloc > summary::-webkit-details-marker { display: none; }
.aide-bloc > summary::after { content: "+"; font: 600 1.4rem var(--texte); color: var(--gris); }
.aide-bloc[open] > summary::after { content: "−"; }
.aide-bloc[open] > summary { border-bottom: 1px solid var(--trait); }
.aide-bloc > :not(summary) { margin-left: 1rem; margin-right: 1rem; }
.aide-bloc > :last-child { margin-bottom: 1rem; }
.aide-etapes, .aide-liste { padding-left: 1.3rem; margin-top: .8rem; }
.aide-etapes > li, .aide-liste > li { margin-bottom: .6rem; line-height: 1.45; }
.aide-etapes ul, .aide-liste ul { padding-left: 1.1rem; margin: .4rem 0 0; }
.aide-etapes ul li, .aide-liste ul li { margin-bottom: .25rem; }
.aide-resultats { display: grid; grid-template-columns: auto 1fr; gap: .45rem .7rem; align-items: center; margin: .6rem 0 .2rem; }
.aide-resultats dt { margin: 0; }
.aide-resultats dd { margin: 0; font-size: .95rem; }
.aide-resultats .etiquette { white-space: nowrap; }
.aide-astuce { background: var(--beton); border-left: 4px solid var(--marine); padding: .6rem .8rem; border-radius: 0 6px 6px 0; font-size: .95rem; }
.aide-astuce.alerte { border-left-color: var(--rouge); background: #FBEAEC; }
.aide-pastille { display: inline-block; background: var(--jaune); color: var(--marine); font-weight: 600; font-size: .85rem; padding: .05rem .5rem; border-radius: 999px; white-space: nowrap; }
.aide-pastille.rouge { background: var(--rouge); color: #fff; }
.aide-faq dt { font-weight: 600; margin-top: .8rem; }
.aide-faq dd { margin: .2rem 0 0; color: var(--gris); }

/* ---------- Thème sapeurs-pompiers : en-tête, logo, connexion ---------- */
.entete { background: linear-gradient(180deg, #1F1F23 0%, var(--nuit) 100%); border-bottom: 3px solid var(--rouge); }
.entete-logo { flex: none; display: flex; align-items: center; }
.entete-logo img { height: 2.6rem; width: auto; display: block; border-radius: 22%; filter: drop-shadow(0 1px 2px rgba(0,0,0,.6)); }
.entete-titre { letter-spacing: .02em; }
.connexion { padding-top: 4vh; }
.connexion-marque { text-align: center; margin-bottom: 1.6rem; }
.connexion-marque img { width: min(9.5rem, 42vw); height: auto; display: block; margin: 0 auto 1rem; filter: drop-shadow(0 6px 14px rgba(17,17,19,.35)); }
.connexion-marque h2 { font-size: 2.3rem; }
.connexion-cis { display: inline-block; margin: .35rem 0 0; padding-bottom: .25rem; border-bottom: 2px solid var(--or); font: 700 1.1rem var(--titre); letter-spacing: .07em; text-transform: uppercase; color: var(--rouge); }
/* Écran avec flèche retour : le titre (nom du secteur) passe avant le logo */
.entete-retour:not([hidden]) + .entete-logo { display: none; }
.bonjour { border-left: 5px solid var(--rouge); padding-left: .6rem; }
.equipe-titre { color: var(--rouge-fonce); }
.btn-rouge { box-shadow: 0 2px 0 var(--rouge-fonce); }
.aide-astuce { border-left-color: var(--or); background: #F7F1E3; }
.aide-bloc > summary { color: var(--marine); }
.aide-bloc[open] > summary { box-shadow: inset 4px 0 0 var(--rouge); }

/* ---------- À propos (RGPD, crédits, copyright) ---------- */
.a-propos { padding-bottom: 2rem; line-height: 1.5; }
.ap-tete { display: flex; align-items: center; gap: 1rem; background: var(--nuit); color: #fff; border-radius: var(--rayon); padding: 1rem 1.1rem; border-bottom: 3px solid var(--rouge); margin-bottom: 1.2rem; }
.ap-tete img { width: 5.5rem; height: auto; flex: none; border-radius: 22%; }
.ap-tete h2 { font-size: 1.9rem; }
.ap-tete p { margin: .15rem 0 0; color: #D6D6DB; font-size: .95rem; }
.ap-tete .ap-version { color: var(--or); font-size: .85rem; font-weight: 600; }
.a-propos section { background: var(--papier); border: 1px solid var(--trait); border-radius: var(--rayon); padding: 1rem 1.1rem; margin-bottom: 1rem; }
.a-propos h3 { font-size: 1.45rem; margin-bottom: .6rem; padding-left: .6rem; border-left: 5px solid var(--rouge); }
.a-propos h4 { font: 700 1.1rem var(--titre); margin: 1.1rem 0 .3rem; color: var(--rouge-fonce); }
.a-propos p { margin: .4rem 0; }
.a-propos ul { padding-left: 1.2rem; margin: .4rem 0; }
.a-propos li { margin-bottom: .35rem; }
.a-propos a { color: var(--rouge-fonce); }
.ap-copyright { text-align: center; color: var(--gris); font-size: .9rem; padding: .5rem 1rem 0; }
.ap-copyright p:first-child { font-weight: 600; color: var(--marine); }
.pied-legal { text-align: center; color: var(--gris); font-size: .85rem; margin: 2rem 0 0; line-height: 1.7; }
.pied-legal a { color: var(--gris); }

/* ---------- Mon compte ---------- */
.compte-bloc { background: var(--papier); border: 1px solid var(--trait); border-radius: var(--rayon); padding: 1.1rem 1.1rem .6rem; margin-bottom: 1.2rem; }
.compte-bloc h2 { font-size: 1.6rem; margin-bottom: 1rem; padding-left: .6rem; border-left: 5px solid var(--rouge); }
.compte-bloc label small { color: var(--gris); font-weight: 400; }
.compte-bloc input[type=tel] { display: block; width: 100%; margin-top: .35rem; font: 400 1.1rem var(--texte); color: var(--marine); padding: .8rem .9rem; border: 1px solid var(--trait); border-radius: var(--rayon); background: var(--papier); }
.compte-ligne { display: grid; grid-template-columns: 1fr 1fr; gap: 0 .8rem; }
.regles-mdp { list-style: none; padding: 0; margin: -.4rem 0 1rem; font-size: .92rem; }
.regles-mdp li { display: flex; align-items: center; gap: .5rem; padding: .12rem 0; color: var(--gris); }
.regles-mdp li::before { content: ""; width: 1rem; height: 1rem; border-radius: 50%; border: 2px solid var(--trait); flex: none; }
.regles-mdp li.ok { color: var(--marine); }
.regles-mdp li.ok::before { background: var(--vert); border-color: var(--vert); }
.compte-bloc .case { display: flex; align-items: center; gap: .5rem; font-weight: 400; }
.compte-bloc .case input { width: auto; margin: 0; }
.compte-bloc .note-aide { color: var(--gris); font-size: .88rem; margin: .5rem 0; }
@media (max-width: 360px) { .compte-ligne { grid-template-columns: 1fr; } }
.compte-ligne > label { min-width: 0; }

/* ---------- Pied de page (copyright) sur tous les écrans ---------- */
.ecran { padding-bottom: 1rem; }
.pied-app { text-align: center; color: var(--gris); font-size: .8rem; padding: .6rem 1rem calc(1.2rem + var(--bas)); border-top: 1px solid var(--trait); max-width: 40rem; margin: 0 auto; }
.pied-app a { color: var(--gris); }

/* ---------- Ajouter une maison (agent) ---------- */
.btn-ajout-maison {
  position: absolute; z-index: 800; left: 10px; bottom: 24px;
  font: 700 .95rem var(--texte); background: var(--rouge); color: #fff;
  border: 0; border-radius: var(--rayon); padding: .65rem .9rem;
  box-shadow: 0 1px 4px rgba(17,17,19,.3); cursor: pointer;
}
.btn-ajout-maison[aria-pressed="true"] { background: var(--jaune); color: var(--marine); }
.btn-ajout-maison[aria-pressed="true"]::after { content: " · annuler"; font-weight: 500; }
.carte-terrain.en-ajout { cursor: crosshair; outline: 3px solid var(--jaune); outline-offset: -3px; }
.maison-ligne { display: grid; grid-template-columns: 5.5rem 1fr; gap: 0 .7rem; }
.maison-ligne > label { min-width: 0; }
#form-maison input[type=number] { display: block; width: 100%; margin-top: .35rem; font: 400 1.1rem var(--texte); padding: .8rem .9rem; border: 1px solid var(--trait); border-radius: var(--rayon); }
#form-maison label small { color: var(--gris); font-weight: 400; }
.ap-tete .ap-creation { color: #B9B9C0; font-size: .85rem; font-style: italic; }

/* ---------- Paiement par carte (QR code du lien de paiement) ---------- */
.bloc-carte { background: var(--papier); border: 2px solid var(--marine); border-radius: var(--rayon); padding: .8rem; margin: .2rem 0 .9rem; text-align: center; }
.carte-titre { font: 700 1.15rem var(--titre); margin: 0 0 .2rem; }
.carte-aide { font-size: .88rem; color: var(--gris); margin: .3rem 0; }
.carte-aide strong { color: var(--marine); }
.qr-paiement { width: min(15rem, 70vw); margin: .5rem auto; background: #fff; }
.qr-paiement svg { display: block; width: 100%; height: auto; }
.carte-actions { display: flex; gap: .5rem; justify-content: center; flex-wrap: wrap; margin: .4rem 0; }
.carte-actions .btn { text-decoration: none; display: inline-flex; align-items: center; font-size: .92rem; min-height: 2.6rem; padding: .5rem .8rem; }
.carte-etapes { text-align: left; padding-left: 1.3rem; margin: .5rem 0 .7rem; font-size: .93rem; }
.carte-etapes li { margin-bottom: .3rem; }
.carte-ouvrir { display: flex; align-items: center; justify-content: center; text-decoration: none; margin: .3rem 0; }
.carte-autre { margin-top: .6rem; border-top: 1px solid var(--trait); padding-top: .5rem; }
.carte-autre summary { cursor: pointer; font-weight: 600; font-size: .92rem; color: var(--marine); padding: .3rem 0; }
.carte-autre .btn { margin: .3rem auto .2rem; display: block; }
.carte-choix { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin: .5rem 0 .7rem; }
.carte-choix label { margin: 0; }
.carte-choix input { position: absolute; opacity: 0; pointer-events: none; }
.carte-choix span { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .1rem; min-height: 4rem; padding: .4rem;
  border: 2px solid var(--trait); border-radius: var(--rayon); cursor: pointer; background: var(--papier); }
.carte-choix span b { font-size: 1.05rem; }
.carte-choix span small { color: var(--gris); font-size: .8rem; }
.carte-choix input:checked + span { border-color: var(--marine); background: var(--marine); color: #fff; }
.carte-choix input:checked + span small { color: #D6D6DB; }
.carte-choix input:focus-visible + span { outline: 3px solid var(--jaune); outline-offset: 2px; }
#carte-qr { margin-top: .6rem; }
.qr-paiement img { display: block; width: 100%; height: auto; }

/* ---------- Signature du donateur, preuve de don par e-mail ---------- */
.bloc-signature { border: 2px dashed var(--trait); border-radius: var(--rayon); padding: .6rem .7rem .4rem; margin-bottom: 1rem; background: var(--beton); }
.bloc-signature.signe { border-style: solid; border-color: var(--vert); }
.signature-titre { font-weight: 600; margin: 0 0 .4rem; }
.signature-titre::after { content: " · obligatoire"; color: var(--rouge); font-weight: 500; font-size: .88rem; }
.bloc-signature.signe .signature-titre::after { content: " · signée"; color: var(--vert); }
#signature { display: block; width: 100%; height: 9rem; background: #fff; border-radius: 6px; border: 1px solid var(--trait); touch-action: none; cursor: crosshair; }
.signature-actions { display: flex; justify-content: space-between; align-items: center; gap: .5rem; font-size: .85rem; color: var(--gris); }
.recu small { color: var(--gris); font-weight: 400; }
.recu .recu-note { display: block; margin-top: .3rem; font-size: .8rem; }
.bloc-donateur { margin-bottom: .6rem; }
.bloc-donateur .case { display: flex; align-items: flex-start; gap: .5rem; font-weight: 400; font-size: .93rem; margin: -.4rem 0 .7rem; }
.bloc-donateur .case input { width: 1.2rem; height: 1.2rem; flex: none; margin: .1rem 0 0; accent-color: var(--marine); }
.bloc-donateur label small { color: var(--gris); font-weight: 400; }

/* ---------- Adresse déjà donnée : dons enregistrés (non modifiables) et don supplémentaire ---------- */
.bloc-dons { border: 2px solid var(--s-donne); border-radius: var(--rayon); padding: .8rem .9rem; margin-bottom: 1rem; background: #EEF6F1; }
.dons-titre { margin: 0 0 .5rem; font-weight: 700; color: var(--s-donne); }
.liste-dons { list-style: none; margin: 0 0 .8rem; padding: 0; display: grid; gap: .4rem; }
.liste-dons li { display: flex; justify-content: space-between; align-items: baseline; gap: .6rem; flex-wrap: wrap;
  background: var(--papier); border: 1px solid var(--trait); border-radius: 8px; padding: .55rem .7rem; }
.liste-dons .don-montant { font: 700 1.35rem var(--titre); }
.liste-dons .don-detail { color: var(--gris); font-size: .9rem; }
.liste-dons .don-total { background: transparent; border: 0; padding: .1rem .2rem; font-weight: 700; }
.titre-complement { margin: 0 0 .7rem; font: 700 1.25rem var(--titre); color: var(--s-donne); }
.aide-bloc h4 { font: 700 1.1rem var(--titre); margin: .8rem 1rem .2rem; }

/* ---------- Liste : rues repliables avec compteur « faites / total » ---------- */
.rue { margin-bottom: .55rem; }
.rue-titre {
  position: relative; display: flex; align-items: center; gap: .7rem; width: 100%;
  font: inherit; color: var(--marine); text-align: left; cursor: pointer;
  background: var(--papier); border: 1px solid var(--trait); border-radius: var(--rayon);
  padding: .8rem .9rem 1rem; min-height: 3.4rem; overflow: hidden;
}
.rue.ouverte .rue-titre { border-radius: var(--rayon) var(--rayon) 0 0; border-bottom-color: transparent; }
.rue-nom { flex: 1; min-width: 0; font-weight: 700; font-size: 1.05rem; }
.rue-compte { font: 700 1.15rem var(--titre); white-space: nowrap; background: var(--beton); border-radius: 999px; padding: .15rem .65rem; }
.rue-titre.finie .rue-compte { background: var(--s-donne); color: #fff; }
.rue-fleche { width: .6rem; height: .6rem; border-right: 2px solid var(--gris); border-bottom: 2px solid var(--gris); transform: rotate(45deg); margin: 0 .2rem .25rem; transition: transform .15s; }
.rue.ouverte .rue-fleche { transform: rotate(-135deg); margin-bottom: -.2rem; }
.rue-barre { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: var(--beton); }
.rue-barre span { display: block; height: 100%; background: var(--s-donne); }
.rue.ouverte .adresses { border-top-left-radius: 0; border-top-right-radius: 0; }

/* Rappel de l'an dernier dans la fiche */
.fiche-rappel { margin: .45rem 0 0; padding: .4rem .65rem; background: #FBF3DC; border-left: 4px solid #A87B00; border-radius: 0 6px 6px 0; font-size: .95rem; }

/* Changement d'adresse (ancienne adresse arc.baecher.fr) */
.demenagement { background: #FBF3DC; border-bottom: 3px solid #C9A227; color: #3B2E00; padding: .7rem 1rem; font-size: .95rem; line-height: 1.4; }
.demenagement a { color: #B71C1C; font-weight: 700; }
