/* === Reset Básico e Configurações Globais === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    background-color: #f8f9fa; /* Cinza muito claro de fundo */
    scroll-behavior: smooth;
    font-size: 17px; /* Aumentar base para desktop, ajustado em media query */
    line-height: 1.7; /* Melhor espaçamento entre linhas padrão */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    max-width: 1000px; /* Levemente maior */
    width: 92%;
    min-height: calc(100vh - 4em);
    margin: 2.5em auto; /* Mais margem vertical */
    padding: 2.5em; /* Mais padding interno */
    background-color: #ffffff;
    border-radius: 12px; /* Cantos mais suaves */
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.07); /* Sombra mais sutil */
    font-family: 'Roboto', sans-serif;
    color: #343a40; /* Cor de texto principal (cinza escuro) */
}

/* === Tipografia === */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Montserrat', sans-serif;
    color: #212529; /* Preto suave */
    line-height: 1.4;
    margin-bottom: 1.2rem;
}

h1 {
    font-size: 2.6rem;
    font-weight: 700;
    text-align: center;
    margin-top: 0;
    margin-bottom: 1.8rem;
}

h1 a.header-link {
    color: inherit;
    text-decoration: none;
    transition: color 0.25s ease-in-out;
}
h1 a.header-link:hover,
h1 a.header-link:focus {
    color: #0056b3;
}

h2 {
    font-size: 1.9rem;
    font-weight: 700;
    color: #343a40;
    margin-top: 2.5rem; /* Mais espaço antes */
    margin-bottom: 1.2rem;
    border-bottom: 1px solid #dee2e6; /* Borda mais fina e clara */
    padding-bottom: 0.6rem;
}
h2[style*="text-align:center"] {
    border-bottom: none;
}
h2 .weight-300 { /* Span dentro de H2 (labels de resultado) */
    font-weight: 400; /* Um pouco mais de peso que 300 */
    color: #495057;
}

h3 { /* Usado nos detalhes da ideologia */
    font-size: 1.4rem;
    color: #495057; /* Cinza médio */
    margin-top: 1.5rem;
    margin-bottom: 0.8rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid #e9ecef; /* Borda ainda mais sutil */
}
.ideology-details #ideology-desc-container h3 {
    margin-top: 0;
}

p {
    font-size: 1rem; /* Ajustado pela base do html */
    margin-bottom: 1.1rem;
    color: #495057; /* Cinza para parágrafos */
}

p.value { /* Nomes dos valores na explicação */
    font-size: 1.6rem;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    margin-top: 1rem;
    margin-bottom: 0.6rem;
}

p.blurb-text { /* Descrição dos valores */
    font-size: 1rem; /* Tamanho padrão */
    color: #495057;
    line-height: 1.65;
}

p.axis_name { /* Nome do eixo na explicação */
    margin-top: 0;
    margin-bottom: 0.4rem;
    color: #6c757d; /* Cinza mais claro */
    font-size: 0.85rem; /* Levemente menor */
    font-family: 'Montserrat', sans-serif;
    font-weight: 600; /* Menos pesado */
    text-transform: uppercase;
    letter-spacing: 0.07em; /* Mais espaçamento */
    line-height: 1.3;
    text-align: center;
}

p.question { /* Bloco da pergunta */
    margin: 2.5rem auto;
    color: #343a40;
    font-family: 'Montserrat', sans-serif;
    font-weight: 500; /* Um pouco mais de peso */
    width: 90%;
    max-width: 750px;
    min-height: 130px;
    height: auto;
    background-color: #f8f9fa; /* Mesmo fundo do html */
    padding: 1.8rem;
    border-radius: 10px;
    border: 1px solid #e9ecef; /* Borda sutil */
    font-size: 1.6rem; /* Pouco maior */
    line-height: 1.45;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.04); /* Sombra externa sutil */
}

p.instruction-text {
    font-size: 1rem;
    color: #495057;
    max-width: 800px; /* Limitar largura */
    margin-left: auto;
    margin-right: auto;
}

a {
    color: #007bff;
    text-decoration: none;
    transition: color 0.2s ease;
}
a:hover {
    color: #0056b3;
    text-decoration: none; /* Manter sem sublinhado */
}

b, strong {
    font-weight: 700;
    color: #343a40; /* Cor mais escura para destaque */
}

hr {
    border: none;
    border-top: 1px solid #dee2e6; /* Linha mais clara */
    margin: 2.5rem 0; /* Mais espaçamento */
}

