/* Definição de variáveis de cor para a paleta do site */
:root {
    --cor-laranja: #f47d30;
    --cor-verde-agua: #41c9c3;
    --cor-cinza-escuro: #54534a;
    --cor-cinza-claro: #f4f4f4;
    --cor-branco: #ffffff;
    --cor-texto: #333;
}

/* Estilos de base para a página */
body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background-color: var(--cor-cinza-claro);
    color: var(--cor-texto);
}

/* Estilos para o cabeçalho global */
header {
    background-color: var(--cor-branco);
    padding: 20px 40px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border-bottom: 1px solid #eee;
}
.header-content { max-width: 1200px; margin: auto; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 20px; }
.logos { display: flex; align-items: center; }
.main-logo { height: 45px; }
.titles { text-align: right; }
.titles h1 { margin: 0; font-size: 1.8em; color: var(--cor-cinza-escuro); }
.titles p { margin: 0; font-weight: 400; color: var(--cor-laranja); }

/* Contêiner principal da aplicação */
#app-container {
    max-width: 950px;
    margin: 40px auto;
    background: var(--cor-branco);
    padding: 0; 
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}
h2 { color: var(--cor-cinza-escuro); border-bottom: 2px solid var(--cor-laranja); padding-bottom: 10px; }
h3 { color: var(--cor-cinza-escuro); }

/* --- PÁGINA DE BOAS-VINDAS --- */
#welcome-section {
    background-color: var(--cor-branco);
}
.welcome-container {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr; 
    align-items: stretch; 
    gap: 0; 
    padding: 0; 
    min-height: 450px; 
}
.welcome-text {
    padding: 60px 40px; 
}
.welcome-text h2 {
    font-size: 2.2em;
    line-height: 1.3;
    color: var(--cor-cinza-escuro);
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 20px;
}
.welcome-text p {
    font-size: 1.1em;
    color: #666;
    margin-bottom: 30px;
}
#start-button-welcome { 
    display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 16px 30px; font-size: 1.1em; font-weight: 600; color: var(--cor-branco); letter-spacing: 0.5px; background: linear-gradient(45deg, #f7954e, var(--cor-laranja)); border: none; border-radius: 8px; cursor: pointer; box-shadow: 0 4px 15px rgba(244, 125, 48, 0.3); transition: transform 0.3s ease, box-shadow 0.3s ease, filter 0.3s ease;
}
#start-button-welcome svg { transition: transform 0.3s ease; }
#start-button-welcome:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(244, 125, 48, 0.4); filter: brightness(1.1); }
#start-button-welcome:hover svg { transform: translateX(5px); }

.welcome-graphic {
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden; 
    border-top-right-radius: 10px; 
    border-bottom-right-radius: 10px; 
}
.welcome-graphic .welcome-image { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
    display: block; 
    border-radius: 0; 
    box-shadow: none; 
}
.disclaimer-box {
    background-color: #f8f9fa;
    padding: 20px 40px;
    border-top: 1px solid #eee;
    border-bottom-left-radius: 10px; 
    border-bottom-right-radius: 10px; 
}
.disclaimer-box p {
    margin: 0;
    font-size: 0.8em;
    color: #666;
    text-align: center;
}
.disclaimer-box a {
    color: var(--cor-laranja);
    text-decoration: underline;
}

/* Padding para as outras seções */
#form-section, #user-data-section, #results-section {
    padding: 40px;
}

