/* =============================================================
   ESTILO BASE - Atena Flashcards
   ============================================================= */
:root {
    --cor-primaria: #6b5f45;
    --cor-primaria-escura: #593d01;
    --cor-fundo: #f7f6f2;
    --cor-texto: #23281f;
    --cor-erro: #b3261e;
    --cor-sucesso: #2f6f4f;
    --cor-borda: #dcd8cd;
    --fonte: 'Segoe UI', Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }

.oculto { display: none !important; }

body {
    margin: 0;
    font-family: var(--fonte);
    background: var(--cor-fundo);
    color: var(--cor-texto);
    line-height: 1.5;
}

.container {
    max-width: 480px;
    margin: 60px auto;
    background: #fff;
    padding: 32px;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.container-largo {
    max-width: 1000px;
    margin: 40px auto;
    padding: 0 20px;
}

h1, h2 { color: var(--cor-primaria-escura); margin-top: 0; }

label {
    display: block;
    margin: 16px 0 6px;
    font-weight: 600;
    font-size: 14px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--cor-borda);
    border-radius: 8px;
    font-size: 15px;
}

input:focus { outline: 2px solid var(--cor-primaria); }

button, .botao {
    display: inline-block;
    background: var(--cor-primaria);
    color: #fff;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 20px;
    text-decoration: none;
    text-align: center;
}

button:hover, .botao:hover { background: var(--cor-primaria-escura); }

.mensagem-erro {
    background: #fdecea;
    color: var(--cor-erro);
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 14px;
    margin-top: 16px;
}

.mensagem-sucesso {
    background: #e9f5ee;
    color: var(--cor-sucesso);
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 14px;
    margin-top: 16px;
}

.link-secundario {
    display: block;
    text-align: center;
    margin-top: 18px;
    font-size: 14px;
}

.link-secundario a { color: var(--cor-primaria-escura); }

nav.topo {
    background: #fff;
    border-bottom: 1px solid var(--cor-borda);
    padding: 14px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

nav.topo a {
    color: var(--cor-texto);
    text-decoration: none;
    margin-left: 20px;
    font-size: 14px;
}

nav.topo strong { color: var(--cor-primaria-escura); font-size: 18px; }

.logo-link {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.logo-icone {
    height: 36px;
    width: auto;
    display: block;
}

.menu-usuario {
    position: relative;
}

.botao-menu {
    background: #fff;
    border: 1px solid var(--cor-borda);
    color: var(--cor-texto);
    font-size: 14px;
    font-weight: 600;
    padding: 9px 16px;
    border-radius: 8px;
    cursor: pointer;
    margin: 0;
}

.botao-menu:hover {
    background: #f0efe9;
}

.dropdown-menu {
    display: none;
    flex-direction: column;
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    background: #fff;
    border: 1px solid var(--cor-borda);
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    min-width: 190px;
    overflow: hidden;
    z-index: 200;
}

.dropdown-menu.aberto {
    display: flex;
}

.dropdown-menu a {
    margin-left: 0;
    padding: 12px 18px;
    border-bottom: 1px solid #eee;
}

.dropdown-menu a:last-child {
    border-bottom: none;
}

.dropdown-menu a:hover {
    background: #f0efe9;
}

.dropdown-menu a.nav-ativo {
    font-weight: 700;
    color: var(--cor-primaria);
    background: #f0f7f3;
}

.botao-perigo {
    background: var(--cor-erro);
}

.botao-perigo:hover {
    background: #8f1e17;
}

.zona-risco {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--cor-borda);
}

.zona-risco h2 {
    font-size: 16px;
    color: #666;
}

.zona-risco p {
    font-size: 14px;
    color: #777;
}

nav.topo a.nav-ativo { font-weight: 700; color: var(--cor-primaria); }

.cloze-oculto {
    background: #dbeafe;
    color: #1d4ed8;
    padding: 1px 8px;
    border-radius: 4px;
    font-weight: 600;
}

.cloze-resposta {
    background: #dbeafe;
    color: #1d4ed8;
    padding: 1px 8px;
    border-radius: 4px;
    font-weight: 700;
}

.separador-comentario {
    border: none;
    border-top: 1px dashed var(--cor-borda);
    margin: 14px 0;
}

.imagem-conteudo {
    max-width: 100%;
    border-radius: 8px;
    margin: 10px 0;
    display: block;
}

/* Árvore de categorias (filtro) */
.arvore-categorias-container {
    max-height: 320px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid var(--cor-borda);
    border-radius: 10px;
    padding: 12px 16px;
}

.titulo-caixa {
    font-size: 13px;
    font-weight: 700;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding-bottom: 8px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--cor-borda);
}

.conteudo-caixa-filtro {
    /* âncora para o conteúdo dinâmico gerado por JS, logo abaixo do título */
}

.arvore-categorias-lista {
    list-style: none;
    margin: 0;
    padding-left: 20px;
}

.no-categoria {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    user-select: none;
}

.no-categoria:hover { background: #f0efe9; }

.no-categoria label {
    font-weight: 400;
    cursor: pointer;
    margin: 0;
}

.no-categoria.nivel-raiz label {
    font-weight: 700;
}

.no-categoria.selecionado {
    background: var(--cor-primaria);
    color: #fff;
    font-weight: 600;
}

.no-categoria-raiz { font-weight: 600; margin-bottom: 4px; }

.seta-categoria {
    display: inline-block;
    width: 14px;
    font-size: 11px;
    color: #999;
}

.no-categoria.selecionado .seta-categoria { color: #fff; }

.contador-selecionados {
    text-align: center;
    font-size: 15px;
    color: var(--cor-primaria-escura);
    font-weight: 600;
    margin: 16px 0;
}

/* Modal de atalhos de teclado (reutilizado nas telas de estudo) */
.botao-atalhos {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: 1px solid var(--cor-borda);
    color: #666;
    font-size: 13px;
    padding: 8px 14px;
    border-radius: 8px;
    cursor: pointer;
    margin: 0 auto 16px;
}

.botao-atalhos:hover {
    background: #f0efe9;
}

.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.aberto {
    display: flex;
}

.modal-caixa {
    background: #fff;
    border-radius: 14px;
    padding: 28px;
    max-width: 380px;
    width: 100%;
    position: relative;
}

.modal-caixa h3 {
    margin-top: 0;
    color: var(--cor-primaria-escura);
}

.modal-fechar {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 20px;
    color: #999;
    cursor: pointer;
    margin: 0;
    padding: 4px;
    line-height: 1;
}

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

.lista-atalhos li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
    font-size: 14px;
}

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

.tecla {
    display: inline-block;
    background: #f0efe9;
    border: 1px solid var(--cor-borda);
    border-radius: 6px;
    padding: 3px 10px;
    font-family: monospace;
    font-size: 13px;
    font-weight: 600;
    color: var(--cor-texto);
}