/* === Layout Index Page (Grade de Ícones) === */
div.center {
    padding: 1rem 0;
    width: 100%;
    max-width: 650px; /* Levemente maior */
    margin: 2.5rem auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    align-items: flex-start;
    gap: 0.5rem 0; /* Espaçamento vertical entre linhas */
}

div.center > div.axis_name { /* Container do nome do eixo na grade */
    width: 24%; /* Ajustar para gap */
    margin: 0; /* Remover margem, usar gap */
    padding-bottom: 0.5rem;
    font-size: 0.8rem; /* Menor ainda */
    font-weight: 600;
    color: #6c757d;
    text-align: center;
    flex: 0 0 24%;
    transition: opacity 0.3s ease-out;
}

a.quadcolumn { /* Link da imagem na grade */
    display: block;
    width: 24%; /* Ajustar para gap */
    margin: 0;
    text-align: center;
    flex: 0 0 24%;
    text-decoration: none;
    padding: 0.3rem; /* Pequeno padding ao redor */
}

img.quadcolumn { /* Imagem do valor na grade */
    width: 100%;
    max-width: 100%;
    height: auto;
    transition: transform 0.25s ease-out, box-shadow 0.25s ease-out;
    border-radius: 8px; /* Cantos mais suaves */
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    display: block;
}
img.quadcolumn:hover {
    transform: scale(1.06) translateY(-4px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.12);
}

/* === Layout da Seção de Explicações === */
.section {
    padding: 2rem 0; /* Mais padding */
}
.section:first-of-type {
    padding-top: 0; /* Remover padding do topo da primeira seção */
}


.explanation_bg {
    border-radius: 10px;
    margin-top: 1.5rem;
    padding: 2rem; /* Mais padding */
    border: 1px solid #e9ecef;
    background-color: #fdfdfd; /* Fundo quase branco */
}

.spacer { /* Container para um par de explicações e eixo */
    display: flex;
    align-items: center;
    margin-bottom: 2.5rem; /* Mais espaço */
    gap: 1.5rem; /* Mais espaço */
    flex-wrap: wrap;
}
.spacer:last-child {
     margin-bottom: 0;
}

div.explanation_blurb_left,
div.explanation_blurb_right { /* Colunas de texto */
    flex: 1;
    min-width: 220px; /* Pouco maior */
    text-align: left;
    padding: 0; /* Remover padding aqui, já tem no .explanation_bg */
}

div.explanation_axis { /* Container central (nome + seta) */
    width: 100px; /* Reduzir um pouco */
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.arrow { /* Imagem da seta */
    width: 55%;
    max-width: 55px;
    height: auto;
    opacity: 0.7; /* Seta um pouco mais sutil */
}

/* === Botões === */
.button {
    font-family: 'Montserrat', sans-serif;
    border: none;
    border-radius: 8px; /* Cantos mais suaves */
    color: white;
    padding: 0.9rem 1.8rem; /* Mais padding */
    width: 85%; /* Pouco maior */
    max-width: 500px;
    text-align: center;
    text-decoration: none;
    display: block;
    font-size: 1.15rem; /* Pouco maior */
    font-weight: 600;
    margin: 0.1rem auto; /* Espaçamento vertical */
    cursor: pointer;
    transition: all 0.25s ease; /* Transição geral */
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
    letter-spacing: 0.02em;
}

.button:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.15);
    filter: brightness(1.05); /* Leve brilho */
}
.button:active {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    filter: brightness(0.95); /* Leve escurecida */
}

