/**
 * ENGIM - Modale Alerte Email
 * Styles de la modale de création d'alerte
 * 
 * @version 1.0
 */

/* ============================================================================
   VARIABLES (héritées de contact-modal)
   ============================================================================ */
.alert-modal {
    --modal-blue-800: #0f2744;
    --modal-blue-600: #1a4d7c;
    --modal-blue-500: #1e5f99;
    --modal-accent: #f6c644;
    --modal-text: #333;
    --modal-text-light: #666;
    --modal-border: #e2e8f0;
    --modal-bg: #f8fafc;
    --modal-bg-white: #ffffff;
    --modal-success: #22c55e;
    --modal-error: #ef4444;
    --modal-radius: 16px;
    --modal-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
}

/* ============================================================================
   STRUCTURE PRINCIPALE
   ============================================================================ */

.alert-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.alert-modal--open {
    opacity: 1;
    visibility: visible;
}

/* Overlay */
.alert-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    cursor: pointer;
}

/* Container */
.alert-modal__container {
    position: relative;
    width: 94%;
    max-width: 520px;
    max-height: 90vh;
    background: var(--modal-bg);
    border-radius: var(--modal-radius);
    box-shadow: var(--modal-shadow);
    overflow: hidden;
    transform: translateY(20px) scale(0.95);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.alert-modal--open .alert-modal__container {
    transform: translateY(0) scale(1);
}

/* ============================================================================
   BOUTON FERMER
   ============================================================================ */

.alert-modal__close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    z-index: 10;
}

.alert-modal__close:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

/* ============================================================================
   HEADER STYLE HERO
   ============================================================================ */

.alert-modal__header {
    position: relative;
    padding: 40px 32px 0;
    background: 
        url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.03)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>'),
        linear-gradient(135deg, #0f2744 0%, #1a4d7c 50%, #1e5f99 100%);
    background-size: 100px 100px, cover;
    text-align: center;
    overflow: visible;
}

.alert-modal__header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(ellipse at 30% 20%, rgba(245, 184, 0, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 80%, rgba(41, 128, 185, 0.15) 0%, transparent 50%);
    pointer-events: none;
}

.alert-modal__header-content {
    position: relative;
    z-index: 2;
    padding-bottom: 50px;
}

.alert-modal__icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    color: var(--modal-accent);
}

.alert-modal__title {
    margin: 0 0 8px;
    font-size: 26px;
    font-weight: 700;
    color: #ffffff;
}

.alert-modal__title span {
    color: var(--modal-accent);
}

.alert-modal__subtitle {
    margin: 0;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
}

/* Vague SVG */
.alert-modal__wave {
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    width: 100%;
    height: 40px;
    overflow: hidden;
}

.alert-modal__wave svg {
    display: block;
    width: 100%;
    height: 100%;
}

/* ============================================================================
   CONTENU
   ============================================================================ */

.alert-modal__content {
    padding: 20px 32px 32px;
    overflow-y: auto;
    flex: 1;
    background: var(--modal-bg);
}

/* ============================================================================
   CRITÈRES DE RECHERCHE
   ============================================================================ */

.alert-modal__criteria {
    margin-bottom: 24px;
}

.alert-modal__criteria-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--modal-text);
    margin: 0 0 12px;
}

.alert-modal__criteria-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.alert-modal__criteria-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--modal-bg-white);
    border: 1px solid var(--modal-border);
    border-radius: 20px;
    font-size: 13px;
    color: var(--modal-text);
}

.alert-modal__criteria-tag svg {
    width: 14px;
    height: 14px;
    color: var(--modal-blue-600);
}

.alert-modal__criteria-empty {
    padding: 16px;
    background: var(--modal-bg-white);
    border: 1px dashed var(--modal-border);
    border-radius: 8px;
    text-align: center;
    color: var(--modal-text-light);
    font-size: 13px;
}

/* ============================================================================
   FORMULAIRE
   ============================================================================ */

.alert-modal__form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.alert-modal__field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.alert-modal__field label {
    font-size: 13px;
    font-weight: 600;
    color: var(--modal-text);
}

.alert-modal__field label .required {
    color: var(--modal-error);
}

