/*
 * Fenêtre modale Bestio.
 * Les valeurs reprennent le design system du thème semhv (_variables.scss) :
 * Roboto, noir #000 / rose #BA77B9, rayon 10px, ombre douce, style des boutons.
 */

.bestio-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    font-family: 'Roboto', Arial, sans-serif;
    opacity: 0;
    transition: opacity 0.25s ease;
}

/* Une fois masqué, l'élément (et donc l'overlay) ne capture plus rien,
   même si un thème remet un `display` sur les éléments [hidden]. */
.bestio-modal[hidden] {
    display: none !important;
}

/* Pendant la fermeture (transition d'opacité), on coupe les interactions
   pour que l'overlay ne reste pas cliquable. */
.bestio-modal:not(.is-visible) {
    pointer-events: none;
}

.bestio-modal.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.bestio-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(40, 40, 40, 0.55);
    cursor: pointer;
}

.bestio-modal__dialog {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 520px;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    background: #ffffff;
    color: #000000;
    border-radius: 10px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.2);
    padding: 40px;
    transform: translateY(12px);
    transition: transform 0.25s ease;
}

.bestio-modal.is-visible .bestio-modal__dialog {
    transform: translateY(0);
}

.bestio-modal__close {
    position: absolute;
    top: 12px;
    right: 16px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 50%;
    font-size: 28px;
    line-height: 1;
    color: #7B7B7B;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.bestio-modal__close:hover {
    background: #F1F1F1;
    color: #000000;
}

.bestio-modal__title {
    margin: 0 0 16px;
    font-size: 24px;
    font-weight: 500;
    color: #BA77B9;
    padding-right: 32px;
}

.bestio-modal__body {
    font-size: 16px;
    line-height: 1.5;
    color: #000000;
}

.bestio-modal__body p {
    margin: 0 0 12px;
}

.bestio-modal__body p:last-child {
    margin-bottom: 0;
}

.bestio-modal__body a {
    color: #BA77B9;
    text-decoration: underline;
}

.bestio-modal__actions {
    margin-top: 24px;
    display: flex;
    justify-content: flex-end;
}

.bestio-modal__button {
    border-radius: 10px;
    padding: 12px 24px;
    background: #000000;
    color: #ffffff;
    border: none;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    font-family: inherit;
    font-size: 16px;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.bestio-modal__button:hover {
    opacity: 0.85;
}

@media screen and (max-width: 425px) {
    .bestio-modal__dialog {
        padding: 28px 20px;
    }

    .bestio-modal__title {
        font-size: 20px;
    }
}
