.auth {
    min-height: 100vh;
    width: 100%;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.4rem;
    padding: 1rem;
    background:
        radial-gradient(circle at top,
        #3b4657,
        #12151c 65%);
    color: #f4f4f4;
    overflow: hidden;
}

.auth.active {
    display: flex;
}

.auth h1 {
    margin: 0;
    text-align: center;
    font-size:
        clamp(2rem,
        6vw,
        4rem);
    letter-spacing: 0.08em;
    text-shadow:
        0 4px 10px rgba(0, 0, 0, 0.6);
}

.auth h2 {
    margin: 0;
    font-size:
        clamp(1rem,
        3vw,
        1.5rem);
    font-weight: 400;
    opacity: 0.85;
}

.auth input {
    width: 90%;
    max-width: 22rem;
    padding: 0.9rem 1rem;
    font-size: 1rem;
    text-align: center;
    border: none;
    border-radius: 1rem;
    outline: none;
    background: #f2f2f2;
    color: #12151c;
    box-shadow:
        rgba(0, 0, 0, 0.25) 0 8px 16px inset,
        rgba(255, 255, 255, 0.15) 0 2px 4px;
    transition:
        box-shadow 160ms ease,
        transform 160ms ease;
}

.auth input:focus {
    box-shadow:
        rgba(0, 0, 0, 0.25) 0 8px 16px inset,
        rgba(255, 255, 255, 0.15) 0 2px 4px,
        rgba(111, 125, 146, 0.45) 0 0 0 4px;
}

.auth input:disabled {
    opacity: 0.75;
}

.auth input.input-error {
    animation:
        inputError 350ms ease-in-out;
}

@keyframes inputError {
    0% {
        transform: translateX(0);
    }

    20% {
        transform: translateX(-0.45rem);
    }

    40% {
        transform: translateX(0.45rem);
    }

    60% {
        transform: translateX(-0.3rem);
    }

    80% {
        transform: translateX(0.3rem);
    }

    100% {
        transform: translateX(0);
    }
}

.auth button {
    width: 9rem;
    height: 9rem;
    padding: 1rem;
    cursor: pointer;
    border: none;
    border-radius: 50%;
    font-weight: bold;
    font-size: 1rem;
    color: #f4f4f4;
    background:
        radial-gradient(circle at 30% 25%,
        #6f7d92,
        #202734 70%);
    box-shadow:
        rgba(0, 0, 0, 0.17) 0 -23px 25px inset,
        rgba(0, 0, 0, 0.15) 0 -36px 30px inset,
        rgba(0, 0, 0, 0.1) 0 -79px 40px inset,
        rgba(0, 0, 0, 0.06) 0 2px 1px,
        rgba(0, 0, 0, 0.09) 0 4px 2px,
        rgba(0, 0, 0, 0.09) 0 8px 4px,
        rgba(0, 0, 0, 0.09) 0 16px 8px,
        rgba(0, 0, 0, 0.09) 0 32px 16px;
    transition:
        transform 160ms ease,
        filter 160ms ease,
        opacity 160ms ease;
}

.auth button:hover:not(:disabled) {
    transform: translateY(-2px);
    filter: brightness(1.08);
}

.auth button:active:not(:disabled) {
    transform: translateY(1px);
}

.auth button:disabled {
    cursor: wait;
    opacity: 0.7;
}

.auth-message {
    min-height: 1.5rem;
    margin: 0;
    font-weight: bold;
    text-align: center;
}

.success {
    color: #2ecc71;
}

.error {
    color: #e74c3c;
}

/* ================================================== */
/* Encadré temporaire des mots de passe                */
/* ================================================== */

.demo-access {
    width: 90%;
    max-width: 30rem;
    padding: 0.8rem 1rem;
    border:
        1px solid rgba(255, 255, 255, 0.15);
    border-radius: 1rem;
    background:
        rgba(18, 21, 28, 0.4);
    box-shadow:
        rgba(0, 0, 0, 0.2) 0 8px 20px;
    color:
        rgba(244, 244, 244, 0.8);
    font-size: 0.85rem;
}

.demo-access summary {
    cursor: pointer;
    text-align: center;
    font-weight: bold;
    color: #f4f4f4;
}

.demo-access summary:hover {
    color: #ffffff;
}

.demo-access p {
    margin: 0.7rem 0 0;
    line-height: 1.5;
    text-align: left;
}

.demo-access strong {
    color: #f4f4f4;
}

/* ================================================== */
/* Animation de sortie de l’authentification           */
/* ================================================== */

.auth.auth-exit {
    pointer-events: none;
    animation:
        authExit 650ms ease-in forwards;
}

@keyframes authExit {
    0% {
        opacity: 1;
        transform:
            scale(1);
        filter:
            blur(0);
    }

    45% {
        opacity: 0.75;
        transform:
            scale(0.985);
        filter:
            blur(1px);
    }

    100% {
        opacity: 0;
        transform:
            scale(0.94);
        filter:
            blur(7px);
    }
}

/* ================================================== */
/* Animation d’entrée des autres panneaux             */
/* ================================================== */

.screen.screen-enter {
    animation:
        screenEnter 700ms cubic-bezier(0.22,
        1,
        0.36,
        1) both;
}

@keyframes screenEnter {
    0% {
        opacity: 0;
        transform:
            translateY(2rem) scale(0.97);
        filter:
            blur(6px);
    }

    100% {
        opacity: 1;
        transform:
            translateY(0) scale(1);
        filter:
        blur(0);
    }
}

/* ================================================== */
/* Écrans de 425 px ou moins                           */
/* ================================================== */

@media (max-width: 425px) {
    .auth {
        gap: 1rem;
    }

    .auth input {
        max-width: 13rem;
    }

    .auth button {
        width: 7rem;
        height: 7rem;
    }

    .demo-access {
        max-width: 20rem;
        font-size: 0.75rem;
    }
}

/* ================================================== */
/* Très petits écrans                                  */
/* ================================================== */

@media (max-width: 249px) {
    .auth input {
        max-width: 8rem;
        font-size: 0.5rem;
    }

    .auth h1 {
        font-size: 1rem;
    }

    .auth button {
        width: 6rem;
        height: 6rem;
    }

    .demo-access {
        padding: 0.5rem;
        font-size: 0.55rem;
    }
}

/* ================================================== */
/* Accessibilité : réduction des animations            */
/* ================================================== */

@media (prefers-reduced-motion: reduce) {

    .auth.auth-exit,
    .screen.screen-enter,
    .auth input.input-error {
        animation-duration: 1ms;
    }

    .auth input,
    .auth button {
        transition: none;
    }
}
