/* style.css
   Paleta quente (creme, marrom e dourado), inspirada em bibliotecas
   antigas e madeira — tipografia como protagonista: serifada (Fraunces)
   para títulos e destaques em itálico, sans-serif (Inter) para o
   restante da interface (formulários, textos de apoio, ícones). */

:root {
    /* Cores */
    --dourado: #a9752f;
    --dourado-escuro: #7d5620;
    --marrom-texto: #2b2018;
    --marrom-medio: #7d6a58;
    --bege-borda: #e6dbc8;
    --creme-fundo: #f4ede1;
    --branco: #fffdf8;

    /* Tipografia */
    --fonte-corpo: "Inter", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --fonte-destaque: "Fraunces", Georgia, "Times New Roman", serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--fonte-corpo);
    color: var(--marrom-texto);
    background-color: var(--creme-fundo);
    background-image:
        radial-gradient(circle at 12% -10%, rgba(169, 117, 47, 0.12), transparent 45%),
        radial-gradient(circle at 100% 0%, rgba(169, 117, 47, 0.07), transparent 40%);
    background-attachment: fixed;
}

h1, h2 {
    font-family: var(--fonte-destaque);
    font-weight: 500;
    color: var(--marrom-texto);
    margin: 0 0 0.5rem;
}

h1 em, h2 em {
    font-style: italic;
    text-decoration: underline;
    text-decoration-color: var(--dourado);
    text-decoration-thickness: 1.5px;
    text-underline-offset: 4px;
}

.cabecalho {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 2rem;
    background-color: var(--branco);
    border-bottom: 1px solid var(--bege-borda);
}

.marca {
    font-family: var(--fonte-corpo);
    font-weight: 600;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--marrom-texto);
    text-decoration: none;
}

.cabecalho-nav {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.9rem;
}

.usuario-logado {
    color: var(--marrom-medio);
    font-size: 0.8rem;
    margin-right: 0.4rem;
}

.cabecalho a {
    color: inherit;
    text-decoration: none;
}

.icone-botao {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    color: var(--marrom-texto);
    transition: background-color 0.15s ease, color 0.15s ease;
}

.icone-botao:hover {
    background-color: var(--creme-fundo);
    color: var(--dourado-escuro);
}

.conteudo {
    display: flex;
    justify-content: center;
    padding: 4rem 1.5rem;
}

.cartao-formulario {
    background-color: var(--branco);
    border: 1px solid var(--bege-borda);
    border-radius: 16px;
    padding: 2.75rem;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 1px 2px rgba(43, 32, 24, 0.04), 0 10px 28px rgba(43, 32, 24, 0.06);
}

.cartao-formulario h1 {
    margin-top: 0;
    font-size: 1.9rem;
    line-height: 1.2;
}

.cartao-formulario form {
    display: flex;
    flex-direction: column;
}

.cartao-formulario label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--marrom-medio);
    margin-top: 1.1rem;
    margin-bottom: 0.4rem;
}

.cartao-formulario input {
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--bege-borda);
    border-radius: 8px;
    font-family: var(--fonte-corpo);
    font-size: 0.95rem;
    color: var(--marrom-texto);
    background-color: var(--branco);
}

.cartao-formulario input:focus {
    outline: none;
    border-color: var(--dourado);
    box-shadow: 0 0 0 3px rgba(169, 117, 47, 0.15);
}

.cartao-formulario button {
    margin-top: 1.75rem;
    padding: 0.8rem;
    font-size: 0.95rem;
}

.link-secundario {
    margin-top: 1.5rem;
    font-size: 0.85rem;
    color: var(--marrom-medio);
    text-align: center;
}

.link-secundario a {
    color: var(--dourado-escuro);
    text-decoration: none;
}

.link-secundario a:hover {
    text-decoration: underline;
}

.alerta {
    background-color: #fdf2ee;
    border: 1px solid #f0c9b4;
    color: #9a3412;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    max-width: 380px;
    font-size: 0.9rem;
}

/* Cartão mais largo, usado nas telas de sessões (mais conteúdo que login/cadastro) */
.cartao-largo {
    max-width: 640px;
}

.descricao {
    color: var(--marrom-medio);
    font-size: 0.9rem;
    line-height: 1.6;
}

.cabecalho-home {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.75rem;
}

.cabecalho-home h1 {
    margin: 0;
}

/* Botão principal: caixa com borda e texto serifado em itálico —
   inverte para preenchido ao passar o mouse. */
