/* ========================================
   MODAL RESPONSIVO - DESKTOP + MOBILE
   ======================================== */

/* Variáveis do Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    backdrop-filter: blur(6px);
    background: rgba(15, 23, 42, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

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

.modal-container {
    background: white;
    border-radius: 16px;
    box-shadow: 0 40px 100px rgba(15, 23, 42, 0.2);
    max-width: 980px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal-overlay.show .modal-container {
    transform: scale(1);
}

/* Cabeçalho do Modal */
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    border-bottom: 1px solid #e6ecf2;
    background: linear-gradient(180deg, #fffef9, #ffffff);
    border-radius: 16px 16px 0 0;
}

.brand-mini {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.brand-mini img {
    width: 42px;
    height: 42px;
    border-radius: 8px;
}

.brand-mini strong {
    font-weight: 800;
    font-size: 1.1rem;
    color: #0f172a;
}

.modal-subtitle {
    font-size: 0.9rem;
    color: #6b7280;
    margin-top: 0.2rem;
}

.modal-close {
    appearance: none;
    background: transparent;
    border: none;
    color: #6b7280;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: #f3f4f6;
    color: #374151;
}

/* Steps Pills */
.steps-pills {
    display: flex;
    gap: 0.5rem;
    padding: 1rem 1.5rem 0;
}

.step-pill {
    padding: 0.4rem 0.8rem;
    border-radius: 999px;
    border: 1px solid #e6ecf2;
    color: #6b7280;
    font-size: 0.8rem;
    background: white;
    transition: all 0.2s ease;
}

.step-pill.active {
    color: #3a2a17;
    border-color: #ff8a00;
    background: linear-gradient(180deg, #fff5e9, #ffffff);
    font-weight: 700;
}

/* Conteúdo do Modal */
.modal-content {
    padding: 1.5rem;
}

/* Formulário */
.modal-form {
    display: none;
}

.modal-form.active {
    display: block;
}

.hidden {
    display: none !important;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-size: 0.85rem;
    color: #6b7280;
    margin-bottom: 0.4rem;
    font-weight: 600;
}

.form-group input,
.form-group select {
    padding: 0.8rem 1rem;
    border: 1px solid #e6ecf2;
    border-radius: 12px;
    background: white;
    color: #0f172a;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #ff8a00;
    box-shadow: 0 0 0 3px rgba(255, 138, 0, 0.2);
}

.form-note {
    font-size: 0.8rem;
    color: #6b7280;
    margin-top: 0.4rem;
}

/* Botões */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.8rem 1.2rem;
    border-radius: 12px;
    border: 1px solid #e6ecf2;
    background: white;
    color: #0f172a;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
    text-decoration: none;
    font-size: 0.95rem;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.1);
}

.btn-primary {
    background: linear-gradient(135deg, #ff8a00, #ffb347);
    color: #1f1203;
    border: none;
    font-weight: 800;
}

.btn-secondary {
    background: #f8fafc;
    color: #374151;
}

.btn-ghost {
    background: transparent;
    color: #6b7280;
}

.btn-full {
    width: 100%;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

/* Grid de Planos */
.plans-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.plan-card {
    border: 1px solid #e6ecf2;
    border-radius: 16px;
    background: linear-gradient(180deg, #ffffff, #fffefd);
    padding: 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
    transition: all 0.2s ease;
    position: relative;
}

.plan-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 32px rgba(15, 23, 42, 0.1);
}

.plan-card.featured {
    border-color: #ff8a00;
    background: linear-gradient(180deg, #fff5e9, #ffffff);
}

.plan-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.plan-icon {
    font-size: 1.2rem;
}

.plan-badge {
    font-size: 0.7rem;
    background: #fff5e9;
    color: #8a4800;
    padding: 0.3rem 0.6rem;
    border: 1px solid #ffe3c2;
    border-radius: 6px;
    font-weight: 700;
}

.plan-card h4 {
    margin: 0.5rem 0;
    font-size: 1.1rem;
    color: #0f172a;
}

.plan-price {
    font-weight: 900;
    font-size: 1.3rem;
    color: #ff8a00;
    margin-bottom: 0.5rem;
}

.plan-features {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem 0;
    display: grid;
    gap: 0.4rem;
    max-height: 200px;
    overflow-y: auto;
}

.plan-features li {
    font-size: 0.85rem;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* Confirmação */
.confirmation-center {
    display: grid;
    place-items: center;
    text-align: center;
    min-height: 300px;
    padding: 2rem;
}

.confirmation-center img {
    width: 100px;
    height: auto;
    margin-bottom: 1rem;
    filter: drop-shadow(0 6px 16px rgba(255, 138, 0, 0.2));
}

.confirmation-message {
    background: linear-gradient(180deg, #f0fff4, #ffffff);
    border: 1px solid #bee7c4;
    color: #14532d;
    border-radius: 12px;
    padding: 1.5rem;
    font-weight: 600;
    max-width: 600px;
    line-height: 1.6;
}

/* ========================================
   VERSÃO MOBILE (max-width: 768px)
   ======================================== */

@media (max-width: 768px) {
    .modal-overlay {
        padding: 1rem;
        align-items: flex-end;
    }
    
    .modal-container {
        width: 100%;
        max-width: 100%;
        max-height: 95%;
        border-radius: 16px 16px 0 0;
        position: absolute;
        bottom: 0;
        transform: translateY(100%);
        transition: transform 0.3s ease;
    }
    
    .modal-overlay.show .modal-container {
        transform: translateY(0);
    }
    
    .modal-header {
        padding: 1rem;
        border-bottom: 1px solid #f0e7dc;
    }
    
    .brand-mini img {
        width: 32px;
        height: 32px;
    }
    
    .steps-pills {
        padding: 0.5rem 1rem 0;
        overflow-x: auto;
    }
    
    .step-pill {
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    .modal-content {
        padding: 1rem;
        overflow-y: auto;
        max-height: calc(95vh - 120px);
    }
    
    .form-grid {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }
    
    .form-actions {
        flex-direction: column;
        position: sticky;
        bottom: 0;
        background: linear-gradient(180deg, rgba(255,255,255,0), white 30%);
        padding-top: 1rem;
    }
    
    .plans-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 0.5rem;
    }
    
    .plan-card {
        flex: 0 0 85%;
        scroll-snap-align: center;
        min-height: fit-content;
    }
    
    .plan-features {
        max-height: 150px;
    }
    
    .confirmation-center {
        min-height: 250px;
        padding: 1rem;
    }
    
    .confirmation-center img {
        width: 80px;
    }
}

/* ========================================
   VERSÃO MOBILE PEQUENA (max-width: 480px)
   ======================================== */

@media (max-width: 480px) {
    .modal-header {
        padding: 0.8rem;
    }
    
    .brand-mini {
        gap: 0.6rem;
    }
    
    .brand-mini strong {
        font-size: 1rem;
    }
    
    .modal-content {
        padding: 0.8rem;
    }
    
    .form-group input,
    .form-group select {
        padding: 0.7rem 0.8rem;
        font-size: 0.9rem;
    }
    
    .plan-card {
        padding: 1rem;
    }
    
    .plan-features {
        max-height: 120px;
    }
    
    .confirmation-center {
        min-height: 200px;
        padding: 0.8rem;
    }
    
    .confirmation-message {
        padding: 1rem;
        font-size: 0.95rem;
    }
}