/* Cores (mantidas, mas podem ser ajustadas para tons pastéis/modernos se desejar) */
.stronglyAgree { background-color: #28a745; }
.stronglyAgree:hover { background-color: #218838; }
.agree { background-color: #5cb85c; }
.agree:hover { background-color: #4cae4c; }
.neutral { background-color: #6c757d; }
.neutral:hover { background-color: #5a6268; }
.disagree { background-color: #dc3545; }
.disagree:hover { background-color: #c82333; }
.stronglyDisagree { background-color: #b21f2d; }
.stronglyDisagree:hover { background-color: #a01a27; }

/* Botão padrão */
.button:not([class*="disagree"]):not([class*="Agree"]):not(.neutral) { background-color: #007bff; }
.button:not([class*="disagree"]):not([class*="Agree"]):not(.neutral):hover { background-color: #0056b3; }
.button.disagree { background-color: #dc3545; } /* Garante cor do Voltar em instructions */
.button.disagree:hover { background-color: #c82333; }

/* Botão pequeno (Anterior) */
.small_button, .small_button_off {
    font-family: 'Montserrat', sans-serif;
    border: none;
    border-radius: 8px;
    color: white;
    padding: 0.6rem 1.2rem;
    width: auto;
    min-width: 110px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.small_button { background-color: #5a6268; } /* Cinza um pouco mais escuro */
.small_button:hover { background-color: #495057; transform: translateY(-2px); }
.small_button:active { transform: translateY(0); }
.small_button_off { background-color: #e9ecef; color: #adb5bd; border: 1px solid #ced4da; cursor: not-allowed; box-shadow: none;}

.button-container { text-align: center; margin-top: 2rem; }
.button-container .button { width: auto; display: inline-block; min-width: 160px; margin: 0.5rem;}
.button.copy-button { background-color: #17a2b8; }
.button.copy-button:hover { background-color: #138496; }
.button.copy-button:disabled { background-color: #6c757d; cursor: not-allowed; opacity: 0.65; }
.button.back-button { background-color: #6c757d; }
.button.back-button:hover { background-color: #5a6268; }

/* === Barras de Resultado === */
div.axis { width: 100%; display: flex; align-items: center; justify-content: center; gap: 1rem; margin-bottom: 1.8rem;}
div.axis img { height: 65px; width: 65px; flex-shrink: 0; opacity: 0.9; }
div.bar-container { display: flex; width: 100%; height: 2.5rem; background-color: #e9ecef; border-radius: 6px; overflow: hidden; border: 1px solid #dee2e6;}
div.bar { height: 100%; line-height: 2.5rem; padding: 0 1rem; margin: 0; border: none; color: #fff; text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.3); font-weight: 700; font-size: 1.2rem; display: flex; align-items: center; transition: width 0.6s ease-out;}
div.equality { background: #e53935; justify-content: flex-start; border-top-right-radius: 0; border-bottom-right-radius: 0;} /* Cor sólida mais limpa */
div.wealth { background: #00897b; justify-content: flex-end; border-top-left-radius: 0; border-bottom-left-radius: 0;}
div.liberty { background: #ffeb3b; justify-content: flex-start; color: #444; text-shadow: none; border-top-right-radius: 0; border-bottom-right-radius: 0;}
div.authority { background: #3f51b5; justify-content: flex-end; border-top-left-radius: 0; border-bottom-left-radius: 0;}
div.might { background: #ff9800; justify-content: flex-start; border-top-right-radius: 0; border-bottom-right-radius: 0;}
div.peace { background: #03a9f4; justify-content: flex-end; border-top-left-radius: 0; border-bottom-left-radius: 0;}
div.tradition { background: #8bc34a; justify-content: flex-start; border-top-right-radius: 0; border-bottom-right-radius: 0;}
div.progress { background: #9c27b0; justify-content: flex-end; border-top-left-radius: 0; border-bottom-left-radius: 0;}

div.text-wrapper { font-family: 'Montserrat', sans-serif; display: inline-block; visibility: visible;}

/* === Detalhes da Ideologia === */
.ideology-details { margin-top: 2.5rem; margin-bottom: 2.5rem; padding: 2rem; background-color: #f8f9fa; border: 1px solid #dee2e6; border-radius: 10px;}
.ideology-details h3 { font-size: 1.4rem; color: #495057; margin-top: 1.2rem; margin-bottom: 0.8rem; padding-bottom: 0.4rem; border-bottom: 1px solid #e9ecef;}
.ideology-details #ideology-desc-container h3 { margin-top: 0; }
.ideology-details p#ideology-desc { font-size: 1.05rem; line-height: 1.7; color: #343a40; margin-bottom: 1.8rem;}
.ideology-details ul { list-style-type: none; padding-left: 0.5rem; margin-bottom: 1.2rem;} /* Remover marcadores padrão */
.ideology-details li { font-size: 1rem; color: #495057; margin-bottom: 0.5rem; position: relative; padding-left: 1.5rem; /* Espaço para marcador customizado */}
.ideology-details li::before { /* Marcador customizado */
    content: "•"; /* Ou "–", "›" */
    color: #007bff; /* Cor de destaque */
    font-weight: bold;
    display: inline-block;
    position: absolute;
    left: 0;
    top: 0;
}
.ideology-details .disclaimer { font-size: 0.85rem; color: #6c757d; font-style: italic; margin-top: 0.8rem; margin-bottom: 1.2rem;}

/* === Banner Gerado === */
#banner { border: 1px solid #dee2e6; border-radius: 10px; display: block; margin: 2rem auto; max-width: 100%; height: auto; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08); max-width: 700px; }

/* === Responsividade === */
@media (max-width: 992px) { /* Ajustes para tablets e desktops menores */
     html { font-size: 16px; } /* Resetar base */
     body { padding: 1.8em; }
     h1 { font-size: 2.4rem; }
     h2 { font-size: 1.7rem; }
     p.question { font-size: 1.5rem; }
}

@media (max-width: 768px) {
    body { width: 100%; padding: 1em; margin: 0; box-shadow: none; border-radius: 0;} /* Tela cheia */
    h1 { font-size: 2rem; margin-bottom: 1.2rem;}
    h2 { font-size: 1.6rem; margin-top: 2rem;}
    hr { margin: 1.8rem 0;}
    p.question { font-size: 1.3rem; padding: 1.2rem; width: 95%; min-height: 100px;}

    .button { width: 90%; font-size: 1.1rem; padding: 0.8rem 1.2rem;}
    .small_button, .small_button_off { font-size: 0.9rem; padding: 0.5rem 1rem; min-width: 90px;}
    .button-container .button { min-width: 130px; font-size: 1rem; padding: 0.7rem 1.1rem; margin: 0.4rem;}

    /* Esconder nomes dos eixos na grade inicial */
     div.center > div.axis_name { display: none; }
    /* Ajuste itens da grade (ícones) */
     a.quadcolumn { width: 30%; flex: 1 1 30%; min-width: 85px; padding: 0.2rem;} /* Tentar 3 colunas */

    /* Explicações */
    .explanation_bg { padding: 1.5rem;}
    .spacer { flex-direction: column; gap: 0.8rem; margin-bottom: 1.8rem;}
    div.explanation_blurb_left, div.explanation_blurb_right { width: 100%; padding: 0.5rem 0; text-align: center; order: 1; min-width: unset;}
    div.explanation_axis { width: 100%; order: 0; margin-bottom: 0.8rem; padding: 0.5rem 0; flex-shrink: unset;}
    p.axis_name { font-size: 0.9rem; margin-bottom: 0.3rem;}
    .arrow { display: block; width: 25%; max-width: 45px;}

    /* Resultados */
    div.axis { flex-direction: column; gap: 0.8rem; margin-bottom: 2.2rem;}
    div.axis img { height: 55px; width: 55px;}
    div.bar-container { height: 2.2rem;}
    div.bar { line-height: 2.2rem; font-size: 1.1rem;}

    /* Detalhes Ideologia */
    .ideology-details { padding: 1.2rem; }
    .ideology-details h3 { font-size: 1.25rem; }
    .ideology-details p#ideology-desc { font-size: 1rem; }
    .ideology-details li { font-size: 0.95rem; padding-left: 1.2rem;}
    .ideology-details ul { padding-left: 0.2rem; }
}

@media (max-width: 480px) {
    html { font-size: 15px; } /* Ajuste fino para celular */
    body { padding: 0.8em; }
    h1 { font-size: 1.8rem; }
    h2 { font-size: 1.4rem; }
    p.question { font-size: 1.2rem; min-height: 90px; padding: 1rem;}

    /* Grade de ícones (forçar 2 colunas) */
     a.quadcolumn {
        width: 46%;
        flex: 1 1 46%;
        min-width: 100px; /* Aumentar um pouco para toque */
        padding: 0.4rem;
    }

    /* Botões */
    .button { font-size: 1rem; padding: 0.1rem 1rem;}
    .button-container .button { min-width: 110px; font-size: 0.9rem; padding: 0.6rem 1rem; margin: 0.3rem;}
    .small_button, .small_button_off { font-size: 0.85rem; padding: 0.4rem 0.8rem; min-width: 80px;}

    /* Resultados */
    div.bar-container { height: 2rem; }
    div.bar { line-height: 2rem; font-size: 1rem; }
     div.axis img { height: 50px; width: 50px;}

    /* Detalhes Ideologia */
     .ideology-details ul { padding-left: 0; }
     .ideology-details li { padding-left: 1rem; }
}