/* Administration des événements : clair, aéré, mobile d'abord. Couleurs de la charte (vert nuit, vert logo, orange braise). Police système (la CSP n'autorise pas de police externe). Aucun style en ligne. */
:root { --vert: #3e641b; --vert-fonce: #284110; --texte: #1b2d0b; --fond: #f7faf5; --bord: #dbd8d7; --rouge: #9b1c1c; --brume: #edf4e7; --pale: #d8e7ca; --gris: #4d4948; --orange: #cc6600; --rayon: 14px; --ombre: 0 1px 2px rgba(27, 45, 11, .06), 0 4px 14px rgba(27, 45, 11, .06); }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 1.0625rem/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--texte); background: var(--fond); }
a { color: var(--vert-fonce); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 3px solid var(--vert-fonce); outline-offset: 2px; }
.saut { position: absolute; left: -999px; }
.saut:focus { left: 0.5rem; top: 0.5rem; background: #fff; padding: 0.5rem; z-index: 10; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* En-tête : logo, menu simple */
.entete { background: #fff; border-bottom: 1px solid var(--bord); }
.entete > div, main { max-width: 64rem; margin: 0 auto; padding: 0.75rem 1rem; }
.entete > div { display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; align-items: center; justify-content: space-between; }
.marque { display: flex; align-items: center; gap: 0.7rem; margin: 0; font-weight: 700; line-height: 1.2; color: var(--vert-fonce); }
.marque img { width: 2.5rem; height: auto; display: block; }
.marque small { display: block; font-weight: 500; font-size: 0.85rem; color: var(--gris); }
.sans-menu > div { justify-content: center; }
main { padding-top: 0.5rem; padding-bottom: 5rem; }
h1 { font-size: 1.75rem; line-height: 1.2; margin: 1.25rem 0 1rem; letter-spacing: -0.01em; }
h2 { font-size: 1.25rem; line-height: 1.3; margin: 2rem 0 0.75rem; }
h3 { line-height: 1.3; }
nav { flex-basis: auto; }
.menu { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 0.5rem; align-items: center; }
.menu a { display: inline-flex; align-items: center; min-height: 2.75rem; padding: 0 0.9rem; border-radius: 999px; font-weight: 700; text-decoration: none; color: var(--vert-fonce); }
.menu a:hover { background: var(--brume); }
.menu a[aria-current=page] { background: var(--pale); }
.menu form { margin: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.menu button { min-height: 2.75rem; padding: 0 0.9rem; border: 0; background: transparent; font-weight: 600; color: var(--gris); text-decoration: underline; }
.menu button:hover { background: var(--brume); }

/* Messages (bandeaux en haut de page) */
.msg { display: flex; gap: 0.75rem; align-items: flex-start; padding: 0.9rem 1rem; border-radius: 12px; border: 1px solid #a2c680; background: var(--brume); color: var(--texte); margin: 1rem 0; }
.msg::before { content: "✓"; flex: none; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--vert); color: #fff; font-weight: 700; text-align: center; line-height: 1.6rem; }
.msg.erreur { border-color: #e0a9a9; background: #fdf2f2; color: #5c0f0f; }
.msg.erreur::before { content: "!"; background: var(--rouge); }
.msg.attention { border-color: #e8b27a; background: #fff0e0; color: #4a2500; display: block; }
.msg.attention::before { content: none; }
.msg.attention p, .msg.attention ul { margin: 0.25rem 0; }

/* Boutons */
.bouton, button { font: inherit; font-weight: 700; min-height: 2.75rem; padding: 0.5rem 1.2rem; border-radius: 999px; border: 2px solid var(--vert); background: #fff; color: var(--vert-fonce); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; line-height: 1.2; }
.bouton:hover, button:hover { background: var(--brume); }
.bouton.principal, button.principal { background: var(--vert); color: #fff; }
.bouton.principal:hover, button.principal:hover { background: var(--vert-fonce); border-color: var(--vert-fonce); }
.bouton.danger, button.danger { border-color: var(--rouge); color: var(--rouge); }
.bouton.danger:hover, button.danger:hover { background: #fdf2f2; }
button.danger.principal { background: var(--rouge); color: #fff; }
button.danger.principal:hover { background: #7a1616; border-color: #7a1616; }
.bouton.grand { min-height: 3.5rem; padding: 0.6rem 1.7rem; font-size: 1.15rem; }
.bouton.discret, button.discret { border-color: transparent; background: transparent; text-decoration: underline; }
.plus-signe { font-size: 1.5rem; line-height: 1; font-weight: 400; }
.actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.75rem; align-items: center; }
.actions form { margin: 0; }

/* Champs */
.champ { margin: 1rem 0; }
label { display: block; font-weight: 700; margin-bottom: 0.3rem; }
input[type=text], input[type=url], input[type=password], input[type=email], input[type=date], input[type=time], select, textarea { width: 100%; font: inherit; padding: 0.7rem 0.8rem; min-height: 2.9rem; border: 2px solid #8a9779; border-radius: 10px; background: #fff; color: var(--texte); }
input:focus, textarea:focus, select:focus { border-color: var(--vert); }
textarea { min-height: 9rem; line-height: 1.5; resize: vertical; }
.aide { font-size: 0.95rem; color: var(--gris); margin: 0.3rem 0 0; }
.err { color: var(--rouge); font-weight: 700; margin: 0.3rem 0 0; }
.invalide { border-color: var(--rouge) !important; }
.trois { display: grid; grid-template-columns: 1fr; gap: 0 1rem; }
.trois > .champ:first-child { grid-column: 1 / -1; }
@media (min-width: 40rem) { .trois { grid-template-columns: 2fr 1fr 1fr; } .trois > .champ:first-child { grid-column: auto; } }
.deux { display: grid; grid-template-columns: 1fr; gap: 0 1rem; }
@media (min-width: 40rem) { .deux { grid-template-columns: 1fr 1fr; } }
.case { display: flex; gap: 0.75rem; align-items: center; }
.case input { width: 1.5rem; height: 1.5rem; flex: none; accent-color: var(--vert); }
.case label { margin: 0; font-weight: 400; }
.piege { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.defaut { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); padding: 0; border: 0; min-height: 0; }
input[type=password] + .aide:empty { display: none; }
.mdp-champ { position: relative; display: block; }
.mdp-champ input { padding-right: 3.2rem; }
.mdp-champ .oeil { display: none; position: absolute; top: 0; right: 0; width: 48px; height: 100%; min-height: 44px; align-items: center; justify-content: center; padding: 0; border: 0; border-radius: 0 10px 10px 0; background: transparent; color: var(--texte); cursor: pointer; }
.js .mdp-champ .oeil { display: inline-flex; }
.mdp-champ .oeil .barre { display: none; }
.mdp-champ .oeil.actif .barre { display: inline; }

/* Connexion et écrans courts : carte centrée */
.carte { background: #fff; border: 1px solid var(--bord); border-radius: 20px; box-shadow: var(--ombre); padding: 1.5rem 1.5rem 1.25rem; max-width: 28rem; margin: 2rem auto; }
.carte h1 { margin-top: 0; font-size: 1.5rem; }
.carte .principal { width: 100%; min-height: 3.25rem; font-size: 1.1rem; margin-top: 0.5rem; }
.carte .actions .principal { width: auto; }
.carte .actions { justify-content: space-between; }
#code { font-size: 2rem; letter-spacing: 0.5em; text-align: center; min-height: 4rem; font-weight: 700; padding-left: 1.2rem; }

/* Pastilles de statut */
.badge { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.85rem; font-weight: 700; padding: 0.1rem 0.7rem; border-radius: 999px; vertical-align: middle; color: var(--vert-fonce); background: var(--pale); white-space: nowrap; }
.badge::before { content: ""; width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--vert); }
.badge.brouillon { color: #7a3d00; background: #fff0e0; }
.badge.brouillon::before { background: var(--orange); }

/* Liste d'événements : cartes visuelles */
.liste { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
.liste li { background: #fff; border: 1px solid var(--bord); border-radius: var(--rayon); padding: 1rem; box-shadow: var(--ombre); }
.liste h3 { margin: 0.2rem 0; font-size: 1.15rem; }
.liste p { margin: 0.15rem 0; }
.liste h2 { margin: 0 0 0.25rem; font-size: 1.1rem; }
.liste.emplacements { grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); }
.liste.emplacements li { display: flex; flex-direction: column; gap: 0.4rem; overflow: hidden; }
.liste.emplacements img, .cadre-vide { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; display: block; }
.cadre-vide { display: flex; flex-direction: column; gap: 0.4rem; align-items: center; justify-content: center; text-align: center; padding: 1rem; background: var(--brume); color: var(--gris); }
.cadre-vide p { margin: 0; }
.cadre-vide svg { color: var(--vert); }
.liste.emplacements .actions { margin-top: auto; padding-top: 0.5rem; }
.cartes-ev .desc { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-line; overflow-wrap: anywhere; color: var(--gris); }
.cartes-ev h3 { overflow-wrap: anywhere; display: flex; flex-direction: column; align-items: flex-start; gap: 0.35rem; }
.cartes-ev .actions { gap: 0.4rem; }
.cartes-ev .actions a.bouton, .cartes-ev .actions button { flex: 1 1 auto; }
.cartes-ev .actions .principal { flex: 2 1 6rem; }
.cartes-ev .actions form { flex: 1 1 auto; display: flex; }
.cartes-ev .actions form button { flex: 1; }
.cartes-ev .actions .bouton:not(.principal) { min-height: 2.75rem; }
.cartes-ev .actions .discret, .cartes-ev .actions .bouton.danger { border-color: transparent; background: transparent; font-weight: 600; font-size: 0.95rem; text-decoration: underline; }
.cartes-ev .apercu-date { letter-spacing: 0.02em; text-transform: none; font-size: 0.95rem; }
.cartes-ev img { height: auto; }
.entete-liste { display: flex; flex-wrap: wrap; gap: 0.75rem 1.5rem; align-items: center; justify-content: space-between; margin: 1rem 0; }
.entete-liste h1 { margin: 0; }
.entete-liste .bouton { flex: 1 1 auto; }
@media (min-width: 40rem) { .entete-liste .bouton { flex: 0 0 auto; } }
.onglets { list-style: none; margin: 0 0 1rem; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.onglets a { display: inline-flex; align-items: center; min-height: 2.75rem; padding: 0 1rem; font-weight: 700; text-decoration: none; border-radius: 999px; border: 2px solid var(--bord); background: #fff; }
.onglets a:hover { background: var(--brume); }
.onglets a[aria-current=page] { background: var(--vert); border-color: var(--vert); color: #fff; }
.compte { margin: 0.5rem 0; color: var(--gris); }
.recherche { background: #fff; border: 1px solid var(--bord); border-radius: var(--rayon); padding: 0.25rem 1rem 0.75rem; margin: 0 0 1rem; }
.vide { background: #fff; border: 2px dashed #a2c680; border-radius: 20px; padding: 2rem 1.25rem; margin: 1.5rem 0; text-align: center; }
.vide svg { color: var(--vert); }
.vide p { margin: 0 auto 0.75rem; max-width: 30rem; }
.vide .titre-vide { font-size: 1.3rem; font-weight: 700; }
.pagination ul { list-style: none; margin: 1rem 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }
.apercu-date { margin: 0; font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--vert-fonce); }

/* Formulaire d'événement : étapes numérotées, aperçu, barre d'actions collante */
.retour { display: inline-flex; align-items: center; min-height: 2.75rem; font-weight: 700; }
.disposition { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.etape { background: #fff; border: 1px solid var(--bord); border-radius: var(--rayon); box-shadow: var(--ombre); padding: 1rem 1.1rem 1.1rem; }
.etape-tete { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.25rem; }
.etape-tete h2 { margin: 0; font-size: 1.25rem; }
.num { flex: none; width: 2.2rem; height: 2.2rem; border-radius: 50%; background: var(--vert); color: #fff; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.plus { margin: 0.75rem 0; }
.plus > summary { cursor: pointer; font-weight: 700; color: var(--vert-fonce); min-height: 2.75rem; display: flex; align-items: center; }
.plus > summary::before { content: "▸"; margin-right: .5rem; }
.plus[open] > summary::before { content: "▾"; }
.pied { position: sticky; bottom: 0; z-index: 5; margin: 0 -1rem; padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom)); background: rgba(255, 255, 255, .97); border-top: 1px solid var(--bord); box-shadow: 0 -4px 14px rgba(27, 45, 11, .08); display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.pied .bouton, .pied button { flex: 1 1 12rem; }
.pied .discret { flex: 0 1 auto; }
@media (min-width: 56rem) {
  .disposition { grid-template-columns: minmax(0, 1fr) 22rem; }
  .disposition > .etape { grid-column: 1; }
  .disposition > .apercu-bloc { grid-column: 2; grid-row: 1 / span 4; position: sticky; top: 1rem; }
  .disposition > .pied { grid-column: 1 / -1; margin: 0; border-radius: var(--rayon) var(--rayon) 0 0; }
  .pied .bouton, .pied button { flex: 0 0 auto; }
}
.apercu-bloc h2 { margin: 0 0 0.25rem; font-size: 1.1rem; }
.apercu { background: var(--fond); border: 1px solid var(--bord); border-radius: 12px; padding: 1rem 1.1rem; margin-top: 0.75rem; }
.apercu-titre { margin: 0.3rem 0 0; font-size: 1.1875rem; line-height: 1.3; font-weight: 700; overflow-wrap: anywhere; }
.apercu-meta { margin: 0.4rem 0 0; color: var(--gris); overflow-wrap: anywhere; }
.apercu-desc { margin: 0.6rem 0 0; white-space: pre-line; overflow-wrap: anywhere; }
.apercu-lien { margin: 0.4rem 0 0; }
.apercu-photos { list-style: none; margin: 0.9rem 0 0; padding: 0; display: grid; gap: 0.5rem; grid-template-columns: repeat(auto-fill, minmax(7rem, 1fr)); }
.apercu-photos li { aspect-ratio: 4 / 3; overflow: hidden; border-radius: 8px; border: 1px solid var(--bord); }
.apercu-photos img { display: block; width: 100%; height: 100%; object-fit: cover; }
div.err p { margin: 0.25rem 0 0; }

/* Photos : zone de dépôt (le champ fichier la recouvre : glisser-déposer natif) et vignettes */
.depot { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.25rem; text-align: center; min-height: 9rem; padding: 1.25rem; margin: 0.75rem 0; border: 2px dashed #8a9779; border-radius: var(--rayon); background: var(--brume); color: var(--vert-fonce); font-weight: 700; }
.depot svg { color: var(--vert); }
.depot input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font-size: 0; }
.depot:hover, .depot.survol { background: var(--pale); border-color: var(--vert); }
.depot:focus-within { outline: 3px solid var(--vert-fonce); outline-offset: 2px; }
.depot small { font-weight: 400; color: var(--gris); }
.choisies { list-style: none; margin: 0.5rem 0; padding: 0; display: grid; gap: 0.5rem; }
.choisies li { display: flex; gap: 0.75rem; align-items: center; justify-content: space-between; background: #fff; border: 1px solid var(--bord); border-radius: 10px; padding: 0.4rem 0.4rem 0.4rem 0.9rem; overflow-wrap: anywhere; }
.choisies button { flex: none; min-height: 2.75rem; padding: 0.25rem 1rem; }
.photos { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; }
.photos.grille { grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); }
.photos li { display: flex; flex-direction: column; gap: 0.5rem; background: var(--fond); border: 1px solid var(--bord); border-radius: 12px; padding: 0.6rem; }
.photos li > div { width: 100%; }
.photos img, .miniature { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; display: block; }
.miniature { max-width: 20rem; }
.photos p { margin: 0; }
.photos .champ { margin: 0.5rem 0; }
.photos .actions a.bouton, .photos .actions button { flex: 1 1 auto; padding: 0.4rem 0.8rem; }
.photos .badge { margin-bottom: 0.25rem; }
.principale { background: #fff0e0; color: #7a3d00; }
.principale::before { content: "★"; width: auto; height: auto; background: none; }
.bloc-actions { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--bord); }
.bloc-actions h2 { font-size: 1.05rem; color: var(--gris); }

/* Paramètres, tableaux, écrans techniques */
.param { background: #fff; border: 1px solid var(--bord); border-radius: var(--rayon); box-shadow: var(--ombre); padding: 0.5rem 1.25rem 1.25rem; margin: 1.25rem 0; }
.param .liste li { box-shadow: none; }
.discret-bas { margin-top: 2rem; font-size: 0.95rem; }
.discret-bas a { display: inline-flex; align-items: center; min-height: 2.75rem; color: var(--gris); }
.tableau { width: 100%; border-collapse: collapse; background: #fff; }
.tableau th, .tableau td { text-align: left; padding: 0.6rem 0.75rem; border: 1px solid var(--bord); vertical-align: top; }
.tableau th[scope=row] { width: 45%; background: var(--brume); }
.defile { overflow-x: auto; }
.codes { font-size: 1.3rem; columns: 2; }
code.mdp, .codes code { font-size: 1.2rem; font-weight: 700; letter-spacing: 0.05em; }
.photos li, .liste li { scroll-margin-top: 1rem; }
input[type=file] { font: inherit; }
