/**
 * Estilos CSS para o Frontend do Quiz de Personalidade Financeira
 * Design moderno, responsivo e acessível
 */

/* Reset e configurações base */
.qpf-quiz-container * {
    box-sizing: border-box;
}

/* Container principal do quiz */
.qpf-quiz-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05), 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* Cabeçalho do quiz */
.qpf-quiz-header {
    text-align: center;
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid #f0f0f0;
}

.qpf-quiz-title {
    font-size: 2.25rem;
    font-weight: 700;
    color: #1a365d;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.qpf-quiz-description {
    font-size: 1.125rem;
    color: #666;
    max-width: 600px;
    margin: 0 auto;
}

/* Barra de progresso */
.qpf-progress-container {
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.qpf-progress-bar {
    flex: 1;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.qpf-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
    position: relative;
}

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

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

.qpf-progress-text {
    font-size: 0.875rem;
    font-weight: 600;
    color: #667eea;
    min-width: 60px;
    text-align: right;
}

/* Container das perguntas */
.qpf-questions-container {
    margin-bottom: 2rem;
}

.qpf-question {
    animation: fadeInUp 0.5s ease;
}

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

.qpf-question-number {
    font-size: 0.875rem;
    font-weight: 600;
    color: #667eea;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.qpf-question-text {
    font-size: 1.375rem;
    font-weight: 600;
    color: #1a365d;
    margin-bottom: 1.5rem;
    line-height: 1.4;
}

/* Container das respostas */
.qpf-answers-container {
    display: grid;
    gap: 1rem;
}

.qpf-answer-option {
    display: flex;
    align-items: flex-start;
    padding: 1.25rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fff;
    position: relative;
    overflow: hidden;
}

.qpf-answer-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 1;
}

.qpf-answer-option:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.qpf-answer-option:hover::before {
    opacity: 0.05;
}

.qpf-answer-input {
    margin-right: 1rem;
    margin-top: 0.125rem;
    position: relative;
    z-index: 2;
    accent-color: #667eea;
}

.qpf-answer-text {
    font-size: 1rem;
    color: #4a5568;
    position: relative;
    z-index: 2;
    flex: 1;
}

.qpf-answer-option:has(.qpf-answer-input:checked) {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.qpf-answer-option:has(.qpf-answer-input:checked) .qpf-answer-text {
    color: white;
    font-weight: 600;
}

/* Botões de navegação */
.qpf-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
}

.qpf-btn {
    padding: 0.875rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 120px;
    position: relative;
    overflow: hidden;
}

.qpf-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.5s;
}

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

.qpf-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.qpf-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.qpf-btn-secondary {
    background: #f7fafc;
    color: #4a5568;
    border: 2px solid #e2e8f0;
}

.qpf-btn-secondary:hover {
    background: #edf2f7;
    border-color: #cbd5e0;
}

.qpf-btn-success {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
}

.qpf-btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(72, 187, 120, 0.3);
}

.qpf-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Container do resultado */
.qpf-result-container {
    animation: fadeInUp 0.5s ease;
}

.qpf-loading {
    text-align: center;
    padding: 3rem 0;
}

.qpf-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e2e8f0;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

/* Resultado do perfil */
.qpf-result-profile {
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    border-radius: 12px;
    padding: 2rem;
    margin-top: 2rem;
}

.qpf-profile-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid #e2e8f0;
}

.qpf-profile-image {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.qpf-profile-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.qpf-profile-info {
    flex: 1;
}

.qpf-profile-name {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1a365d;
    margin-bottom: 0.5rem;
}

.qpf-profile-description {
    font-size: 1.125rem;
    color: #4a5568;
}

.qpf-profile-details {
    margin-bottom: 2rem;
}

.qpf-profile-details h4 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1a365d;
    margin-bottom: 1rem;
}

.qpf-profile-detailed-description {
    font-size: 1rem;
    color: #4a5568;
    line-height: 1.7;
}

/* Pontuações por dimensão */
.qpf-dimension-scores {
    margin-bottom: 2rem;
}

.qpf-dimension-scores h4 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1a365d;
    margin-bottom: 1.5rem;
}

.qpf-scores-grid {
    display: grid;
    gap: 1rem;
}

.qpf-score-item {
    background: white;
    padding: 1.25rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.qpf-score-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 0.5rem;
}

.qpf-score-bar {
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.qpf-score-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
    transition: width 1s ease;
}

.qpf-score-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: #667eea;
    text-align: right;
}

/* Ações do resultado */
.qpf-result-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Estados de erro */
.qpf-error {
    background: #fed7d7;
    color: #c53030;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #feb2b2;
    text-align: center;
    font-weight: 500;
}

