/* Sistema de Steps para Modal de Pagamento */

/* ============================================ */
/* CONTAINER PRINCIPAL */
/* ============================================ */

.modal-steps-container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    overflow-x: hidden;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

/* ============================================ */
/* HEADER COM PROGRESSO */
/* ============================================ */

.modal-steps-header {
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    color: white;
    padding: 32px 24px;
    text-align: center;
    position: relative;
}

.modal-steps-title {
    font-size: 2rem;
    font-weight: 900;
    margin-bottom: 8px;
    line-height: 1.2;
}

.modal-steps-subtitle {
    font-size: 1.125rem;
    opacity: 0.9;
    margin-bottom: 32px;
}

/* Progress Bar */
.modal-progress-container {
    position: relative;
    margin-bottom: 24px;
}

.modal-progress-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    overflow: hidden;
}

.modal-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #fbbf24, #f59e0b);
    border-radius: 3px;
    transition: width 0.5s ease;
    width: 0%;
}

.modal-progress-text {
    position: absolute;
    top: -8px;
    right: 0;
    font-size: 0.875rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 12px;
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

/* ============================================ */
/* STEPS INDICATOR */
/* ============================================ */

.modal-steps-indicator {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 0;
}

.modal-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    opacity: 0.4;
    transition: all 0.3s ease;
    cursor: pointer;
}

.modal-step.active {
    opacity: 1;
}

.modal-step.completed {
    opacity: 1;
}

.modal-step-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.modal-step.active .modal-step-circle {
    background: #fbbf24;
    border-color: #f59e0b;
    color: #78350f;
    transform: scale(1.1);
}

.modal-step.completed .modal-step-circle {
    background: #10b981;
    border-color: #059669;
    color: white;
}

.modal-step.completed .modal-step-circle::before {
    content: '✓';
    font-size: 1.25rem;
}

.modal-step-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
    max-width: 80px;
    line-height: 1.2;
}

/* ============================================ */
/* CONTEÚDO DOS STEPS */
/* ============================================ */

.modal-steps-content {
    padding: 0;
    min-height: 500px;
}

.modal-step-content {
    display: none;
    padding: 40px 32px;
    animation: fadeIn 0.3s ease;
}

.modal-step-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================ */
/* FORMULÁRIO */
/* ============================================ */

.modal-step-form {
    display: grid;
    gap: 24px;
}

.modal-step-section {
    background: #f8fafc;
    padding: 24px;
    border-radius: 12px;
    border-left: 4px solid var(--primary);
}

.section-help {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 20px;
    margin-top: -8px;
}

/* Layout de 2 colunas */
.modal-form-row {
    display: grid;
    gap: 20px;
    margin-bottom: 20px;
}

.modal-form-row-2 {
    grid-template-columns: 1fr 1fr;
}

@media (max-width: 768px) {
    .modal-form-row-2 {
        grid-template-columns: 1fr;
    }
}

.modal-step-section h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-step-section h3::before {
    content: '';
    width: 4px;
    height: 20px;
    background: var(--primary);
    border-radius: 2px;
}

.modal-form-group {
    margin-bottom: 20px;
    position: relative;
}

.modal-form-group label {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.modal-form-group input,
.modal-form-group select,
.modal-form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

.modal-form-group input:focus,
.modal-form-group select:focus,
.modal-form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(95, 36, 159, 0.1);
}

.modal-form-group small {
    display: block;
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-top: 4px;
}

/* ============================================ */
/* BOTÕES DE NAVEGAÇÃO */
/* ============================================ */

.modal-steps-navigation {
    background: #f8fafc;
    padding: 24px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #e5e7eb;
}

.modal-step-btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-step-btn.prev {
    background: white;
    color: var(--text-secondary);
    border-color: #e5e7eb;
}

.modal-step-btn.prev:hover {
    background: #f8fafc;
    border-color: var(--primary);
    color: var(--primary);
}

.modal-step-btn.next {
    background: var(--primary);
    color: white;
}

.modal-step-btn.next:hover {
    background: #7c3aed;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(95, 36, 159, 0.3);
}

