#popup-urgent-bg {
    position: fixed; left: 0; top: 0; width: 100vw; height: 100vh;
    background: transparent; 
    display: none; align-items: center; justify-content: center; z-index: 10002;
    pointer-events: all;
    overflow: visible;
}

#popup-urgent-box {
    background: #fff; border-radius: 16px; padding: 32px 32px 60px 32px; max-width: 550px; 
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    position: relative;
    border: 3px solid #3c69b2;
    box-shadow: 0 0 0 8px #fff, 0 0 0 11px #3c69b2, 0 8px 32px rgba(0, 0, 0, 0.15);
    overflow: visible;
    display: flex; flex-direction: column; align-items: center;
    margin-top: -100px;
    pointer-events: auto;
    max-height: 90vh;
    overflow-y: auto;
}

#popup-date {
    position: absolute; right: 20px; top: 16px;
    font-size: 32px; color: #333;
    font-weight: 500;
}

#popup-logo {
    width: 100%; text-align: center; margin-bottom: 24px;
}

#popup-logo img { 
    max-width: 280px; max-height: 180px; display: block; margin: 0 auto;
}

#popup-urgent-box h2 { 
    margin: 16px 0;
    color: #1a5c86;
    font-weight: 700;
    font-size: 24px;
    text-align: center;
}

#popup-image {
    width: 100%; text-align: center; margin: 20px 0 0 0;
}

#popup-image img {
    max-width: 100%; max-height: 250px; border-radius: 8px;
}

#popup-fichier {
    text-align: center; margin-top: 16px;
}

#popup-fichier a {
    display: inline-block;
    padding: 10px 20px;
    background: #3c69b2;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    transition: background 0.3s;
}

#popup-fichier a:hover {
    background: #1a5c86;
}

#popup-urgent-box .popup-texte {
    font-size: 15px;
    line-height: 1.6;
    color: #333;
    text-align: center;
    margin-bottom: 0;
}

/* Classe pour cacher le popup (surpasse les !important) */
#popup-urgent-bg.popup-fermé {
    display: none !important;
}

/* Conteneur du bouton de fermeture (en bas, centré du popup) */
#popup-close-container {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10005;
    pointer-events: auto;
    width: auto;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
    padding: 12px;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.1);
}

#popup-close {
    background: #d0d0d0;
    color: white; 
    border: 2px solid white;
    border-radius: 50%;
    width: 50px; 
    height: 50px; 
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    box-shadow: 0 4px 12px rgba(176, 176, 176, 0.5);
    position: relative;
    pointer-events: auto;
    -webkit-appearance: none;
    appearance: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    line-height: 1;
}

#popup-close:active,
#popup-close:focus {
    background: #b8b8b8;
    outline: none;
    box-shadow: 0 2px 8px rgba(176, 176, 176, 0.8);
    transform: scale(0.95);
}

#popup-close:hover {
    background: #b8b8b8;
    box-shadow: 0 6px 16px rgba(176, 176, 176, 0.6);
}

@media (max-width: 750px) {
    #popup-urgent-bg {
        align-items: flex-start;
        padding-top: 15px;
    }

    #popup-urgent-box { 
        padding: 24px 20px 60px 20px; 
        max-width: 90vw;
        width: 90vw;
        margin-top: 40px;
    }
    #popup-logo img {
        max-width: 200px;
    }
    #popup-urgent-box h2 {
        font-size: 20px;
    }
    #popup-urgent-box .popup-texte {
        font-size: 14px;
    }
    #popup-date {
        font-size: 12px;
    }
}

/* Petit écran mobile (480px et moins) */
@media (max-width: 480px) {
    #popup-urgent-bg {
        background: transparent;
        padding: 10px;
        align-items: flex-start !important;
        padding-top: 20px;
        overflow-y: auto;
    }

    #popup-urgent-box { 
        padding: 20px 16px 55px 16px;
        max-width: 100%;
        width: calc(100vw - 40px);
        max-height: auto;
        overflow-y: auto;
        border: 2px solid #3c69b2;
        box-shadow: 0 0 0 4px #fff, 0 0 0 6px #3c69b2, 0 4px 16px rgba(0, 0, 0, 0.2);
        margin-top: 0;
    }

    #popup-date {
        position: absolute;
        right: 12px;
        top: 12px;
        font-size: 18px;
        color: #333;
    }

    #popup-logo {
        margin-bottom: 16px;
    }

    #popup-logo img {
        max-width: 150px;
        max-height: 120px;
    }

    #popup-urgent-box h2 {
        margin: 12px 0;
        font-size: 18px;
        line-height: 1.4;
    }

    #popup-image {
        margin: 12px 0 0 0;
    }

    #popup-image img {
        max-width: 100%;
        max-height: 200px;
    }

    #popup-fichier {
        margin-top: 12px;
    }

    #popup-fichier a {
        padding: 8px 16px;
        font-size: 13px;
    }

    #popup-urgent-box .popup-texte {
        font-size: 13px;
        line-height: 1.5;
    }

    #popup-close-container {
        bottom: 16px;
    }

    #popup-close {
        width: 44px;
        height: 44px;
        font-size: 24px;
        line-height: 1;
    }
}

/* Très petit écran (max-width: 360px) */
@media (max-width: 360px) {
    #popup-urgent-bg {
        display: flex !important;
        align-items: flex-start !important;
        padding-top: 15px;
        overflow-y: auto;
    }

    #popup-urgent-box {
        padding: 16px 12px 50px 12px;
        width: calc(100vw - 32px);
        max-height: auto;
        margin-top: 30px;
    }

    #popup-date {
        font-size: 14px;
    }

    #popup-logo img {
        max-width: 120px;
        max-height: 100px;
    }

    #popup-urgent-box h2 {
        font-size: 16px;
        margin: 10px 0;
    }

    #popup-urgent-box .popup-texte {
        font-size: 12px;
    }

    #popup-image img {
        max-height: 150px;
    }

    #popup-fichier a {
        padding: 6px 12px;
        font-size: 12px;
    }

    #popup-close-container {
        bottom: 12px;
    }

    #popup-close {
        width: 40px;
        height: 40px;
        font-size: 20px;
        line-height: 1;
    }
}
