/**
 * Sapien Modal System - Estilos Premium
 * Design consistente com o padrão Sapien (GUIA_ESTILIZACAO_PREMIUM.md)
 * Versão: 2.0.0 (Atualizado - 02/02/2026)
 */

/* Variáveis CSS - Paleta Sapien Premium */
:root {
    --modal-primary-700: #05636c;  /* Azul escuro Sapien */
    --modal-primary-600: #077885;  /* Azul médio Sapien */
    --modal-primary-300: #49c3ce;  /* Azul claro Sapien */
    
    --modal-success: #28a745;      /* Verde */
    --modal-danger: #dc3545;       /* Vermelho */
    --modal-warning: #ffc107;      /* Amarelo */
    --modal-info: #17a2b8;         /* Ciano */
    
    --modal-text-dark: #333333;
    --modal-text-muted: #6c757d;
}

#sapien-modal-system {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#sapien-modal-system.modal-active {
    pointer-events: all;
    opacity: 1;
}

/* Overlay com Glassmorphism Premium */
.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);  /* Mais escuro para melhor contraste */
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease;
}

/* Container do Modal */
.modal-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    max-width: 500px;
    width: 90%;
    animation: modalSlideIn 0.3s ease forwards;
}

#sapien-modal-system.modal-active .modal-container {
    transform: translate(-50%, -50%) scale(1);
}

/* Conteúdo com Sombra Premium */
.modal-content {
    background: white;
    border-radius: 16px;
    padding: 40px 32px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);  /* Sombra elevada */
    text-align: center;
}

/* Ícone Base */
.modal-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    background: #f1f5f9;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.modal-icon i {
    font-size: 40px;
}

/* Variantes de Ícone por Tipo (Com cores semânticas) */
.modal-icon-success {
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.15), rgba(40, 167, 69, 0.05));
    border: 2px solid rgba(40, 167, 69, 0.3);
}

.modal-icon-success i {
    color: var(--modal-success);
}

.modal-icon-error {
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.15), rgba(220, 53, 69, 0.05));
    border: 2px solid rgba(220, 53, 69, 0.3);
}

.modal-icon-error i {
    color: var(--modal-danger);
}

.modal-icon-warning {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.15), rgba(255, 193, 7, 0.05));
    border: 2px solid rgba(255, 193, 7, 0.3);
}

.modal-icon-warning i {
    color: var(--modal-warning);
}

.modal-icon-info {
    background: linear-gradient(135deg, rgba(23, 162, 184, 0.15), rgba(23, 162, 184, 0.05));
    border: 2px solid rgba(23, 162, 184, 0.3);
}

.modal-icon-info i {
    color: var(--modal-info);
}

.modal-icon-confirm {
    background: linear-gradient(135deg, rgba(7, 120, 133, 0.15), rgba(7, 120, 133, 0.05));
    border: 2px solid rgba(7, 120, 133, 0.3);
}

.modal-icon-confirm i {
    color: var(--modal-primary-600);
}

/* Mensagem */
.modal-message {
    font-size: 16px;
    color: var(--modal-text-dark);
    line-height: 1.6;
    margin-bottom: 32px;
    white-space: pre-wrap;
    font-weight: 500;
}

/* Ações (Botões) */
.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center !important;
}

.modal-btn {
    padding: 12px 32px;
    border: none;
    border-radius: 8px;  /* Padrão do guia: --radius-md */
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 120px;
}

.modal-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(7, 120, 133, 0.2);
}

/* Botão Primário - Gradiente Sapien */
.modal-btn-primary {
    color: white;
    background: linear-gradient(135deg, var(--modal-primary-700), var(--modal-primary-600));
    box-shadow: 0 4px 12px rgba(7, 120, 133, 0.25);
}

.modal-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(7, 120, 133, 0.35);
    background: linear-gradient(135deg, var(--modal-primary-600), var(--modal-primary-700));
}

.modal-btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(7, 120, 133, 0.25);
}

/* Botão Secundário */
.modal-btn-secondary {
    color: var(--modal-text-muted);
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
}

.modal-btn-secondary:hover {
    background: #e2e8f0;
    color: var(--modal-text-dark);
    border-color: #cbd5e1;
}

/* Animações */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes modalSlideIn {
    from {
        transform: translate(-50%, -50%) scale(0.9);
        opacity: 0;
    }

    to {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

/* Responsividade */
@media (max-width: 768px) {
    .modal-container {
        width: 95%;
        max-width: 400px;
    }

    .modal-content {
        padding: 32px 24px;
    }

    .modal-icon {
        width: 64px;
        height: 64px;
    }

    .modal-icon i {
        font-size: 32px;
    }

    .modal-message {
        font-size: 15px;
    }

    .modal-actions {
        flex-direction: column-reverse;
    }

    .modal-btn {
        width: 100%;
    }
}