/* REM Live · la « porte » du site d'un événement : inscription, accès, entrée (noyau/site-vues.php).
   Ordinateur : un écran partagé, la scène de l'événement à gauche (collée), le formulaire en pleine lumière à droite.
   Téléphone : la scène devient un bandeau, le formulaire monte par-dessus comme une feuille. */

.porte {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    min-height: 100vh;
    min-height: 100svh;
    background: var(--s-creme);
}

.porte__scene {
    position: sticky;
    top: 0;
    align-items: end;
    height: 100vh;
    height: 100svh;
    min-height: 0;
}

.porte__evenement {
    position: relative;
    z-index: 2;
    max-width: 640px;
    padding: calc(var(--s-entete-h) + env(safe-area-inset-top) + 48px) clamp(32px, 5vw, 72px) 64px;
}

.porte__titre {
    margin: 0;
    color: #ffffff;
    font-family: var(--s-police-titre);
    font-size: 52px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.02em;
    text-wrap: balance;
}

.porte__sous-titre {
    max-width: 30em;
    margin: 18px 0 0;
    color: rgba(255, 255, 255, 0.82);
    font-size: 18px;
    line-height: 1.45;
}

.porte__infos {
    margin-top: 24px;
}

.porte__decompte {
    margin-top: 28px;
}

.porte__decompte .decompte--ouverture {
    --chrono-t: 36px;
}

.porte__motif {
    top: calc(var(--s-entete-h) + 24px);
    right: -12%;
    width: min(62vh, 72%);
}

.porte__panneau {
    display: grid;
    place-items: center;
    padding: calc(var(--s-entete-h) + env(safe-area-inset-top) + 40px) clamp(20px, 5vw, 80px) 72px;
}

.porte__carte {
    width: 100%;
    max-width: 520px;
}

.porte__titre-page {
    margin: 0 0 12px;
    color: var(--s-encre);
    font-family: var(--s-police-titre);
    font-size: 56px;
    font-weight: 700;
    line-height: 1.02;
    letter-spacing: -0.035em;
}

.porte__texte {
    max-width: 34em;
    margin: 0 0 32px;
    color: var(--s-texte);
    font-size: 18px;
    line-height: 1.5;
}

.porte__formulaire {
    display: grid;
    gap: 22px;
}

.porte__formulaire .champ,
.porte__formulaire .formulaire__grille {
    margin: 0;
}

.porte__formulaire .formulaire__grille {
    gap: 16px;
}

.porte__groupe {
    display: grid;
    gap: 16px;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.porte__groupe > legend {
    margin-bottom: 6px;
    padding: 0;
    color: var(--s-encre);
    font-family: var(--s-police-titre);
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.porte__formulaire .champ label,
.porte__formulaire .champ--choix legend {
    margin-bottom: 8px;
    color: var(--s-encre);
    font-size: 15px;
    font-weight: 600;
}

.porte__formulaire input:not([type="checkbox"]):not([type="radio"]) {
    min-height: 56px;
    padding: 0 18px;
    border: 1px solid var(--s-filet);
    border-radius: 14px;
    background: var(--s-papier);
    color: var(--s-encre);
    font-size: 17px;
    transition: border-color 0.24s var(--s-ui), box-shadow 0.24s var(--s-ui);
}

.porte__formulaire input:not([type="checkbox"]):not([type="radio"]):focus {
    border-color: var(--s-encre);
    outline: none;
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--s-action) 45%, transparent);
}

.porte__formulaire .champ--erreur input {
    border-color: var(--danger);
}

.porte__progression {
    height: 4px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--s-filet);
}

.porte__progression span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--s-action);
    transform: scaleX(var(--remplissage, 0));
    transform-origin: 0 50%;
    transition: transform 0.6s var(--s-entree);
}

.porte__formulaire .case {
    font-size: 15px;
    line-height: 1.45;
}

.porte__formulaire .bouton--grand.est-envoi {
    opacity: 0.75;
    pointer-events: none;
}

.porte__note,
.porte__bas {
    margin: 24px 0 0;
    color: var(--s-texte);
    font-size: 15px;
    line-height: 1.5;
}

.porte__bas {
    padding-top: 22px;
    border-top: 1px solid var(--s-filet);
}

.porte__note a,
.porte__bas a {
    color: var(--s-encre);
    font-weight: 600;
}

.porte__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 32px;
}

