/* Modal de confirmation d'envoi du formulaire de contact */

/* Overlay (fond semi-transparent) */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(78, 59, 53, 0.7); /* brun-chocolat avec opacité */
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 1rem;
    animation: fadeIn 0.3s ease-out;
    opacity: 0;
}

.modal-overlay.show {
    opacity: 1;
}

/* Conteneur de la modal */
.modal-container {
    background-color: #FAF7F5; /* blanc-casse */
    border-radius: 2rem;
    box-shadow: 0 25px 50px -12px rgba(78, 59, 53, 0.4);
    max-width: 500px;
    width: 100%;
    position: relative;
    animation: slideUp 0.4s ease-out;
    transform: translateY(20px);
    opacity: 0;
    border: 2px solid #E7C9C2; /* rose-poudre */
}

.modal-overlay.show .modal-container {
    transform: translateY(0);
    opacity: 1;
}

/* En-tête de la modal */
.modal-header {
    padding: 2.5rem 2.5rem 1.5rem;
    text-align: center;
    position: relative;
}

/* Bouton de fermeture */
.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    color: #4E3B35; /* brun-chocolat */
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background-color: #E7C9C2; /* rose-poudre */
    transform: rotate(90deg);
}

.modal-close:focus {
    outline: 2px solid #E7C9C2;
    outline-offset: 2px;
}

.modal-close svg {
    width: 24px;
    height: 24px;
}

/* Icône de succès */
.modal-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    background: linear-gradient(135deg, #E7C9C2 0%, #D8B4AB 100%); /* gradient rose-poudre */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: scaleIn 0.5s ease-out 0.2s both;
}

.modal-icon svg {
    width: 48px;
    height: 48px;
    color: #FAF7F5; /* blanc-casse */
    animation: drawCheck 0.6s ease-out 0.4s both;
}

/* Contenu de la modal */
.modal-content {
    padding: 0 2.5rem 2.5rem;
    text-align: center;
}

.modal-title {
    font-family: var(--font-family-display);
    font-size: 2rem;
    font-weight: 700;
    color: #4E3B35; /* brun-chocolat */
    margin-bottom: 1rem;
    line-height: 1.3;
}

.modal-message {
    font-family: var(--font-family-sans);
    font-size: 1.125rem;
    color: rgba(78, 59, 53, 0.8);
    line-height: 1.7;
    margin-bottom: 2rem;
}

/* Bouton de fermeture principal */
.modal-button {
    background: linear-gradient(135deg, #E7C9C2 0%, #D8B4AB 100%);
    color: #4E3B35;
    font-family: var(--font-family-sans);
    font-weight: 700;
    font-size: 1.125rem;
    padding: 1rem 2.5rem;
    border: none;
    border-radius: 9999px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(231, 201, 194, 0.4);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-button:hover {
    background: #4E3B35;
    color: #FAF7F5;
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(78, 59, 53, 0.3);
}

.modal-button:focus {
    outline: 3px solid #E7C9C2;
    outline-offset: 3px;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

@keyframes scaleIn {
    from {
        transform: scale(0);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes drawCheck {
    from {
        stroke-dasharray: 100;
        stroke-dashoffset: 100;
    }
    to {
        stroke-dasharray: 100;
        stroke-dashoffset: 0;
    }
}

/* Animation de sortie */
.modal-overlay.hide {
    animation: fadeOut 0.3s ease-out forwards;
}

.modal-overlay.hide .modal-container {
    animation: slideDown 0.3s ease-out forwards;
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

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

/* Responsive mobile */
@media (max-width: 640px) {
    .modal-container {
        margin: 1rem;
        border-radius: 1.5rem;
    }

    .modal-header {
        padding: 2rem 1.5rem 1rem;
    }

    .modal-content {
        padding: 0 1.5rem 2rem;
    }

    .modal-title {
        font-size: 1.75rem;
    }

    .modal-message {
        font-size: 1rem;
    }

    .modal-icon {
        width: 64px;
        height: 64px;
        margin-bottom: 1rem;
    }

    .modal-icon svg {
        width: 36px;
        height: 36px;
    }

    .modal-button {
        font-size: 1rem;
        padding: 0.875rem 2rem;
    }
}

/* Accessibilité : désactiver les animations si préférence utilisateur */
@media (prefers-reduced-motion: reduce) {
    .modal-overlay,
    .modal-container,
    .modal-icon,
    .modal-icon svg,
    .modal-button,
    .modal-close {
        animation: none !important;
        transition: none !important;
    }

    .modal-overlay.show .modal-container {
        transform: none;
    }
}
