/*
 * Modale / Boîte de dialogue personnalisé - Inkwell
 */

.modale-fond {
    position:fixed;
    inset:0;
    z-index:950;
    background-color:rgba(38, 53, 60, 0.55);
    backdrop-filter:blur(2px);
    display:none;
    align-items:center;
    justify-content:center;
    padding:24px;
}

.modale-fond.modale-fond--ouverte {
    display:flex;
    animation:modale-fond-apparition 0.2s ease;
}

@keyframes modale-fond-apparition {
    from {
        opacity:0;
    }
    to {
        opacity:1;
    }
}

.modale {
    position:relative;
    display:flex;
    width:100%;
    max-width:460px;
    max-height:85vh;
    flex-direction:column;
    background-color:#FFFFFF;
    border-radius:var(--rayon-carte);
    box-shadow:0 24px 64px rgba(38, 53, 60, 0.3);
    font-family:var(--police-corps);
    animation:modale-apparition 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow:hidden;
}

@keyframes modale-apparition {
    from {
        opacity:0;
        transform:scale(0.92) translateY(12px);
    }
    to {
        opacity:1;
        transform:scale(1) translateY(0);
    }
}

.modale--petite {
    max-width:380px;
}

.modale--grande {
    max-width:640px;
}

.modale__entete {
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:16px;
    padding:24px 24px 0;
}

.modale__icone {
    flex-shrink:0;
    width:48px;
    height:48px;
    border-radius:50%;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:1.3rem;
    color:#FFFFFF;
    margin-bottom:12px;
}

.modale__icone--info {
    background-color:var(--couleur-bleu-vif);
}

.modale__icone--succes {
    background-color:var(--couleur-vert-emeraude);
}

.modale__icone--avertissement {
    background-color:var(--couleur-ocre);
}

.modale__icone--danger {
    background-color:var(--couleur-rouge-vif);
}

.modale__titre {
    font-family:var(--police-titres);
    font-weight:800;
    font-size:1.25rem;
    color:var(--couleur-anthracite);
    flex:1;
}

.modale__fermer {
    flex-shrink:0;
    width:32px;
    height:32px;
    display:flex;
    align-items:center;
    justify-content:center;
    border-radius:50%;
    color:rgba(38, 53, 60, 0.45);
    font-size:0.95rem;
    transition:background-color 0.15s ease, color 0.15s ease;
}

.modale__fermer:hover {
    background-color:var(--couleur-beige);
    color:var(--couleur-anthracite);
}

.modale__corps {
    padding:12px 24px 24px;
    overflow-y:auto;
    flex:1;
    min-height:0;
    color:rgba(38, 53, 60, 0.75);
    font-size:0.92rem;
    line-height:1.55;
}

.modale__corps p + p {
    margin-top:10px;
}

.modale__pied {
    display:flex;
    align-items:center;
    justify-content:flex-end;
    flex-wrap: wrap;
    gap:10px;
    padding:16px 24px 24px;
    border-top:1px solid rgba(38, 53, 60, 0.08);
    margin-top:4px;
    padding-top:20px;
    width: auto !important;
    max-width: 100%;
    box-sizing: border-box;
}

.modale__pied .bouton {
    max-width: 100%;
    white-space: normal;
    flex-shrink: 1;
}

.modale__pied--gauche {
    justify-content:flex-start;
}

.modale__pied--etale {
    justify-content:space-between;
}

.bouton--danger {
    background-color:var(--couleur-rouge-vif);
    color:#FFFFFF;
}

.bouton--danger:hover {
    background-color:#E02900;
    box-shadow:0 6px 16px rgba(255, 49, 9, 0.3);
}

.modale__corps::-webkit-scrollbar {
    width:6px;
}

.modale__corps::-webkit-scrollbar-thumb {
    background-color:var(--couleur-corail);
    border-radius:999px;
}

@media (max-width:576px) {
    .modale-fond {
        padding:16px;
        align-items:center;
    }
    .modale {
        max-width:100%;
        max-height:90vh;
    }
    .modale--grande {
        max-height:94vh;
    }    
    .modale__pied {
        flex-direction:column-reverse;
        align-items:stretch;
    }
    .modale__pied .bouton {
        width:100%;
    }
}