/* Style commun aux 3 pages. Pensé pour un téléphone de 360 px de large. */
:root {
  /* PALETTE À AJUSTER avec les couleurs exactes du site de la mosquée : tout le reste s'adapte */
  --encre: #1c2733;
  --fond: #faf7f0;
  --carte: #ffffff;
  --principal: #1f3a4d;
  --or: #c9a24b;
  --halo: rgba(201, 162, 75, .5);
  --ok: #17693f;  --ok-fond: #e1f3e8;
  --non: #a8322b; --non-fond: #fbe8e5;
  --info-fond: #fbf1d9;
  --gris: #56616c;
  --ligne: #e2dccd;
  --bord: #857d6c;        /* bordure des champs : contraste ≥ 3:1 sur blanc */
  --r: 14px;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--fond); color: var(--encre); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
main { max-width: 560px; margin: 0 auto; padding: 0 16px 48px; }
main.large { max-width: 1100px; }
h1, h2 { font-family: Georgia, "Times New Roman", serif; color: var(--principal); line-height: 1.25; }
h1 { font-size: 1.55rem; margin: 12px 0 4px; }
h2 { font-size: 1.15rem; margin: 0 0 10px; }
[hidden] { display: none !important; }

.entete { text-align: center; padding: 22px 0 8px; }
.logo { height: 84px; max-width: 92%; width: auto; object-fit: contain; border-radius: 14px; box-shadow: 0 0 28px 6px var(--halo); background: #fff; padding: 6px 12px; }
.sous { margin: 0; color: var(--gris); }
.entete.compact { display: flex; align-items: center; gap: 14px; text-align: left; padding: 12px 0 4px; }
.entete.compact .logo { height: 46px; max-width: 45%; border-radius: 10px; box-shadow: 0 0 16px 3px var(--halo); padding: 3px 8px; }
.entete.compact h1 { font-size: 1.1rem; margin: 0; }

.carte { background: var(--carte); border: 1px solid var(--ligne); border-radius: 14px; padding: 16px; margin: 14px 0; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
label, .etiquette { display: block; font-weight: 600; margin: 12px 0 4px; }
.facultatif { font-weight: 400; color: var(--gris); }
input[type=text], input[type=tel], input[type=date], input[type=password], input[type=search], select {
  width: 100%; min-height: 48px; font: inherit; color: inherit; background: #fff;
  border: 1.5px solid var(--bord); border-radius: 10px; padding: 8px 12px;
}
input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid var(--principal); outline-offset: 2px; box-shadow: 0 0 0 6px var(--halo); }

/* Choix à gros boutons (fille/garçon, oui/non) */
.choix { display: flex; gap: 8px; }
.choix label { flex: 1; margin: 0; position: relative; }
.choix input { position: absolute; opacity: 0; inset: 0; }
.choix span { display: flex; align-items: center; justify-content: center; min-height: 48px; padding: 6px 10px; text-align: center;
  border: 1.5px solid var(--bord); border-radius: 10px; background: #fff; font-weight: 600; }
.choix input:checked + span { background: var(--principal); border-color: var(--principal); color: #fff; }
.choix input:focus-visible + span { outline: 3px solid var(--principal); outline-offset: 2px; box-shadow: 0 0 0 6px var(--halo); }

.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 52px; padding: 10px 16px;
  font: inherit; font-weight: 700; color: #fff; background: var(--principal); border: 2px solid var(--principal);
  border-radius: 12px; cursor: pointer; text-decoration: none; }
.btn:disabled { opacity: .6; cursor: wait; }
.btn-or { background: #fff; color: var(--principal); border-color: var(--or); box-shadow: 0 0 14px var(--halo); }
.btn-sec { background: #fff; color: var(--principal); border-color: var(--bord); }
.btn-petit { width: auto; min-height: 40px; padding: 4px 12px; font-size: .9rem; }
.btn svg, .pastille svg { width: 22px; height: 22px; flex: none; }
.lien { background: none; border: 0; padding: 8px 0; color: var(--principal); text-decoration: underline; font: inherit; cursor: pointer; }

.alerte { display: flex; gap: 10px; padding: 12px 14px; border-radius: 10px; margin: 12px 0; font-weight: 500; }
.alerte svg { width: 22px; height: 22px; flex: none; margin-top: 2px; }
.alerte.err { background: var(--non-fond); color: var(--non); }
.alerte.info { background: var(--info-fond); color: #6b4e08; }
.alerte.ok { background: var(--ok-fond); color: var(--ok); }
.consent { display: flex; gap: 12px; align-items: flex-start; font-weight: 400; font-size: .92rem; }
.consent input { width: 24px; height: 24px; flex: none; margin-top: 2px; accent-color: var(--principal); }
.piege { position: absolute; left: -9999px; height: 0; overflow: hidden; }
.petit { font-size: .88rem; color: var(--gris); }
.centre { text-align: center; }
.enfant-titre { display: flex; justify-content: space-between; align-items: center; }

/* Écran prof */
.barre { display: flex; gap: 8px; align-items: center; justify-content: space-between; padding: 10px 0; flex-wrap: wrap; }
.onglets { display: flex; gap: 6px; margin: 8px 0; flex-wrap: wrap; }
.onglets button { flex: 1; min-height: 46px; font: inherit; font-weight: 700; color: var(--principal); background: #fff; border: 1.5px solid var(--bord); border-radius: 10px; cursor: pointer; padding: 4px 10px; }
.onglets button[aria-pressed=true] { background: var(--principal); color: #fff; border-color: var(--principal); }
.compte { display: flex; gap: 14px; font-weight: 600; margin: 6px 0 10px; flex-wrap: wrap; }
.sous-ligne { flex-basis: 100%; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 8px 0 4px; border-top: 1px dashed var(--ligne); }
.ligne-eleve { flex-wrap: wrap; display: flex; gap: 10px; align-items: center; background: var(--carte); border: 1px solid var(--ligne); border-radius: 12px; padding: 8px 8px 8px 12px; margin: 8px 0; }
.ligne-eleve .nom { flex: 1; min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.ligne-eleve .nom small { display: block; font-weight: 400; color: var(--gris); }
.ligne-eleve select { width: auto; min-height: 40px; padding: 4px 6px; font-size: .88rem; }
.badge { display: inline-block; font-size: .72rem; font-weight: 700; padding: 1px 8px; border-radius: 99px; background: var(--info-fond); color: #6b4e08; margin-left: 6px; vertical-align: middle; }
.pastille { display: flex; align-items: center; justify-content: center; gap: 6px; width: 112px; min-height: 52px; flex: none;
  font: inherit; font-weight: 700; border-radius: 10px; border: 2px dashed var(--bord); background: #fff; color: var(--gris); cursor: pointer; }
.pastille.present { background: var(--ok-fond); border: 2px solid var(--ok); color: var(--ok); }
.pastille.absent { background: var(--non-fond); border: 2px solid var(--non); color: var(--non); }
.pastille.attente { opacity: .55; }
.pastille.echec { border: 2px solid var(--non); color: var(--non); background: #fff; font-size: .78rem; }

/* Espace admin */
.compteurs { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.compteurs div { background: var(--carte); border: 1px solid var(--ligne); border-radius: 12px; padding: 10px 12px; }
.compteurs b { display: block; font-family: Georgia, serif; font-size: 1.7rem; color: var(--principal); }
.filtres { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin: 10px 0; }
.tableau { overflow-x: auto; background: var(--carte); border: 1px solid var(--ligne); border-radius: 12px; }
table { border-collapse: collapse; width: 100%; font-size: .92rem; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--ligne); vertical-align: top; }
th { background: #f3eee1; position: sticky; top: 0; font-size: .82rem; text-transform: uppercase; letter-spacing: .03em; }
td.mat { text-align: center; cursor: pointer; font-weight: 700; min-width: 46px; }
td.mat.present { color: var(--ok); background: var(--ok-fond); }
td.mat.absent { color: var(--non); background: var(--non-fond); }
.fil { list-style: none; padding: 0; margin: 0; }
.fil li { background: var(--carte); border: 1px solid var(--ligne); border-radius: 10px; padding: 8px 12px; margin: 6px 0; }
.fil time { color: var(--gris); font-size: .82rem; display: block; }
.grille2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 12px; }
.feuille { page-break-after: always; }
.feuille table { font-size: 1rem; }
.feuille td, .feuille th { border: 1px solid #444; }

@media print {
  body { background: #fff; }
  #app { display: none !important; }
  #feuilles { display: block !important; }
  .feuille td { height: 34px; }
}
.feuille h2 { margin: 0 0 4px; }
.feuille .case { width: 54px; }

/* Date de naissance : 3 listes (jour, mois, année), plus simples qu'un calendrier */
.date3 { display: grid; grid-template-columns: 1fr 1.6fr 1.2fr; gap: 8px; }

/* ===== Habillage v2 : rythme, ornement, états ===== */
body { -webkit-text-size-adjust: 100%; }
main { padding-bottom: 24px; }
h1 { font-size: 1.65rem; letter-spacing: .005em; }
h2 { display: flex; align-items: center; gap: 10px; font-size: 1.12rem; }
h2::before { content: ""; width: 4px; height: 1.1em; border-radius: 2px; background: var(--or); flex: none; }
.entete { padding-bottom: 14px; }
.entete:not(.compact)::after {            /* filet doré avec losange central */
  content: ""; display: block; height: 14px; margin: 18px auto 0; max-width: 260px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 260 14'%3E%3Cpath d='M0 7h112M148 7h112' stroke='%23c9a24b' stroke-width='1.5'/%3E%3Cpath d='M130 1l6 6-6 6-6-6z' fill='none' stroke='%23c9a24b' stroke-width='1.5'/%3E%3C/svg%3E") center / contain no-repeat;
}
.carte { border-radius: var(--r); padding: 18px 16px; margin: 16px 0; box-shadow: 0 1px 2px rgba(31, 58, 77, .06); }
label, .etiquette { margin: 16px 0 6px; font-size: .97rem; }
label:first-of-type, .carte > .etiquette:first-child { margin-top: 4px; }
input::placeholder { color: #6b7480; }
input[type=text], input[type=tel], input[type=date], input[type=password], input[type=search], select { border-radius: 12px; }
input:hover, select:hover { border-color: var(--principal); }
.choix span { transition: background .15s, color .15s, border-color .15s; }
.choix label:hover span { border-color: var(--principal); }
.btn { border-radius: 14px; font-size: 1.02rem; transition: transform .1s, box-shadow .15s, background .15s; }
.btn:active { transform: scale(.985); }
.btn:hover:not(:disabled) { box-shadow: 0 4px 14px rgba(31, 58, 77, .22); }
#envoyer { margin-top: 8px; min-height: 56px; }

/* Erreurs de champ : bordure + icône + texte (jamais la couleur seule) */
.invalide:is(input, select), .invalide.choix span, .invalide.date3 select { border-color: var(--non); background: #fffafa; }
.choix.invalide span { border-color: var(--non); }
.consent.invalide { outline: 2px solid var(--non); outline-offset: 4px; border-radius: 8px; }
.msg-champ { display: flex; gap: 6px; align-items: flex-start; margin: 6px 0 0; color: var(--non); font-size: .9rem; font-weight: 600; }
.msg-champ svg { width: 18px; height: 18px; flex: none; margin-top: 2px; }

.pied { text-align: center; font-size: .78rem; color: var(--gris); padding: 8px 16px 28px; }
.pied a { color: inherit; }
.droit-non { color: var(--non); font-weight: 800; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
@media print { .pied { display: none; } }

@media print { .droit-non { color: #000; border: 2px solid #000; padding: 1px 4px; font-size: .8rem; } }
.date3 select { padding: 8px 4px 8px 10px; text-overflow: ellipsis; }
.date3 { grid-template-columns: .9fr 1.5fr 1.1fr; }
.choix.invalide input:checked + span { background: var(--principal); border-color: var(--principal); color: #fff; }