.alert-modal__field input {
    width: 100%;
    padding: 12px 14px;
    font-size: 14px;
    font-family: inherit;
    color: var(--modal-text);
    background: var(--modal-bg-white);
    border: 1px solid var(--modal-border);
    border-radius: 8px;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.alert-modal__field input:focus {
    outline: none;
    border-color: var(--modal-blue-600);
    box-shadow: 0 0 0 3px rgba(26, 77, 124, 0.1);
}

.alert-modal__field input::placeholder {
    color: #a0aec0;
}

.alert-modal__field input:read-only {
    background: var(--modal-bg);
    color: var(--modal-text-light);
}

.alert-modal__hint {
    font-size: 12px;
    color: var(--modal-text-light);
    line-height: 1.5;
    margin-top: 4px;
}

/* ============================================================================
   BOUTON SUBMIT
   ============================================================================ */

.alert-modal__submit {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 24px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    color: var(--modal-blue-800);
    background: var(--modal-accent);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 14px rgba(246, 198, 68, 0.4);
    margin-top: 8px;
}

.alert-modal__submit:hover:not(:disabled) {
    background: #e5b63d;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(246, 198, 68, 0.5);
}

.alert-modal__submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Spinner */
.alert-modal__spinner {
    animation: alertSpin 1s linear infinite;
}

@keyframes alertSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ============================================================================
   MESSAGE DE SUCCÈS
   ============================================================================ */

.alert-modal__success {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 20px;
    animation: alertFadeIn 0.4s ease;
}

.alert-modal__success svg {
    color: var(--modal-success);
    margin-bottom: 16px;
}

.alert-modal__success h3 {
    margin: 0 0 8px;
    font-size: 20px;
    font-weight: 700;
    color: var(--modal-text);
}

.alert-modal__success p {
    margin: 0;
    font-size: 14px;
    color: var(--modal-text-light);
    line-height: 1.6;
}

@keyframes alertFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================================================
   RESPONSIVE
   ============================================================================ */

@media (max-width: 600px) {
    .alert-modal__container {
        width: 96%;
        max-height: 94vh;
        border-radius: 12px;
    }

    .alert-modal__header {
        padding: 28px 20px 0;
    }

    .alert-modal__header-content {
        padding-bottom: 40px;
    }

    .alert-modal__content {
        padding: 16px 20px 24px;
    }

    .alert-modal__title {
        font-size: 22px;
    }

    .alert-modal__close {
        top: 12px;
        right: 12px;
        width: 36px;
        height: 36px;
    }

    .alert-modal__wave {
        height: 35px;
    }

    .alert-modal__icon {
        width: 48px;
        height: 48px;
    }
}

/* ============================================================================
   RESPONSIVE - 374px (Très petit écran)
   ============================================================================ */
@media (max-width: 374px) {
    .alert-modal__container {
        width: 98%;
        max-height: 96vh;
    }
    
    .alert-modal__header {
        padding: 24px 16px 0;
    }
    
    .alert-modal__header-content {
        padding-bottom: 35px;
    }
    
    .alert-modal__content {
        padding: 12px 16px 20px;
    }
    
    .alert-modal__title {
        font-size: 20px;
    }
    
    .alert-modal__subtitle {
        font-size: 13px;
    }
    
    .alert-modal__icon {
        width: 44px;
        height: 44px;
    }
    
    .alert-modal__criteria-tag {
        padding: 5px 10px;
        font-size: 12px;
    }
    
    .alert-modal__field input {
        padding: 10px 12px;
        font-size: 14px;
    }
    
    .alert-modal__field label {
        font-size: 12px;
    }
    
    .alert-modal__submit {
        padding: 12px 20px;
        font-size: 14px;
    }
    
    .alert-modal__success h3 {
        font-size: 18px;
    }
    
    .alert-modal__success p {
        font-size: 13px;
    }
}
/* Style pour la checkbox RGPD - à ajouter dans alert-modal.css */

.alert-modal__checkbox {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin: 1rem 0;
    font-size: 0.85rem;
    line-height: 1.4;
}

.alert-modal__checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    flex-shrink: 0;
    accent-color: #1a56db;
    cursor: pointer;
}

.alert-modal__checkbox label {
    color: #64748b;
    cursor: pointer;
}

.alert-modal__checkbox label a {
    color: #1a56db;
    text-decoration: underline;
}

.alert-modal__checkbox label a:hover {
    color: #1e40af;
}

.alert-modal__checkbox .required {
    color: #ef4444;
}
