/* ==========================================================
   FSPEEJ — habillage global de SweetAlert2 et Notyf
   Purement visuel : aucune option ni comportement n'est modifié.
   Signature : ruban aux couleurs du drapeau de la RDC
   (bleu, jaune, rouge) et palette FSPEEJ.
   ========================================================== */

:root {
    --fsp-blue: #2D4E9D;
    --fsp-blue-dark: #1c3577;
    --fsp-navy: #10224f;
    --fsp-yellow: #F7D618;
    --fsp-red: #BC1619;
    --fsp-green: #1f9d5c;
    --fsp-amber: #E39B12;
    --fsp-text: #4a5068;
    --fsp-muted: #8a91a8;
    --fsp-line: #E6E9F2;
    --fsp-soft: #F3F5FB;
    /* Bande signature (charte : bleu, jaune, rouge à parts égales) */
    --fsp-band-blue: #158BCB;
    --fsp-band-yellow: #EFEB5B;
    --fsp-band-red: #E1393D;
    --fsp-band: linear-gradient(90deg, var(--fsp-band-blue) 0 33.333%, var(--fsp-band-yellow) 33.333% 66.666%, var(--fsp-band-red) 66.666% 100%);
}

/* ==========================================================
   SWEETALERT2
   Les variables sont posées sur .swal2-container pour l'emporter
   sur celles injectées par sweetalert2.all.min.js (:root).
   ========================================================== */

.swal2-container {
    --swal2-backdrop: rgba(10, 22, 52, .55);
    --swal2-backdrop-transition: background-color .25s ease;
    --swal2-width: 31em;
    --swal2-padding: 0 0 1.6em;
    --swal2-border-radius: 22px;
    /* La bande est un calque de fond : elle suit automatiquement les coins arrondis */
    --swal2-background: var(--fsp-band) left bottom / 100% 4px no-repeat, radial-gradient(120% 55% at 50% -12%, rgba(45, 78, 157, .09), rgba(45, 78, 157, 0) 62%), #fff;
    --swal2-color: var(--fsp-text);
    --swal2-show-animation: fsp-swal-in .42s cubic-bezier(.2, .9, .25, 1.12);
    --swal2-hide-animation: fsp-swal-out .18s ease-in forwards;
    --swal2-title-padding: 1.15em 1.4em 0;
    --swal2-html-container-padding: .75em 1.9em .25em;
    --swal2-input-border: 1.5px solid var(--fsp-line);
    --swal2-input-border-radius: 12px;
    --swal2-input-box-shadow: none;
    --swal2-input-background: #fff;
    --swal2-input-hover-box-shadow: none;
    --swal2-input-focus-border: 1.5px solid var(--fsp-blue);
    --swal2-input-focus-box-shadow: 0 0 0 4px rgba(45, 78, 157, .14);
    --swal2-progress-step-background: #c9d3ec;
    --swal2-validation-message-background: #FDF1F1;
    --swal2-validation-message-color: var(--fsp-red);
    --swal2-footer-border-color: var(--fsp-line);
    --swal2-footer-color: var(--fsp-muted);
    --swal2-close-button-color: #a3aabf;
    --swal2-close-button-font-size: 2em;
    --swal2-actions-margin: 1.5em auto 0;
    --swal2-action-button-transition: background-color .2s, box-shadow .2s, transform .15s, color .2s;
    --swal2-confirm-button-border-radius: 12px;
    --swal2-deny-button-border-radius: 12px;
    --swal2-cancel-button-border-radius: 12px;
    --swal2-toast-box-shadow: 0 18px 40px -14px rgba(16, 34, 79, .35), 0 0 0 1px rgba(45, 78, 157, .08);
}

/* Fond : voile bleu nuit flouté + pictogramme FSPEEJ conservé */
.swal2-container.swal2-backdrop-show:not(.swal2-no-backdrop):not(:has(.swal2-toast)) {
    background: rgba(10, 22, 52, .55) url("/img/shape/1.webp") right 5% top 18px no-repeat;
    background-size: 30px auto;
    -webkit-backdrop-filter: blur(5px) saturate(120%);
    backdrop-filter: blur(5px) saturate(120%);
}

