/* Blocs géants : polices hébergées dans le projet, aucune requête vers l'extérieur. */
@font-face {
    font-family: 'Anton';
    src: url("../fonts/anton-latin-400-normal-BQ6cMqE.woff2") format('woff2');
    font-weight: 400;
    font-display: swap;
}
@font-face {
    font-family: 'Archivo';
    src: url("../fonts/archivo-latin-600-normal-EsLJ6V7.woff2") format('woff2');
    font-weight: 600;
    font-display: swap;
}
@font-face {
    font-family: 'Archivo';
    src: url("../fonts/archivo-latin-800-normal-_yR6G4e.woff2") format('woff2');
    font-weight: 800;
    font-display: swap;
}

:root {
    --fond: #0b0b0b;
    --texte: #ffffff;
    --resultat: #ff6a13;
    --vient: #28e07a;
    --peut-etre: #36b7ff;
    --non: #b48cff;
    --egal: #d9d6cc;
    --lieu-1: #ffd400;
    --lieu-2: #ff3c8e;
    --lieu-3: #2ee6d6;
    --titre: 'Anton', Impact, sans-serif;
    --corps: 'Archivo', system-ui, sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--fond);
    color: var(--texte);
    font-family: var(--corps);
    font-weight: 600;
}

.pile {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
    max-width: 40rem;
    margin: 0 auto;
}

.etapes {
    display: contents;
    list-style: none;
}

.bloc {
    margin: 0;
    padding: 1.5rem 1.25rem;
    color: var(--fond);
}

.bloc--titre {
    flex: 1.4;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    color: var(--texte);
    font-family: var(--titre);
    font-weight: 400;
    font-size: clamp(3.5rem, 19vw, 7.5rem);
    line-height: 0.9;
    text-transform: uppercase;
}

.bloc--titre span {
    color: var(--resultat);
}

.etapes .bloc {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.5rem;
    min-height: 7.5rem;
}

.bloc__titre {
    font-family: var(--titre);
    font-weight: 400;
    font-size: clamp(2.25rem, 11vw, 3.5rem);
    line-height: 1;
    text-transform: uppercase;
}

.bloc__texte {
    font-size: 1.125rem;
}

.bloc--jaune { background: var(--lieu-1); }
.bloc--vert { background: var(--vient); }
.bloc--orange { background: var(--resultat); }

.bloc--gris {
    background: var(--egal);
    font-weight: 800;
    font-size: 1.25rem;
}

/* Liens et boutons géants */
.bloc--action,
.bloc--bouton,
.bloc--lien {
    display: block;
    width: 100%;
    border: 0;
    text-align: left;
    text-decoration: none;
    font-family: var(--titre);
    font-weight: 400;
    font-size: clamp(2rem, 10vw, 3rem);
    line-height: 1;
    text-transform: uppercase;
    cursor: pointer;
}

.bloc--action { background: var(--resultat); }
.bloc--bleu { background: var(--peut-etre); }
.bloc--rose { background: var(--lieu-2); }
.bloc--resultat { background: var(--resultat); }

.bloc--lien {
    background: transparent;
    color: var(--texte);
    font-size: 1.5rem;
    text-decoration: underline;
}

/* Texte agrandi à 200 % (RGAA 10.4, M12) : un mot plus long que l'écran (« Confidentialité » en Anton) est coupé
   au bord au lieu de faire défiler la page. Un mot qui tient n'est jamais coupé : rien ne change à taille normale. */
h1, h2, h3, .bloc {
    overflow-wrap: anywhere;
}

/* Focus toujours visible, au clavier comme au lecteur d'écran */
:focus-visible {
    outline: 4px solid var(--texte);
    outline-offset: -4px;
}

.bloc :focus-visible,
.bloc:focus-visible {
    outline-color: var(--fond);
}

.bloc--lien:focus-visible {
    outline-color: var(--texte);
}

/* Création : un bloc par question */
.creation {
    display: contents;
}

.bloc--entete {
    font-family: var(--titre);
    font-weight: 400;
    font-size: clamp(2.75rem, 14vw, 5rem);
    line-height: 0.95;
    text-transform: uppercase;
    color: var(--texte);
}

.bloc--erreur {
    background: var(--texte);
    font-size: 1.125rem;
    border-left: 0.75rem solid var(--lieu-2);
}

