/* Modal do Plano Família */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
    box-sizing: border-box;
}

.modal-content {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 520px;
    width: 100%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    background: var(--yufin-gradient);
    color: white;
    padding: 24px;
    border-radius: 16px 16px 0 0;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0; /* Header fixo */
    position: relative;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    text-align: center;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
    position: absolute;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.modal-body {
    padding: 20px;
    flex: 1;
    overflow-y: auto;
    /* Scrollbar customizada mais discreta */
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 140, 66, 0.3) transparent;
}

/* Webkit scrollbar customizada para o body */
.modal-body::-webkit-scrollbar {
    width: 6px;
}

.modal-body::-webkit-scrollbar-track {
    background: transparent;
}

.modal-body::-webkit-scrollbar-thumb {
    background: rgba(255, 140, 66, 0.3);
    border-radius: 3px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 140, 66, 0.5);
}

.plan-info {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 20px;
}

.plan-info h3 {
    color: #ea580c;
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 12px 0;
}

.plan-info ul {
    margin: 0;
    padding-left: 20px;
    color: #ea580c;
}

.plan-info li {
    margin-bottom: 4px;
    font-size: 0.9rem;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    color: #374151;
    transition: border-color 0.2s ease;
}

/* Inputs no mesmo padrão visual do select (aplicado ao modal do Plano Escola) */
.form-group input,
.form-group input[type="number"],
.form-group input[type="text"] {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    color: #374151;
    transition: border-color 0.2s ease;
    -moz-appearance: textfield;
}

.form-group input:focus,
.form-group input[type="number"]:focus,
.form-group input[type="text"]:focus {
    outline: none;
    border-color: #ff8c42;
    box-shadow: 0 0 0 3px rgba(255, 140, 66, 0.1);
}

/* Estado de erro para inputs (ex.: quantidade < 50) */
.form-group input.input-error {
    border-color: #ef4444 !important; /* vermelho */
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15) !important;
}

.form-help.help-error {
    color: #ef4444 !important;
}

/* Remover setas do input number (Chrome, Safari, Edge, Opera) */
.form-group input[type="number"]::-webkit-outer-spin-button,
.form-group input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.form-group select:focus {
    outline: none;
    border-color: #ff8c42;
    box-shadow: 0 0 0 3px rgba(255, 140, 66, 0.1);
}

.plan-summary {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}

.plan-summary h3 {
    color: #374151;
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 12px 0;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: #6b7280;
}

.summary-total {
    display: flex;
    justify-content: space-between;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e5e7eb;
    font-weight: 600;
    color: #ff8c42;
    font-size: 1rem;
}

.how-it-works {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}

.how-it-works h3 {
    color: #2563eb;
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 12px 0;
}

.how-it-works ul {
    margin: 0;
    padding-left: 20px;
    color: #2563eb;
}

.how-it-works li {
    margin-bottom: 4px;
    font-size: 0.9rem;
}

.modal-footer {
    padding: 20px 24px 24px;
    display: flex;
    gap: 12px;
    border-top: 1px solid #e5e7eb;
    flex-shrink: 0; /* Footer fixo */
}

.btn-cancel {
    flex: 1;
    padding: 12px 20px;
    border: 2px solid #e5e7eb;
    background: white;
    color: #6b7280;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-cancel:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

.btn-continue {
    flex: 1;
    padding: 12px 20px;
    background: var(--yufin-gradient);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}
.btn-continue:disabled,
.btn-continue.disabled {
    background: #f3f4f6 !important;
    color: #9ca3af !important;
    cursor: not-allowed !important;
    opacity: 0.7 !important;
}

.btn-continue:hover {
    background: var(--yufin-gradient-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 140, 66, 0.3);
}

/* Responsividade */
@media (max-width: 768px) {
    .modal-overlay {
        padding: 16px;
    }
    
    .modal-content {
        max-height: 95vh;
    }
    
    .modal-header {
        padding: 20px;
    }
    
    .modal-header h2 {
        font-size: 1.3rem;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .modal-footer {
        padding: 16px 20px 20px;
        flex-direction: column;
    }
    
    .btn-cancel,
    .btn-continue {
        flex: none;
    }
}

@media (max-width: 480px) {
    .modal-overlay {
        padding: 12px;
    }
    
    .modal-header {
        padding: 16px;
    }
    
    .modal-header h2 {
        font-size: 1.2rem;
    }
    
    .modal-body {
        padding: 16px;
    }
    
    .modal-footer {
        padding: 12px 16px 16px;
    }
}

