:root {
  --fond: #fffaf3;
  --carte: #ffffff;
  --texte: #1f2a2a;
  --doux: #5b6b6b;
  --vert: #2f6f5e;
  --vert-clair: #e3f1ec;
  --orange: #c45a1b;        /* bords et fonds seulement */
  --orange-fonce: #9a4310;  /* texte orange : contraste 5,8:1 sur --orange-clair */
  --orange-clair: #fdeee3;
  --rouge: #b3261e;
  --bord: #e6ded2;          /* séparations décoratives */
  --bord-champ: #8f8576;    /* bords des champs : contraste 3,5:1 sur le fond */
  --rayon: 14px;
}
* { box-sizing: border-box; }
html { font-size: 18px; }
body {
  margin: 0; background: var(--fond); color: var(--texte);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; line-height: 1.45;
  padding-bottom: 84px;
}
a { color: var(--vert); }
h1 { font-size: 1.45rem; margin: .4rem 0 1rem; }
h2 { font-size: 1.15rem; margin: 1.6rem 0 .6rem; }
h3 { font-size: 1rem; margin: 0 0 .3rem; }
p { margin: .4rem 0; }
.entete {
  display: flex; justify-content: space-between; align-items: center;
  padding: .7rem 16px; background: var(--vert); color: #fff; position: sticky; top: 0; z-index: 5;
}
.marque { color: #fff; font-weight: 700; font-size: 1.2rem; text-decoration: none; }
.marque { min-height: 44px; display: inline-flex; align-items: center; }
.cloche {
  color: #fff; text-decoration: none; position: relative;
  min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center;
}
.pastille {
  position: absolute; top: 2px; right: -2px; background: var(--orange-fonce); color: #fff; font-weight: 700;
  border-radius: 999px; font-size: .7rem; padding: 0 .4rem; border: 1px solid #fff;
}
.icone { width: 24px; height: 24px; flex: none; }
.page { max-width: 640px; margin: 0 auto; padding: 1rem 16px; }
.barre {
  position: fixed; bottom: 0; left: 0; right: 0; display: flex; background: #fff;
  border-top: 1px solid var(--bord); padding-bottom: env(safe-area-inset-bottom); z-index: 5;
}
.barre a {
  flex: 1; text-align: center; padding: .5rem .2rem; font-size: .75rem; color: var(--doux); min-height: 56px;
  text-decoration: none; display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.barre a.actif { color: var(--vert); font-weight: 700; }
.carte {
  background: var(--carte); border: 1px solid var(--bord); border-radius: var(--rayon);
  padding: 1rem; margin: .7rem 0;
}
.carte.urgente { border-color: var(--orange); background: var(--orange-clair); }
.carte.info { background: var(--vert-clair); border-color: #c4e0d6; }
.carte.alerte { background: var(--orange-clair); border-color: #f2c6a8; }
.doux { color: var(--doux); font-size: .9rem; }
.etiquette {
  display: inline-block; font-size: .75rem; padding: .1rem .5rem; border-radius: 999px;
  background: var(--vert-clair); color: var(--vert); margin-right: .3rem;
}
.etiquette.orange { background: var(--orange-clair); color: var(--orange-fonce); font-weight: 600; }
.carte.urgente .etiquette.orange { background: #fff; }
.etiquette.fictif { background: #fff3c4; color: #7a5b00; }
.bouton, button {
  display: inline-block; border: 0; border-radius: 12px; padding: .8rem 1.1rem; font-size: 1rem;
  background: var(--vert); color: #fff; text-decoration: none; cursor: pointer; font-family: inherit;
  min-height: 48px;
}
.bouton.large, button.large { display: block; width: 100%; text-align: center; margin: .6rem 0; }
.bouton.secondaire, button.secondaire { background: #fff; color: var(--vert); border: 2px solid var(--vert); }
.bouton.danger, button.danger { background: var(--rouge); }
button.lien {
  background: none; color: var(--doux); padding: .6rem .4rem; min-height: 44px; text-decoration: underline;
  font-size: .9rem; display: inline-flex; align-items: center;
}
/* Liens dans une phrase : ils restent dans la ligne (pas de flex, pas de marge sur les côtés). Le
   remplissage vertical agrandit la zone à toucher sans changer la hauteur de la ligne. */
:where(.page p) a:not(.bouton) { padding: .4em 0; }
/* Liens d'action seuls sur leur ligne : au moins 44 px de haut. */
.lien-action > a, .carte > a:not(.bouton):not(.carte), .ligne > a:not(.bouton):not(.carte),
.actions > a, .actions-message a, details > summary, .filtres a {
  min-height: 44px; display: inline-flex; align-items: center;
}
.lien-action > a, .ligne > a:not(.bouton):not(.carte), .actions > a { padding: 0 .2rem; }
.lien-action { margin: .2rem 0; }
.lien-action.danger > a { color: var(--rouge); }
details > summary { cursor: pointer; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; }
/* Actions d'une carte (Mes enfants) : toutes du même style, alignées à gauche, une colonne si besoin. */
.actions-carte { flex-direction: column; align-items: flex-start; gap: 0; margin-top: .3rem; }
.actions-carte > a, .actions-carte button.lien {
  color: var(--vert); font-size: .95rem; padding: .5rem 0; min-height: 44px; text-decoration: underline;
  text-align: left; display: inline-flex; align-items: center;
}
form p, .champ { margin: .8rem 0; }
label, legend { display: block; font-weight: 600; margin-bottom: .25rem; }
fieldset { border: 0; padding: 0; margin: .8rem 0; min-width: 0; }
legend { padding: 0; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date],
input[type=time], input[type=search], input[type=tel], select, textarea {
  width: 100%; font-size: 1rem; padding: .7rem; border: 1px solid var(--bord-champ); border-radius: 10px; background: #fff;
  font-family: inherit;
}
/* Champ photo : même largeur et même police que les autres champs, bouton comme les boutons secondaires. */
input[type=file] { display: block; width: 100%; max-width: 100%; font-size: 1rem; font-family: inherit; color: var(--texte); }
input[type=file]::file-selector-button {
  font-family: inherit; font-size: 1rem; min-height: 48px; padding: .6rem 1rem; margin-right: .8rem;
  background: #fff; color: var(--vert); border: 2px solid var(--vert); border-radius: 12px; cursor: pointer;
}
input[type=checkbox], input[type=radio] { width: 1.3rem; height: 1.3rem; flex: none; margin: 0; accent-color: var(--vert); }
ul.choix, form ul { list-style: none; padding: 0; margin: 0; }
/* Choix à cocher : un choix par ligne, texte normal, toute la ligne se touche (44 px au moins).
   Django 5 range les choix dans des <div> (plus des <ul>) : on vise les deux. */
fieldset label, div[id^="id_"] > div > label, form ul li label, ul.choix label,
label:has(> input[type=checkbox]), label:has(> input[type=radio]) {
  font-weight: 400; display: flex; align-items: center; gap: .6rem; min-height: 44px; padding: .3rem 0; margin: 0;
}
fieldset > div > div + div, div[id^="id_"] > div + div { border-top: 1px solid var(--bord); }
/* Texte lu par les lecteurs d'écran seulement (étiquette d'un champ dont le sens se voit déjà). */
.lecteur-seulement {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.helptext { display: block; color: var(--doux); font-size: .85rem; }
.errorlist { color: var(--rouge); padding: 0; list-style: none; font-size: .9rem; }
.message { padding: .8rem 1rem; border-radius: 10px; background: var(--vert-clair); }
.message.error { background: #fde8e7; color: var(--rouge); }
.message.warning, .message.info { background: var(--orange-clair); }
.carte-lien { display: block; text-decoration: none; color: inherit; }
.carte-lien.ligne { display: flex; }
.extensible { flex: 1; }
/* Pas de vide au-dessus du premier élément d'un encadré, ni sous le dernier. */
.carte > :first-child { margin-top: 0; }
.carte > :last-child { margin-bottom: 0; }
.carte-titre { display: block; }
.carte-lien:hover .carte-titre, .carte-lien:focus .carte-titre { text-decoration: underline; }
.carte.nouvelle { border-color: var(--vert); border-width: 2px; }
.photo { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; background: var(--vert-clair); }
.photo.grande { width: 140px; height: 140px; }
.ligne { display: flex; gap: .8rem; align-items: center; }
.filtres { display: flex; gap: .4rem; overflow-x: auto; padding-bottom: .3rem; }
.filtres a { white-space: nowrap; padding: .4rem .8rem; border-radius: 999px; border: 1px solid var(--bord); text-decoration: none; color: var(--texte); background: #fff; }
.filtres a.actif { background: var(--vert); color: #fff; border-color: var(--vert); }
.fil { max-height: 360px; overflow-y: auto; }
.bulle { background: #f4efe7; border-radius: 12px; padding: .5rem .8rem; margin: .4rem 0; }
.bulle.moi { background: var(--vert-clair); margin-left: 2rem; }
.resultats { border: 1px solid var(--bord); border-radius: 10px; margin-top: .4rem; background: #fff; }
.resultats .vide, .resultats .message { padding: .6rem; margin: 0; }
.resultats button { display: block; width: 100%; text-align: left; background: #fff; color: var(--texte); border-bottom: 1px solid var(--bord); border-radius: 0; }
.code { font-family: ui-monospace, monospace; font-size: 1.3rem; letter-spacing: .1em; background: #fff; padding: .2rem .6rem; border-radius: 8px; border: 1px dashed var(--vert); }
.mention { font-size: .85rem; background: #fff3c4; padding: .6rem .8rem; border-radius: 10px; }
table { width: 100%; border-collapse: collapse; }
td, th { padding: .4rem; border-bottom: 1px solid var(--bord); text-align: left; }

/* Autorisation à montrer à l'école */
.autorisation h1 { font-size: 1.6rem; line-height: 1.25; }
@media print {
  .entete, .barre, .page > p { display: none; }
  .autorisation { border: 2px solid #000; }
}

.actions-message form { display: inline; }
.actions-message a, .actions-message button { font-size: .85rem; }
details.gerer form { display: block; }
/* Pied de page légal (legal/_pied.html) : liens assez grands pour le doigt. Une liste avec un écart
   plutôt que des « · » : sur un téléphone, aucun séparateur ne reste seul en bout de ligne. */
.pied-legal { text-align: center; font-size: .85rem; margin: 2rem 0 1rem; }
.pied-legal ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 0 1rem; }
.pied-legal a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 .2rem; }
/* Texte qui ne se coupe pas en fin de ligne (numéro de téléphone…). */
.insecable { white-space: nowrap; }
/* « Je ne peux plus venir » : un bouton qui déplie le formulaire. */
summary.bouton { list-style: none; display: inline-flex; align-items: center; justify-content: center; margin: .3rem 0; }
summary.bouton::-webkit-details-marker { display: none; }
summary.bouton.large { display: flex; width: 100%; }
/* Action dépliable (« Créer un cercle »…) : un bouton, et le formulaire dans un encadré dessous. */
details.action-depliable { margin: .6rem 0; }
details.action-depliable > .carte { margin-top: .4rem; }
/* Lien d'invitation : affiché entier, coupé proprement, sélectionnable. */
input.lien-invitation { width: 100%; font-family: ui-monospace, monospace; font-size: .85rem; color: var(--texte); background: #f7f3ec; }
.flexible { flex: 1; }
.texte-normal { font-weight: 400; }
.barre-texte { text-decoration: line-through; color: var(--doux); }
.marge-fine { margin: .4rem 0; }
/* Sommaire des pages légales. */
.sommaire { margin: .6rem 0 1.2rem; }
.sommaire ol { margin: .3rem 0 0; padding-left: 1.4rem; }
.sommaire li a { display: inline-block; padding: .35rem 0; }
:target { scroll-margin-top: 80px; }
/* « Me déconnecter » (comptes/_deconnexion.html) : un vrai bouton, pas un lien discret. */
form[data-deconnexion] button.lien {
  background: #fff; color: var(--vert); border: 2px solid var(--vert); padding: .8rem 1.1rem;
  min-height: 48px; text-decoration: none; font-size: 1rem; margin: .6rem 0;
}
[hidden] { display: none !important; }
