/* =========================================
   Design System & Variables - Mais Sóbrio
   ========================================= */
:root {
    /* Colors */
    --primary: #0056b3;       /* Azul corporativo mais escuro */
    --primary-hover: #004494;
    --primary-light: #e6f0fa;
    
    --secondary: #28a745;     /* Verde padrão sucesso */
    --secondary-hover: #218838;
    --secondary-light: #e9f7ef;

    --bg-main: #f4f6f8;       /* Fundo cinza claro sólido, sem gradiente para parecer mais humano/sério */
    
    --surface: #ffffff;
    --surface-hover: #fcfcfc;
    
    --text-main: #212529;
    --text-muted: #6c757d;
    
    --border: #dee2e6;
    --border-active: #b8daff;
    
    --error: #dc3545;
    --error-bg: #f8d7da;
    
    /* Shadows - mais sutis e reais */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.08);
    
    /* Border Radius - cantos menos arredondados, visual mais padrão corporativo */
    --radius-md: 0.375rem;
    --radius-lg: 0.5rem;
    --radius-full: 9999px;

    /* Transitions */
    --transition: all 0.2s ease-in-out;
}

/* =========================================
   Reset & Base Styles
   ========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

/* =========================================
   Layout
   ========================================= */
.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.app-header {
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.logo {
    display: flex;
    align-items: center;
    width: 100%;
}

.logo-img {
    height: auto;
    width: 100%;
    max-width: 220px; /* Maior destaque na logo */
    max-height: 60px; /* Permite que a logo fique maior */
    object-fit: contain;
    object-position: left center;
}

.content-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

/* =========================================
   Components
   ========================================= */
.card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    width: 100%;
    max-width: 600px;
    padding: 2.5rem;
    border: 1px solid var(--border);
}

.screen {
    display: none;
    width: 100%;
    max-width: 600px;
}

.screen.active {
    display: block;
}

/* Intro Screen */
.intro-card {
    text-align: left;
}

.main-title {
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-main);
}

.subtitle {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
    line-height: 1.5;
}

/* Progress Bar */
.progress-container {
    margin-bottom: 1.5rem;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.progress-bar-bg {
    height: 6px;
    background: var(--border);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background-color: var(--primary);
    border-radius: var(--radius-full);
    width: 0%;
    transition: width 0.3s ease;
}

/* Question Area */
.question-text {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--text-main);
}

.question-subtext {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    min-height: 1rem;
}

.options-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.option-card {
    display: flex;
    align-items: center;
    padding: 1rem 1.25rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
}

.option-card:hover {
    border-color: var(--text-muted);
    background: var(--surface-hover);
}

.option-card.selected {
    border-color: var(--primary);
    background: var(--primary-light);
}

.option-label {
    flex: 1;
    font-size: 0.95rem;
    color: var(--text-main);
}

/* Checkbox/Radio Indicator */
.indicator {
    width: 18px;
    height: 18px;
    border: 1px solid var(--text-muted);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    background: white;
}

.option-card.type-multiple .indicator {
    border-radius: 3px;
}

.option-card.selected .indicator {
    border-color: var(--primary);
    background: var(--primary);
}

.indicator svg {
    width: 10px;
    height: 10px;
    stroke: white;
    stroke-width: 3;
    opacity: 0;
}

.option-card.selected .indicator svg {
    opacity: 1;
}

/* Error Message */
.error-message {
    display: none;
    color: var(--error);
    background: var(--error-bg);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    font-size: 0.875rem;
    border: 1px solid #f5c6cb;
}

.error-message.show {
    display: block;
}

/* Buttons */
.navigation-buttons {
    display: flex;
    justify-content: space-between;
    border-top: 1px solid var(--border);
    padding-top: 1.25rem;
    margin-top: 1.25rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    border: none;
}

.btn-large {
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-primary:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
}

.btn-secondary {
    background: white;
    color: var(--text-main);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--surface-hover);
    border-color: var(--text-muted);
}

.btn-secondary:disabled {
    visibility: hidden;
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
    margin-top: 1rem;
}

.btn-outline:hover {
    background: var(--primary-light);
}

/* Inputs */
.text-input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-family: inherit;
    color: var(--text-main);
    transition: var(--transition);
    outline: none;
    text-align: center;
    letter-spacing: 1px;
}
.text-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* Result Screen */
.result-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.result-subtitle {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.summary-container {
    background: #fafafa;
    border-radius: var(--radius-md);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border);
}

.summary-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.summary-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.75rem;
}

.summary-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.summary-question {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.summary-answer {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-main);
}

.result-actions {
    display: flex;
    flex-direction: column;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text-main);
    color: white;
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-md);
    display: none;
    font-size: 0.95rem;
    z-index: 1000;
    box-shadow: var(--shadow-md);
}

.toast.show {
    display: block;
}

@media (max-width: 640px) {
    .app-header {
        padding: 1rem;
        justify-content: center;
    }

    .logo {
        justify-content: center;
    }

    .logo-img {
        max-width: 170px;
        max-height: 45px;
        object-position: center;
    }

    .content-wrapper {
        padding: 0;
        align-items: flex-start; /* Remove o espaço cinza acima do card */
        background-color: var(--surface); /* Tela toda branca no mobile */
    }

    .card {
        padding: 1.5rem 1.25rem;
        border-radius: 0;
        border: none;
        box-shadow: none; /* Layout mais flat para mobile */
    }

    .option-card {
        padding: 1.125rem 1rem; /* Hitbox maior para os dedos */
    }

    /* Ajuste dos botões para preencher a tela */
    .navigation-buttons {
        flex-direction: column-reverse; /* "Avançar" fica em cima do "Voltar" */
        gap: 0.75rem;
        border-top: none;
    }

    .btn {
        width: 100%;
        padding: 0.875rem 1rem; /* Mais altura para toque */
    }

    .btn-secondary:disabled {
        display: none; /* Remove o espaço vazio do botão voltar na primeira pergunta */
    }
}
