/* ===============================================
   QUIZ FINANCEIRO - ESTILIZAÇÃO MODERNA
   Design System: Mobile-First & Responsivo
   =============================================== */

/* Reset e base */
* {
    box-sizing: border-box;
}

.quiz-page {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #ffffff;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    color: #1e293b;
    position: relative;
    width: 100%;
}

/* Títulos e fontes maiores com gradiente */
h1, h2, h3, h4, h5, h6 {
    background: linear-gradient(135deg, #3b82f6 0%, #06b6d4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
}

.large-text, .stat-value, .card-content h4 {
    background: linear-gradient(135deg, #3b82f6 0%, #06b6d4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
}

/* Container principal */
.quiz-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 10px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Container fixo para botões de navegação */
.quiz-navigation-fixed {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 600px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    padding: 15px 20px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Espaçamento para conteúdo quando há botões fixos */
.quiz-step {
    padding-bottom: 80px; /* Espaço para os botões fixos */
}

/* ===============================================
   BARRA DE PROGRESSO MODERNA
   =============================================== */
.progress-container {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 
        0 4px 16px rgba(59, 130, 246, 0.08),
        0 2px 8px rgba(59, 130, 246, 0.04);
    border: 1px solid rgba(59, 130, 246, 0.15);
    flex-shrink: 0;
    z-index: 100;
}

.progress-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.progress-logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-logo:hover {
    transform: scale(1.05);
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex: 1;
    font-weight: 600;
    color: #475569;
    font-size: 0.85rem;
}

#progressText {
    font-size: 0.9rem;
    color: #3b82f6;
}

#progressPercent {
    font-size: 1.1rem;
    color: #06b6d4;
    font-weight: 700;
}

.progress-bar-container {
    height: 8px;
    background: #e0f2fe;
    border-radius: 50px;
    overflow: hidden;
    position: relative;
}

.progress-bar {
    height: 100%;
    background: #3b82f6;
    border-radius: 50px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.2) 50%, transparent 100%);
    animation: shimmer 4s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ===============================================
   CARDS DAS ETAPAS
   =============================================== */
.quiz-step {
    display: none;
    flex: 1;
    flex-direction: column;
}

.quiz-step.active {
    display: flex;
}

.quiz-step:not(.active) {
    display: none;
}

.quiz-card {
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.08),
        0 4px 16px rgba(0, 0, 0, 0.04);
    border: 1px solid #e2e8f0;
    overflow: hidden;
    position: relative;
    transform: translateY(0);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.quiz-card:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 25px 70px rgba(0, 0, 0, 0.12),
        0 10px 30px rgba(0, 0, 0, 0.08);
}

/* Header do card */
.quiz-card-header {
    padding: 20px 20px 15px;
    text-align: center;
    position: relative;
    flex-shrink: 0;
}

.step-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background: #3b82f6;
    color: white;
    border-radius: 50%;
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 15px;
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.4);
    position: relative;
}

.step-indicator::after {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    background: #3b82f6;
    border-radius: 50%;
    z-index: -1;
    opacity: 0.2;
    animation: pulse 4s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.2; }
    50% { transform: scale(1.05); opacity: 0.1; }
}

.step-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #3b82f6 0%, #06b6d4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.step-subtitle {
    font-size: 0.9rem;
    color: #475569;
    margin: 0;
    font-weight: 400;
    line-height: 1.3;
}

/* Conteúdo do card */
.quiz-card-content {
    padding: 0 20px 15px;
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

/* Aumenta inputs e fontes para etapas 2+ */
.quiz-step:not(#step1) .input-modern input,
.quiz-step:not(#step1) .input-modern select {
    padding: 18px 16px 8px;
    font-size: 1.1rem;
    border-radius: 12px;
    min-height: 56px;
}

/* Estilos específicos para etapa 14 (lançamentos fixos) - removidos da etapa 6 */
#step14 .quiz-card {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 120px);
}

#step14 .quiz-card-content {
    padding: 20px;
    flex: 1;
    overflow-y: auto;
    scroll-behavior: smooth;
    display: flex;
    flex-direction: column;
}