/* Estilos para o Questionário Interativo (Wizard) */
#overall-progress-container { 
    margin-bottom: 30px; 
    padding-bottom: 20px; 
    border-bottom: 1px solid #eee; 
    position: sticky;
    top: 0;
    background-color: var(--cor-branco);
    z-index: 100;
    padding-top: 20px;
    margin-top: -40px;
    margin-left: -40px;
    margin-right: -40px;
}
#overall-progress-container h3 {
    padding: 0 40px;
    margin-bottom: 20px;
}
#steps-container { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 0 40px;
}
.step { 
    display: flex; 
    align-items: center; 
    flex-direction: column; 
    color: #999; 
    font-size: 0.8em; 
    position: relative; 
    text-align: center; 
}
.step .step-circle { 
    width: 30px; 
    height: 30px; 
    border-radius: 50%; 
    background-color: #e0e0e0; 
    border: 2px solid #ccc; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    font-weight: bold; 
    margin-bottom: 5px; 
    transition: background-color 0.4s ease, border-color 0.4s ease, color 0.4s ease; 
}
.step span {
    display: none;
}
.step.active .step-circle { 
    background-color: var(--cor-laranja); 
    color: white; 
    border-color: var(--cor-laranja); 
}
.step.completed .step-circle { 
    background-color: var(--cor-verde-agua); 
    color: white; 
    border-color: var(--cor-verde-agua); 
}
.form-step-card { display: none; background-color: #fdfdfd; border: 1px solid #e9eef3; border-radius: 10px; padding: 25px; margin-bottom: 20px; }
.form-step-card.active-step { display: block; }
.sticky-card-header { 
    position: sticky;
    top: 130px;
    background-color: var(--cor-branco); 
    padding: 20px 20px 15px 20px; 
    margin: -25px -25px 10px -25px; 
    z-index: 90;
    border-bottom: 1px solid #eee; 
    box-shadow: 0 2px 5px rgba(0,0,0,0.03); 
    border-radius: 10px 10px 0 0;
}
.category-progress-bar { background-color: #e9eef3; border-radius: 5px; height: 8px; overflow: hidden; margin-top: 10px; }
.category-progress-bar-inner { background-color: var(--cor-laranja); border-radius: 5px; transition: width 0.3s ease-in-out; height: 100%; width: 0%;}
.category-progress-text { font-size: 0.9em; color: #555; margin-top: 5px; text-align: right; }
#form-navigation { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
#form-navigation button { padding: 12px 30px; font-size: 1em; font-weight: bold; color: white; border: none; border-radius: 5px; cursor: pointer; transition: filter 0.3s, opacity 0.3s, background-color 0.3s; }
#prev-button { background-color: #ffc107; color: #212529; margin-right: auto; }
#prev-button:hover { filter: brightness(1.1); }
#next-button { background-color: var(--cor-laranja); }
#next-button:hover { filter: brightness(1.1); }
#next-button:disabled { background-color: #aaa; cursor: not-allowed; opacity: 0.7; }

/* Estilo para o botão de submissão desabilitado (cinza) */
#submit-button { 
    background-color: #aaa; 
    cursor: not-allowed; 
    opacity: 0.7; 
}
/* Estilo para o botão de submissão habilitado (verde) */
#submit-button.enabled { 
    background-color: var(--cor-verde-agua); 
    cursor: pointer; 
    opacity: 1; 
}
#submit-button.enabled:hover { 
    filter: brightness(1.1); 
}


