.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
}

.modal-overlay.active {
    display: flex !important;
}

.modal-content {
    background: white;
    border-radius: 20px;
    padding: 55px 50px;  /* Aumentado padding para abraçar melhor o conteúdo */
    max-width: 750px;    /* Aumentado para 750px */
    width: 100%;
    max-height: 90vh;
    min-height: 300px;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    gap: 25px;  /* Espaçamento consistente entre elementos */
}

/* Garantir que todos os elementos filhos diretos tenham espaçamento */
.modal-content > * {
    width: 100%;  /* Garantir que todos ocupem a largura total */
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 2rem;
    color: #718096;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    z-index: 1;
}

.modal-close:hover {
    background: #f7fafc;
    color: #2d3748;
}

/* Garantir que o conteúdo do modal tenha espaço adequado */
.modal-content h2,
.modal-content h3 {
    margin-top: 0;
    padding-right: 50px;
    color: #2d3748;
}

.modal-content p {
    line-height: 1.6;
    color: #4a5568;
}

.modal-content button {
    padding: 14px 28px;  /* Aumentado padding dos botões */
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    min-height: 52px;  /* Altura mínima dos botões */
}

/* Estilos específicos para o formulário de checkout */
.modal-content form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.modal-content input[type="text"],
.modal-content input[type="email"],
.modal-content input[type="tel"] {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
}

/* Estilos para o box de detalhes do plano */
#modalPlanDetails {
    background: #f7fafc !important;
    padding: 25px !important;
    border-radius: 12px !important;
    width: 100% !important;
    box-sizing: border-box;
}

/* Estilos para o aviso importante */
.modal-content > div[style*="background"] {
    padding: 20px !important;
    border-radius: 12px !important;
    width: 100% !important;
    box-sizing: border-box;
}

/* Melhorar espaçamento do checkbox e links */
.modal-content label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 0.95rem;
    color: #4a5568;
    line-height: 1.6;
    cursor: pointer;
    padding: 15px;  /* Adicionar padding ao redor do checkbox */
    margin: -15px;  /* Compensar o padding para não afetar layout */
    border-radius: 8px;
    transition: background 0.2s ease;
}

.modal-content label:hover {
    background: #f7fafc;
}

.modal-content label input[type="checkbox"] {
    margin-top: 2px;
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    min-width: 20px;
    min-height: 20px;
    cursor: pointer;
}

.modal-content label a {
    color: #667eea;
    text-decoration: underline;
    transition: color 0.2s ease;
}

.modal-content label a:hover {
    color: #5568d3;
}

/* Garantir que os botões tenham boa apresentação */
#modalButtons {
    display: flex;
    gap: 15px;
    margin-top: 10px;
    width: 100%;
}

#modalButtons button {
    flex: 1;
    min-height: 52px;
}

/* Estilos mobile */
@media (max-width: 768px) {
    .modal-content {
        padding: 40px 35px;  /* Aumentado padding lateral no mobile */
        max-width: 95%;      /* Usar mais espaço disponível */
        max-height: 85vh;
    }
    
    .modal-close {
        top: 15px;
        right: 15px;
    }
    
    #modalButtons {
        flex-direction: column;
    }
    
    #modalButtons button {
        width: 100%;
    }
    
    .modal-content label {
        font-size: 0.9rem;
        padding: 12px;
        margin: -12px;
    }
}

@media (max-width: 480px) {
    .modal-content {
        padding: 35px 25px;
    }
    
    .modal-content label {
        font-size: 0.85rem;
    }
}

/* Estilos para garantir que o container do aviso amarelo fique dentro do modal */
.modal-content > div {
    width: 100% !important;
    box-sizing: border-box !important;
}