#step14 .add-recurring-btn {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%) !important;
    color: white !important;
    border: 2px solid #0891b2 !important;
    border-radius: 12px;
    padding: 18px 24px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    margin: 20px 0;
    position: relative;
    z-index: 10;
    opacity: 1 !important;
    visibility: visible !important;
    box-shadow: 0 4px 16px rgba(6, 182, 212, 0.3);
    min-height: 60px;
    flex-shrink: 0;
}

#step14 .add-recurring-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(6, 182, 212, 0.4);
}

#step14 .recurring-container {
    margin: 0;
    min-height: 60px;
    position: relative;
    z-index: 5;
    flex: 1;
    overflow-y: auto;
}

/* Scroll personalizado para etapa 14 */
#step14 .quiz-card-content::-webkit-scrollbar {
    width: 8px;
}

#step14 .quiz-card-content::-webkit-scrollbar-track {
    background: rgba(226, 232, 240, 0.3);
    border-radius: 10px;
}

#step14 .quiz-card-content::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
}

#step14 .quiz-card-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
}

/* Debug: Garantir que o botão seja visível */
.add-recurring-btn {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    z-index: 999 !important;
}

/* Ajustes para cards informativos na etapa 14 */
#step14 .info-card,
#step14 .info-card-success,
#step14 .info-card-warning {
    margin: 15px 0;
    flex-shrink: 0;
}

.quiz-step:not(#step1) .input-modern label {
    font-size: 1rem;
    top: 20px;
    left: 16px;
}

.quiz-step:not(#step1) .input-modern input:focus + label,
.quiz-step:not(#step1) .input-modern input:not(:placeholder-shown) + label,
.quiz-step:not(#step1) .input-modern select:focus + label,
.quiz-step:not(#step1) .input-modern select:not([value=""]) + label {
    top: 10px;
    font-size: 0.8rem;
}

.quiz-step:not(#step1) .step-title {
    font-size: 1.8rem;
    margin-bottom: 12px;
}

.quiz-step:not(#step1) .step-subtitle {
    font-size: 1.1rem;
    margin-bottom: 20px;
}

.quiz-step:not(#step1) .info-card,
.quiz-step:not(#step1) .info-card-success,
.quiz-step:not(#step1) .info-card-warning {
    font-size: 0.95rem;
    padding: 16px;
    margin: 16px 0;
    line-height: 1.5;
}

/* Footer do card - removido para usar botões fixos */
.quiz-card-footer {
    display: none; /* Botões agora são fixos no final da página */
}

/* ===============================================
   INPUTS MODERNOS COM FLOATING LABELS
   =============================================== */
.input-modern {
    position: relative;
    margin-bottom: 15px;
}

.input-modern input,
.input-modern select {
    width: 100%;
    padding: 14px 12px 6px;
    border: 2px solid #e0f2fe;
    border-radius: 10px;
    font-size: 0.95rem;
    background: #ffffff;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    color: #1e293b;
}

.input-modern input:focus,
.input-modern select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
    transform: translateY(-1px);
}

/* Remove background preto dos inputs form-control */
.form-control:focus {
    background-color: #ffffff !important;
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1) !important;
    outline: none !important;
}

.form-control {
    background-color: #ffffff !important;
    border: 2px solid #e0f2fe !important;
    color: #1e293b !important;
}

.input-modern label {
    position: absolute;
    top: 16px;
    left: 12px;
    color: #475569;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    display: flex;
    align-items: center;
    gap: 6px;
}

.input-modern input:focus + label,
.input-modern input:not(:placeholder-shown) + label,
.input-modern select:focus + label,
.input-modern select:not([value=""]) + label {
    top: 8px;
    font-size: 0.7rem;
    color: #3b82f6;
    font-weight: 600;
}

/* ===============================================
   BOTÕES DE MÚLTIPLA ESCOLHA
   =============================================== */
.choice-buttons {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 24px;
}

.choice-btn {
    display: flex;
    align-items: center;
    padding: 20px 24px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(6, 182, 212, 0.08) 100%);
    border: 2px solid rgba(59, 130, 246, 0.2);
    border-radius: 16px;
    color: #1e293b;
    text-decoration: none;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.08);
    backdrop-filter: blur(10px);
}

.choice-btn:hover {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(6, 182, 212, 0.12) 100%);
    border-color: rgba(59, 130, 246, 0.4);
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 32px rgba(59, 130, 246, 0.2);
    color: #1e40af;
}

