/* Le fond sombre (overlay) en plein écran */
#ali-ml-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background-color: rgba(0, 0, 0, 0.7) !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    z-index: 999999 !important;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

#ali-ml-overlay.ali-ml-visible {
    opacity: 1 !important;
    visibility: visible !important;
}

/* La boite blanche du Popup */
#ali-ml-popup {
    width: 90% !important;
    max-width: 450px !important;
    padding: 45px 35px !important;
    border-radius: 16px !important;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15) !important;
    position: relative !important;
    transform: translateY(20px) scale(0.95);
    transition: transform 0.3s ease;
    text-align: center !important;
    box-sizing: border-box !important;
}

#ali-ml-overlay.ali-ml-visible #ali-ml-popup {
    transform: translateY(0) scale(1);
}

#ali-ml-popup.ali-ml-success-state {
    padding-top: 48px !important;
    padding-bottom: 48px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 160px;
}

#ali-ml-popup.ali-ml-success-state .ali-ml-content {
    width: 100%;
}

#ali-ml-popup.ali-ml-success-state .ali-ml-message {
    margin-top: 0 !important;
}

/* FORCER LA DISPARITION DU TITRE ET DESCRIPTION EN SUCCES (ANTI-BUG DE THEME) */
#ali-ml-popup.ali-ml-success-state .ali-ml-title,
#ali-ml-popup.ali-ml-success-state .ali-ml-desc {
    display: none !important;
}

/* Le bouton Fermer (X) */
#ali-ml-close {
    position: absolute !important;
    top: 15px !important;
    right: 20px !important;
    background: transparent !important;
    border: none !important;
    font-size: 26px !important;
    font-weight: bold !important;
    color: #a1a1aa !important;
    cursor: pointer !important;
    padding: 0 !important;
    line-height: 1 !important;
}

#ali-ml-close:hover {
    color: #18181b !important;
}

/* Textes et formulaires */
.ali-ml-title {
    margin: 0 0 10px !important;
    font-size: 24px !important;
    font-weight: 800 !important;
}

.ali-ml-desc {
    margin: 0 0 24px !important;
    font-size: 15px !important;
    line-height: 1.6 !important;
}

.ali-ml-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* --- CHAMPS (Taille diminuée) --- */
.ali-ml-form input {
    width: 100% !important;
    height: 46px !important;
    padding: 0 18px !important;
    border: 1px solid #e4e4e7 !important;
    border-radius: 10px !important;
    font-size: 15px !important;
    box-sizing: border-box !important;
    background: #ffffff !important;
    color: #18181b !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04) !important;
    transition: all 0.3s ease !important;
}

.ali-ml-form input:focus {
    border-color: #d4d4d8 !important;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08) !important;
    outline: none !important;
}

/* Taille du texte pré-écrit (Placeholder) */
.ali-ml-form input::placeholder {
    color: #52525b !important;
    font-size: 14px !important;
    opacity: 1 !important;
}

/* --- BOUTON --- */
.ali-ml-submit {
    border: none !important;
    height: 46px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    border-radius: 10px !important;
    cursor: pointer !important;
    transition: background-color 0.2s ease, transform 0.1s ease !important;
    width: 100% !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
}

.ali-ml-submit:active {
    transform: scale(0.98) !important;
}

/* Base de l'Embed (Fond transparent et sans bordure) */
.ali-ml-embed {
    max-width: 400px;
    margin: 20px auto;
    padding: 0 !important;
    border: none !important;
    box-sizing: border-box;
}

.ali-ml-hidden {
    display: none !important;
}

/* Loader CSS */
.ali-ml-loader {
    width: 22px;
    height: 22px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: ali-ml-spin 1s ease-in-out infinite;
}
@keyframes ali-ml-spin {
    to { transform: rotate(360deg); }
}

/* Message de Succès */
.ali-ml-message {
    margin-top: 15px;
    font-weight: 600;
    font-size: 16px;
    text-align: center;
}