.modal-step-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.modal-step-btn svg {
    width: 20px;
    height: 20px;
}

/* ============================================ */
/* RESUMO DE PREÇO */
/* ============================================ */

.modal-price-summary {
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    border: 2px solid #10b981;
    border-radius: 16px;
    padding: 24px;
    margin: 24px 0;
    text-align: center;
}

.modal-price-summary h3 {
    color: #065f46;
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 16px;
}

.modal-price-comparison {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(16, 185, 129, 0.2);
}

.modal-price-old {
    color: #6b7280;
    text-decoration: line-through;
    font-size: 1.125rem;
}

.modal-price-new {
    font-size: 2rem;
    font-weight: 900;
    color: var(--primary);
}

.modal-price-savings {
    background: #fbbf24;
    color: #78350f;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.875rem;
    display: inline-block;
    margin-bottom: 16px;
}

.modal-price-details {
    color: #047857;
    font-size: 1rem;
    font-weight: 600;
}

/* ============================================ */
/* RESPONSIVIDADE */
/* ============================================ */

@media (max-width: 768px) {
    .modal-steps-container {
        margin: 0;
        border-radius: 0;
        height: 100vh;
        display: flex;
        flex-direction: column;
    }
    
    .modal-steps-header {
        padding: 24px 20px;
    }
    
    .modal-steps-title {
        font-size: 1.5rem;
    }
    
    .modal-steps-subtitle {
        font-size: 1rem;
    }
    
    .modal-steps-indicator {
        gap: 8px;
        flex-wrap: wrap;
    }
    
    .modal-step-circle {
        width: 32px;
        height: 32px;
        font-size: 0.875rem;
    }
    
    .modal-step-label {
        font-size: 0.7rem;
        max-width: 60px;
    }
    
    .modal-steps-content {
        flex: 1;
        overflow-y: auto;
    }
    
    .modal-step-content {
        padding: 24px 20px;
    }
    
    .modal-step-section {
        padding: 20px;
    }
    
    .modal-steps-navigation {
        padding: 20px;
        flex-direction: column;
        gap: 16px;
    }
    
    .modal-step-btn {
        width: 100%;
        justify-content: center;
    }
    
    .modal-price-summary {
        padding: 20px;
    }
    
    .modal-price-new {
        font-size: 1.75rem;
    }
}

@media (max-width: 480px) {
    .modal-steps-header {
        padding: 20px 16px;
    }
    
    .modal-steps-title {
        font-size: 1.25rem;
    }
    
    .modal-step-content {
        padding: 20px 16px;
    }
    
    .modal-step-section {
        padding: 16px;
    }
    
    .modal-steps-navigation {
        padding: 16px;
    }
    
    .modal-form-group input,
    .modal-form-group select,
    .modal-form-group textarea {
        padding: 10px 12px;
        font-size: 0.95rem;
    }
}

/* ============================================ */
/* ANIMAÇÕES E ESTADOS */
/* ============================================ */

