@import url("fonts-ofxb3Nc.css");
:root {
    /* Charte Groupe MG 2026 */
    --nuit: #0F0841;
    --bleu: #3732FF;
    --pastel: #F4F4FF;
    --blanc: #FFFFFF;
    --bleu-clair: #a3a0ff;   /* accent lisible sur bleu nuit (ajout technique de la charte) */
    --texte: var(--nuit);
    --accent: var(--bleu);
    --rouge: #d0453a;
    --titre: "Poppins", system-ui, sans-serif;
    --corps: "Merriweather", Georgia, serif;
    font-family: var(--titre);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
.logo-mg {
    display: block;
    aspect-ratio: 263 / 110;
    background: currentColor;
    -webkit-mask: url("../images/logo-mg-dLXsjYT.png") no-repeat center / contain;
    mask: url("../images/logo-mg-dLXsjYT.png") no-repeat center / contain;
}
/* Logo CJD (blanc) en bas à droite de chaque écran (base.html.twig). Sur le mur il passe au-dessus des nuages,
   mais pointer-events: none laisse le toucher atteindre la question située dessous. */
.logo-cjd { position: fixed; right: 1.25rem; bottom: 1rem; z-index: 1; width: clamp(5rem, 9vw, 9rem); height: auto; opacity: .9; pointer-events: none; }
.visuellement-cache { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

/* ---------- Ciel commun ---------- */
.ciel {
    position: fixed; inset: 0; z-index: 0; overflow: hidden;
    background: radial-gradient(120% 80% at 50% 115%, #3732FF 0%, #2a20c9 30%, #170f6b 62%, #0F0841 100%);
    pointer-events: none;
}
.ciel::after { /* quelques étoiles discrètes en haut */
    content: ""; position: absolute; inset: 0 0 55% 0;
    background:
        radial-gradient(1.5px 1.5px at 12% 22%, #fff9 50%, transparent 51%),
        radial-gradient(1px 1px at 28% 8%, #fff8 50%, transparent 51%),
        radial-gradient(1.5px 1.5px at 47% 30%, #fff7 50%, transparent 51%),
        radial-gradient(1px 1px at 66% 12%, #fff9 50%, transparent 51%),
        radial-gradient(1.5px 1.5px at 83% 26%, #fff8 50%, transparent 51%),
        radial-gradient(1px 1px at 92% 6%, #fff7 50%, transparent 51%);
}
.nuage-fond {
    position: absolute; left: 0;
    width: var(--l); aspect-ratio: 2;
    background: url("../images/nuage-fond-VC0upUB.svg") no-repeat center / contain;
    opacity: var(--o); filter: blur(var(--f));
    animation: deriver var(--d) linear infinite;
    animation-delay: var(--r);
}
.n1 { --l: 46vw; --o: .16; --f: 6px; --d: 190s; --r: -40s;  top: 4%; }
.n2 { --l: 30vw; --o: .12; --f: 4px; --d: 150s; --r: -110s; top: 30%; }
.n3 { --l: 58vw; --o: .20; --f: 10px; --d: 240s; --r: -60s; top: 58%; }
.n4 { --l: 24vw; --o: .10; --f: 3px; --d: 130s; --r: -20s;  top: 18%; }
.n5 { --l: 40vw; --o: .18; --f: 8px; --d: 210s; --r: -160s; top: 76%; }
@keyframes deriver { from { translate: -60vw 0; } to { translate: 110vw 0; } }

/* ---------- Page participant ---------- */
.page-accueil { position: relative; height: auto; min-height: 100%; color: #fff; }
/* Page participant : mention et logo en pied de page (pas fixés à l'écran), pour ne jamais recouvrir le
   formulaire sur un petit téléphone ; .saisie leur réserve la place en bas. */
.page-accueil .propulse, .page-accueil .logo-cjd { position: absolute; bottom: 1rem; }
.page-accueil .propulse { left: 1.25rem; translate: none; }
.saisie {
    position: relative; z-index: 1;
    min-height: 100dvh;
    width: min(100%, 34rem); margin: 0 auto;
    padding: max(2rem, 6vh) 1.25rem 4.5rem; /* place du logo CJD en bas */
    display: flex; flex-direction: column; justify-content: center;
}
.entete { text-align: center; margin-bottom: 1.5rem; }
.entete .logo-mg { width: 7.5rem; margin: 0 auto 1.4rem; color: var(--blanc); }
.entete h1 { margin: 0 0 .4rem; font-weight: 600; font-size: clamp(2.2rem, 9vw, 3rem); letter-spacing: -.01em; }
.entete h1::after { content: ""; display: block; width: 3rem; height: 3px; margin: .6rem auto 0; border-radius: 3px; background: var(--bleu-clair); }
.entete p { margin: 0; font-family: var(--corps); font-weight: 300; font-size: 1.05rem; opacity: .92; }
.verre {
    background: var(--blanc);
    border: 1.5px solid var(--nuit);
    border-radius: 1.9rem;
    padding: 1.1rem;
    box-shadow: 0 1.5rem 3rem rgb(5 3 30 / .45);
    color: var(--texte);
}
.verre textarea {
    display: block; width: 100%;
    border: 0; background: transparent; resize: none;
    font-family: var(--corps); font-size: 1.15rem; line-height: 1.55; color: inherit;
    padding: .5rem .4rem; min-height: 7.5rem;
}
.verre textarea:focus { outline: none; }
.verre textarea::placeholder { color: #8f8cb8; font-style: italic; }
.pied { display: flex; justify-content: space-between; align-items: center; padding: .4rem .4rem .8rem; border-top: 1.5px solid var(--pastel); font-size: .9rem; color: #6d6a99; }
.anonyme { display: inline-flex; align-items: center; gap: .35rem; font-weight: 600; color: var(--bleu); background: var(--pastel); padding: .25rem .7rem; border-radius: 999px; }
.compteur.plein { color: var(--rouge); font-weight: 700; }
.envoyer {
    width: 100%;
    display: flex; align-items: center; justify-content: center; gap: .6rem;
    font: inherit; font-size: 1.15rem; font-weight: 600;
    border: 0; border-radius: 999px; padding: 1rem;
    color: var(--blanc); cursor: pointer;
    background: var(--bleu);
    box-shadow: 0 .6rem 1.4rem rgb(55 50 255 / .4);
    transition: transform .15s, box-shadow .15s;
}
.envoyer:hover { background: #2620e0; }
.envoyer:active { transform: scale(.98); }
.envoyer:disabled { opacity: .65; cursor: wait; }
.envoyer svg { transition: transform .3s; }
.envoyer:hover svg { transform: translateX(4px) rotate(-8deg); }
.message { min-height: 1.6rem; margin: 1rem 0 0; text-align: center; font-weight: 600; font-size: 1.05rem; }
.message .succes { color: #fff; }
.message .erreur { color: #ffc9c4; }
.mention { margin: .5rem 0 0; text-align: center; font-family: var(--corps); font-style: italic; font-size: .85rem; opacity: .75; }

/* La question envoyée s'envole dans un petit nuage. */
.envol { position: fixed; inset: 0; pointer-events: none; z-index: 2; overflow: hidden; }
.envol .bulle { position: absolute; left: 50%; top: 45%; width: max-content; max-width: min(20rem, 78vw); --taille: 1.05rem; animation: senvoler 2.6s cubic-bezier(.4, 0, .6, 1) forwards; }
@keyframes senvoler {
    0% { translate: -50% 0; scale: .6; opacity: 0; }
    15% { translate: -50% -2vh; scale: 1; opacity: 1; }
    100% { translate: -30% -70vh; scale: .55; opacity: 0; }
}

/* Carte simple (connexion) */
.page-accueil .carte {
    position: relative; z-index: 1;
    width: min(calc(100% - 2rem), 26rem); margin: 12vh auto 0;
    background: var(--blanc); color: var(--texte);
    border: 1.5px solid var(--nuit);
    border-radius: 1.9rem; padding: 1.75rem 1.5rem;
    box-shadow: 0 1.5rem 3rem rgb(5 3 30 / .45);
}
.carte .logo-mg { width: 5.5rem; margin: 0 auto 1rem; color: var(--nuit); }
.carte h1 { margin: 0 0 1rem; font-size: 1.5rem; font-weight: 600; text-align: center; }
.formulaire-connexion { display: grid; gap: .5rem; }
.formulaire-connexion input:not([type=checkbox]) { font: inherit; padding: .75rem 1rem; border: 1.5px solid var(--nuit); border-radius: .9rem; background: var(--pastel); }
.formulaire-connexion input:focus { outline: none; border-color: var(--accent); }
.formulaire-connexion button { margin-top: .75rem; font: inherit; font-weight: 700; border: 0; border-radius: 999px; padding: .85rem; color: var(--blanc); background: var(--bleu); cursor: pointer; }
.carte .message .erreur { color: var(--rouge); text-shadow: none; }
.case { display: flex; gap: .5rem; align-items: center; font-size: .95rem; }

/* ---------- Mur ---------- */
.page-mur { overflow: hidden; color: #fff; user-select: none; -webkit-user-select: none; }
.nuage { position: fixed; inset: 0; z-index: 1; }

/* Un nuage de question : un corps arrondi et des « bosses » rondes sur le dessus.
   Le JS règle le padding-top de .bulle pour que la boîte englobe les bosses. */
.bulle {
    position: absolute; left: 0; top: 0;
    max-width: min(30rem, 40vw);
    filter: drop-shadow(0 .9rem 1.4rem rgb(5 3 30 / .45));
    cursor: pointer;
    will-change: transform;
    touch-action: manipulation;
    animation: apparition 1.1s cubic-bezier(.2, .9, .3, 1.15) both;
}
.bulle .corps {
    position: relative;
    background: var(--fond, #fff);
    border-radius: 999px;
    padding: 1.2rem 2.1rem 1.35rem;
    animation: flotter 6s ease-in-out infinite alternate;
    animation-delay: var(--decalage, 0s);
}
.bulle .bosse {
    position: absolute; top: 0;
    aspect-ratio: 1;
    border-radius: 50%;
    background: var(--fond, #fff);
}
.bulle .contenu {
    position: relative; z-index: 1;
    display: block;
    color: var(--texte);
    font-size: var(--taille, 1.6rem);
    line-height: 1.28;
    font-weight: 600;
    text-align: center;
    overflow-wrap: anywhere;
}
.bulle.part { pointer-events: none; animation: disparition .6s ease-in forwards; }
@keyframes apparition { from { opacity: 0; scale: .3; } to { opacity: 1; scale: 1; } }
@keyframes disparition { to { opacity: 0; scale: 1.35; filter: blur(14px); } }
@keyframes flotter { from { translate: 0 -5px; } to { translate: 0 6px; } }

.vide {
    position: absolute; inset: 0; margin: auto;
    height: fit-content; text-align: center;
    font-size: clamp(1.5rem, 3vw, 2.6rem); font-weight: 600;
    opacity: .85; padding: 0 2rem;
}
.qr {
    position: fixed; left: 1.25rem; bottom: 1.25rem; z-index: 2;
    background: var(--blanc); color: var(--texte);
    border: 1.5px solid var(--nuit);
    border-radius: 1.6rem; padding: .8rem .8rem .7rem;
    display: grid; justify-items: center; gap: .35rem;
    box-shadow: 0 .8rem 2rem rgb(5 3 30 / .5);
}
.qr img { width: clamp(140px, 14vw, 240px); height: auto; }
.qr .appel { font-weight: 600; text-align: center; line-height: 1.2; font-size: clamp(.8rem, 1vw, 1.05rem); }
.qr[hidden] { display: none; }
.outils {
    position: fixed; top: 1rem; right: 1rem; z-index: 3;
    display: flex; gap: .5rem;
    opacity: .3; transition: opacity .3s;
}
.outils:hover, .outils:focus-within { opacity: 1; }
.outils button, .outils a {
    font: inherit; font-weight: 600; font-size: .95rem;
    border: 0; border-radius: 999px; padding: .55rem 1.1rem;
    background: rgb(255 255 255 / .18); color: #fff;
    cursor: pointer; text-decoration: none;
    backdrop-filter: blur(6px);
}
.outils .danger { background: var(--rouge); }
.outils .danger.confirmer { background: var(--blanc); color: var(--rouge); animation: pulse .8s infinite alternate; }
@keyframes pulse { to { box-shadow: 0 0 0 .5rem rgb(208 69 58 / .45); } }
.consigne { position: fixed; right: 1.25rem; bottom: calc(1.5rem + clamp(5rem, 9vw, 9rem) * 291 / 863); z-index: 2; margin: 0; opacity: .55; font-family: var(--corps); font-style: italic; font-size: .85rem; }
.marque { position: fixed; left: 1.5rem; top: 1.25rem; z-index: 2; width: 6.5rem; color: var(--blanc); opacity: .9; }
/* Sous les nuages (même z-index que .nuage, placé avant dans la page) : une question peut passer dessus. */
.propulse { position: fixed; left: 50%; bottom: 1rem; translate: -50% 0; z-index: 1; margin: 0; opacity: .6; font-size: .85rem; letter-spacing: .02em; pointer-events: none; }
.propulse strong { font-weight: 600; }
.hors-ligne { position: fixed; top: 1rem; left: 50%; translate: -50% 0; z-index: 3; margin: 0; padding: .4rem 1rem; border-radius: 999px; background: var(--rouge); }
.hors-ligne[hidden] { display: none; }

/* ---------- Affiche imprimable (A4) ---------- */
.page-affiche { margin: 0; background: #d9d8ee; color: var(--nuit); }
.affiche {
    width: 210mm; height: 297mm; margin: 1.5rem auto;
    background: radial-gradient(120% 80% at 50% 115%, #3732FF 0%, #2a20c9 35%, #170f6b 70%, #0F0841 100%);
    color: var(--blanc);
    padding: 14mm 14mm 10mm;
    display: flex; flex-direction: column;
    overflow: hidden; /* les nuages décoratifs débordent du cartouche : coupés au bord de la feuille */
    box-shadow: 0 1rem 3rem rgb(5 3 30 / .25);
}
.filet { display: flex; align-items: center; gap: 1.2rem; }
.filet .libelle { font-family: var(--corps); font-weight: 700; font-size: 15pt; }
.filet .ligne-filet { flex: 1; height: 1.5px; background: var(--blanc); opacity: .6; }
.filet .rubrique { font-weight: 600; font-size: 15pt; }
.cartouche {
    position: relative;
    flex: 1; margin: 9mm 0 7mm;
    /* Le fond bleu est celui de toute la feuille (.affiche). */
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center; padding: 12mm;
}
.cartouche .nuage-deco { position: absolute; width: 95mm; aspect-ratio: 2; background: url("../images/nuage-fond-VC0upUB.svg") no-repeat center / contain; opacity: .12; }
.cartouche .d1 { top: 6mm; left: -22mm; }
.cartouche .d2 { bottom: 10mm; right: -26mm; width: 120mm; opacity: .16; }
.cartouche .logo-mg { position: relative; width: 38mm; color: var(--blanc); margin-bottom: 10mm; }
.cartouche h1 { position: relative; margin: 0; font-weight: 600; font-size: 46pt; line-height: 1.05; }
.cartouche .sous-titre { position: relative; margin: 5mm 0 10mm; font-family: var(--corps); font-weight: 300; font-size: 15pt; max-width: 135mm; }
.cartouche .code { position: relative; background: var(--blanc); border-radius: 9mm; padding: 6mm; box-shadow: 0 4mm 10mm rgb(5 3 30 / .4); }
.cartouche .code img { display: block; width: 85mm; height: 85mm; }
.cartouche .anonyme-affiche { position: relative; margin-top: 8mm; font-weight: 600; font-size: 13pt; color: var(--bleu-clair); }
.pied-affiche { display: flex; justify-content: space-between; align-items: center; font-family: var(--corps); font-style: italic; font-size: 10pt; }
.pied-affiche p { margin: 0; }
.logo-cjd-affiche { width: 32mm; height: auto; }
@page { size: A4; margin: 0; }
@media print {
    .page-affiche { background: none; }
    .affiche { margin: 0; box-shadow: none; }
    .affiche, .cartouche .code { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

@media (prefers-reduced-motion: reduce) {
    .nuage-fond, .bulle .corps, .entete .logo { animation: none; }
    .bulle, .bulle.part, .envol .bulle { animation-duration: .01s; }
}