.choice-btn.selected {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2) 0%, rgba(6, 182, 212, 0.15) 100%);
    border-color: #3b82f6;
    color: #1e40af;
    box-shadow: 0 8px 28px rgba(59, 130, 246, 0.25);
    transform: translateY(-2px) scale(1.01);
    border-width: 3px;
}

.choice-btn.selected::after {
    content: '✓';
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.4rem;
    color: #3b82f6;
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
    animation: checkmark 0.3s ease-in-out;
}

@keyframes checkmark {
    0% {
        opacity: 0;
        transform: translateY(-50%) scale(0.5);
    }
    100% {
        opacity: 1;
        transform: translateY(-50%) scale(1);
    }
}

.choice-icon {
    width: 1.8rem;
    height: 1.8rem;
    margin-right: 16px;
    min-width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.choice-icon svg {
    width: 100%;
    height: 100%;
    stroke: currentColor;
}

.choice-text {
    flex: 1;
    text-align: left;
    line-height: 1.4;
    letter-spacing: -0.01em;
}

/* Efeito de ondulação para botões de escolha */
.choice-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s ease;
    z-index: 0;
}

.choice-btn:hover::before {
    left: 100%;
}

.choice-btn > * {
    position: relative;
    z-index: 1;
}

/* Efeito de pulso ao fazer hover */
.choice-btn:hover {
    animation: pulse 0.6s ease-in-out;
}

@keyframes pulse {
    0% {
        box-shadow: 0 12px 32px rgba(59, 130, 246, 0.3);
    }
    50% {
        box-shadow: 0 12px 32px rgba(59, 130, 246, 0.5);
    }
    100% {
        box-shadow: 0 12px 32px rgba(59, 130, 246, 0.3);
    }
}

/* Transição para resumo do perfil */
.transition-content {
    text-align: center;
    padding: 20px 0;
}

.profile-summary {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Responsividade para botões de escolha */
@media (max-width: 480px) {
    .choice-buttons {
        gap: 14px;
        margin-top: 20px;
    }
    
    .choice-btn {
        padding: 18px 20px;
        font-size: 1rem;
        border-radius: 14px;
    }
    
    .choice-icon {
        width: 1.6rem;
        height: 1.6rem;
        margin-right: 14px;
        min-width: 36px;
    }
    
    .choice-btn:hover {
        transform: translateY(-3px) scale(1.01);
    }
}

/* ===============================================
   TELA DE LOADING COM AVALIAÇÕES
   =============================================== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 50%, #e8f4f8 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    backdrop-filter: blur(10px);
}

.loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.loading-overlay.fade-out {
    opacity: 0;
    transform: scale(0.98);
}

.loading-content {
    text-align: center;
    max-width: 450px;
    padding: 50px 30px;
    color: #f1f5f9;
    background: rgba(15, 23, 42, 0.8);
    border-radius: 24px;
    border: 1px solid rgba(148, 163, 184, 0.1);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(20px);
}

.loading-spinner {
    margin-bottom: 35px;
}

.spinner {
    width: 70px;
    height: 70px;
    border: 3px solid rgba(59, 130, 246, 0.15);
    border-top: 3px solid #3b82f6;
    border-right: 3px solid #06b6d4;
    border-radius: 50%;
    animation: spin 1.2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
    margin: 0 auto;
    position: relative;
}

.spinner::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    border: 2px solid rgba(6, 182, 212, 0.2);
    border-top: 2px solid #06b6d4;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: spin 0.8s linear infinite reverse;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 25px;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    letter-spacing: -0.025em;
}

.evaluation-text {
    font-size: 1.125rem;
    margin-bottom: 35px;
    min-height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #cbd5e1;
    font-weight: 500;
    line-height: 1.6;
    padding: 0 10px;
    text-align: center;
    letter-spacing: -0.01em;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.loading-progress {
    width: 100%;
    height: 6px;
    background: rgba(148, 163, 184, 0.15);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 25px;
    position: relative;
}

.progress-line {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #3b82f6 0%, #06b6d4 50%, #0891b2 100%);
    border-radius: 3px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.4);
}

.progress-line::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: shimmer 2.5s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Animações melhoradas para entrada da tela de loading */
.loading-content {
    transform: translateY(30px) scale(0.95);
    animation: slideInUpScale 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes slideInUpScale {
    to {
        transform: translateY(0) scale(1);
    }
}

/* Efeito de partículas de fundo */
.loading-overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 25% 25%, rgba(59, 130, 246, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(139, 92, 246, 0.1) 0%, transparent 50%);
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-10px) rotate(1deg); }
}