.botao-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--branco);
    color: var(--marrom-texto);
    border: 1.5px solid var(--marrom-texto);
    text-decoration: none;
    padding: 0.6rem 1.25rem;
    border-radius: 8px;
    font-family: var(--fonte-destaque);
    font-style: italic;
    font-weight: 500;
    font-size: 0.98rem;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
    white-space: nowrap;
}

.cartao-formulario button,
.botao-link {
    background-color: var(--branco);
    color: var(--marrom-texto);
    border: 1.5px solid var(--marrom-texto);
    border-radius: 8px;
    font-family: var(--fonte-destaque);
    font-style: italic;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.cartao-formulario button:hover,
.botao-link:hover {
    background-color: var(--marrom-texto);
    color: var(--branco);
}

.lista-sessoes {
    list-style: none;
    padding: 0;
    margin: 0;
}

.lista-sessoes li {
    border-bottom: 1px solid var(--bege-borda);
}

.lista-sessoes li:last-child {
    border-bottom: none;
}

.lista-sessoes a {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 1rem 0.25rem;
    text-decoration: none;
    color: var(--marrom-texto);
}

.lista-sessoes a:hover {
    background-color: var(--creme-fundo);
}

.titulo-sessao {
    font-weight: 500;
}

.meta-sessao {
    font-size: 0.8rem;
    color: var(--marrom-medio);
}

.info-sessao {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.5rem 1rem;
    font-size: 0.9rem;
    margin: 1.5rem 0;
}

.info-sessao dt {
    color: var(--marrom-medio);
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    align-self: center;
}

.info-sessao dd {
    margin: 0;
}

.previa-texto {
    background-color: var(--creme-fundo);
    border: 1px solid var(--bege-borda);
    border-radius: 8px;
    padding: 1rem;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.78rem;
    color: var(--marrom-texto);
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 300px;
    overflow-y: auto;
}

/* --- Tela de estudo (questão) --- */

.progresso {
    color: var(--marrom-medio);
    font-size: 0.85rem;
    margin: 0 0 0.75rem;
}

.etiqueta-tipo,
.etiqueta-assunto {
    display: inline-block;
    font-size: 0.75rem;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    margin-right: 0.5rem;
    margin-bottom: 1rem;
}

.etiqueta-tipo {
    background-color: #f2e6cf;
    color: var(--dourado-escuro);
}

.etiqueta-assunto {
    background-color: var(--creme-fundo);
    color: var(--marrom-medio);
    border: 1px solid var(--bege-borda);
}

/* Badge "Tentativa N" — usada em títulos de sessão que foram reiniciadas */
.etiqueta-tentativa {
    display: inline-block;
    font-family: var(--fonte-corpo);
    font-style: normal;
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    background-color: #f2e6cf;
    color: var(--dourado-escuro);
    vertical-align: middle;
    white-space: nowrap;
}

.cartao-formulario h1.enunciado {
    font-size: 1.3rem;
    font-style: normal;
    line-height: 1.5;
    margin: 0 0 1.5rem;
}

.cartao-formulario textarea {
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--bege-borda);
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--marrom-texto);
    background-color: var(--branco);
    resize: vertical;
}

.cartao-formulario textarea:focus {
    outline: none;
    border-color: var(--dourado);
    box-shadow: 0 0 0 3px rgba(169, 117, 47, 0.15);
}

/* --- Julgamento (resultado de uma resposta) ---
   Cores semânticas (verde/amarelo/vermelho) mantidas de propósito,
   para preservar a leitura imediata de certo/incompleto/errado. */

.etiqueta-julgamento {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    margin-bottom: 1rem;
}

.etiqueta-correta {
    background-color: #dcfce7;
    color: #166534;
}

.etiqueta-incompleta {
    background-color: #fef9c3;
    color: #854d0e;
}

.etiqueta-incorreta {
    background-color: #fee2e2;
    color: #991b1b;
}

/* --- Conclusão da sessão --- */

.lista-resumo {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0;
}

.lista-resumo li {
    border-bottom: 1px solid var(--bege-borda);
    padding: 1rem 0;
}

.lista-resumo li:last-child {
    border-bottom: none;
}

.cabecalho-resumo {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.numero-questao {
    font-size: 0.85rem;
    color: var(--marrom-medio);
}

.enunciado-resumo {
    font-weight: 500;
    margin: 0.25rem 0;
}

.resposta-resumo {
    font-size: 0.88rem;
    color: var(--marrom-texto);
    background-color: var(--creme-fundo);
    border: 1px solid var(--bege-borda);
    border-radius: 8px;
    padding: 0.65rem 0.85rem;
    margin: 0.5rem 0;
    white-space: pre-wrap;
}

.rotulo-resposta-resumo {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--marrom-medio);
    margin-bottom: 0.25rem;
}

