/* Paleta de Cores */
:root {
    --primary-color: #7B42F6; 
    --primary-dark: #5A27B0;  
    --background-light: #f7f7f7; 
    --card-background: #ffffff; 
    --border-radius: 12px;   
    --shadow: rgba(0, 0, 0, 0.08);
    --success: #28a745;
    --warning: #ffc107;
    --danger: #dc3545;
}

/* Reset e Estilo Básico */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 40px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    line-height: 1.6;
    color: #333;
}

/* Seções */
section {
    max-width: 900px; 
    margin: 0 auto 30px auto;
    background: var(--card-background);
    padding: 40px;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2); 
    animation: fadeIn 0.5s ease-in;
}

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

/* Títulos */
h2 {
    color: var(--primary-dark);
    border-bottom: 3px solid var(--primary-color);
    padding-bottom: 15px;
    margin-bottom: 25px;
    font-size: 2em;
}

h3 {
    color: var(--primary-color);
    margin-top: 30px;
    margin-bottom: 15px;
    font-size: 1.5em;
}

h4 {
    color: var(--primary-dark);
    margin-top: 15px;
    margin-bottom: 10px;
}

/* Descrições e Instruções */
.descricao, .instrucoes {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 25px;
    border-left: 4px solid var(--primary-color);
}

.instrucoes {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
}

.info {
    color: #666;
    font-size: 0.9em;
    margin: 10px 0;
}

/* Botões */
button, .btn-selecionar {
    background: var(--primary-color);
    color: white;
    padding: 14px 28px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    width: auto;
    display: inline-block;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(123, 66, 246, 0.3);
}

button:hover, .btn-selecionar:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(123, 66, 246, 0.4);
}

button:active, .btn-selecionar:active {
    transform: translateY(0);
}

form button[type="submit"] {
    width: 100%;
    margin-top: 30px;
    padding: 18px;
    font-size: 18px;
}

#btnVoltar {
    background: #6c757d;
    margin-top: 20px;
}

#btnVoltar:hover {
    background: #5a6268;
}

/* Formulários */
form label:not(.pergunta label) {
    display: block;
    margin-top: 20px;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

input[type="text"],
input[type="number"],
input[type="date"],
input[type="email"],
select {
    width: 100%;
    padding: 12px 15px;
    margin: 5px 0 10px 0;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.3s, box-shadow 0.3s;
}

input:focus, select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(123, 66, 246, 0.1);
    outline: none;
}

input::placeholder {
    color: #aaa;
}

/* Perguntas */
.pergunta {
    background: #f8f9fa;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 10px;
    border-left: 4px solid var(--primary-color);
    transition: all 0.3s ease;
    animation: fadeIn 0.4s ease-out;
}

.pergunta:hover {
    background: #e9ecef;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.pergunta p {
    font-weight: 600;
    margin-bottom: 15px;
    color: #333;
    font-size: 1.05em;
}

.pergunta .numero-questao {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    width: 28px;
    height: 28px;
    line-height: 28px;
    text-align: center;
    border-radius: 50%;
    font-size: 0.8em;
    font-weight: 700;
    margin-right: 10px;
    flex-shrink: 0;
}

.pergunta .texto-questao {
    display: flex;
    align-items: flex-start;
    gap: 0;
    margin-bottom: 15px;
    font-weight: 600;
    color: #333;
    font-size: 1.05em;
}

.pergunta .opcoes-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-left: 38px;
}

.pergunta label {
    display: flex;
    align-items: center;
    font-weight: normal;
    cursor: pointer;
    padding: 10px 14px;
    border-radius: 8px;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    background: white;
}

.pergunta label:hover {
    background: rgba(123, 66, 246, 0.05);
    border-color: rgba(123, 66, 246, 0.2);
}

.pergunta input[type="radio"] {
    margin-right: 10px;
    cursor: pointer;
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
    flex-shrink: 0;
}

.pergunta input[type="radio"]:checked + span,
.pergunta label:has(input:checked) {
    background: rgba(123, 66, 246, 0.08);
    border-color: var(--primary-color);
    color: var(--primary-dark);
    font-weight: 500;
}

.pergunta.nao-respondida {
    border-left-color: var(--danger);
    animation: shake 0.4s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}

/* Barra de Progresso */
.barra-progresso-container {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 15px 0;
    margin: -10px 0 25px 0;
    border-bottom: 1px solid #eee;
}

.progresso-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.85em;
    font-weight: 600;
    color: var(--primary-dark);
}

.progresso-barra-bg {
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.progresso-barra-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 4px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    width: 0%;
}

/* Navegação */
.navegacao-botoes {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #eee;
}

.navegacao-botoes button {
    flex: 1;
}

#btnAnterior {
    background: #6c757d;
}

#btnAnterior:hover {
    background: #5a6268;
}

#btnFinalizar {
    background: var(--success);
    box-shadow: 0 4px 6px rgba(40, 167, 69, 0.3);
}

#btnFinalizar:hover {
    background: #218838;
    box-shadow: 0 6px 12px rgba(40, 167, 69, 0.4);
}

/* Resultado / Conclusão */
.resultado-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 25px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.sucesso-container {
    text-align: center;
    padding: 30px 20px;
}

.sucesso-icone {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 2.5em;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.sucesso-container h3 {
    color: #333;
    margin-top: 0;
    font-size: 1.4em;
}

.sucesso-container p {
    color: #555;
    font-size: 1.05em;
    line-height: 1.7;
}

/* Status de Envio */
#statusEnvioEmail {
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    font-size: 1.1em;
    margin: 20px 0;
    background: #f8f9fa;
    border: 2px solid var(--primary-color);
}

/* Responsividade */
@media (max-width: 768px) {
    body {
        padding: 20px 10px;
    }
    
    section {
        padding: 25px 20px;
    }
    
    h2 {
        font-size: 1.6em;
    }
    
    .pergunta .opcoes-container {
        padding-left: 0;
    }
    
    .pergunta label {
        padding: 10px 12px;
        font-size: 0.95em;
    }

    .navegacao-botoes {
        flex-direction: column;
    }

    button, .btn-selecionar {
        width: 100%;
        margin: 5px 0;
    }
}

@media (max-width: 480px) {
    h2 {
        font-size: 1.4em;
    }
    
    section {
        padding: 20px 15px;
    }
    
    .pergunta {
        padding: 15px;
    }
}

/* Animações */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(123, 66, 246, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(123, 66, 246, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(123, 66, 246, 0);
    }
}

button:focus {
    animation: pulse 1.5s infinite;
}

/* Scrollbar personalizada */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* Impressão */
@media print {
    body {
        background: white;
    }
    
    section {
        box-shadow: none;
        page-break-inside: avoid;
    }
    
    button {
        display: none;
    }
}
