/*
 * Sistema de design compartilhado por todas as paginas do FUVEST Analyzer.
 *
 * Visual editorial/profissional: fundo bege quente, titulos serifados,
 * paleta suave por materia - inspirado num mockup de "mapa de conhecimento"
 * que o usuario trouxe como referencia. Mantem o principio anterior (o
 * publico e vestibulando com a cabeca cheia, entao hierarquia clara e nada
 * de contraste agressivo ou gradiente "banner promocional"), so troca o
 * tom neutro-corporativo por algo mais quente e refinado.
 */

@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,500;0,600;0,700;1,500&family=Inter:wght@400;500;600;700&display=swap');

:root {
    --bg: #f6f2ea;
    --surface: #fffdf9;
    --surface-muted: #efe9dd;
    --border: #e6ddcc;
    --border-forte: #d6c9ac;

    --texto: #262218;
    --texto-suave: #6f6858;
    --texto-fraco: #9c9481;

    --acento: #26365c;
    --acento-forte: #182543;
    --acento-fundo: #e7eaf1;
    --acento-borda: #c7cede;

    --sucesso: #4f8a6d;
    --sucesso-fundo: #e9f5ee;
    --alerta: #a8791f;
    --alerta-fundo: #fbf3e3;
    --alerta-borda: #f0dfb8;

    --raio: 14px;
    --raio-pequeno: 8px;
    --sombra: 0 1px 2px rgba(60, 50, 20, 0.04), 0 8px 20px rgba(60, 50, 20, 0.05);

    --fonte-titulo: 'Lora', Georgia, 'Times New Roman', serif;
    --fonte-corpo: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--fonte-corpo);
    background: var(--bg);
    color: var(--texto);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--acento); }

h1, h2, h3, .marca .nome, .secao-titulo, .cartao-titulo {
    font-family: var(--fonte-titulo);
    font-weight: 600;
}

/* ---------- Layout geral: barra lateral fixa + conteudo ---------- */

.layout { display: flex; min-height: 100vh; align-items: stretch; }

.barra-lateral {
    width: 232px;
    flex-shrink: 0;
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 22px;
    position: sticky;
    top: 0;
    align-self: flex-start;
    height: 100vh;
    overflow-y: auto;
}

.conteudo { flex: 1; min-width: 0; }

.pagina {
    max-width: 1220px;
    margin: 0;
    padding: 26px 32px 60px;
}

.marca-bloco { padding: 2px 8px; }

.marca {
    display: flex;
    align-items: center;
    gap: 9px;
}

.marca .simbolo { font-size: 18px; line-height: 1; color: var(--acento); }
.marca .nome { font-size: 17px; font-weight: 700; color: var(--texto); letter-spacing: 0.01em; }
.marca-bloco .tagline { display: block; font-size: 11px; font-family: var(--fonte-corpo); color: var(--texto-fraco); margin-top: 3px; }

/* ---------- Navegacao (barra lateral) ---------- */

.abas {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.aba {
    font-family: var(--fonte-corpo);
    font-size: 13.5px;
    font-weight: 500;
    text-align: left;
    border: none;
    background: transparent;
    color: var(--texto-suave);
    padding: 9px 12px;
    border-radius: var(--raio-pequeno);
    cursor: pointer;
    text-decoration: none;
    display: block;
}

.aba:hover { background: var(--surface-muted); color: var(--texto); }
.aba.ativa { background: var(--acento); color: #fff; font-weight: 600; }

/* ---------- Auth widget ---------- */

.auth-widget { font-size: 12.5px; color: var(--texto-suave); padding: 0 8px; }
.auth-widget a { color: var(--acento); font-weight: 500; text-decoration: none; }
.auth-widget a:hover { text-decoration: underline; }
.auth-aviso-assinatura { color: var(--alerta) !important; font-weight: 700 !important; }

/* ---------- Cartoes e secoes ---------- */

.cartao {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--raio);
    padding: 18px 20px;
    box-shadow: var(--sombra);
}

.secao { margin-bottom: 32px; }

.secao-titulo {
    font-size: 17px;
    color: var(--texto);
    margin-bottom: 4px;
}

.secao-legenda {
    font-size: 13px;
    color: var(--texto-suave);
    margin-bottom: 16px;
}

/* ---------- Estatisticas discretas (nao competem por atencao) ---------- */

.stats-discretas {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    margin-bottom: 24px;
    padding: 14px 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--raio);
    box-shadow: var(--sombra);
}

.stat-discreta { font-size: 13px; color: var(--texto-suave); }
.stat-discreta strong { font-family: var(--fonte-titulo); color: var(--texto); font-size: 15px; font-weight: 700; }