.category-header { background-color: #f8f9fa; padding: 10px 10px; margin-top: 20px; font-weight: 600; display: grid; grid-template-columns: 2fr repeat(3, 1fr); align-items: center; border-bottom: 2px solid #dee2e6; font-size: 0.9em; color: var(--cor-cinza-escuro); }
.category-header div { text-align: center; }
.question { margin: 0; padding: 20px 10px; display: grid; grid-template-columns: 2fr repeat(3, 1fr); align-items: center; border-bottom: 1px solid #eee; transition: background-color 0.2s; }
.question:last-child { border-bottom: none; }
.question:nth-child(even) { background-color: #fdfdfd; }
.question p { font-weight: 400; margin: 0; padding-right: 20px; font-size: 1em; }
.options-container { text-align: center; }
.options-container input[type="radio"] { margin: 0; width: 20px; height: 20px; cursor: pointer; accent-color: var(--cor-laranja); }


/* Estilos para a seção de dados do usuário */
.user-data-header { text-align: center; margin-bottom: 30px; }
.user-data-header h2 { border: none; }
.user-data-header p { font-size: 1.1em; color: #666; max-width: 500px; margin: 0 auto; }
#user-data-form { max-width: 550px; margin: 0 auto; display: grid; gap: 20px;}
.input-group { display: flex; flex-direction: column; }
.input-group label { font-weight: 600; margin-bottom: 8px; color: var(--cor-cinza-escuro); }
.input-group input { box-sizing: border-box; width: 100%; padding: 12px; border: 1px solid #ccc; border-radius: 5px; font-size: 1em; font-family: 'Poppins', sans-serif; }
.input-group input:focus { outline: none; border-color: var(--cor-laranja); box-shadow: 0 0 0 2px rgba(244, 125, 48, 0.2); }
#view-results-button { padding: 16px; font-size: 1.2em; font-weight: 600; color: var(--cor-branco); background: var(--cor-verde-agua); border: none; border-radius: 8px; cursor: pointer; transition: filter 0.3s; margin-top: 10px; }
#view-results-button:hover:enabled { filter: brightness(1.1); }
#view-results-button:disabled { background: #aaa; cursor: not-allowed; opacity: 0.7; }
.error-message { color: #c82333; border: 1px solid #dc3545; background-color: #f8d7da; border-radius: 5px; padding: 10px; margin-top: 10px; }

/* Estilos para o Dashboard de Resultados */
.results-header { background: linear-gradient(45deg, var(--cor-laranja), #f7954e); color: white; padding: 25px 30px; margin: -40px -40px 30px -40px; } 
.results-header h2 { color: white; margin: 0; font-size: 1.8em; font-weight: 600; border: none; }
.results-header p { margin: 5px 0 0; font-size: 1.1em; opacity: 0.9; }
.score-box-container { display: flex; flex-wrap: wrap; gap: 30px; background-color: var(--cor-cinza-claro); padding: 30px; border-radius: 10px; margin-bottom: 30px; }
.score-box { flex: 1; min-width: 200px; padding: 30px 20px; border-radius: 10px; text-align: center; color: var(--cor-branco); display: flex; flex-direction: column; justify-content: center; }
.score-box h3 { color: var(--cor-branco); font-size: 1.1em; margin: 0 0 10px 0; font-weight: 600; }
.score-box .total-score-value { font-size: 4.5em; font-weight: 700; line-height: 1; }
.score-green { background: #28a745; }
.score-yellow { background: #ffc107; color: var(--cor-cinza-escuro); }
.score-red { background: #dc3545; }
.score-breakdown-chart { flex: 2; min-width: 300px; display: flex; flex-direction: column; }
.score-breakdown-chart h4 { margin: 0 0 15px 0; color: var(--cor-cinza-escuro); }
.chart-container { display: flex; justify-content: space-around; align-items: flex-end; height: 100%; gap: 15px; }
.chart-bar-item { flex: 1; text-align: center; }
.bar-wrapper { height: 120px; background-color: #e9e9e9; border-radius: 5px; display: flex; align-items: flex-end; }
.bar { width: 100%; background-color: var(--cor-verde-agua); border-radius: 5px; transition: height 0.5s ease-out; }
.bar-label { font-size: 0.75em; margin-top: 8px; font-weight: 600; color: #666; }
#maturity-comment-container { background: #fdfdfd; border: 1px solid #e0e0e0; padding: 25px; margin-bottom: 30px; border-left: 5px solid var(--cor-verde-agua); border-radius: 8px; }
.results-grid { display: grid; grid-template-columns: 1fr; gap: 25px; }
.result-card-redesigned { background-color: var(--cor-branco); border-radius: 12px; box-shadow: 0 4px 15px rgba(0,0,0,0.08); display: grid; grid-template-columns: 150px 1fr; align-items: start; overflow: hidden; }
.score-value-large { font-size: 3.5em; font-weight: 700; color: var(--cor-laranja); background-color: var(--cor-cinza-claro); height: 100%; display: flex; align-items: flex-start; justify-content: center; padding-top: 20px; box-sizing: border-box; }
.card-content-right { padding: 20px; }
.card-header-redesigned { display: flex; align-items: center; margin-bottom: 15px; }
.card-header-redesigned .icon svg { width: 40px; height: 40px; margin-right: 15px; fill: var(--cor-cinza-escuro); }
.card-header-redesigned h4 { margin: 0; font-size: 1.5em; color: var(--cor-cinza-escuro); }
.progress-bar-container { background-color: #e9eef3; border-radius: 8px; height: 16px; width: 100%; overflow: hidden; }
.progress-bar { height: 100%; border-radius: 8px; transition: width 0.5s ease-in-out; }
.progress-bar-green { background: linear-gradient(90deg, #28a745, #218838); }
.progress-bar-yellow { background: linear-gradient(90deg, #ffc107, #e0a800); }
.progress-bar-red { background: linear-gradient(90deg, #dc3545, #c82333); }
.observations-section { margin-top: 20px; padding-top: 20px; border-top: 1px solid #e9eef3; }
.observations-section h5 { margin-top: 0; font-size: 1.1em; color: #333; }
.no-observations { padding: 20px; background-color: #e2fdfb; border: 1px solid var(--cor-verde-agua); color: #0c5460; border-radius: 8px; text-align: center; }

/* Bloco de Chamada para Ação (CTA) e Botões Finais */
#download-container { margin-top: 40px; }
#download-button { width: 100%; padding: 15px; font-size: 1.1em; font-weight: bold; color: white; border: none; border-radius: 5px; cursor: pointer; transition: filter 0.3s; background-color: var(--cor-verde-agua); }
#download-button:hover { filter: brightness(1.1); }
.cta-block { margin-top: 40px; padding: 30px; border: 2px dashed var(--cor-laranja); border-radius: 10px; text-align: center; background-color: #fffaf6; }
.cta-block img { max-height: 70px; margin-bottom: 30px; }
.cta-block h4 { font-size: 1.3em; color: var(--cor-cinza-escuro); margin: 20px 0 10px 0; }
.cta-block p { margin: 0 0 20px 0; }
.cta-block hr.cta-divider { border: none; height: 1px; background-color: #ddd; width: 60%; margin: 20px auto; }
.cta-button { display: inline-block; text-decoration: none; padding: 15px 40px; font-size: 1.2em; font-weight: 700; color: white; background-color: var(--cor-laranja); border-radius: 8px; transition: transform 0.3s ease, box-shadow 0.3s ease; box-shadow: 0 4px 15px rgba(244, 125, 48, 0.3); }
.cta-button:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(244, 125, 48, 0.4); }
#restart-container { margin-top: 20px; text-align: center; }
#restart-button { width: auto; padding: 10px 30px; font-weight: 600; color: white; background-color: var(--cor-cinza-escuro); border: none; border-radius: 5px; cursor: pointer; transition: filter 0.3s; }
#restart-button:hover { filter: brightness(1.2); }

/* ============================================= */
/* ESTILOS PARA DISPOSITIVOS MÓVEIS      */
/* ============================================= */

@media (max-width: 768px) {

    /* --- AJUSTES GERAIS E CABEÇALHO --- */
    body { overflow-x: hidden; }
    .header-content { flex-direction: column; gap: 15px; }
    .titles { text-align: center; }
    .titles h1 { font-size: 1.5em; }
    #app-container { margin: 20px 10px; border-radius: 8px; } 

    /* Reduz o padding interno das seções no mobile */
    #form-section, #user-data-section, #results-section {
        padding: 25px;
    }

    /* --- PÁGINA DE BOAS-VINDAS --- */
    .welcome-container {
        grid-template-columns: 1fr; 
        padding: 0; 
        text-align: center;
        min-height: auto; 
    }
    .welcome-text {
        padding: 40px 25px; 
    }
    .welcome-text h2 { font-size: 1.8em; }
    .welcome-graphic {
        grid-row: 1; 
        margin-bottom: 0; 
        max-width: 100%; 
        border-top-left-radius: 10px; 
        border-top-right-radius: 10px;
        border-bottom-right-radius: 0; 
    }
    .welcome-graphic .welcome-image {
         border-radius: 0; 
         max-height: 270px;
    }
    .disclaimer-box {
        border-top: 1px solid #eee;
        border-radius: 0 0 10px 10px; 
    }

    /* --- QUESTIONÁRIO E ELEMENTOS STICKY PARA MOBILE --- */
    
    /* ALTERAÇÃO 1: Corrige o alinhamento do progresso da análise no mobile */
    #overall-progress-container {
        margin-left: -25px;
        margin-right: -25px;
        margin-top: -25px;
        padding-left: 0;
        padding-right: 0;
        width: auto;
    }
    #overall-progress-container h3,
    #steps-container {
        padding-left: 25px;
        padding-right: 25px;
    }

    /* ALTERAÇÃO 2: Animação para esconder o título do card na rolagem */
    .sticky-card-header {
        top: 100px;
        padding-top: 15px;
        padding-bottom: 10px;
    }
    .sticky-card-header h2 {
        transition: max-height 0.3s ease-out, opacity 0.2s ease-out, margin 0.3s ease-out;
        max-height: 30px; /* Altura aproximada do título para animação */
        opacity: 1;
        margin-bottom: 10px;
        overflow: hidden;
        font-size: 1.2em;
        border: none;
    }
    .sticky-card-header.is-stuck h2 {
        max-height: 0;
        opacity: 0;
        margin-bottom: 0;
    }

    .category-header {
        display: none;
    }
    .question { 
        display: flex; 
        flex-wrap: wrap; 
        padding: 20px 0; 
        border-bottom: 1px solid #eee; 
    }
    .question p { 
        flex-basis: 100%;
        margin-bottom: 20px; 
        padding-right: 0;
    }
    .options-container { 
        flex: 1; 
        display: flex; 
        flex-direction: column; 
        align-items: center; 
        padding: 10px 5px; 
        text-align: center; 
        border: none; 
    }
    .options-container::before { 
        content: "";
        font-weight: 600; 
        color: var(--cor-cinza-escuro); 
        margin-bottom: 8px; 
        font-size: 0.9em;
    }
    .options-container:nth-of-type(1)::before { content: "Sim"; }
    .options-container:nth-of-type(2)::before { content: "Parcial"; }
    .options-container:nth-of-type(3)::before { content: "Não"; }

    .options-container input[type="radio"] { 
        margin: 0; 
        width: 22px;
        height: 22px;
    }

    /* --- PÁGINA DE RESULTADOS --- */
    .results-header { 
        font-size: 1.5em; 
        margin: -25px -25px 20px -25px;
    }
    .score-box-container { flex-direction: column; gap: 20px; }
    .result-card-redesigned { grid-template-columns: 1fr; }
    .score-value-large { height: auto; padding: 20px; align-items: center; border-bottom: 1px solid #ddd; }
}

/* Estilos para o placeholder do input */
::placeholder { color: #d3d3d3 !important; opacity: 1; }
::-ms-input-placeholder { color: #d3d3d3 !important; }

/* ============================================= */
/* ESTILOS PARA A NOVA FORMATAÇÃO DOS RESULTADOS */
/* ============================================= */

.observations-section ul {
    list-style-type: none;
    padding-left: 0;
    margin: 0;
}

.observation-item {
    padding: 25px 0;
    border-bottom: 1px solid #e9eef3;
}

.observation-item:last-child {
    border-bottom: none;
    padding-bottom: 10px;
}

.observation-item:first-child {
    padding-top: 15px;
}

.observation-question {
    font-size: 1.2em; /* Equivalente a um h2 customizado */
    color: var(--cor-cinza-escuro);
    margin-top: 0;
    margin-bottom: 15px;
    line-height: 1.4;
    border: none; /* Reseta bordas de h2 genéricos */
    padding: 0;
}

.observation-impact,
.recommendation-text {
    font-size: 0.95em;
    color: #555;
    line-height: 1.7;
    margin-top: 0;
    margin-bottom: 20px;
}

.recommendation-title {
    font-size: 1.05em; /* Equivalente a um h3 customizado */
    color: var(--cor-laranja);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 0;
    margin-bottom: 10px;
    font-weight: 700;
}

.recommendation-text {
    margin-bottom: 0;
    background-color: #fffaf6;
    border-left: 3px solid var(--cor-laranja);
    padding: 15px 20px;
    border-radius: 0 5px 5px 0;
}

/* Estilos para o novo campo select */
.input-group select {
    box-sizing: border-box;
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1em;
    font-family: 'Poppins', sans-serif;
    background-color: white; /* Garante fundo branco */
}

.input-group select:focus {
    outline: none;
    border-color: var(--cor-laranja);
    box-shadow: 0 0 0 2px rgba(244, 125, 48, 0.2);
}

/* NOVO: Estilo para destacar campos inválidos */
.input-group input.invalid,
.input-group select.invalid {
    border-color: #c82333; /* Vermelho para erro */
    background-color: #f8d7da; /* Fundo rosa claro */
}

.input-group select.invalid {
    color: #721c24; /* Cor do texto para erro */
}