/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
    padding: 20px;
    box-sizing: border-box;
}

.modal-content {
    background: var(--card-bg-solid);
    border-radius: 16px;
    padding: 0;
    max-width: 900px;
    width: 95%;
    max-height: 100vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 2px solid var(--border-color);
    animation: slideIn 0.3s ease;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border-radius: 14px 14px 0 0;
}

.modal-header h3 {
    margin: 0;
    color: white;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 24px;
    font-weight: 600;
}

.modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.3s;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.modal-body {
    padding: 0;
    flex: 1;
}

.modal-main-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 0;
    min-height: 400px;
}

.modal-left {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    padding: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    border-right: 1px solid var(--border-color);
}

body.dark-mode .modal-left {
    background: linear-gradient(135deg, #2d3748, #4a5568);
}

.alert-icon {
    width: 80px;
    height: 80px;
    background: var(--warning-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    font-size: 32px;
    color: white;
}

.cnpj-info h4 {
    margin: 0 0 10px 0;
    color: var(--text-color);
    font-size: 16px;
    font-weight: 600;
}

.cnpj-number {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color);
    background: rgba(0, 123, 255, 0.1);
    padding: 10px 15px;
    border-radius: 8px;
    border: 2px dashed var(--primary-color);
}

.modal-right {
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.motivos-section h4,
.solucao-section h4 {
    margin: 0 0 15px 0;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 600;
}

.motivos-grid {
    display: grid;
    gap: 12px;
}

.motivo-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    background: rgba(0, 123, 255, 0.05);
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.motivo-item i {
    color: var(--primary-color);
    font-size: 16px;
    margin-top: 2px;
    flex-shrink: 0;
}

.motivo-item span {
    color: var(--text-color);
    line-height: 1.4;
}

.solucao-content p {
    margin: 0 0 20px 0;
    color: var(--text-light);
    line-height: 1.5;
}

.actions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.btn-sintegra,
.btn-tentar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
    text-align: left;
}

.btn-sintegra {
    background: var(--success-color);
    color: white;
}

.btn-sintegra:hover {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.3);
}

.btn-tentar {
    background: var(--primary-color);
    color: white;
}

.btn-tentar:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 123, 255, 0.3);
}

.btn-sintegra i,
.btn-tentar i {
    font-size: 20px;
    flex-shrink: 0;
}

.btn-sintegra div,
.btn-tentar div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.btn-sintegra strong,
.btn-tentar strong {
    font-size: 14px;
}

.btn-sintegra small,
.btn-tentar small {
    font-size: 11px;
    opacity: 0.9;
    font-weight: 400;
}

.modal-footer {
    padding: 20px 30px;
    border-top: 1px solid var(--border-color);
    text-align: right;
    background: var(--card-bg);
    border-radius: 0 0 14px 14px;
}

.btn-fechar {
    background: #6c757d;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-fechar:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

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

@keyframes slideIn {
    from { 
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to { 
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Responsividade */
@media (max-width: 768px) {
    .modal-content {
        width: 98%;
        max-width: 95%;
        margin: 10px;
    }
    
    .modal-main-content {
        grid-template-columns: 1fr;
    }
    
    .modal-left {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding: 20px;
    }
    
    .modal-right {
        padding: 20px;
    }
    
    .actions-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-header {
        padding: 20px;
    }
    
    .modal-header h3 {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .modal-overlay {
        padding: 10px;
    }
    
    .modal-content {
        width: 100%;
        max-width: 100%;
        margin: 0;
    }
    
    .modal-header {
        padding: 15px;
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .modal-left,
    .modal-right {
        padding: 15px;
    }
}