/* SOCA-FORM – site public. Conception mobile d'abord (§8), couleurs par événement via variables CSS. */

:root {
    --principale: #0A7A3A;
    --secondaire: #C8102E;
    --texte: #0F1F17;
    --fond: #FFFFFF;
    --doux: #F5F8F6;
    --bordure: #E5E7EB;
    --gris: #4B5563;
    --ok-fond: #E7F4EC; --ok: #0B5A2C;
    --att-fond: #FFF4E0; --att: #8A4B00;
    --ko-fond: #FDECEC; --ko: #9B1C1C;
    --rayon: 14px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--fond);
    color: var(--texte);
    font: 15px/1.5 Poppins, system-ui, -apple-system, "Segoe UI", sans-serif;
}
h1 { font-size: 22px; line-height: 1.3; margin: 0 0 8px; }
h2 { font-size: 17px; margin: 0 0 12px; }
a { color: var(--principale); }
img { max-width: 100%; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--principale); outline-offset: 2px; }
[hidden] { display: none !important; }

/* --- Boutons ------------------------------------------------------------ */
.bouton {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 48px; padding: 0 18px; border-radius: 12px; border: 0;
    font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
}
.bouton--principal { background: var(--principale); color: #FFF; min-height: 56px; font-size: 17px; border-radius: var(--rayon); box-shadow: 0 6px 16px rgb(0 0 0 / .18); }
.bouton--principal:hover { filter: brightness(.92); color: #FFF; }
.bouton--secondaire { background: var(--texte); color: #FFF; }
.bouton--contour { background: transparent; color: var(--principale); border: 1.5px solid var(--principale); }
.bouton--doux { background: var(--doux); color: var(--texte); }
.bouton--inactif { background: var(--bordure); color: var(--gris); min-height: 56px; font-size: 16px; border-radius: var(--rayon); cursor: not-allowed; }
.bouton--ajout { width: 100%; background: transparent; border: 1.5px dashed var(--principale); color: var(--principale); }
.bouton[disabled][data-envoi] { opacity: .7; cursor: progress; }
.lien { background: none; border: 0; padding: 0; font: inherit; color: var(--principale); text-decoration: underline; cursor: pointer; }
.lien--danger { color: var(--ko); }

/* --- Bandeaux ------------------------------------------------------------ */
.flash { padding: 12px 20px; font-weight: 500; }
.flash--succes { background: var(--ok-fond); color: var(--ok); }
.flash--erreur { background: var(--ko-fond); color: var(--ko); }
.bandeau-apercu { background: var(--att-fond); color: var(--att); padding: 10px 20px; font-size: 14px; }
.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; }
.badge--ok { background: var(--ok-fond); color: var(--ok); }
.badge--att { background: var(--att-fond); color: var(--att); }
.badge--ko { background: var(--ko-fond); color: var(--ko); }
.pastilles { display: flex; gap: 8px; flex-wrap: wrap; }
.pastille { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--ok-fond); color: var(--ok); }

/* --- Accueil de l'événement --------------------------------------------- */
.evenement { padding-bottom: 120px; }
.evenement-visuel img { display: block; width: 100%; height: auto; }
.visuel-agrandir { display: block; cursor: zoom-in; }
.visuel-absent { aspect-ratio: 1055 / 1491; max-height: 70vh; display: grid; place-items: center; background: var(--secondaire); color: #FFF; font-size: 24px; font-weight: 700; padding: 24px; text-align: center; }
.evenement-infos { padding: 20px 20px 28px; display: flex; flex-direction: column; gap: 14px; }
.theme { margin: 0; color: var(--gris); }
.faits { margin: 0; display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: var(--rayon); background: var(--doux); }
.faits > div { display: flex; gap: 10px; align-items: flex-start; }
.faits dt { color: var(--principale); padding-top: 2px; }
.faits dd { margin: 0; font-size: 14px; }
.compte-rebours { display: block; font-weight: 600; color: var(--principale); }
.contacts { display: flex; gap: 10px; }
.contacts .bouton { flex: 1; }
.infos { border-top: 1px solid var(--bordure); padding-top: 16px; }
.description { margin-bottom: 12px; }
.liste-contacts { padding-left: 18px; }
.partage { display: flex; gap: 12px; flex-wrap: wrap; font-size: 14px; color: var(--gris); }
.alerte label { font-weight: 600; font-size: 14px; display: block; margin-bottom: 6px; }
.alerte-ligne { display: flex; gap: 8px; }
.alerte-ligne input { flex: 1; min-width: 0; }

.cta { display: flex; flex-direction: column; gap: 6px; }
.cta .bouton { width: 100%; }
.cta-aide { font-size: 12px; color: var(--gris); text-align: center; }
/* Sur mobile, le bouton flottant reste fixé en bas ; le bouton du panneau n'apparaît que s'il est demandé « au-dessus » */
.cta--panneau { display: none; }
.evenement--cta-dessus .cta--panneau { display: flex; order: -1; }
.cta--flottant {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
    padding: 14px 20px calc(18px + env(safe-area-inset-bottom));
    background: var(--fond); border-top: 1px solid var(--bordure);
}

.visionneuse { border: 0; padding: 0; background: transparent; max-width: 96vw; max-height: 96vh; }
.visionneuse::backdrop { background: rgb(0 0 0 / .85); }
.visionneuse img { display: block; max-width: 96vw; max-height: 92vh; object-fit: contain; }
.visionneuse-fermer { position: fixed; top: 12px; right: 16px; font-size: 32px; color: #FFF; background: none; border: 0; cursor: pointer; }

/* --- Écrans de formulaire ------------------------------------------------ */
.ecran { max-width: 560px; margin: 0 auto; }
.entete-ecran { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--bordure); position: sticky; top: 0; background: var(--fond); z-index: 5; }
.retour { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--doux); color: var(--texte); }
.entete-titre { display: flex; flex-direction: column; font-size: 13px; color: var(--gris); }
.entete-titre strong { color: var(--texte); font-size: 15px; }
.contenu-ecran { padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.note { margin: 0; font-size: 13px; color: var(--gris); }

.carte-choix { display: flex; align-items: center; gap: 14px; padding: 18px; border: 1.5px solid var(--bordure); border-radius: var(--rayon); color: var(--texte); text-decoration: none; }
.carte-choix:hover { border-color: var(--principale); }
.carte-choix-icone { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 12px; background: var(--ok-fond); color: var(--principale); }
.carte-choix-icone svg { width: 24px; height: 24px; }
.carte-choix-texte { flex: 1; display: flex; flex-direction: column; }
.carte-choix-texte span { font-size: 13px; color: var(--gris); }
.chevron { color: var(--gris); }

.formulaire { display: flex; flex-direction: column; gap: 16px; }
.champ { display: flex; flex-direction: column; gap: 6px; }
.champ label { font-weight: 600; font-size: 14px; }
.champ input, .champ textarea, .alerte-ligne input, .champ select {
    width: 100%; min-height: 48px; padding: 10px 14px;
    font: inherit; color: var(--texte); background: #FFF;
    border: 1.5px solid #CBD5D0; border-radius: 12px;
}
.champ textarea { min-height: 96px; resize: vertical; }
.champ input:focus, .champ textarea:focus { border-color: var(--principale); outline: none; box-shadow: 0 0 0 3px rgb(10 122 58 / .15); }
.champ--erreur input, .champ--erreur textarea { border-color: var(--ko); }
.champ .aide { font-size: 12px; color: var(--gris); }
.champ .erreur { font-size: 13px; color: var(--ko); font-weight: 500; }
.champ-prefixe { display: flex; }
.champ-prefixe span { display: grid; place-items: center; padding: 0 12px; background: var(--doux); border: 1.5px solid #CBD5D0; border-right: 0; border-radius: 12px 0 0 12px; font-weight: 600; }
.champ-prefixe input { border-radius: 0 12px 12px 0; }
.deux-colonnes { display: grid; gap: 16px; }
.case { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; line-height: 1.45; }
.champ .case { font-weight: 400; font-size: 13px; }
.case input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--principale); flex: none; }
.alerte-erreur { padding: 12px 16px; border-radius: 12px; background: var(--ko-fond); color: var(--ko); }
.alerte-erreur p { margin: 0; }
.encart-doublon { padding: 14px 16px; border-radius: 12px; background: var(--att-fond); display: flex; flex-direction: column; gap: 8px; }
.encart-doublon p { margin: 0; font-size: 14px; }
.barre-envoi { position: sticky; bottom: 0; padding: 12px 0 calc(12px + env(safe-area-inset-bottom)); background: var(--fond); }
.barre-envoi .bouton { width: 100%; }

.bandeau-taille { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-radius: 12px; background: var(--doux); font-size: 14px; }
.bloc { display: flex; flex-direction: column; gap: 14px; padding: 16px; border: 1px solid var(--bordure); border-radius: var(--rayon); }
.bloc h2 { margin: 0; }
.bloc-titre { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.bloc-titre h2 { margin: 0; }
.facultatif summary { cursor: pointer; font-size: 14px; color: var(--principale); font-weight: 600; }
.facultatif[open] { display: flex; flex-direction: column; gap: 14px; }
.membres { display: flex; flex-direction: column; gap: 10px; }
.carte-membre { border: 1.5px solid var(--bordure); border-radius: var(--rayon); }
.carte-membre[open] { border-color: var(--principale); }
.carte-membre summary { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; cursor: pointer; font-weight: 600; list-style: none; }
.carte-membre summary::-webkit-details-marker { display: none; }
.carte-membre-etat { font-size: 13px; color: var(--principale); }
.carte-membre[open] .carte-membre-etat { display: none; }
.carte-membre-corps { padding: 0 16px 16px; display: flex; flex-direction: column; gap: 14px; }
.lien-retirer { align-self: flex-start; background: none; border: 0; color: var(--ko); font: inherit; font-size: 14px; text-decoration: underline; cursor: pointer; padding: 0; }

/* --- Confirmation / équipe ------------------------------------------------ */
.confirmation { text-align: center; align-items: center; }
.confirmation-icone { display: grid; place-items: center; width: 72px; height: 72px; border-radius: 50%; background: var(--ok-fond); color: var(--principale); }
.confirmation-icone svg { width: 36px; height: 36px; stroke-width: 2.5; }
.confirmation-icone--attente { background: var(--att-fond); color: var(--att); }
.recapitulatif { width: 100%; margin: 0; border: 1px solid var(--bordure); border-radius: var(--rayon); text-align: left; }
.recapitulatif > div { display: flex; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--bordure); }
.recapitulatif > div:last-child { border-bottom: 0; }
.recapitulatif dt { color: var(--gris); font-size: 14px; }
.recapitulatif dd { margin: 0; font-weight: 600; text-align: right; }
.numero { font-size: 18px; letter-spacing: .5px; }
.envoi-confirme { display: flex; gap: 8px; align-items: center; font-size: 14px; color: var(--ok); }
.actions-confirmation { width: 100%; display: flex; flex-direction: column; gap: 10px; }
.liste-membres { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; }
.liste-membres li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; padding: 12px 0; border-bottom: 1px solid var(--bordure); }
.liste-membres li > div { display: flex; flex-direction: column; font-size: 14px; }
.liste-membres li > div span { color: var(--gris); font-size: 13px; }
.actions-membre { display: flex; gap: 14px; width: 100%; font-size: 13px; }