/* Popup */
.swal2-container .swal2-popup:not(.swal2-toast) {
    box-shadow:
        0 40px 80px -30px rgba(10, 22, 52, .55),
        0 0 0 1px rgba(45, 78, 157, .06);
}

/* Titre & texte */
.swal2-container .swal2-title {
    color: var(--fsp-navy);
    font-size: 1.5em;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -.01em;
}
.swal2-container .swal2-html-container {
    font-size: 1em;
    line-height: 1.65;
    color: var(--fsp-text);
}
.swal2-container .swal2-footer { font-size: .9em; }

/* Bouton fermer */
.swal2-container .swal2-close {
    position: absolute;
    top: .4em;
    right: .4em;
    z-index: 3;
    width: 1.6em;
    height: 1.6em;
    margin: 0;
    border-radius: 50%;
    transition: color .2s, background-color .2s, transform .2s;
}
.swal2-container .swal2-close:hover {
    color: var(--fsp-red);
    background: #FDF1F1;
    transform: rotate(90deg);
}

/* Boutons (couleurs forcées : certaines alertes passent confirmButtonColor en ligne) */
.swal2-container .swal2-actions { gap: .6em; }
.swal2-container .swal2-styled {
    margin: 0;
    padding: .78em 1.55em;
    font-size: .98em;
    font-weight: 500;
    letter-spacing: .01em;
}
.swal2-container .swal2-styled:not([disabled]):hover { transform: translateY(-1px); }
.swal2-container .swal2-styled:not([disabled]):active { transform: translateY(0); }