/* L'enveloppe de la confirmation : le pli se dessine, la pastille arrive */
.porte__enveloppe {
    display: block;
    width: 88px;
    height: 88px;
    margin-bottom: 28px;
    overflow: visible;
}

.porte__enveloppe-fond {
    fill: color-mix(in srgb, var(--s-action) 26%, var(--s-papier));
    stroke: var(--s-encre);
    stroke-width: 3;
}

.porte__enveloppe-trait {
    fill: none;
    stroke: var(--s-encre);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.porte__enveloppe-point {
    fill: var(--s-lueur);
}

@media (prefers-reduced-motion: no-preference) {
    .porte__carte > * {
        animation: porte-entree 0.9s var(--s-entree) both;
    }

    .porte__carte > :nth-child(2) { animation-delay: 0.08s; }
    .porte__carte > :nth-child(3) { animation-delay: 0.16s; }
    .porte__carte > :nth-child(4) { animation-delay: 0.24s; }
    .porte__carte > :nth-child(5) { animation-delay: 0.32s; }

    .porte__evenement > * {
        animation: porte-entree 1s var(--s-entree) both;
        animation-delay: 0.3s;
    }

    .porte__evenement > :nth-child(2) { animation-delay: 0.38s; }
    .porte__evenement > :nth-child(3) { animation-delay: 0.46s; }
    .porte__evenement > :nth-child(4) { animation-delay: 0.54s; }
    .porte__evenement > :nth-child(5) { animation-delay: 0.62s; }

    .porte__enveloppe-trait {
        stroke-dasharray: 100;
        stroke-dashoffset: 100;
        animation: porte-trait 0.9s var(--s-entree) 0.35s forwards;
    }

    .porte__enveloppe-point {
        transform-box: fill-box;
        transform-origin: 50% 50%;
        animation: porte-point 0.6s cubic-bezier(0.3, 1.6, 0.5, 1) 0.9s both;
    }
}

@keyframes porte-entree {
    from { opacity: 0; transform: translateY(26px); }
}

@keyframes porte-trait {
    to { stroke-dashoffset: 0; }
}

@keyframes porte-point {
    from { transform: scale(0); }
}

/* L'appel final de l'accueil, qui mène à ces pages */
.acces__appel {
    display: grid;
    gap: 14px;
    align-self: center;
    justify-items: start;
    max-width: 420px;
}

.acces__lien {
    color: rgba(255, 255, 255, 0.82);
    font-size: 16px;
    font-weight: 500;
    text-decoration: underline;
    text-decoration-color: rgba(255, 255, 255, 0.35);
    text-underline-offset: 4px;
}

.acces__lien:hover {
    color: #ffffff;
}

.hab-unigrains .porte__titre {
    text-transform: uppercase;
}

@media (max-width: 1068px) {
    .porte__titre {
        font-size: 40px;
    }

    .porte__titre-page {
        font-size: 44px;
    }
}

@media (max-width: 734px) {
    .porte {
        grid-template-columns: minmax(0, 1fr);
    }

    .porte__scene {
        position: relative;
        height: auto;
        min-height: 0;
    }

    .porte__evenement {
        padding: calc(var(--s-entete-h) + env(safe-area-inset-top) + 28px) var(--s-gouttiere) 64px;
    }

    .porte__titre {
        max-width: 11ch;
        font-size: 32px;
    }

    .porte__sous-titre {
        font-size: 16px;
    }

    .porte__decompte .decompte--ouverture {
        --chrono-t: 26px;
    }

    .porte__motif {
        top: calc(var(--s-entete-h) + env(safe-area-inset-top));
        right: -8vw;
        width: 28vw;
    }

    .porte__panneau {
        position: relative;
        z-index: 3;
        margin-top: -28px;
        padding: 36px var(--s-gouttiere) 56px;
        border-radius: 28px 28px 0 0;
        background: var(--s-creme);
        box-shadow: 0 -18px 40px rgba(10, 16, 40, 0.18);
    }

    .porte__titre-page {
        font-size: 36px;
    }

    .porte__texte {
        margin-bottom: 24px;
        font-size: 17px;
    }

    .porte__formulaire .formulaire__grille {
        grid-template-columns: minmax(0, 1fr);
    }

    .porte__actions {
        display: grid;
    }

    .porte__actions .bouton {
        width: 100%;
    }

    @media (prefers-reduced-motion: no-preference) {
        .porte__panneau {
            animation: porte-feuille 0.8s var(--s-entree) 0.15s both;
        }
    }
}

@keyframes porte-feuille {
    from { transform: translateY(60px); }
}