/* Responsividade */
@media (max-width: 768px) {
    .qpf-quiz-container {
        padding: 1.5rem;
        margin: 1rem;
    }
    
    .qpf-quiz-title {
        font-size: 1.875rem;
    }
    
    .qpf-quiz-description {
        font-size: 1rem;
    }
    
    .qpf-question-text {
        font-size: 1.25rem;
    }
    
    .qpf-profile-header {
        flex-direction: column;
        text-align: center;
    }
    
    .qpf-navigation {
        flex-direction: column;
    }
    
    .qpf-btn {
        width: 100%;
    }
    
    .qpf-result-actions {
        flex-direction: column;
    }
    
    .qpf-progress-container {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .qpf-progress-text {
        text-align: center;
    }
}

@media (max-width: 480px) {
    .qpf-quiz-container {
        padding: 1rem;
        margin: 0.5rem;
    }
    
    .qpf-quiz-title {
        font-size: 1.5rem;
    }
    
    .qpf-answer-option {
        padding: 1rem;
    }
    
    .qpf-profile-name {
        font-size: 1.5rem;
    }
}

/* Animações de entrada */
.qpf-quiz-container {
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Melhorias de acessibilidade */
.qpf-answer-option:focus-within {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

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

/* Modo escuro (opcional) */
@media (prefers-color-scheme: dark) {
    .qpf-quiz-container {
        background: #1a202c;
        color: #e2e8f0;
    }
    
    .qpf-quiz-title {
        color: #e2e8f0;
    }
    
    .qpf-quiz-description {
        color: #a0aec0;
    }
    
    .qpf-question-text {
        color: #e2e8f0;
    }
    
    .qpf-answer-option {
        background: #2d3748;
        border-color: #4a5568;
    }
    
    .qpf-answer-text {
        color: #e2e8f0;
    }
    
    .qpf-result-profile {
        background: #2d3748;
    }
    
    .qpf-score-item {
        background: #2d3748;
    }
}


.qpf-quiz-title {
    text-align: center;
}


/* Estilos para os cards de próximas ações */
.cf-tools { 
    margin-block: 2rem 0; 
}

.cf-tools h2 { 
    font-size: 1.25rem; 
    line-height: 1.3; 
    margin-bottom: 1rem; 
    color: #1a365d;
    font-weight: 600;
}

.cf-grid {
    display: grid; 
    gap: 1rem; 
    grid-template-columns: 1fr;
}

@media (min-width: 768px) {
    .cf-grid { 
        grid-template-columns: repeat(2, minmax(0,1fr)); 
    }
}

.cf-card {
    background: #fff; 
    border-radius: 14px; 
    padding: 1.25rem;
    box-shadow: 0 6px 24px rgba(15,15,40,.06);
    display: flex; 
    flex-direction: column; 
    gap: .5rem;
    border: 1px solid #f0f0f0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cf-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(15,15,40,.12);
}

.cf-card-icon { 
    font-size: 1.5rem; 
    margin-bottom: 0.25rem;
}

.cf-card h3 { 
    font-size: 1.125rem; 
    margin: .25rem 0; 
    color: #1a365d;
    font-weight: 600;
}

.cf-card p { 
    margin: 0; 
    color: #666;
    font-size: 0.95rem;
    line-height: 1.5;
}

.cf-btn {
    margin-top: .5rem; 
    display: inline-block; 
    padding: .625rem .9rem;
    border-radius: 10px; 
    text-decoration: none; 
    font-weight: 600;
    background: #6B4CE6; 
    color: #fff !important; /* Forçando a cor branca */
    transition: transform .08s ease, opacity .2s ease;
    border: none;
    cursor: pointer;
    text-align: center;
    font-size: 0.9rem;
}

.cf-btn:hover { 
    opacity: .95; 
    transform: translateY(-1px); 
    text-decoration: none;
    color: #fff !important; /* Garantindo que fique branco no hover */
}

.cf-tags { 
    display: flex; 
    gap: .5rem; 
    margin: .5rem 0 0; 
    padding: 0; 
    list-style: none; 
    flex-wrap: wrap;
}

.cf-tags li {
    font-size: .75rem; 
    padding: .25rem .5rem; 
    border-radius: 999px;
    background: #5B46D6; /* Fundo roxo */
    color: #fff; /* Texto branco */
    font-weight: 500;
}

/* Responsividade adicional para cards */
@media (max-width: 480px) {
    .cf-card {
        padding: 1rem;
    }
    
    .cf-card h3 {
        font-size: 1rem;
    }
    
    .cf-card p {
        font-size: 0.9rem;
    }
    
    .cf-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }
}

