/* Paleta compartilhada. As famílias de componentes mantêm seus próprios tokens.
   Carregado por último, sem redefinir cards, cartazes ou imagens por heurística. */
html { color-scheme: dark; }
html.light-theme-early { color-scheme: light; background-color: #f4f1ea; }
:root.light-theme-early,
:root.light-theme-early body,
body.light-theme {
    --bg: #f4f1ea;
    --surface: #fff;
    --surface2: #ece9e2;
    --bg-soft: #fff;
    --border: rgba(30, 41, 59, .14);
    --border2: rgba(30, 41, 59, .24);
    --text: #1e293b;
    --text-main: #1e293b;
    --muted: #526070;
    --text-muted: #526070;
    --status-error: #b42318;
    --accent: #c8a84b;
    --accent2: #e8c96a;
    --accent-ink: #806117;
    --accent-ink-hover: #6c4e10;
    --link-color: #806117;
    --link-hover-color: #6c4e10;
    --cyan: #0369a1;
    --violet: #6d28d9;
    --green: #047857;
    --type-movie: #be123c;
    --type-tv: #6d28d9;
    --type-game: #15803d;
    --type-book: #854d0e;
    --type-music: #be185d;
    color-scheme: light;
}
:root.light-theme-early body,
body.light-theme { background-color: var(--bg); color: var(--text); }

/* Baixa especificidade permite que campos de busca e controles personalizados
   preservem seus estados e superfícies sem recorrer a !important. */
:where(html.light-theme-early, body.light-theme) :where(
    input:not([type=checkbox], [type=radio], [type=range], [type=button], [type=submit], [type=reset], [type=color], [type=image]),
    select, textarea
) {
    background-color: #fff;
    color: #1e293b;
    border-color: #86909c;
    caret-color: #806117;
}
:where(html.light-theme-early, body.light-theme) :where(input, textarea)::placeholder {
    color: #596579;
    opacity: 1;
}
:is(html.light-theme-early, body.light-theme) select option { background: #fff; color: #1e293b; }
:is(html.light-theme-early, body.light-theme) :is(input[type=checkbox], input[type=radio], input[type=range]) { accent-color: #806117; }
:is(html.light-theme-early, body.light-theme) :focus-visible { outline: 2px solid #806117; outline-offset: 3px; }
:where(a, button, input, select, textarea, summary, [role="button"], [tabindex]):focus-visible {
    outline: 3px solid #e8c96a;
    outline-offset: 3px;
}
:is(html.light-theme-early, body.light-theme) :where(a, button, input, select, textarea, summary, [role="button"], [tabindex]):focus-visible {
    outline-color: #806117;
}
:is(html.light-theme-early, body.light-theme) ::selection { background: #e4ce91; color: #1e293b; }
:is(html.light-theme-early, body.light-theme) ::-webkit-scrollbar-thumb { background: #9a8b68; }
:is(html.light-theme-early, body.light-theme) ::-webkit-scrollbar-thumb:hover { background: #806117; }

/* Cabeçalhos compartilhados também aparecem em páginas sem base.css. */
:is(html.light-theme-early, body.light-theme) .topbar {
    background: rgba(244, 241, 234, .96);
    border-bottom-color: var(--border);
    color: var(--text);
    box-shadow: 0 1px 0 var(--border);
}
:is(html.light-theme-early, body.light-theme) .topbar.scrolled,
html.light-theme-early body.gs-page .topbar,
body.light-theme.gs-page .topbar { background: rgba(244, 241, 234, .97); border-bottom-color: var(--border); }
:is(html.light-theme-early, body.light-theme) .topbar :is(.topbar-back, .topbar-user, .btn-voltar, .btn-back, .btn-header, .search-icon-btn) {
    color: #526070;
    border-color: var(--border2);
}
:is(html.light-theme-early, body.light-theme) .topbar :is(.topbar-back, .topbar-user, .btn-voltar, .btn-back, .btn-header, .search-icon-btn):hover {
    color: #1e293b;
    background-color: #e7e3da;
}
:is(html.light-theme-early, body.light-theme) .logout { color: #526070; background: #fff; border-color: var(--border2); }
:is(html.light-theme-early, body.light-theme) .logout:hover { color: #1e293b; background: #e7e3da; }