.feedback-resumo {
    font-size: 0.85rem;
    color: var(--marrom-medio);
    margin: 0;
}

/* --- Tela de desempenho --- */

.cartoes-totais {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin: 1.5rem 0 2rem;
}

.cartao-total {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 1rem 0.5rem;
    background-color: var(--creme-fundo);
    border: 1px solid var(--bege-borda);
    border-radius: 8px;
}

.numero-total {
    font-family: var(--fonte-destaque);
    font-size: 1.6rem;
    font-weight: 600;
}

.rotulo-total {
    font-size: 0.75rem;
    color: var(--marrom-medio);
    text-align: center;
}

.cor-correta {
    color: #166534;
}

.cor-incompleta {
    color: #854d0e;
}

.cor-incorreta {
    color: #991b1b;
}

.lista-assuntos {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
}

.lista-assuntos li {
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--bege-borda);
}

.lista-assuntos li:last-child {
    border-bottom: none;
}

.cabecalho-assunto {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.nome-assunto {
    font-weight: 500;
}

.total-assunto {
    color: var(--marrom-medio);
    font-size: 0.8rem;
}

.barra-assunto {
    display: flex;
    height: 8px;
    border-radius: 999px;
    overflow: hidden;
    background-color: var(--bege-borda);
}

.segmento-barra {
    height: 100%;
}

.segmento-correta {
    background-color: #22c55e;
}

.segmento-incompleta {
    background-color: #eab308;
}

.segmento-incorreta {
    background-color: #ef4444;
}

.legenda-percentuais {
    display: flex;
    flex-wrap: wrap;
    gap: 0.15rem 0.75rem;
    font-size: 0.75rem;
    color: var(--marrom-medio);
    margin: 0.4rem 0 0;
}

.legenda-item::before {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    margin-right: 0.3rem;
}

.legenda-correta::before {
    background-color: #22c55e;
}

.legenda-incompleta::before {
    background-color: #eab308;
}

.legenda-incorreta::before {
    background-color: #ef4444;
}

/* --- Desempenho por sessão --- */

.lista-sessoes-desempenho {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
}

.bloco-sessao-desempenho {
    padding: 1.1rem 0;
    border-bottom: 1px solid var(--bege-borda);
}

.bloco-sessao-desempenho:last-child {
    border-bottom: none;
}

.cabecalho-sessao-desempenho {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.5rem;
}

.titulo-sessao-desempenho {
    font-family: var(--fonte-destaque);
    font-style: italic;
    font-weight: 500;
    font-size: 1.05rem;
}

.lista-assuntos-sessao {
    margin: 0.9rem 0 0 1rem;
    padding-left: 0.85rem;
    border-left: 2px solid var(--bege-borda);
}

/* --- Botão secundário (ex: gerar reforço) --- */

.form-reforco {
    display: inline-block;
    margin-top: 0.75rem;
}

.botao-secundario {
    background-color: var(--branco);
    color: var(--dourado-escuro);
    border: 1px solid var(--dourado);
    padding: 0.55rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
}

.botao-secundario:hover {
    background-color: #faf3e7;
}

.acoes-conclusao {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* --- Formulário de quantidade de questões --- */

.form-quantidade {
    display: flex;
    flex-direction: column;
    max-width: 260px;
}

.form-quantidade label {
    font-size: 0.85rem;
    color: var(--marrom-medio);
    margin-bottom: 0.35rem;
}

.form-quantidade input[type="number"] {
    padding: 0.55rem 0.75rem;
    border: 1px solid var(--bege-borda);
    border-radius: 8px;
    font-size: 0.95rem;
    width: 100px;
}

.form-quantidade button {
    margin-top: 1rem;
    align-self: flex-start;
}

.descricao-pequena {
    font-size: 0.8rem;
    color: var(--marrom-medio);
    margin: 0.5rem 0 0;
}

.form-mais-questoes {
    margin-top: 1rem;
}

.form-mais-questoes summary {
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--dourado-escuro);
}

.form-mais-questoes .form-quantidade {
    margin-top: 0.75rem;
}

@media (max-width: 560px) {
    .usuario-logado {
        display: none;
    }

    .cabecalho {
        padding: 1rem 1.25rem;
    }

    .conteudo {
        padding: 2.5rem 1rem;
    }

    .cartoes-totais {
        grid-template-columns: repeat(2, 1fr);
    }
}