.modal-step-content.leaving {
    animation: fadeOut 0.2s ease;
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

.modal-step-btn.loading {
    position: relative;
    color: transparent;
}

.modal-step-btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid currentColor;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================ */
/* VALIDAÇÃO E FEEDBACK */
/* ============================================ */

/* Erro Global */
.modal-error-global {
    background: #fee2e2;
    border: 2px solid #ef4444;
    border-radius: 8px;
    padding: 16px;
    margin: 0 24px 24px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #991b1b;
    font-weight: 600;
}

.modal-error-global svg {
    width: 24px;
    height: 24px;
    stroke: #ef4444;
    flex-shrink: 0;
}

/* Validação de campos */
.modal-form-group.error input,
.modal-form-group.error select,
.modal-form-group.error textarea {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.modal-form-group.success input,
.modal-form-group.success select,
.modal-form-group.success textarea {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.modal-form-group.error label {
    color: #ef4444;
}

.modal-form-group .error-message {
    color: #ef4444;
    font-size: 0.875rem;
    margin-top: 4px;
    display: none;
}

.modal-form-group.error .error-message {
    display: block;
}

.modal-form-group .field-feedback {
    color: #10b981;
    font-size: 0.875rem;
    margin-top: 4px;
    display: none;
    font-weight: 600;
}

.modal-form-group.success .field-feedback {
    display: block;
}

/* Auto-save indicator */
.auto-save-indicator {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: rgba(16, 185, 129, 0.95);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 10000;
    pointer-events: none;
}

/* Character counter */
.char-counter {
    display: block;
    text-align: right;
    color: var(--text-secondary);
    font-size: 0.75rem;
    margin-top: 4px;
}

/* ============================================ */
/* ACORDEÃO DE CAMPOS OPCIONAIS */
/* ============================================ */

.optional-fields-accordion {
    margin-top: 24px;
    border: 2px dashed #e5e7eb;
    border-radius: 12px;
    padding: 0;
    background: white;
}

.optional-fields-accordion summary {
    cursor: pointer;
    padding: 16px 20px;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    color: var(--primary);
    user-select: none;
    transition: all 0.3s ease;
}

.optional-fields-accordion summary:hover {
    background: #f8fafc;
}

.optional-fields-accordion summary::-webkit-details-marker {
    display: none;
}

.optional-fields-accordion .accordion-icon {
    width: 20px;
    height: 20px;
    stroke: var(--primary);
    transition: transform 0.3s ease;
}

.optional-fields-accordion[open] .accordion-icon {
    transform: rotate(180deg);
}

.optional-fields-accordion .accordion-content {
    padding: 0 20px 20px 20px;
    animation: fadeIn 0.3s ease;
}

/* ============================================ */
/* RESUMO DE DADOS */
/* ============================================ */

.data-summary {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    display: grid;
    gap: 16px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f3f4f6;
}

.summary-item:last-child {
    border-bottom: none;
}

.summary-label {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.summary-value {
    font-weight: 600;
    color: var(--text-primary);
    text-align: right;
    max-width: 60%;
    word-break: break-word;
}

@media (max-width: 768px) {
    .summary-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .summary-value {
        max-width: 100%;
        text-align: left;
    }
}

/* ============================================ */
/* CHECKBOX CUSTOMIZADO */
/* ============================================ */

.email-confirmation-checkbox {
    background: #fffbeb;
    border: 2px solid #fbbf24;
    border-radius: 12px;
    padding: 20px;
    margin-top: 24px;
}

.checkbox-container {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}

.checkbox-container input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: relative;
    height: 24px;
    width: 24px;
    background-color: white;
    border: 2px solid #d1d5db;
    border-radius: 6px;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.checkbox-container:hover .checkmark {
    border-color: var(--primary);
}

.checkbox-container input:checked ~ .checkmark {
    background-color: var(--primary);
    border-color: var(--primary);
}

.checkmark::after {
    content: "";
    position: absolute;
    display: none;
    left: 7px;
    top: 3px;
    width: 6px;
    height: 11px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-container input:checked ~ .checkmark::after {
    display: block;
}

.checkbox-label {
    flex: 1;
    line-height: 1.5;
    color: #78350f;
    font-size: 0.95rem;
}

.checkbox-label strong {
    color: var(--primary);
}

/* ============================================ */
/* AJUSTES DE PREÇO */
/* ============================================ */

.modal-price-comparison {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
}

.modal-price-label {
    font-weight: 600;
    color: var(--text-secondary);
}

/* ============================================ */
/* MOBILE - AJUSTES FINAIS */
/* ============================================ */

@media (max-width: 480px) {
    .modal-error-global {
        margin: 0 16px 16px 16px;
        padding: 12px;
        font-size: 0.875rem;
    }

    .auto-save-indicator {
        bottom: 16px;
        right: 16px;
        padding: 10px 16px;
        font-size: 0.8125rem;
    }

    .data-summary {
        padding: 16px;
        gap: 12px;
    }

    .email-confirmation-checkbox {
        padding: 16px;
    }

    .checkbox-label {
        font-size: 0.875rem;
    }
}
