/* ==========================================================================
   Controle d'age et conditions de participation
   Repris du projet Sofitel Sunset Afterwork, aux couleurs Brunch With Martini.
   Le voile est visible par defaut : si le JS tombe, le site reste protege.
   ========================================================================== */

/* Tant que le voile est en place, la page derriere ne defile pas. */
body.is-gated { overflow: hidden; }
body.age-gate-passed { overflow: visible; }

.age-gate {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    padding-block: max(20px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-bottom));
    overflow-y: auto;
    overscroll-behavior: contain;
}

.age-gate[hidden] { display: none; }

.age-gate__backdrop {
    position: fixed;
    inset: 0;
    background: rgba(29, 32, 38, .92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.age-gate__box {
    position: relative;
    width: 100%;
    max-width: 440px;
    margin: auto;
    padding: 28px 22px 24px;
    border-radius: 22px;
    background: #fff;
    border-top: 6px solid var(--red, #E1251B);
    box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .9);
    text-align: center;
    color: var(--ink, #1D2026);
}

.age-gate__logo {
    width: 130px;
    height: auto;
    margin: 0 auto 16px;
}

.age-gate__title {
    margin: 0 0 22px;
    font-family: "Anton", Impact, sans-serif;
    font-weight: 400;
    font-size: 1.5rem;
    line-height: 1.15;
    text-transform: uppercase;
    letter-spacing: .02em;
}

/* Champs ----------------------------------------------------------------- */
.age-gate__form { display: grid; gap: 18px; }

.age-gate__field { text-align: left; }

.age-gate__label {
    display: block;
    margin-bottom: 8px;
    padding: 0;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--red, #E1251B);
}

.age-gate__input {
    width: 100%;
    min-height: 54px;
    padding: 12px 16px;
    border: 2px solid rgba(0, 0, 0, .12);
    border-radius: 12px;
    background: var(--cream, #F7F4EF);
    color: var(--ink, #1D2026);
    font-family: inherit;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-align: center;
    transition: border-color .18s ease, background-color .18s ease;
}

.age-gate__input::placeholder { color: rgba(0, 0, 0, .3); font-weight: 400; letter-spacing: .2em; }

.age-gate__input:focus {
    outline: none;
    border-color: var(--red, #E1251B);
    background: #fff;
}

/* On masque les fleches du input number : la saisie est au clavier. */
.age-gate__input::-webkit-outer-spin-button,
.age-gate__input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.age-gate__input[type=number] { -moz-appearance: textfield; }

.age-gate__hint {
    margin: 8px 0 0;
    font-size: .78rem;
    color: var(--muted, #6B6F76);
}

/* Consentement ----------------------------------------------------------- */
.age-gate__consent {
    margin: 0;
    padding: 16px;
    border: 1px solid rgba(0, 0, 0, .1);
    border-radius: 12px;
    background: var(--cream, #F7F4EF);
    text-align: left;
}

.age-gate__terms {
    margin: 0 0 14px;
    font-size: .85rem;
    line-height: 1.5;
    color: var(--muted, #6B6F76);
}

.age-gate__terms a {
    color: var(--red, #E1251B);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.age-gate__choices { display: flex; gap: 10px; }

.age-gate__radio {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 10px 12px;
    border: 2px solid rgba(0, 0, 0, .12);
    border-radius: 999px;
    background: #fff;
    cursor: pointer;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    font-size: .9rem;
    transition: border-color .18s ease, background-color .18s ease, color .18s ease;
}

.age-gate__radio input { accent-color: #E1251B; width: 18px; height: 18px; }

.age-gate__radio:has(input:checked) {
    border-color: var(--red, #E1251B);
    background: rgba(225, 37, 27, .08);
    color: var(--red, #E1251B);
}

.age-gate__radio:has(input:focus-visible) { outline: 2px solid #E1251B; outline-offset: 2px; }

/* Erreur et mentions ----------------------------------------------------- */
.age-gate__error {
    margin: 0;
    padding: 12px 14px;
    border: 1px solid rgba(225, 37, 27, .4);
    border-radius: 12px;
    background: rgba(225, 37, 27, .08);
    font-size: .88rem;
    line-height: 1.45;
    font-weight: 700;
    color: var(--red-dark, #B71C14);
    text-align: left;
}

.age-gate__error:empty { display: none; }

.age-gate__legal {
    margin: 20px 0 0;
    padding-top: 16px;
    border-top: 1px solid rgba(0, 0, 0, .1);
    font-size: .64rem;
    line-height: 1.6;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--muted, #6B6F76);
}

/* Refus : on remplace le formulaire par un message de sortie. */
.age-gate--denied .age-gate__form,
.age-gate--denied .age-gate__hint { display: none; }

.age-gate__denied {
    margin-top: 10px;
    font-size: .95rem;
    line-height: 1.55;
    color: var(--ink, #1D2026);
}

/* Reponse NON : rappel informatif, l'acces au site reste ouvert. */
.age-gate--notice .age-gate__title { display: none; }

.age-gate__icon {
    display: block;
    width: 52px;
    height: 52px;
    margin: 8px auto 0;
    color: var(--red, #E1251B);
}

.age-gate__icon svg {
    display: block;
    width: 100%;
    height: 100%;
}

.age-gate__notice {
    margin-top: 16px;
    padding: 14px 16px;
    border: 1px solid rgba(225, 37, 27, .3);
    border-radius: 12px;
    background: rgba(225, 37, 27, .06);
    font-weight: 600;
}

@media (min-width: 600px) {
    .age-gate__box { padding: 36px 32px 30px; }
    .age-gate__title { font-size: 1.8rem; }
    .age-gate__logo { width: 150px; }
}

@media (prefers-reduced-motion: reduce) {
    .age-gate, .age-gate__box { animation: none !important; }
}

.age-gate__submit { width: 100%; justify-content: center; }
