/* ==========================================================================
   MODALES SYSTEME (style.modals.css)
   ========================================================================== */

/* --- 1. OVERLAY / BACKDROP --- */
.solum-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: var(--solum-z-modal-backdrop, 9999);
    align-items: center;
    justify-content: center;
}

.solum-modal-overlay.is-active {
    display: flex;
}

/* --- 2. BOITE MODALE (.solum-modal-dialog) --- */
.solum-modal-dialog {
    padding: 0 !important;
    background-color: #ffffff;
    width: 100%;
    max-width: 500px;
    min-height: 180px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    z-index: var(--solum-z-modal, 10000);
    box-shadow: var(--solum-shadow-modal, 0 4px 15px rgba(0,0,0,0.2));
    border: none;
    border-radius: 0 !important;
}

.solum-modal-dialog.solum-modal-lg {
    max-width: 800px;
}

/* --- 3. STRUCTURE INTERNE DE LA MODALE --- */
.solum-modal-header {
    height: 38px;
    min-height: 38px;
    max-height: 38px;
    box-sizing: border-box;
    padding: 0 24px;
    background-color: #2f5071 !important; /* Defaut = Info */
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.solum-modal-title {
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    font-size: 1.125rem !important; /* 18px */
    font-weight: normal !important;
    color: #ffffff !important;
    margin: 0 0 10px 0 !important;
    text-align: left;
    line-height: 1 !important;
    padding: 0 !important;
    align-self: flex-end;
}

.solum-modal-close {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    color: #ffffff !important;
    cursor: pointer;
    padding: 0;
}

.solum-modal-close:hover {
    color: #cc3333;
}

.solum-modal-body {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1;
    font-family: 'Roboto', sans-serif !important;
    font-size: 0.9rem;
    font-weight: normal;
}

.solum-modal-footer {
    height: 50px;
    min-height: 50px;
    max-height: 50px;
    box-sizing: border-box;
    padding: 9px 10px 10px 24px; /* Marges droite, haute et basse = 10px (puisque 50px - 30px = 20px / 2 = 10px) */
    border-top: 1px solid #000000;
    background-color: #d9dbdb;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 4px;
}

/* --- 5. BOUTONS SPECIFIQUES AUX MODALES (Uniformisation 150px) --- */
.solum-modal-btn,
.solum-modal-footer button,
.solum-modal-footer .btn,
.solum-modal-actions button,
.solum-modal-actions .btn,
.solum-modal .btn,
.modal-footer button,
.modal-footer .btn,
.modal-actions button,
.modal-actions .btn,
.modal .btn:not(.modal-close):not(.solum-modal-close) {
    width: var(--solum-btn-modal-width, 150px) !important;
    min-width: var(--solum-btn-modal-width, 150px) !important;
    max-width: var(--solum-btn-modal-width, 150px) !important;
    white-space: nowrap !important;
    box-sizing: border-box !important;
    height: 30px !important;
    min-height: 30px !important;
    margin: 0 !important;
    padding: 0 10px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-family: 'Roboto', sans-serif !important;
    font-size: 0.85rem !important;
    cursor: pointer;
    border: none !important;
    border-radius: 0 !important;
    outline: none !important;
}

.solum-modal-btn-primary {
    background-color: #b88a5c !important;
    color: #ffffff !important;
}

.solum-modal-btn-secondary {
    background-color: #b5b4b0 !important;
    color: #ffffff !important;
}

.solum-modal-btn-danger {
    background-color: #b82e2e !important;
    color: #ffffff !important;
}

/* Hover effects */
.solum-modal-btn-primary:hover { background-color: #a3794f !important; }
.solum-modal-btn-secondary:hover { background-color: #9b9a97 !important; }
.solum-modal-btn-danger:hover { background-color: #a32828 !important; }

/* --- 4. TYPES D'ALERTE MODALE (Couleurs Liseré) --- */
.solum-modal-dialog.solum-modal-info .solum-modal-header,
.solum-modal-dialog.solum-modal-success .solum-modal-header,
.solum-modal-dialog.solum-modal-saving .solum-modal-header {
    background-color: #2f5071 !important;
}

.solum-modal-dialog.solum-modal-warning .solum-modal-header {
    background-color: #b88a5c !important;
}

.solum-modal-dialog.solum-modal-danger .solum-modal-header {
    background-color: #b82e2e !important;
}

/* Fix pour checkboxes et selects specifiques dans les modales si besoin */
.solum-modal-dialog label:has(input[type="checkbox"]) {
    margin-bottom: 5px;
}