/* Importando uma fonte do Google para um visual mais profissional */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;700&display=swap');

/* --- Estrutura Principal de Todos os Módulos (Quiz, Pagamento, Resultado) --- */
#quiz-app-container,
#payment-section,
#result-section {
    font-family: 'Montserrat', sans-serif;
    max-width: 700px;
    margin: 40px auto;
    background-color: #ffffff;
    border-radius: 12px;
    padding: 30px 40px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    border: 1px solid #e9ecef;
}

/* --- ESTILOS DO MOTOR DO QUIZ --- */

/* Cabeçalho da Pergunta */
.quiz-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f1f3f5;
}

.quiz-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: #212529;
    margin-bottom: 10px;
}

.quiz-header p {
    font-size: 14px;
    color: #868e96;
    margin: 0;
}

/* Botões de Opções de Resposta */
.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.quiz-option-btn {
    width: 100%;
    padding: 18px 25px;
    background-color: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    text-align: left;
    font-family: 'Montserrat', sans-serif;
    font-size: 16px;
    font-weight: 500;
    color: #495057;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.quiz-option-btn:hover {
    background-color: #e9ecef;
    border-color: #adb5bd;
    color: #212529;
    font-weight: bold;
}

.quiz-option-btn.selected {
    background-color: #e6f7ff;
    border-color: #1890ff;
    color: #1890ff;
    font-weight: 700;
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
}

/* Botões de Navegação (Anterior/Próximo) */
.quiz-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #f1f3f5;
}

#prev-btn, #next-btn {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

#prev-btn {
    background-color: #f1f3f5;
    color: #495057;
}

#prev-btn:hover {
    background-color: #dee2e6;
}

#prev-btn:disabled {
    background-color: #f8f9fa;
    color: #adb5bd;
    cursor: not-allowed;
}

#next-btn {
    background-color: #007bff;
    color: #ffffff;
}

#next-btn:hover {
    background-color: #0056b3;
}


/* --- NOVA SEÇÃO: ESTILOS DE PAGAMENTO E RESULTADO --- */

/* Textos da seção de pagamento */
#payment-section h2 {
    font-size: 24px;
    font-weight: 700;
    color: #212529;
    margin-bottom: 10px;
}

#payment-section p {
    font-size: 16px;
    color: #868e96;
    margin-bottom: 30px;
}

/* Container do formulário da Stripe */
#payment-element {
    margin-bottom: 25px;
}

/* Botão de Pagar */
#submit-payment-button {
    width: 100%;
    padding: 15px 30px;
    border: none;
    border-radius: 8px;
    background-color: #28a745; /* Verde para indicar ação positiva/segura */
    color: #ffffff;
    font-family: 'Montserrat', sans-serif;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

#submit-payment-button:hover {
    background-color: #218838; /* Verde mais escuro no hover */
}

/* Mensagem de erro do pagamento */
#payment-message {
    margin-top: 15px;
    color: #dc3545; /* Vermelho para erros */
    font-size: 14px;
    font-weight: 500;
}

/* Seção de Resultado Final */
#result-section {
    text-align: center;
}

#result-section h2 {
    font-size: 32px;
    font-weight: 700;
    color: #212529;
    margin-bottom: 15px;
}

#result-section p {
    font-size: 18px;
    color: #495057;
    line-height: 1.6;
}

/* Estilo do número da pontuação */
#result-section p strong {
    font-size: 1.2em;
    color: #007bff; /* Azul para destaque */
    font-weight: 700;
}


/* --- RESPONSIVIDADE (JÁ INCLUÍDA ANTES) --- */
@media (max-width: 768px) {
    #quiz-app-container,
    #payment-section,
    #result-section {
        margin: 20px 15px;
        padding: 20px;
    }

    .quiz-header h2,
    #payment-section h2,
    #result-section h2 {
        font-size: 22px;
    }

    .quiz-option-btn,
    #payment-section p,
    #result-section p {
        font-size: 15px;
    }
    
    .quiz-option-btn {
        width: 100%;
        padding: 18px 25px;
        background-color: #f8f9fa;
        border: 2px solid #dee2e6;
        border-radius: 8px;
        text-align: left;
        font-family: 'Montserrat', sans-serif;
        font-size: 16px;
        font-weight: 500;
        color: #495057;
        cursor: pointer;
        transition: all 0.2s ease-in-out;
    }

    .quiz-option-btn:hover {
        background-color: #f8f9fa;
        border-color: #dee2e6;
        color: #495057;
        font-weight: 500;
    }
}


/* --- NOVA SEÇÃO: TELA INICIAL DO QUIZ --- */

.quiz-start-screen {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    animation: fadeIn 0.5s ease-in-out; /* Efeito de entrada suave */
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.start-title {
    font-size: 28px;
    font-weight: 700;
    color: #212529;
    margin-bottom: 15px;
}

.start-description {
    font-size: 16px;
    color: #495057;
    line-height: 1.6;
    max-width: 500px; /* Limita a largura do texto para melhor leitura */
    margin-bottom: 30px;
}

#start-quiz-btn {
    padding: 15px 40px;
    border: none;
    border-radius: 8px;
    background-color: #007bff;
    color: #ffffff;
    font-family: 'Montserrat', sans-serif;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.2);
}