/* Responsividade melhorada para tela de loading */
@media (max-width: 480px) {
    .loading-content {
        padding: 35px 20px;
        max-width: 350px;
        margin: 20px;
    }
    
    .loading-title {
        font-size: 1.5rem;
    }
    
    .evaluation-text {
        font-size: 1rem;
        min-height: 60px;
        padding: 0 5px;
    }
    
    .spinner {
        width: 60px;
        height: 60px;
    }
    
    .spinner::after {
        width: 35px;
        height: 35px;
    }
    
    .loading-progress {
        height: 5px;
    }
}

/* ===============================================
   BOTÕES MODERNOS
   =============================================== */
.btn-quiz {
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn-quiz::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.2) 50%, transparent 100%);
    transition: left 0.5s ease;
}

.btn-quiz:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.5);
}

.btn-secondary {
    background: #f8fafc;
    color: #475569;
    border: 2px solid #e0f2fe;
}

.btn-secondary:hover {
    background: #e0f2fe;
    border-color: #bae6fd;
    transform: translateY(-1px);
}

.btn-success {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    color: white;
    box-shadow: 0 4px 16px rgba(6, 182, 212, 0.4);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(6, 182, 212, 0.5);
}

/* ===============================================
   NAVEGAÇÃO
   =============================================== */
.quiz-navigation {
    display: flex;
    gap: 15px;
}

.quiz-navigation.centered {
    justify-content: center;
}

/* ===============================================
   PÁGINA INICIAL ESPECIAL
   =============================================== */
.initial-page {
    background: linear-gradient(135deg, #3b82f6 0%, #06b6d4 100%);
    color: white;
    position: relative;
    overflow: hidden;
}

.initial-page .quiz-card-header,
.initial-page .quiz-card-content,
.initial-page .quiz-card-footer {
    position: relative;
    z-index: 2;
}

.initial-page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="%23ffffff" opacity="0.05"/><circle cx="75" cy="75" r="1" fill="%23ffffff" opacity="0.05"/><circle cx="50" cy="10" r="0.5" fill="%23ffffff" opacity="0.03"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    z-index: 1;
}

.initial-page .step-indicator {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.initial-page .step-title {
    color: #1e293b;
    -webkit-text-fill-color: transparent;
    background: linear-gradient(135deg, #3b82f6 0%, #06b6d4 100%);
    -webkit-background-clip: text;
    background-clip: text;
    text-shadow: none;
}

.initial-page .step-subtitle {
    color: #334155;
    text-shadow: none;
}

/* Conteúdo da página inicial */
.initial-page .quiz-card-content {
    color: #1e293b;
}

.initial-page .quiz-card-content h2,
.initial-page .quiz-card-content h3,
.initial-page .quiz-card-content h4,
.initial-page .quiz-card-content p {
    color: #1e293b;
    text-shadow: none;
}

.initial-page .quiz-card-content .h4 {
    color: #1e293b;
    text-shadow: none;
}

.initial-page .quiz-card-content .welcome-content {
    color: #1e293b;
}

.initial-page .quiz-card-content .welcome-content h2,
.initial-page .quiz-card-content .welcome-content h3,
.initial-page .quiz-card-content .welcome-content h4 {
    color: #1e293b;
    -webkit-text-fill-color: transparent;
    background: linear-gradient(135deg, #3b82f6 0%, #06b6d4 100%);
    -webkit-background-clip: text;
    background-clip: text;
    text-shadow: none;
}

.initial-page .quiz-card-content .welcome-content p {
    color: #1e293b;
    text-shadow: none;
}

.initial-page .quiz-card-content .welcome-content h2 svg {
    stroke: #3b82f6;
}

/* Ícones flutuantes */
.floating-icon {
    position: absolute;
    width: 2rem;
    height: 2rem;
    opacity: 0.3;
    animation: float 6s ease-in-out infinite;
    z-index: 1;
    color: #3b82f6;
}

.floating-icon svg {
    width: 100%;
    height: 100%;
    stroke: currentColor;
}

.floating-icon:nth-child(1) { animation-delay: 0s; }
.floating-icon:nth-child(2) { animation-delay: 2s; }
.floating-icon:nth-child(3) { animation-delay: 4s; }

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-10px) rotate(2deg); }
}

