/* NB Invicta Rede — contraste e consistência do modo escuro v48.
   Esta camada é carregada por último para corrigir páginas antigas sem alterar o
   tema visual próprio do catálogo NB Games nem dos jogos reais. */

html[data-nb-theme="dark"] {
  color-scheme: dark;
  --nb-ink: #f8fbff;
  --nb-muted: #d4e0ef;
  --nb-faint: #b8c8db;
  --nb-line: rgba(221, 235, 252, 0.2);
  --nb-line-strong: rgba(221, 235, 252, 0.34);
  --nb-surface: #0d223b;
  --nb-surface-soft: #132d4c;
  --nb-soft: #173a61;
}

html[data-nb-theme="dark"] body:not(.games-page):not([data-games-project]) {
  color: #f8fbff !important;
  background:
    radial-gradient(circle at 12% -8%, rgba(41, 111, 211, 0.2), transparent 32rem),
    linear-gradient(180deg, #061321, #091b2f 55%, #071526) !important;
}

html[data-nb-theme="dark"] body:not(.games-page):not([data-games-project])
  :where(h1, h2, h3, h4, h5, h6, legend, th) {
  color: #f8fbff;
}

html[data-nb-theme="dark"] body:not(.games-page):not([data-games-project])
  :where(input:not([type="checkbox"]):not([type="radio"]), select, textarea) {
  border-color: rgba(215, 232, 252, 0.28) !important;
  color: #f8fbff !important;
  background: #102a46 !important;
  caret-color: #fff !important;
}

html[data-nb-theme="dark"] body:not(.games-page):not([data-games-project])
  :where(input, textarea)::placeholder {
  color: #bdcce0 !important;
  opacity: 1 !important;
}

html[data-nb-theme="dark"] body:not(.games-page):not([data-games-project]) select option {
  color: #f8fbff !important;
  background: #102a46 !important;
}

/* Navegação desktop e mobile. */
html[data-nb-theme="dark"] body:not(.games-page):not([data-games-project]) .site-category-panel,
html[data-nb-theme="dark"] body:not(.games-page):not([data-games-project]) .site-menu-group {
  border-color: #2d4b6b !important;
  color: #f8fbff !important;
  background: linear-gradient(180deg, #142e4c, #0d2239) !important;
}

html[data-nb-theme="dark"] body:not(.games-page):not([data-games-project]) .site-menu-group h3 {
  color: #91c4ff !important;
}

html[data-nb-theme="dark"] body:not(.games-page):not([data-games-project])
  :where(.site-menu-links a, .site-menu-links span, .nb-mobile-primary-v33 a) {
  color: #f8fbff !important;
}

html[data-nb-theme="dark"] body:not(.games-page):not([data-games-project]) .site-menu-links small {
  color: #c6d4e6 !important;
}

html[data-nb-theme="dark"] body:not(.games-page):not([data-games-project])
  :where(.site-menu-links a:hover, .site-menu-links a:focus-visible) {
  background: #1c3a5e !important;
}

html[data-nb-theme="dark"] body:not(.games-page):not([data-games-project]) .nb-mobile-menu-v33 {
  border-color: #2d4b6b !important;
  color: #f8fbff !important;
  background: #0b1f35 !important;
}

html[data-nb-theme="dark"] body:not(.games-page):not([data-games-project])
  :where(.nb-mobile-menu-close-v33, .nb-mobile-primary-v33 a, .nb-mobile-groups-v33 .site-menu-group) {
  border-color: #2d4b6b !important;
  color: #f8fbff !important;
  background: #132d4c !important;
}

/* Controlos e estados comuns. */
html[data-nb-theme="dark"] body:not(.games-page):not([data-games-project])
  :where(.nb-button-secondary-v2, .nb-button-quiet-v2) {
  border-color: #54779e !important;
  color: #f8fbff !important;
  background: #193b60 !important;
}

html[data-nb-theme="dark"] body:not(.games-page):not([data-games-project])
  :where(.nb-button-secondary-v2, .nb-button-quiet-v2):hover {
  border-color: #83b7ee !important;
  color: #fff !important;
  background: #24517f !important;
}

html[data-nb-theme="dark"] body:not(.games-page):not([data-games-project])
  :where(.section-chip, .tool-kicker, .nb-eyebrow-v2, .settings-note, .article-breadcrumb-v37) {
  color: #c5d8ee !important;
}

html[data-nb-theme="dark"] body:not(.games-page):not([data-games-project])
  :where(kbd, .nb-search-shortcut-v2) {
  border-color: #6685a8 !important;
  color: #f8fbff !important;
  background: #173553 !important;
}

/* Início: pesquisa e cartões de acesso rápido. */
html[data-nb-theme="dark"] body:not(.games-page):not([data-games-project])
  .nb-premium-hero-v33 .nb-hero-search-v32 > div {
  border-color: rgba(202, 225, 255, 0.35) !important;
  background: rgba(6, 24, 48, 0.92) !important;
}

html[data-nb-theme="dark"] body:not(.games-page):not([data-games-project])
  .nb-premium-hero-v33 .nb-hero-search-v32 input {
  color: #f8fbff !important;
  background: #102b49 !important;
}

html[data-nb-theme="dark"] body:not(.games-page):not([data-games-project]) .nb-search-symbol-v33 {
  border-color: #b8cae0 !important;
}

html[data-nb-theme="dark"] body:not(.games-page):not([data-games-project]) .nb-search-symbol-v33::after {
  background: #b8cae0 !important;
}

html[data-nb-theme="dark"] body:not(.games-page):not([data-games-project])
  .nb-premium-hero-v33 .nb-hero-search-v32 button {
  color: #fff !important;
  background: #176ee5 !important;
}

html[data-nb-theme="dark"] body:not(.games-page):not([data-games-project]) .nb-hero-project-grid-v33 > a {
  border-color: rgba(201, 224, 250, 0.25) !important;
  color: #f8fbff !important;
  background: linear-gradient(145deg, #173453, #0d253f) !important;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.24) !important;
}

html[data-nb-theme="dark"] body:not(.games-page):not([data-games-project])
  .nb-hero-project-grid-v33 > a:hover {
  border-color: #77afe9 !important;
  background: linear-gradient(145deg, #1d4168, #12304f) !important;
}

html[data-nb-theme="dark"] body:not(.games-page):not([data-games-project])
  .nb-hero-project-grid-v33 :where(strong, small) {
  color: #f8fbff !important;
}

html[data-nb-theme="dark"] body:not(.games-page):not([data-games-project]) .nb-hero-project-grid-v33 small {
  color: #cfdbeb !important;
}

html[data-nb-theme="dark"] body:not(.games-page):not([data-games-project])
  :where(.nb-topic-paths-v32, .nb-project-card-v2, .nb-start-card-v2, .nb-tool-card-v2, .nb-news-card-v2, .nb-personal-card-v2) {
  border-color: #294866 !important;
  color: #f8fbff !important;
  background: #0e253f !important;
}

html[data-nb-theme="dark"] body:not(.games-page):not([data-games-project])
  :where(.nb-project-card-v2 h3, .nb-project-card-v2 p, .nb-project-card-v2 strong, .nb-project-card-v2 > span) {
  color: #f8fbff !important;
}

html[data-nb-theme="dark"] body:not(.games-page):not([data-games-project]) .nb-project-card-v2 > p {
  color: #cedaea !important;
}

/* Projetos, Academia e conteúdos gerados por versões anteriores. */
html[data-nb-theme="dark"] body:not(.games-page):not([data-games-project])
  :where(.projects-page-group-v35, .academy-areas-v35, .academy-future-v35, .academy-next-five-v36) {
  border-color: #2a4868 !important;
  color: #f8fbff !important;
  background: linear-gradient(145deg, #102a46, #0c2139) !important;
}

html[data-nb-theme="dark"] body:not(.games-page):not([data-games-project])
  :where(.projects-page-grid article, .academy-areas-grid-v35 > a, .academy-future-grid-v35 > a, .academy-next-five-grid-v36 article) {
  border-color: #2b4a6a !important;
  color: #f8fbff !important;
  background: #132e4d !important;
}

html[data-nb-theme="dark"] body:not(.games-page):not([data-games-project])
  :where(.projects-page-group-head-v35 h2, .projects-page-grid h3, .academy-areas-grid-v35 strong,
    .academy-future-grid-v35 h3, .academy-next-five-grid-v36 h3) {
  color: #f8fbff !important;
}

html[data-nb-theme="dark"] body:not(.games-page):not([data-games-project])
  :where(.projects-page-group-head-v35 p, .projects-page-grid p, .academy-areas-grid-v35 small,
    .academy-future-grid-v35 p, .academy-next-five-v36 p, .academy-next-five-v36 > header p) {
  color: #cedaea !important;
}

html[data-nb-theme="dark"] body:not(.games-page):not([data-games-project])
  :where(.academy-future-grid-v35 > a > strong, .academy-next-five-grid-v36 span) {
  color: #a9ceff !important;
}

/* Centro de conteúdos e artigos indexáveis. */
html[data-nb-theme="dark"] body:not(.games-page):not([data-games-project])
  :where(.content-hub-v37, .content-article-v37) {
  color: #f8fbff !important;
}

html[data-nb-theme="dark"] body:not(.games-page):not([data-games-project])
  :where(.content-card-v37, .content-trust-v37, .article-toc-v37, .article-step-v37,
    .article-note-v37, .article-faq-v37 details) {
  border-color: #2b4a6a !important;
  color: #f8fbff !important;
  background: #102944 !important;
}

html[data-nb-theme="dark"] body:not(.games-page):not([data-games-project])
  :where(.content-card-v37 h2, .content-card-v37 h3, .content-card-v37 strong,
    .article-toc-v37 strong, .article-faq-v37 summary) {
  color: #f8fbff !important;
}

html[data-nb-theme="dark"] body:not(.games-page):not([data-games-project])
  :where(.content-section-head-v37 p, .content-card-v37 p, .content-trust-v37 p,
    .article-head-v37 > p, .article-copy-v37 p, .article-copy-v37 li, .article-toc-v37 a) {
  color: #cbd8e8 !important;
}

html[data-nb-theme="dark"] body:not(.games-page):not([data-games-project])
  :where(.content-card-v37 > span, .article-meta-v37 span) {
  color: #b7d8ff !important;
  background: #183c63 !important;
}

/* Definições, conta, rede pessoal e instalação PWA. */
html[data-nb-theme="dark"] body:not(.games-page):not([data-games-project])
  :where(.settings-card, .profile-card, .my-network-stats, .my-network-panel,
    .my-network-project, .my-network-event, .my-network-empty, .my-network-privacy,
    .nb-pwa-install-card) {
  border-color: #2b4a6a !important;
  color: #f8fbff !important;
  background: #102944 !important;
}

html[data-nb-theme="dark"] body:not(.games-page):not([data-games-project])
  :where(.settings-card p, .settings-note, .my-network-head p, .my-network-panel > p,
    .my-network-project p, .my-network-event small, .my-network-event time,
    .my-network-empty, .my-network-privacy p, .nb-pwa-install-card p) {
  color: #ccd9e9 !important;
}

html[data-nb-theme="dark"] body:not(.games-page):not([data-games-project])
  :where(.settings-actions button, .nb-pwa-install-actions button) {
  border-color: #54779e !important;
  color: #f8fbff !important;
  background: #173a60 !important;
}

html[data-nb-theme="dark"] body:not(.games-page):not([data-games-project])
  :where(.settings-actions button:hover, .settings-actions button:focus-visible,
    .nb-pwa-install-actions button:hover, .nb-pwa-install-actions button:focus-visible) {
  border-color: #8cc3ff !important;
  background: #24547f !important;
}

html[data-nb-theme="dark"] body:not(.games-page):not([data-games-project])
  :where(.my-network-stat span, .my-network-stat small, .my-network-project header span,
    .my-network-progress-copy) {
  color: #c5d4e6 !important;
}

/* Suite educativa: cartões, painéis e cabeçalho mantêm identidade, mas ganham leitura. */
html[data-nb-theme="dark"] body.learn-body:not(.games-page):not([data-games-project]) {
  --learn-ink: #f8fbff;
  --learn-muted: #cbd8e8;
  --learn-paper: #071526;
  --learn-card: #102944;
  --learn-line: #2b4a6a;
}

html[data-nb-theme="dark"] body.learn-body:not(.games-page):not([data-games-project])
  :where(.learn-header, .learn-progress-strip, .learn-card, .learn-panel, .learn-activity-card,
    .learn-goal-card, .learn-quiz-card) {
  border-color: var(--learn-line) !important;
  color: var(--learn-ink) !important;
  background: var(--learn-card) !important;
}

html[data-nb-theme="dark"] body.learn-body:not(.games-page):not([data-games-project])
  :where(.learn-nav a, .learn-breadcrumb, .learn-section-head p, .learn-card p, .learn-panel p) {
  color: var(--learn-muted) !important;
}

html[data-nb-theme="dark"] body.academy-body .academy-tool-icon {
  color: #d9e9ff !important;
  background: #26305f !important;
}

html[data-nb-theme="dark"] body.academy-body .academy-pillar .academy-pillar-state {
  color: #ddfff2 !important;
  background: #155843 !important;
}

html[data-nb-theme="dark"] body.academy-body .academy-pillar .academy-pillar-state.is-next {
  color: #fff1c1 !important;
  background: #6b4a08 !important;
}

html[data-nb-theme="dark"] body.academy-body .academy-button {
  color: #062e34 !important;
  background: #63e6dc !important;
}

html[data-nb-theme="dark"] body.academy-body .academy-button span {
  color: inherit !important;
}

html[data-nb-theme="dark"] body.academy-body .academy-nav a[aria-current="page"] {
  color: #fff !important;
  background: #34308c !important;
}

html[data-nb-theme="dark"] body.academy-body .academy-skip {
  color: #fff !important;
  background: #171c43 !important;
}

html[data-nb-theme="dark"] body.academy-body .academy-action:not(.is-muted):not(.is-danger) {
  color: #fff !important;
  background: #4338ca !important;
}

/* FaturaCerta: estados e resumo mensal deixam de desaparecer no fundo escuro. */
html[data-nb-theme="dark"] body.fc-home-v2
  :where(.fc-status-chip-v2, .fc-plan-state-v2, .fc-summary-card-v2, .fc-summary-item-v2) {
  border-color: #3b5c7d !important;
  color: #f8fbff !important;
  background: #173854 !important;
}

html[data-nb-theme="dark"] body.fc-home-v2
  :where(.fc-status-chip-v2.is-ready, .fc-plan-state-v2.is-positive) {
  color: #d6fff0 !important;
  background: #10503f !important;
}

html[data-nb-theme="dark"] body.fc-home-v2
  :where(.fc-plan-state-v2.is-warning, .fc-status-chip-v2.is-warning) {
  color: #fff2c7 !important;
  background: #684b0c !important;
}

/* LeiClara: ações principais e avisos continuam claramente distinguíveis. */
html[data-nb-theme="dark"] body.lc-home-v2 .lc-primary-action-v2 {
  color: #fff !important;
  background: #1764c4 !important;
}

html[data-nb-theme="dark"] body.lc-home-v2
  :where(.lc-status-chip-v2, .lc-path-state-v2) {
  border-color: #3b5c7d !important;
  color: #f8fbff !important;
  background: #173854 !important;
}

/* FardaPronta: dourado acessível e texto dos avisos legível. */
html[data-nb-theme="dark"] body.fp-body
  :where(.fp-disclaimer, .fp-info, .fp-note, .fp-study-note) {
  border-color: #6d5a2a !important;
  color: #f5ead0 !important;
  background: #302812 !important;
}

html[data-nb-theme="dark"] body.fp-body :where(.fp-primary, .fp-button-primary) {
  color: #071526 !important;
  background: #f1c65c !important;
}

html[data-nb-theme="dark"] body.fp-body .fp-safety > span {
  color: #071526 !important;
  background: #e3b53e !important;
}

html[data-nb-theme="dark"] body.fp-body :where(.fp-disclaimer p, .fp-info p, .fp-note p) {
  color: #f5ead0 !important;
}

html[data-nb-theme="dark"] body.psp-study-body
  :where(.psp-hub-card, .psp-hub-note, .psp-study-provenance) {
  border-color: #31556f !important;
  color: #edf6fc !important;
  background: #0d2638 !important;
}

html[data-nb-theme="dark"] body.psp-study-body
  :where(.psp-hub-card h2, .psp-hub-card h3, .psp-hub-note h2, .psp-study-provenance h2) {
  color: #f8fbff !important;
}

html[data-nb-theme="dark"] body.psp-study-body
  :where(.psp-hub-card > span, .psp-hub-card p, .psp-hub-note p, .psp-hub-note li, .psp-study-provenance p) {
  color: #c7d9e6 !important;
}

html[data-nb-theme="dark"] body.psp-study-body .psp-hub-card strong {
  color: #8fc7ff !important;
}

html[data-nb-theme="dark"] body.psp-study-body .psp-study-alert {
  border-color: #806b2d !important;
  border-left-color: #e0b43e !important;
  color: #fff2c9 !important;
  background: #302812 !important;
}

html[data-nb-theme="dark"] body.psp-study-body .psp-study-alert p {
  color: #f2e6c1 !important;
}

/* Digital Seguro e outros futuros: etiquetas informativas com contraste AA. */
html[data-nb-theme="dark"] body.edu-future-body
  :where(.edu-status, .edu-chip, .edu-tag) {
  border-color: #71cfc7 !important;
  color: #e8fffc !important;
  background: #13534f !important;
}

/* O TreinoASério já é escuro; reforçamos apenas texto secundário e formulários. */
html[data-nb-theme="dark"] body.tas-home-v2
  :where(.tas-board-state-v2, .tas-board-next-v2 small, .tas-panel-v2 p,
    .tas-form-status-v2, .tas-session-item-v2 small, .tas-empty-state-v2 p,
    .tas-tool-card-v2 > small, .tas-disclaimer-v2 p) {
  color: #d2d4da !important;
}

html[data-nb-theme="dark"] body.tas-home-v2
  :where(input, select, textarea) {
  border-color: rgba(255, 255, 255, 0.24) !important;
  color: #fff !important;
  background: #191b20 !important;
}

@media (forced-colors: active) {
  html[data-nb-theme="dark"] body:not(.games-page):not([data-games-project])
    :where(a, button, input, select, textarea, summary) {
    forced-color-adjust: auto;
  }
}
