/* ==========================================================================
   1. Definição das Fontes e Variáveis Globais
   ========================================================================== */
@font-face {
    font-family: 'Elegant';
    src: url('fonts/Elegant-Regular.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Roboto';
    src: url('fonts/Roboto-Regular.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

:root {
    --font-headline: 'Elegant', serif;
    --font-base: 'Roboto', sans-serif;
    --button-bg-color: #8c6e54;
    --text-color-light: #FEF5E6;
    --text-color-dark: #5c4b3c;
    --background-color: #FEF5E6;
    --input-border: rgba(92, 75, 60, 0.3); /* Cor da linha dos campos */
}

/* ==========================================================================
   2. Estilos Base e Reset
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
html {
    scroll-behavior: smooth;
}
body {
    font-family: var(--font-base);
    color: var(--text-color-dark);
    background-color: var(--background-color);
    line-height: 1.6;
}

/* Container centralizado para leitura confortável */
.form-container {
    max-width: 650px;
    margin: 0 auto;
    padding: 2rem 20px 4rem 20px;
}

/* ==========================================================================
   3. Cabeçalho do Formulário (Imagem e Copy)
   ========================================================================== */
.form-header {
    text-align: center;
    margin-bottom: 3rem;
}
.header-cover-image {
    width: 100%;
    height: auto;
    border-radius: 15px;
    margin-bottom: 2rem;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}
.headline {
    font-family: var(--font-headline);
    font-size: clamp(2rem, 5vw, 2.5rem);
    color: var(--text-color-dark);
    margin-bottom: 1.5rem;
    line-height: 1.2;
}
.welcome-copy p {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: var(--text-color-dark);
    opacity: 0.9;
    text-align: left;
}
.welcome-copy strong {
    color: var(--button-bg-color);
    font-weight: 700;
}

/* Barra de Progresso */
.progress-container {
    margin-top: 2rem; 
    background: rgba(140, 110, 84, 0.1); 
    border-radius: 10px; 
    height: 8px; 
    overflow: hidden;
}
.progress-bar {
    height: 100%; 
    background: var(--button-bg-color); 
    transition: width 0.4s ease;
}

/* ==========================================================================
   4. Estrutura do Formulário (Seções)
   ========================================================================== */
.sophisticated-form {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.form-section {
    border: none;
    padding: 0;
    margin: 0;
}

.form-section legend {
    font-family: var(--font-headline);
    font-size: 1.8rem;
    color: var(--button-bg-color);
    margin-bottom: 2rem;
    width: 100%;
    border-bottom: 1px solid rgba(140, 110, 84, 0.2);
    padding-bottom: 0.5rem;
}

.highlight-section {
    background-color: rgba(140, 110, 84, 0.05);
    padding: 2rem;
    border-radius: 15px;
    border: 1px solid rgba(140, 110, 84, 0.1);
}
.highlight-section legend {
    border-bottom: none;
    margin-bottom: 1.5rem;
}

/* ==========================================================================
   5. Estilo dos Campos (Inputs e Textareas) Fixos e Organizados
   ========================================================================== */
.input-group {
    display: flex;
    flex-direction: column; 
    margin-bottom: 2.5rem; 
}

/* O truque de mestre: forçamos a ordem visual sem mexer no HTML */
.input-group > label {
    order: 1;
    font-size: 1rem;
    color: var(--button-bg-color);
    font-weight: 500; /* Tipografia mais fina e delicada */
    margin-bottom: 0.3rem; 
}

.input-group > .helper-text {
    order: 2;
    font-size: 0.85rem;
    color: var(--text-color-dark);
    opacity: 0.8;
    margin-bottom: 0.8rem; 
    line-height: 1.4;
}

.input-group > input,
.input-group > textarea {
    order: 3;
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--input-border); /* Linha mais fina */
    padding: 0.5rem 0; 
    font-family: var(--font-base);
    font-size: 1rem;
    color: var(--text-color-dark);
    outline: none;
    transition: border-color 0.3s ease;
    resize: vertical;
}

.input-group > .input-outro {
    order: 4;
}

.input-group input:focus,
.input-group textarea:focus {
    border-bottom: 1px solid var(--button-bg-color);
}

.input-group input::placeholder,
.input-group textarea::placeholder {
    color: rgba(92, 75, 60, 0.4);
}

/* ==========================================================================
   6. Checkboxes e Radio Buttons Personalizados e Elegantes
   ========================================================================== */
.radio-group, .checkbox-group {
    margin-bottom: 2.5rem;
}

.radio-label, .checkbox-label {
    font-size: 1rem;
    color: var(--button-bg-color);
    font-weight: 500; /* Mais delicado */
    margin-bottom: 0.5rem;
}

.radio-group label, .checkbox-grid label {
    display: flex;
    align-items: flex-start; 
    gap: 0.8rem; 
    font-size: 0.95rem;
    color: var(--text-color-dark);
    font-weight: 400; /* Respostas com fonte normal/fina */
    cursor: pointer;
    margin-bottom: 0.8rem; 
    line-height: 1.4;
    transition: opacity 0.2s;
}

.radio-group label:hover, .checkbox-grid label:hover {
    opacity: 0.8;
}

/* Esconde as caixas padrões do navegador e cria as nossas próprias */
input[type="radio"], input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    min-width: 18px;
    border: 1px solid var(--button-bg-color);
    background-color: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 0.1rem;
    transition: all 0.2s ease;
}

input[type="checkbox"] {
    border-radius: 4px;
}

input[type="radio"] {
    border-radius: 50%;
}

/* O estado "Marcado" */
input[type="checkbox"]:checked, input[type="radio"]:checked {
    background-color: var(--button-bg-color);
}

/* O ícone de "Check" suave */
input[type="checkbox"]:checked::after {
    content: "✓";
    color: var(--background-color);
    font-size: 14px;
}

/* A bolinha do Radio Button */
input[type="radio"]:checked::after {
    content: "";
    width: 8px;
    height: 8px;
    background-color: var(--background-color);
    border-radius: 50%;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.5rem 1rem; 
    margin-top: 1rem;
}

/* Opção "Outros" alinhada e premium */
.input-outro {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    margin-top: 0.5rem;
    margin-left: 1.9rem; /* Alinha perfeitamente com os textos das opções acima */
    width: calc(100% - 1.9rem);
}

.input-outro label {
    font-size: 0.95rem;
    font-weight: 400;
    color: var(--text-color-dark);
    margin-bottom: 0;
    white-space: nowrap;
}

.input-outro input[type="text"] {
    flex-grow: 1;
    background: rgba(140, 110, 84, 0.03); /* Fundo extremamente sutil */
    border: none;
    border-bottom: 1px solid var(--input-border);
    padding: 0.4rem 0.8rem;
    border-radius: 4px 4px 0 0; /* Leve arredondamento no topo */
    font-family: var(--font-base);
    font-size: 0.95rem;
    color: var(--text-color-dark);
    outline: none;
    transition: all 0.3s ease;
    margin-bottom: 0;
}

.input-outro input[type="text"]:focus {
    background: rgba(140, 110, 84, 0.08); /* Fundo levemente mais escuro ao clicar */
    border-bottom: 1px solid var(--button-bg-color);
}

/* ==========================================================================
   7. Botões de Navegação e Envio
   ========================================================================== */
.form-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(140, 110, 84, 0.1);
}

.form-navigation[style*="justify-content: flex-end;"] {
    border-top: none;
}

.shimmer-button {
    font-family: var(--font-base);
    color: var(--text-color-light);
    background-color: var(--button-bg-color);
    font-size: 1rem;
    text-decoration: none;
    padding: 12px 24px;
    border-radius: 30px;
    position: relative;
    overflow: hidden;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(140, 110, 84, 0.3);
    transition: transform 0.2s ease, background-color 0.3s ease;
    font-weight: 500; /* Mais leve e requintado */
}

.shimmer-button:hover {
    transform: scale(1.02);
    background-color: #7a5f49;
}

.shimmer-button.btn-prev {
    background: transparent;
    color: var(--button-bg-color);
    border: 1px solid var(--button-bg-color);
    box-shadow: none;
}

.shimmer-button.btn-prev:hover {
    background: rgba(140, 110, 84, 0.05);
}

/* Aplica a animação fluida em todos os botões primários (Próximo e Enviar) */
.shimmer-button:not(.btn-prev)::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(100deg, rgba(255, 255, 255, 0) 20%, rgba(255, 255, 255, 0.3) 50%, rgba(255, 255, 255, 0) 80%);
    transform: translateX(-100%);
    animation: shimmer 2.5s infinite;
}

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

.success-feedback {
    background-color: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

/* ==========================================================================
   8. Responsividade
   ========================================================================== */
@media (max-width: 600px) {
    .form-container {
        padding-top: 1rem;
    }
    .highlight-section {
        padding: 1.5rem 1rem;
    }
    .form-section legend {
        font-size: 1.5rem;
    }
    .checkbox-grid {
        grid-template-columns: 1fr;
    }
    .form-navigation {
        flex-direction: column-reverse; /* No celular, o botão 'Próximo' fica em cima e o 'Anterior' embaixo */
        gap: 1rem;
    }
    .shimmer-button {
        width: 100%;
        text-align: center;
    }
}