.swal2-container .swal2-styled.swal2-confirm {
    background: linear-gradient(135deg, #3a63bf, var(--fsp-blue) 55%, var(--fsp-blue-dark)) !important;
    color: #fff !important;
    box-shadow: 0 10px 22px -10px rgba(45, 78, 157, .75);
}
.swal2-container .swal2-styled.swal2-confirm:hover { box-shadow: 0 14px 26px -10px rgba(45, 78, 157, .85); }
.swal2-container .swal2-styled.swal2-confirm:focus-visible { box-shadow: 0 0 0 4px rgba(45, 78, 157, .25); }

.swal2-container .swal2-styled.swal2-cancel {
    background: var(--fsp-soft) !important;
    color: #3b4466 !important;
    box-shadow: inset 0 0 0 1px var(--fsp-line);
}
.swal2-container .swal2-styled.swal2-cancel:hover { background: #e9edf7 !important; }
.swal2-container .swal2-styled.swal2-cancel:focus-visible { box-shadow: 0 0 0 4px rgba(45, 78, 157, .15); }

.swal2-container .swal2-styled.swal2-deny {
    background: #FDF1F1 !important;
    color: var(--fsp-red) !important;
    box-shadow: inset 0 0 0 1px rgba(188, 22, 25, .18);
}
.swal2-container .swal2-styled.swal2-deny:hover { background: #fbe3e3 !important; }

/* Icônes : palette FSPEEJ + halo discret */
.swal2-container .swal2-icon { margin-top: 2.1em; }
.swal2-container .swal2-icon.swal2-success { border-color: var(--fsp-green); color: var(--fsp-green); box-shadow: 0 0 0 10px rgba(31, 157, 92, .07); }
.swal2-container .swal2-icon.swal2-success .swal2-success-ring { border-color: rgba(31, 157, 92, .25); }
.swal2-container .swal2-icon.swal2-success [class^=swal2-success-line] { background-color: var(--fsp-green); }
.swal2-container .swal2-icon.swal2-error { border-color: var(--fsp-red); color: var(--fsp-red); box-shadow: 0 0 0 10px rgba(188, 22, 25, .06); }
.swal2-container .swal2-icon.swal2-error [class^=swal2-x-mark-line] { background-color: var(--fsp-red); }
.swal2-container .swal2-icon.swal2-warning { border-color: var(--fsp-amber); color: var(--fsp-amber); box-shadow: 0 0 0 10px rgba(227, 155, 18, .08); }
.swal2-container .swal2-icon.swal2-info { border-color: var(--fsp-blue); color: var(--fsp-blue); box-shadow: 0 0 0 10px rgba(45, 78, 157, .07); }
.swal2-container .swal2-icon.swal2-question { border-color: #5b7fd6; color: #5b7fd6; box-shadow: 0 0 0 10px rgba(91, 127, 214, .08); }

/* Chargement (Swal.showLoading) */
.swal2-container .swal2-loader {
    width: 2.6em;
    height: 2.6em;
    border-width: .28em;
    border-color: var(--fsp-blue) rgba(45, 78, 157, .12) var(--fsp-red) rgba(45, 78, 157, .12);
}

/* Barre de minuterie */
.swal2-container .swal2-timer-progress-bar-container { bottom: 4px; }
.swal2-container .swal2-timer-progress-bar { height: 3px; background: rgba(45, 78, 157, .35); }

/* Champs */
.swal2-input#swal2-input { width: unset !important; }
.swal2-container .swal2-input,
.swal2-container .swal2-file,
.swal2-container .swal2-textarea,
.swal2-container .swal2-select { font-size: 1em; color: var(--fsp-navy); }
.swal2-container .swal2-input,
.swal2-container .swal2-select { height: 3em; padding: 0 .9em; }
.swal2-container .swal2-select { border: 1.5px solid var(--fsp-line); border-radius: 12px; }
.swal2-container .swal2-validation-message { border-radius: 10px; margin: 1em 1.6em 0; font-size: .92em; }
.swal2-container .swal2-validation-message::before { background-color: var(--fsp-red); }
.swal2-container .swal2-checkbox input,
.swal2-container .swal2-radio input { accent-color: var(--fsp-blue); }

/* Étapes de progression */
.swal2-container .swal2-progress-steps .swal2-progress-step,
.swal2-container .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step { background: var(--fsp-blue); }

/* Modal compact « À la Une » (page d'accueil) */
.swal2-container .swal2-popup.fsp-une-popup { padding: 0 0 .9em; }
.swal2-container .fsp-une-popup .swal2-title {
    padding: .75em 2.6em 0 1em;
    font-size: 1.05em;
    text-align: left;
}
.swal2-container .fsp-une-popup .swal2-title::before {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    margin: 0 .55em .12em .2em;
    vertical-align: middle;
    border-radius: 50%;
    background: var(--fsp-band-red);
    box-shadow: 0 0 0 4px rgba(225, 57, 61, .15);
}
.swal2-container .fsp-une-popup .swal2-close { top: .3em; right: .3em; font-size: 1.6em; }
.swal2-container .fsp-une-popup .swal2-html-container { padding: .6em .9em 0; margin: 0; }
.swal2-container .fsp-une-popup .description { margin-top: 8px; line-height: 1.4; }

/* Toasts SweetAlert2 */
.swal2-container .swal2-popup.swal2-toast { border-radius: 14px; }
.swal2-container .swal2-popup.swal2-toast .swal2-title { font-size: 1em; font-weight: 500; }

@keyframes fsp-swal-in {
    0% { opacity: 0; transform: translateY(18px) scale(.94); filter: blur(4px); }
    100% { opacity: 1; transform: none; filter: none; }
}
@keyframes fsp-swal-out {
    to { opacity: 0; transform: translateY(8px) scale(.97); }
}

@media (max-width: 575px) {
    .swal2-container { --swal2-html-container-padding: .7em 1.2em .2em; --swal2-title-padding: 1.05em 1em 0; }
    .swal2-container .swal2-actions { width: 100%; padding: 0 1.2em; }
    .swal2-container .swal2-actions .swal2-styled { flex: 1 1 auto; }
}

/* ==========================================================
   NOTYF
   Carte claire en verre dépoli. Le "ripple" (qui porte la couleur
   du type via le JS) devient une barre d'accent verticale.
   ========================================================== */

.notyf { padding: 18px; }
.notyf .notyf__toast {
    width: 370px;
    min-width: 0;
    max-width: calc(100vw - 36px);
    padding: 0 14px 0 22px;
    border-radius: 16px;
    background: var(--fsp-band) left bottom / 100% 3px no-repeat, rgba(255, 255, 255, .94) !important;
    -webkit-backdrop-filter: blur(12px) saturate(140%);
    backdrop-filter: blur(12px) saturate(140%);
    color: var(--fsp-navy);
    box-shadow:
        0 22px 45px -18px rgba(16, 34, 79, .45),
        0 0 0 1px rgba(45, 78, 157, .08);
    animation: fsp-toast-in .5s cubic-bezier(.2, .9, .25, 1.15) forwards;
}


/* Barre d'accent (couleur du type) */
.notyf .notyf__ripple {
    width: 4px !important;
    height: auto !important;
    top: 12px;
    bottom: 12px;
    left: 9px;
    right: auto;
    border-radius: 4px;
    transform: none;
    transform-origin: center;
    animation: fsp-toast-bar .45s .1s ease-out both;
    z-index: 11;
}
.notyf .notyf__toast--success .notyf__ripple { background: var(--fsp-green) !important; }
.notyf .notyf__toast--error .notyf__ripple { background: var(--fsp-red) !important; }

.notyf .notyf__wrapper { padding-top: 14px; padding-bottom: 14px; padding-right: 8px; }
.notyf .notyf__toast--dismissible .notyf__wrapper { padding-right: 34px; }

/* Icône sur pastille teintée */
.notyf .notyf__icon {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    display: grid;
    place-items: center;
    margin-right: 13px;
    border-radius: 12px;
    background: var(--fsp-soft);
    font-size: 1em;
}
.notyf .notyf__icon:has(.notyf__icon--success) { background: #E6F5EC; }
.notyf .notyf__icon:has(.notyf__icon--error) { background: #FCEAEA; }
.notyf .notyf__icon:has(.material-icons) { background: #EAF0FB; }
.notyf .notyf__icon--success,
.notyf .notyf__icon--error { background: transparent; margin: 0; }
.notyf .notyf__icon--success { color: var(--fsp-green) !important; }
.notyf .notyf__icon--error { color: var(--fsp-red) !important; }
.notyf .notyf__icon .material-icons { color: var(--fsp-blue) !important; font-size: 22px; }

.notyf .notyf__message {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.45;
    color: var(--fsp-navy);
}

/* Bouton fermer */
.notyf .notyf__dismiss { width: 34px; margin-right: -6px; }
.notyf .notyf__dismiss-btn {
    background: transparent;
    opacity: .55;
    border-radius: 0 16px 16px 0;
}
.notyf .notyf__dismiss-btn::before,
.notyf .notyf__dismiss-btn::after { background: #6b7088; }
.notyf .notyf__dismiss-btn:hover { opacity: 1; background: rgba(45, 78, 157, .06); }
.notyf .notyf__dismiss-btn:hover::before,
.notyf .notyf__dismiss-btn:hover::after { background: var(--fsp-red); }

.notyf .notyf__toast--disappear { animation: fsp-toast-out .35s .2s ease-in forwards; }

@keyframes fsp-toast-in {
    0% { opacity: 0; transform: translateX(24px) scale(.96); }
    100% { opacity: 1; transform: none; }
}
@keyframes fsp-toast-out {
    to { opacity: 0; transform: translateX(28px) scale(.97); }
}
@keyframes fsp-toast-bar {
    from { transform: scaleY(0); }
    to { transform: scaleY(1); }
}

/* Mobile : on garde des cartes arrondies au lieu du bandeau pleine largeur */
@media only screen and (max-width: 480px) {
    .notyf { padding: 12px; }
    .notyf .notyf__toast {
        width: 100%;
        min-width: 0;
        max-width: none;
        border-radius: 14px;
    }
    .notyf .notyf__ripple { width: 4px !important; height: auto !important; }
}

/* Accessibilité : animations réduites */
@media (prefers-reduced-motion: reduce) {
    .swal2-container { --swal2-show-animation: none; --swal2-hide-animation: none; }
    .notyf .notyf__toast,
    .notyf .notyf__toast--disappear,
    .notyf .notyf__ripple { animation-duration: .01ms !important; animation-delay: 0s !important; }
}