.question {
    border: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.question__titre {
    float: left; /* place la légende dans le bloc */
    width: 100%;
    margin-bottom: 0.5rem;
    padding: 0;
    font-family: var(--titre);
    font-size: clamp(2.25rem, 11vw, 3.5rem);
    line-height: 1;
    text-transform: uppercase;
}

.choix {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    column-gap: 0.75rem;
    padding: 0.75rem 0;
    border-top: 2px solid rgb(11 11 11 / 0.25);
    cursor: pointer;
}

/* Le choix est montré par la pastille cochée et le texte en gras, pas seulement par la couleur. */
.choix input {
    width: 1.75rem;
    height: 1.75rem;
    margin: 0;
    accent-color: var(--fond);
}

.choix__nom {
    font-size: 1.375rem;
}

.choix:has(input:checked) .choix__nom {
    font-weight: 800;
    text-decoration: underline;
    text-underline-offset: 0.2em;
}

.choix__detail {
    grid-column: 2;
    font-size: 1rem;
}

.champ {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding-top: 0.5rem;
    font-size: 1rem;
}

.champ input,
.partage__message,
.partage__lien {
    width: 100%;
    padding: 0.75rem;
    border: 3px solid var(--fond);
    border-radius: 0;
    background: var(--texte);
    color: var(--fond);
    font: inherit;
    font-size: 1.25rem;
}

/* Le champ de date ou d'heure n'apparaît qu'avec son choix (si le navigateur sait le faire). */
@supports selector(:has(*)) {
    .question:not(:has(input[value="date"]:checked)) .champ--date,
    .question:not(:has(input[value="heure"]:checked)) .champ--heure {
        display: none;
    }
}

/* Partage */
.partage {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.partage__message {
    resize: none;
    overflow-wrap: anywhere;
    font-size: 1.125rem;
}

.partage__etat {
    margin: 0;
    padding: 0 1.25rem;
    min-height: 1.5rem;
}

.bloc--info,
.bloc--resultat {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Plus d'options : fermé par défaut, sous les deux questions */
.bloc--turquoise { background: var(--lieu-3); }

.options__titre {
    font-family: var(--titre);
    font-weight: 400;
    font-size: clamp(2rem, 10vw, 3rem);
    line-height: 1;
    text-transform: uppercase;
    cursor: pointer;
}

/* « + » fermé, « − » ouvert : l'état se voit sans la couleur (le lecteur d'écran l'annonce seul). */
.options__titre {
    list-style: none;
}

.options__titre::-webkit-details-marker {
    display: none;
}

.options__titre::after {
    content: ' +';
}

.options[open] .options__titre::after {
    content: ' \2212';
}

/* En flex, comme .question : la légende flottante ne pousse pas les champs hors de l'écran.
   min-width : un fieldset prend sinon la largeur de ses champs. */
.options__groupe {
    display: flex;
    flex-direction: column;
    min-width: 0;
    margin: 1.25rem 0 0;
    padding: 0;
    border: 0;
    border-top: 2px solid rgb(11 11 11 / 0.25);
}

.options__legende {
    float: left;
    width: 100%;
    padding: 0.75rem 0 0;
    font-family: var(--titre);
    font-size: 1.75rem;
    line-height: 1;
    text-transform: uppercase;
}

.champ__aide {
    margin: 0.25rem 0 0;
    font-size: 0.9375rem;
}

/* Une erreur sur fond blanc, à côté de son champ */
.champ__erreur {
    margin: 0.5rem 0 0;
    padding: 0.5rem 0.75rem;
    background: var(--texte);
    border-left: 0.75rem solid var(--lieu-2);
    font-size: 1.0625rem;
}

.champ input[aria-invalid="true"] {
    border-width: 5px;
    border-style: dashed;
}

/* Une seule case de lieu vide à la fois : la suivante apparaît quand on remplit celle-ci. */
@supports selector(:has(*)) {
    .idees__case:has(input:placeholder-shown) ~ .idees__case:has(input:placeholder-shown) {
        display: none;
    }
}

.heures {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 0.75rem;
}

/* Page de la sortie : les idées déjà proposées */
/* Page du lien : rejoindre et voter, un bloc par étape */
.etape {
    display: contents;
}

/* Enveloppe d'une zone mise à jour en direct : sans effet sur la mise en page. */
.zone {
    display: contents;
}

.bloc--violet { background: var(--non); }
.bloc--blanc { background: var(--texte); }

.bloc--noir {
    background: var(--fond);
    color: var(--texte);
}

.bloc--noir :focus-visible {
    outline-color: var(--texte);
}

.prenom {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.prenom__titre {
    font-family: var(--titre);
    font-size: clamp(2.25rem, 11vw, 3.5rem);
    line-height: 1;
    text-transform: uppercase;
}

.prenom input {
    width: 100%;
    padding: 0.75rem;
    border: 4px solid var(--fond);
    border-radius: 0;
    background: var(--texte);
    color: var(--fond);
    font-family: var(--titre);
    font-size: clamp(2rem, 10vw, 3rem);
    text-transform: none;
}

.prenom input[aria-invalid="true"] {
    border-style: dashed;
}

/* Deux blocs de même couleur l'un sous l'autre restent distincts */
.bloc--separe {
    border-top: 0.5rem solid var(--fond);
}

.bloc--presence {
    min-height: 6rem;
}

/* L'effet de « Peut-être », collé sous son bloc et dans sa couleur */
.bloc--precision {
    margin-top: -1rem;
    padding-top: 0;
    font-size: 1.0625rem;
}

/* Changer d'avis : la réponse actuelle est écrite dans son bloc, pas seulement montrée */
.bloc__actuelle {
    display: block;
    margin-top: 0.5rem;
    font-family: var(--corps);
    font-weight: 800;
    font-size: 1rem;
    text-transform: none;
}

.bloc__lien {
    color: inherit;
    font-weight: 800;
    font-size: 1.125rem;
}

/* Un message court sur fond blanc : idée ajoutée, choix gardés */
.bloc--message {
    padding-block: 1rem;
    font-size: 1.0625rem;
    border-left: 0.75rem solid var(--resultat);
}

/* Ajouter une idée pendant le vote, sous Valider */
.autre-idee {
    gap: 1rem;
    border-top: 2px solid var(--egal);
}

.autre-idee__champ {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.autre-idee__titre {
    font-size: 1.125rem;
}

.autre-idee input {
    width: 100%;
    min-height: 3.25rem;
    padding: 0.5rem 0.75rem;
    border: 4px solid var(--texte);
    border-radius: 0;
    background: var(--fond);
    color: var(--texte);
    font: inherit;
    font-size: 1.375rem;
    color-scheme: dark;
}

.autre-idee input[aria-invalid="true"] {
    border-style: dashed;
}

.autre-idee__ajouter {
    align-self: flex-start;
    min-height: 3rem;
    padding: 0.5rem 1rem;
    border: 0;
    background: var(--texte);
    color: var(--fond);
    font-family: var(--titre);
    font-size: 1.5rem;
    text-transform: uppercase;
    cursor: pointer;
}

.autre-idee .champ__erreur {
    color: var(--fond);
}

/* Qui vient : le nom de la réponse est écrit, la couleur ne sert que de repère */
.reponses {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.reponses__liste {
    margin: 0;
    padding: 0;
    list-style: none;
}

.reponse {
    display: flex;
    flex-direction: column;
    padding: 0.5rem 0 0.5rem 0.75rem;
    border-left: 0.5rem solid var(--egal);
    overflow-wrap: anywhere;
}

.reponse + .reponse {
    margin-top: 0.5rem;
}

.reponse--vert { border-left-color: var(--vient); }
.reponse--bleu { border-left-color: var(--peut-etre); }
.reponse--violet { border-left-color: var(--non); }
.reponse--attente { border-left-style: dashed; }

.reponse__titre {
    font-weight: 800;
    font-size: 1.125rem;
    text-transform: uppercase;
}

.reponse__noms {
    font-size: 1.25rem;
}

/* Les votes : un bloc par idée, plus haut avec ses voix */
.votes__sous-titre {
    margin: 0;
    padding: 0.75rem 1.25rem 0.25rem;
    font-size: 1.125rem;
    text-transform: uppercase;
}

.votes__liste {
    margin: 0;
    padding: 0;
    list-style: none;
}

.vote {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    min-height: 4.5rem;
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.vote[data-niveau="1"] { min-height: 6rem; }
.vote[data-niveau="2"] { min-height: 7.5rem; }
.vote[data-niveau="3"] { min-height: 9rem; }
.vote[data-niveau="4"] { min-height: 10.5rem; }
.vote[data-niveau="5"] { min-height: 12rem; }
.vote[data-niveau="6"] { min-height: 13.5rem; }

.vote--lieu-1 { background: var(--lieu-1); }
.vote--lieu-2 { background: var(--lieu-2); }
.vote--lieu-3 { background: var(--lieu-3); }
.vote--heure { background: var(--texte); }

.vote__nom {
    min-width: 0;
    font-family: var(--titre);
    font-size: clamp(1.75rem, 8vw, 2.5rem);
    line-height: 1;
    text-transform: uppercase;
    overflow-wrap: anywhere;
}

.vote__voix {
    flex-shrink: 0;
    font-weight: 800;
    font-size: 1.25rem;
}

.idees-proposees {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.idees-proposees__sous-titre {
    margin: 0.5rem 0 0;
    font-size: 1.125rem;
    text-transform: uppercase;
}

.idees-proposees__liste {
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 1.375rem;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.idees-proposees__liste li {
    padding: 0.375rem 0;
    border-top: 2px solid rgb(11 11 11 / 0.25);
}

/* Gérer la sortie : réservé à la personne qui organise, sous les votes */
.gerer {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    border-top: 2px solid var(--egal);
}

.gerer__info {
    padding-left: 0.75rem;
    border-left: 0.5rem solid var(--resultat);
    font-weight: 800;
}

.gerer__limite {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.gerer__titre {
    margin: 0.5rem 0 0;
    font-size: 1.125rem;
    font-weight: 800;
    text-transform: uppercase;
}

.gerer input {
    width: 100%;
    min-height: 3.25rem;
    padding: 0.5rem 0.75rem;
    border: 4px solid var(--texte);
    border-radius: 0;
    background: var(--fond);
    color: var(--texte);
    font: inherit;
    font-size: 1.375rem;
    color-scheme: dark;
}

.gerer input[aria-invalid="true"] {
    border-style: dashed;
}

.gerer .champ__erreur {
    color: var(--fond);
}

.gerer__bouton {
    align-self: flex-start;
    min-height: 3rem;
    padding: 0.5rem 1rem;
    border: 0;
    background: var(--texte);
    color: var(--fond);
    font-family: var(--titre);
    font-size: 1.5rem;
    text-transform: uppercase;
    cursor: pointer;
}

.gerer__liste {
    margin: 0;
    padding: 0;
    list-style: none;
}

.gerer__ligne {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 3rem;
    border-top: 2px solid rgb(255 255 255 / 0.25);
}

.gerer__nom {
    min-width: 0;
    font-size: 1.25rem;
    font-weight: 800;
    overflow-wrap: anywhere;
}

/* Liens d'au moins 44 px de haut : faciles à toucher */
.gerer__retirer,
.gerer__annuler {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    min-height: 2.75rem;
    padding: 0 0.5rem;
    color: inherit;
    font-weight: 800;
    font-size: 1.125rem;
}

.gerer__annuler {
    align-self: flex-start;
    margin-top: 0.5rem;
    padding-left: 0;
    font-size: 1.25rem;
}

/* Lu par le lecteur d'écran, caché à l'écran (ponctuation des titres en plusieurs lignes) */
.invisible {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

/* Sortie close : le résultat prend le haut de l'écran */
.decision {
    flex: 1.4;
    justify-content: flex-end;
    min-height: 60dvh;
    font-weight: 400;
}

.decision__surtitre {
    font-family: var(--corps);
    font-weight: 800;
    font-size: 1.25rem;
    text-transform: uppercase;
}

.decision__lieu,
.decision__heure {
    font-family: var(--titre);
    line-height: 0.95;
    text-transform: uppercase;
    overflow-wrap: anywhere;
}

.decision__lieu {
    font-size: clamp(3rem, 16vw, 6rem);
}

.decision__heure {
    font-size: clamp(2.25rem, 12vw, 4.5rem);
}

.decision__noms {
    font-size: 1.375rem;
    overflow-wrap: anywhere;
}

/* Sous-titre d'un bouton géant, en texte courant */
.decision__maps {
    display: block;
    margin-top: 0.5rem;
    font-family: var(--corps);
    font-weight: 800;
    text-transform: none;
    text-decoration: underline;
}

/* En flex plutôt qu'en « contents » : la section reste annoncée par le lecteur d'écran. */
.pile-partage {
    display: flex;
    flex-direction: column;
}

/* Annulée ou en attente du roi : un bloc gris, la raison en une phrase */
.bloc--fin {
    min-height: 40dvh;
    justify-content: flex-end;
}

/* Titres et paragraphes d'un bloc d'information : l'espacement vient du bloc, pas du navigateur */
.bloc--info > h2,
.bloc--info > p {
    margin: 0;
}

/* Roi du soir : les ex aequo se partagent l'écran, un bloc par idée.
   Le choix se voit à la pastille cochée et au texte souligné, pas seulement à la couleur. */
.roi__consigne {
    font-family: var(--titre);
    font-size: clamp(2.25rem, 12vw, 4.5rem);
    line-height: 0.95;
    text-transform: uppercase;
}

.roi__choix {
    display: flex;
    flex-direction: column;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.roi__question {
    float: left; /* place la légende dans la pile de blocs */
    width: 100%;
    font-family: var(--titre);
    font-size: clamp(2rem, 10vw, 3rem);
    line-height: 1;
    text-transform: uppercase;
}

.roi__ex-aequo {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    column-gap: 0.75rem;
    min-height: 22dvh;
    cursor: pointer;
}

.roi__ex-aequo input {
    width: 2rem;
    height: 2rem;
    margin: 0;
    accent-color: var(--fond);
}

.roi__nom {
    font-family: var(--titre);
    font-size: clamp(2.25rem, 12vw, 4rem);
    line-height: 0.95;
    text-transform: uppercase;
    overflow-wrap: anywhere;
}

.roi__ex-aequo:has(input:checked) .roi__nom {
    text-decoration: underline;
    text-decoration-thickness: 0.08em;
    text-underline-offset: 0.12em;
}

.roi__ex-aequo:has(input:focus-visible) {
    outline: 4px solid var(--texte);
    outline-offset: -8px;
}

/* Administration (/admin) : réservée à l'auteur, mêmes blocs, plus d'informations par ligne */
.admin .bloc--titre {
    flex: none;
    padding-top: 2.5rem;
    font-size: clamp(2.75rem, 14vw, 5rem);
}

.admin a {
    color: inherit;
    font-weight: 800;
}

.admin__barre {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-block: 0.75rem;
    border-bottom: 2px solid var(--egal);
}

.admin__lien {
    min-height: 2.75rem;
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    font-weight: 800;
    text-decoration: underline;
    cursor: pointer;
}

.admin__connexion label {
    margin-top: 0.5rem;
}

.admin__sortie,
.admin__journal .gerer__ligne {
    flex-wrap: wrap;
    justify-content: flex-start;
    column-gap: 1rem;
    padding-block: 0.5rem;
}

.admin__sortie .gerer__nom {
    flex-basis: 100%;
}

.admin__details {
    flex-basis: 100%;
    font-size: 0.9375rem;
    overflow-wrap: anywhere;
}

.admin__resume {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.25rem 1rem;
    margin: 0;
}

.admin__resume dd {
    margin: 0;
}

/* Un code de sortie garde sa casse : « aB » et « AB » sont deux sorties différentes. */
.admin code {
    font-family: ui-monospace, monospace;
    text-transform: none;
}

.admin .admin__supprimer {
    margin-top: 0;
    padding: 1.25rem 1.25rem 2rem;
    color: var(--lieu-2);
}

/* Pages d'information (M11) : Confidentialité, Mentions légales. Mêmes blocs, du texte à lire. */
.informations {
    min-height: auto;
}

.informations .bloc--entete {
    padding-top: 2.5rem;
}

.informations__resume {
    font-size: 1.25rem;
    font-weight: 800;
}

.informations__resume p {
    margin: 0;
}

.informations__resume p + p {
    margin-top: 0.75rem;
}

.informations__partie {
    padding: 1.5rem 1.25rem 0.5rem;
    font-size: 1.0625rem;
    line-height: 1.5;
}

.informations__partie h2 {
    margin: 0 0 0.75rem;
    font-family: var(--titre);
    font-weight: 400;
    font-size: clamp(2rem, 9vw, 2.75rem);
    line-height: 1;
    text-transform: uppercase;
    color: var(--resultat);
}

.informations__partie h3 {
    margin: 1.5rem 0 0.5rem;
    font-size: 1.25rem;
    font-weight: 800;
}

.informations__partie p,
.informations__partie dd {
    margin: 0 0 0.75rem;
}

.informations__partie dt {
    font-weight: 800;
    color: var(--lieu-1);
}

.informations__partie a {
    color: inherit;
    font-weight: 800;
}

.informations code {
    font-family: ui-monospace, monospace;
    overflow-wrap: anywhere;
}

.informations__date {
    margin: 0;
    padding: 1rem 1.25rem 2rem;
    color: var(--egal);
}

/* Pied de page : les deux liens d'information, sobres, assez grands pour le doigt. */
.pied {
    max-width: 40rem;
    margin: 0 auto;
    padding: 1rem 1.25rem 2rem;
    border-top: 2px solid var(--egal);
}

.pied__liens {
    display: flex;
    flex-wrap: wrap;
    gap: 0 1.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.pied a {
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem;
    color: var(--texte);
    font-weight: 800;
    text-decoration: underline;
}

.pied a[aria-current="page"] {
    text-decoration-thickness: 3px;
    color: var(--resultat);
}