#start-quiz-btn:hover {
    background-color: #0056b3;
    transform: translateY(-2px); /* Efeito de elevação ao passar o mouse */
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.3);
}


/* --- ADIÇÃO: ESTILOS PARA BARRA DE PROGRESSO E ANIMAÇÕES --- */

/* Container da barra de progresso */
.quiz-progress-bar {
    width: 100%;
    height: 8px;
    background-color: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 30px;
}

/* Barra interna que se preenche */
.quiz-progress-bar-inner {
    height: 100%;
    width: 0%; /* Começa com 0% */
    background-color: #007bff; /* Azul, combinando com os botões */
    border-radius: 4px;
    transition: width 0.4s ease-in-out; /* Animação suave de preenchimento */
}

/* Animação para a pergunta aparecer suavemente */
.question-fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

/* Keyframes da animação (já tínhamos, mas garantindo que está aqui) */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* --- ADIÇÃO: ESTILOS PARA O SPINNER DE CARREGAMENTO NO BOTÃO --- */

/* Estilo do botão quando está em modo de carregamento */
#submit-payment-button.loading {
    position: relative;
    color: transparent !important; /* Esconde o texto do botão */
    cursor: wait;
}

/* Cria o spinner usando bordas */
#submit-payment-button.loading::after {
    content: '';
    display: block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.5);
    border-top-color: #ffffff;
    border-radius: 50%;
    
    /* Posiciona o spinner no centro do botão */
    position: absolute;
    left: 50%;
    top: 50%;
    margin-left: -10px; /* Metade da largura */
    margin-top: -10px; /* Metade da altura */

    /* Animação de rotação */
    animation: spin 0.8s linear infinite;
}

/* Animação de rotação do spinner */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* --- ADIÇÃO: ESTILOS PARA A SEÇÃO DE COMPARTILHAMENTO --- */

/* Container da seção de compartilhamento */
.quiz-share-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid #e9ecef;
    text-align: center;
}

.quiz-share-section p {
    font-size: 16px;
    font-weight: 500;
    color: #495057;
    margin-bottom: 20px;
}

.share-buttons-container {
    display: flex;
    justify-content: center;
    gap: 15px; /* Espaço entre os botões */
}

.share-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 50%; /* Deixa os botões redondos */
    color: #ffffff;
    font-size: 24px;
    text-decoration: none;
    transition: all 0.2s ease-in-out;
}

.share-button:hover {
    transform: translateY(-3px);
    opacity: 0.9;
}

/* Cores específicas para cada rede social */
.share-button.facebook {
    background-color: #1877F2;
}

.share-button.twitter {
    background-color: #14171A; /* Cor preta do X */
}

.share-button.whatsapp {
    background-color: #25D366;
}

/* Ícones SVG para os botões (para não dependermos de fontes externas) */
.share-button svg {
    width: 24px;
    height: 24px;
    fill: #ffffff; /* Cor branca dos ícones */
}


/* --- ADIÇÃO: ESTILOS PARA CAPTURA DE E-MAIL --- */
.quiz-email-capture {
    margin-bottom: 25px;
    text-align: left;
}
.quiz-email-capture label {
    display: block;
    font-weight: 500;
    color: #495057;
    margin-bottom: 8px;
}
.quiz-email-capture input[type="email"] {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 16px;
    font-family: 'Montserrat', sans-serif;
    box-sizing: border-box; /* Garante que o padding não aumente a largura */
}
#submit-payment-button:disabled {
    background-color: #a0a0a0;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* --- ADIÇÃO: ESTILOS PARA O RELATÓRIO DETALHADO (QI + CATEGORIAS) --- */

/* Container da pontuação de QI */
.qi-score-display {
    margin: 25px auto;
    width: 150px;
    height: 150px;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.qi-score-display span {
    font-size: 48px;
    font-weight: 700;
    color: #007bff;
}

.qi-score-display p {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    color: #495057;
}

/* Aviso de isenção de responsabilidade sobre o QI */
.qi-disclaimer {
    font-size: 12px;
    font-style: italic;
    color: #adb5bd;
    margin-top: -10px;
    margin-bottom: 30px;
}

/* Container para a lista de categorias */
.results-breakdown {
    list-style: none;
    padding: 0;
    margin: 30px 0;
    text-align: left;
    border-top: 1px solid #e9ecef;
}

/* Cada item da lista (cada categoria) */
.category-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 10px;
    border-bottom: 1px solid #e9ecef;
}

/* Nome da categoria (ex: Raciocínio Lógico) */
.category-name {
    font-weight: 500;
    color: #495057;
    font-size: 16px;
}

/* Pontuação da categoria (ex: 9 de 10) */
.category-score {
    font-weight: 700;
    color: #007bff;
    font-size: 16px;
    background-color: #e6f7ff;
    padding: 5px 12px;
    border-radius: 6px;
}