.page-simple { max-width: 720px; margin: 0 auto; padding: 40px 20px; }
.liste-evenements { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.liste-evenements a { display: flex; gap: 14px; align-items: center; padding: 12px; border: 1px solid var(--bordure); border-radius: var(--rayon); text-decoration: none; color: var(--texte); }
.liste-evenements img, .liste-evenements .visuel-absent { width: 80px; height: auto; border-radius: 8px; font-size: 10px; padding: 4px; }
.liste-evenements a > span { display: flex; flex-direction: column; }
.liste-evenements a > span span { color: var(--gris); font-size: 14px; }
.trace { white-space: pre-wrap; font-size: 12px; background: var(--doux); padding: 12px; overflow: auto; }

@media (min-width: 600px) {
    .deux-colonnes { grid-template-columns: 1fr 1fr; }
    .actions-confirmation { flex-direction: row; justify-content: center; }
}

/* --- Ordinateur : visuel à gauche, panneau d'informations à droite --------- */
@media (min-width: 960px) {
    .evenement {
        display: grid; grid-template-columns: minmax(0, 560px) minmax(0, 480px);
        gap: 48px; justify-content: center; align-items: start;
        padding: 40px 24px;
    }
    .evenement-visuel img { border-radius: var(--rayon); box-shadow: 0 10px 30px rgb(0 0 0 / .12); }
    .evenement-infos { position: sticky; top: 24px; padding: 0; }
    .cta--panneau, .evenement--cta-dessus .cta--panneau { display: flex; order: -1; }
    .cta--flottant { display: none; }
    h1 { font-size: 28px; }
}

@media (prefers-reduced-motion: reduce) {
    * { scroll-behavior: auto !important; transition: none !important; }
}