/* ---------- Filtro de materia ---------- */

.filtro-materia {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

/* especificidade igual a ".filtro-materia { display: flex }" acima -
 * sem isso o atributo [hidden] do navegador (mesma especificidade, mas
 * declarado antes no cascata) perderia pra essa regra e o elemento
 * continuaria visivel mesmo com hidden setado via JS */
.filtro-materia[hidden] { display: none; }

.filtro-materia button {
    font-family: var(--fonte-corpo);
    font-size: 13px;
    border: 1px solid var(--border-forte);
    background: var(--surface);
    color: var(--texto-suave);
    border-radius: 999px;
    padding: 6px 14px;
    cursor: pointer;
}

.filtro-materia button.ativa {
    background: var(--acento);
    border-color: var(--acento);
    color: white;
    font-weight: 600;
}

/* ---------- Badges ---------- */

.badge {
    display: inline-block;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    background: var(--surface-muted);
    color: var(--texto-suave);
    border-radius: 4px;
    padding: 2px 6px;
}

.badge-materia { background: var(--acento-fundo); color: var(--acento-forte); }

/* topico "quente": alta probabilidade E no programa oficial 2027 - os
 * dois juntos, um selo raro de proposito (ver ehTopicoQuente em dashboard.js) */
.selo-quente { margin-left: 6px; font-size: 11px; letter-spacing: -1px; cursor: default; }
.badge-nivel-basico { background: var(--sucesso-fundo); color: var(--sucesso); }
.badge-nivel-intermediario { background: var(--alerta-fundo); color: var(--alerta); }
.badge-nivel-avancado { background: #f7e6e6; color: #a84f4f; }

/* ---------- Botoes ---------- */

.btn {
    font-family: var(--fonte-corpo);
    font-size: 13px;
    font-weight: 500;
    border: 1px solid var(--border-forte);
    color: var(--texto);
    background: var(--surface);
    border-radius: var(--raio-pequeno);
    padding: 7px 13px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

.btn:hover { background: var(--surface-muted); }
.btn-primario { background: var(--acento); border-color: var(--acento); color: white; }
.btn-primario:hover { background: var(--acento-forte); }
.btn-discreto { border-color: transparent; color: var(--texto-suave); background: transparent; }
.btn-discreto:hover { background: var(--surface-muted); color: var(--texto); }

/* ---------- Barra de probabilidade ---------- */

.prob { display: flex; align-items: center; gap: 10px; }
.prob-barra { height: 5px; width: 90px; background: var(--surface-muted); border-radius: 3px; overflow: hidden; flex-shrink: 0; }
.prob-preenchimento { height: 100%; background: var(--acento); }
.prob-texto { font-weight: 700; color: var(--acento-forte); font-size: 13px; min-width: 42px; text-align: right; }
.prob-detalhe { font-size: 11px; color: var(--texto-fraco); text-align: right; }

/* ---------- Anel de progresso circular (SVG, ver iniciarAnelProgresso) ---------- */

.anel-progresso { position: relative; display: inline-flex; align-items: center; justify-content: center; }
.anel-progresso svg { transform: rotate(-90deg); }
.anel-progresso .trilho { fill: none; stroke: var(--surface-muted); }
.anel-progresso .preenchimento { fill: none; stroke: var(--acento); stroke-linecap: round; transition: stroke-dashoffset 0.6s ease; }
.anel-progresso .valor {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    font-family: var(--fonte-titulo); font-weight: 700; font-size: 20px; color: var(--texto);
}

/* ---------- Linha "ver tudo" / progressive disclosure ---------- */

.ver-mais {
    text-align: center;
    padding: 14px;
}

.aviso {
    background: var(--alerta-fundo);
    border: 1px solid var(--alerta-borda);
    color: var(--alerta);
    border-radius: var(--raio-pequeno);
    padding: 10px 14px;
    font-size: 13px;
}

.carregando, .erro {
    text-align: center;
    padding: 40px 20px;
    color: var(--texto-suave);
}

.erro { color: #a84f4f; }

/* ---------- Responsivo ---------- */

@media (max-width: 860px) {
    .layout { flex-direction: column; }
    .barra-lateral {
        width: 100%;
        height: auto;
        position: static;
        flex-direction: row;
        align-items: center;
        gap: 14px;
        padding: 12px 16px;
        overflow-x: auto;
    }
    .marca-bloco .tagline { display: none; }
    .abas { flex-direction: row; }
    .aba { white-space: nowrap; }
    .auth-widget { white-space: nowrap; margin-left: auto; }
    .pagina { padding: 20px 16px 48px; }
}