/* Lista de recursos */
.feature-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.feature-list li {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid rgba(30, 41, 59, 0.1);
    font-weight: 500;
    color: #1e293b;
}

.feature-list li:last-child {
    border-bottom: none;
}

.feature-icon {
    width: 24px;
    height: 24px;
    stroke: #1e293b;
    flex-shrink: 0;
}

/* ===============================================
   CARDS INFORMATIVOS
   =============================================== */
.info-card {
    background: linear-gradient(135deg, #f8fafc 0%, #e0f2fe 100%);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 10px;
    padding: 12px;
    margin: 12px 0;
    font-size: 0.8rem;
    line-height: 1.4;
    color: #475569;
}

.info-card-success {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border: 1px solid rgba(6, 182, 212, 0.3);
    border-radius: 10px;
    padding: 12px;
    margin: 12px 0;
    color: #065f46;
    font-size: 0.8rem;
    line-height: 1.4;
}

.info-card-warning {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 10px;
    padding: 12px;
    margin: 12px 0;
    color: #92400e;
    font-size: 0.8rem;
    line-height: 1.4;
}

/* ===============================================
   LANÇAMENTOS RECORRENTES
   =============================================== */
.recurring-container {
    margin: 20px 0;
    min-height: 50px;
    position: relative;
    z-index: 5;
}

/* Seleção de tipo (Ganho/Gasto) */
.type-selection {
    margin-bottom: 20px;
}

.type-buttons {
    display: flex;
    gap: 10px;
    width: 100%;
}

.type-btn {
    flex: 1;
    padding: 16px 20px;
    border: 2px solid #e0f2fe;
    border-radius: 12px;
    background: #f8fafc;
    color: #475569;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
}

.type-btn:hover {
    border-color: #3b82f6;
    background: #e0f2fe;
    transform: translateY(-2px);
}

.type-btn.selected {
    border-color: #3b82f6;
    background: linear-gradient(135deg, #3b82f6 0%, #06b6d4 100%);
    color: white;
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.3);
}

.type-btn.type-ganho.selected {
    border-color: #06b6d4;
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    box-shadow: 0 4px 16px rgba(6, 182, 212, 0.3);
}

.type-btn.type-gasto.selected {
    border-color: #f56565;
    background: linear-gradient(135deg, #f56565 0%, #e53e3e 100%);
    box-shadow: 0 4px 16px rgba(245, 101, 101, 0.3);
}

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

/* Linha com dia e valor */
.day-value-row {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.day-value-row .input-modern {
    flex: 1;
    margin-bottom: 0;
}

.day-value-row .input-modern:first-child {
    flex: 0.8; /* Dia ocupa menos espaço */
}

.day-value-row .input-modern:last-child {
    flex: 1.2; /* Valor ocupa mais espaço */
}

.recurring-item {
    background: #ffffff;
    border: 2px solid #e0f2fe;
    border-radius: 16px;
    margin-bottom: 20px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.08);
}

.recurring-item:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.15);
}

.recurring-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: linear-gradient(135deg, #3b82f6 0%, #06b6d4 100%);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.recurring-item-header:hover {
    background: linear-gradient(135deg, #2563eb 0%, #0891b2 100%);
}

.recurring-item-title {
    font-weight: 600;
    font-size: 0.9rem;
}

.recurring-item-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.recurring-toggle-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.recurring-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.toggle-icon {
    transition: transform 0.3s ease;
    font-size: 0.8rem;
}

.recurring-remove-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.recurring-remove-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.recurring-item-summary {
    padding: 15px 20px;
    background: linear-gradient(135deg, #f8fafc 0%, #e0f2fe 100%);
    border-bottom: 1px solid #e0f2fe;
    display: block;
}

.summary-content {
    color: #475569;
    font-size: 0.9rem;
    line-height: 1.4;
}

.summary-text {
    display: block;
}

.summary-text strong {
    color: #1e293b;
    font-weight: 600;
}

.summary-text small {
    color: #64748b;
    font-size: 0.8rem;
}

.recurring-fields {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    transition: all 0.3s ease;
}

.add-recurring-btn {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 16px 24px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    margin: 20px 0;
    position: relative;
    z-index: 10;
    opacity: 1;
    visibility: visible;
}

.add-recurring-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(6, 182, 212, 0.4);
}

/* ===============================================
   ANIMAÇÕES BÁSICAS
   =============================================== */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* ===============================================
   VALIDAÇÃO E FEEDBACK
   =============================================== */
.validation-error {
    color: #e53e3e;
    font-size: 0.875rem;
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: fadeIn 0.3s ease;
}

.alert {
    border-radius: 12px;
    border: none;
    padding: 20px;
    margin-bottom: 20px;
}

.alert-danger {
    background: linear-gradient(135deg, #fed7d7 0%, #feb2b2 100%);
    color: #742a2a;
    border: 1px solid #fc8181;
}

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

/* Tablet */
@media (min-width: 768px) {
    .quiz-container {
        padding: 40px;
    }
    
    .quiz-card {
        border-radius: 28px;
    }
    
    .quiz-card-header {
        padding: 40px 40px 30px;
    }
    
    .quiz-card-content {
        padding: 0 40px 40px;
    }
    
    .quiz-card-footer {
        padding: 30px 40px 40px;
    }
    
    .step-title {
        font-size: 2.2rem;
    }
    
    .step-indicator {
        width: 70px;
        height: 70px;
        font-size: 1.8rem;
    }
    
    .recurring-fields {
        gap: 16px;
    }
    
    /* Ajustes para tablet nas etapas 2+ */
    .quiz-step:not(#step1) .input-modern input,
    .quiz-step:not(#step1) .input-modern select {
        padding: 20px 18px 10px;
        font-size: 1.2rem;
        min-height: 60px;
    }
    
    .quiz-step:not(#step1) .input-modern label {
        font-size: 1.1rem;
        top: 22px;
        left: 18px;
    }
    
    .quiz-step:not(#step1) .step-title {
        font-size: 2.4rem;
    }
    
    .quiz-step:not(#step1) .step-subtitle {
        font-size: 1.3rem;
    }
    
    /* Ajustes para tablet na etapa 14 */
    #step14 .quiz-card {
        height: calc(100vh - 140px);
    }
    
    #step14 .quiz-card-content {
        padding: 25px;
    }
}

/* Desktop */
@media (min-width: 1024px) {
    .quiz-container {
        max-width: 800px;
        padding: 60px;
    }
    
    .step2-layout {
        display: grid;
        grid-template-columns: 1fr;
        align-items: center;
        min-height: 500px;
    }
    
    .step2-content {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        text-align: center;
    }
    
    .step2-main-content {
        max-width: 400px;
        width: 100%;
    }
    
    .recurring-fields {
        gap: 18px;
    }
    
    /* Para desktop, dia e valor ficam em linha */
    .day-value-row {
        flex-direction: row;
        gap: 20px;
    }
    
    .day-value-row .input-modern:first-child {
        flex: 0.6; /* Dia menor no desktop */
    }
    
    .day-value-row .input-modern:last-child {
        flex: 1.4; /* Valor maior no desktop */
    }
    
    .quiz-navigation {
        justify-content: space-between;
    }
    
    .quiz-navigation.centered {
        justify-content: center;
    }
    
    /* Ajustes para desktop nas etapas 2+ */
    .quiz-step:not(#step1) .input-modern input,
    .quiz-step:not(#step1) .input-modern select {
        padding: 22px 20px 12px;
        font-size: 1.3rem;
        min-height: 64px;
    }
    
    .quiz-step:not(#step1) .input-modern label {
        font-size: 1.2rem;
        top: 24px;
        left: 20px;
    }
    
    .quiz-step:not(#step1) .step-title {
        font-size: 2.6rem;
    }
    
    .quiz-step:not(#step1) .step-subtitle {
        font-size: 1.4rem;
    }
    
    .quiz-step:not(#step1) .info-card,
    .quiz-step:not(#step1) .info-card-success,
    .quiz-step:not(#step1) .info-card-warning {
        font-size: 1.1rem;
        padding: 20px;
    }
    
    /* Ajustes para desktop na etapa 14 */
    #step14 .quiz-card {
        height: calc(100vh - 160px);
    }
    
    #step14 .quiz-card-content {
        padding: 30px;
    }
}

/* Modo escuro - mantém paleta branco gelo */
@media (prefers-color-scheme: dark) {
    .quiz-page {
        background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 50%, #e8f4f8 100%);
    }
    
    .quiz-card {
        background: rgba(255, 255, 255, 0.98);
        border-color: rgba(59, 130, 246, 0.15);
        color: #1e293b;
    }
    
    .step-title {
        color: #1e293b;
        -webkit-text-fill-color: transparent;
        background: linear-gradient(135deg, #3b82f6 0%, #06b6d4 100%);
        -webkit-background-clip: text;
        background-clip: text;
    }
    
    .input-modern input,
    .input-modern select {
        background: #ffffff;
        border-color: #e0f2fe;
        color: #1e293b;
    }
    
    .info-card {
        background: linear-gradient(135deg, #f8fafc 0%, #e0f2fe 100%);
        border-color: rgba(59, 130, 246, 0.2);
        color: #1e293b;
    }
}

/* ===============================================
   OTIMIZAÇÕES PARA PERFORMANCE
   =============================================== */
.quiz-card,
.btn-quiz,
.input-modern input,
.input-modern select,
.progress-bar,
.step-indicator {
    will-change: transform;
}

/* Suavização de fontes */
body, .quiz-page {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Melhora performance de animações */
.quiz-card {
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Estados de carregamento */
.loading-state {
    pointer-events: none;
    opacity: 0.7;
}

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

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

/* Responsividade para a logo na barra de progresso */
@media (max-width: 480px) {
    .progress-logo {
        width: 100px;
        height: 60px;
    }
    
    .progress-header {
        gap: 12px;
    }
    
    .progress-info {
        font-size: 0.75rem;
    }
    
    #progressText {
        font-size: 0.8rem;
    }
    
    #progressPercent {
        font-size: 0.9rem;
    }
}

@media (min-width: 768px) {
    .progress-logo {
        width: 100px;
        height: 100px;
    }
    
    .progress-header {
        gap: 20px;
    }
}

/* Melhorias para toque e mobile */
@media (max-width: 768px), (hover: none) and (pointer: coarse) {
    .quiz-container {
        padding: 8px;
    }
    
    .quiz-navigation-fixed {
        padding: 12px 15px;
        bottom: 0;
    }
    
    .btn-quiz {
        min-height: 44px;
        padding: 12px 20px;
        font-size: 0.9rem;
    }
    
    .input-modern input,
    .input-modern select {
        min-height: 56px;
        font-size: 16px; /* Evita zoom no iOS */
        padding: 20px 12px 10px;
    }
    
    .input-modern label {
        left: 12px;
        top: 32px;
    }
    
    .input-modern input:focus + label,
    .input-modern input:not(:placeholder-shown) + label,
    .input-modern select:focus + label,
    .input-modern select:not([value=""]) + label {
        top: 18px;
    }
    
    .quiz-card-header {
        padding: 15px 15px 10px;
    }
    
    .quiz-card-content {
        padding: 0 15px 10px;
    }
    
    .step-title {
        font-size: 1.3rem;
    }
    
    .step-subtitle {
        font-size: 0.85rem;
    }
    
    .info-card,
    .info-card-success,
    .info-card-warning {
        padding: 10px;
        margin: 8px 0;
        font-size: 0.75rem;
    }
    
    /* Ajusta espaçamento para mobile */
    .quiz-step {
        padding-bottom: 70px;
    }
    
    /* Ajustes específicos para mobile nas etapas 2+ */
    .quiz-step:not(#step1) .input-modern input,
    .quiz-step:not(#step1) .input-modern select {
        min-height: 64px;
        font-size: 16px; /* Evita zoom no iOS */
        padding: 24px 16px 12px;
    }
    
    /* Ajustes específicos para mobile na etapa 14 */
    #step14 .quiz-card {
        min-height: calc(100vh - 140px) !important;
        max-height: none !important;
        height: auto !important;
        margin: 0;
    }
    
    #step14 .quiz-card-content {
        padding: 12px !important;
        flex: 1 !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        display: flex !important;
        flex-direction: column !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    #step14 .recurring-container {
        margin: 0;
        padding-bottom: 10px;
        flex: 1;
        min-height: 60px;
    }
    
    #step14 .add-recurring-btn {
        margin: 15px 0 !important;
        padding: 16px 20px !important;
        font-size: 1rem !important;
        min-height: 50px !important;
        flex-shrink: 0 !important;
        position: relative !important;
        z-index: 10 !important;
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    #step14 .info-card,
    #step14 .info-card-success,
    #step14 .info-card-warning {
        margin: 10px 0 !important;
        padding: 12px !important;
        font-size: 0.8rem !important;
        flex-shrink: 0 !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    /* Ajustes para itens de lançamento no mobile */
    #step14 .recurring-item {
        margin-bottom: 15px;
        border-radius: 12px;
    }
    
    /* Ajustes para botões de tipo no mobile */
    .type-btn {
        padding: 14px 16px;
        font-size: 0.9rem;
        gap: 6px;
    }
    
    .type-icon {
        font-size: 1rem;
    }
    
    /* Ajustes para linha dia/valor no mobile */
    .day-value-row {
        flex-direction: row; /* Mantém lado a lado no mobile também */
        gap: 12px;
    }
    
    .day-value-row .input-modern {
        flex: 1;
        margin-bottom: 0;
    }
    
    .day-value-row .input-modern:first-child {
        flex: 0.7; /* Dia um pouco menor no mobile */
    }
    
    .day-value-row .input-modern:last-child {
        flex: 1.3; /* Valor um pouco maior no mobile */
    }
    
    #step14 .recurring-item-header {
        padding: 12px 15px;
        font-size: 0.9rem;
    }
    
    #step14 .recurring-fields {
        padding: 15px;
        gap: 15px;
        display: flex;
        flex-direction: column;
    }
    
    #step14 .recurring-fields .input-modern {
        margin-bottom: 0;
    }
    
    #step14 .recurring-fields .input-modern input,
    #step14 .recurring-fields .input-modern select {
        min-height: 56px;
        font-size: 16px;
        padding: 22px 14px 10px;
    }
    
    #step14 .recurring-fields .input-modern label {
        font-size: 0.85rem;
        top: 34px;
        left: 14px;
    }
    
    /* Ajustes para resumo no mobile */
    #step14 .recurring-item-summary {
        padding: 12px 15px;
        font-size: 0.85rem;
    }
    
    #step14 .recurring-item-header {
        padding: 12px 15px;
    }
    
    #step14 .recurring-item-actions {
        gap: 6px;
    }
    
    #step14 .recurring-toggle-btn,
    #step14 .recurring-remove-btn {
        width: 28px;
        height: 28px;
        font-size: 0.9rem;
    }
    
    /* Garantir que o scroll funcione no mobile */
    #step14 .quiz-card-content {
        position: relative;
        z-index: 1;
    }
    
    /* Ajustar espaçamento para botões fixos no mobile */
    .quiz-step {
        padding-bottom: 60px;
    }
    
    #step14 {
        padding-bottom: 0;
    }
    
    .quiz-step:not(#step1) .input-modern label {
        top: 36px;
        left: 16px;
        font-size: 0.9rem;
    }
    
    .quiz-step:not(#step1) .step-title {
        font-size: 1.5rem;
    }
    
    .quiz-step:not(#step1) .step-subtitle {
        font-size: 1rem;
    }
}

/* Reduz animações para usuários que preferem movimento reduzido */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .floating-emoji {
        animation: none;
    }
    
    .progress-bar::after {
        animation: none;
    }
    
    .step-indicator::after {
        animation: none;
    }
}

/* ===============================================
   LOADING STATES
   =============================================== */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.15em;
}

.spinner-border {
    display: inline-block;
    width: 2rem;
    height: 2rem;
    vertical-align: text-bottom;
    border: 0.25em solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spinner-border 0.75s linear infinite;
}

@keyframes spinner-border {
    to {
        transform: rotate(360deg);
    }
}

/* ===============================================
   ACESSIBILIDADE
   =============================================== */
.quiz-card:focus-within {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

.btn-quiz:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

.input-modern input:focus,
.input-modern select:focus {
    outline: none; /* Já tem box-shadow personalizado */
}

/* Alto contraste para melhor acessibilidade */
@media (prefers-contrast: high) {
    .quiz-card {
        border-width: 3px;
    }
    
    .btn-quiz {
        border-width: 2px;
        border-style: solid;
    }
    
    .btn-primary {
        border-color: #4c51bf;
    }
    
    .btn-secondary {
        border-color: #2d3748;
    }
}

