/* Temas alternativos do site (escuro = padrao, sem data-theme ou "escuro").
   So entra em cena em html[data-theme="claro"|"oceano"|"floresta"]; o tema
   padrao nao recebe nenhuma destas regras (escuro renderiza identico). */

html[data-theme="claro"] {
  --rc-bg: #f8fafc; --rc-bg-deep: #f1f5f9;
  --rc-surface-95: rgba(255, 255, 255, 0.95);
  --rc-surface-90: rgba(255, 255, 255, 0.92);
  --rc-surface-70: rgba(241, 245, 249, 0.9);
  --rc-text: #0f172a; --rc-text-dim: #334155;
  --rc-muted: #475569; --rc-muted-2: #475569;
  --rc-accent: #4338ca; --rc-accent-2: #6d28d9;
  --rc-accent-strong: #4338ca; --rc-accent-hover: #3730a3;
  --rc-border: #e2e8f0; --rc-border-soft: #e2e8f0;
  --rc-accent-soft: rgba(67, 56, 202, 0.08); --rc-accent-soft2: rgba(109, 40, 217, 0.08);
  --rc-accent-soft3: rgba(67, 56, 202, 0.3);
  --rc-hero-from: #e0e7ff; --rc-alt-from: #eef2ff;
  --rc-shadow: rgba(100, 116, 139, 0.25);
  --rc-btn-a: #4338ca; --rc-btn-b: #6d28d9;
  --rc-hover: rgba(67, 56, 202, 0.1); --rc-hover-strong: rgba(67, 56, 202, 0.18);
}
html[data-theme="oceano"] {
  --rc-bg: #04151f; --rc-bg-deep: #031017;
  --rc-surface-95: rgba(11, 37, 52, 0.95);
  --rc-surface-90: rgba(11, 37, 52, 0.9);
  --rc-surface-70: rgba(15, 48, 68, 0.75);
  --rc-text: #e0f2fe; --rc-text-dim: #b8dcff;
  --rc-muted: #94b8cc; --rc-muted-2: #94b8cc;
  --rc-accent: #38bdf8; --rc-accent-2: #22d3ee;
  --rc-accent-strong: #38bdf8; --rc-accent-hover: #7dd3fc;
  --rc-border: #164e63; --rc-border-soft: rgba(56, 189, 248, 0.15);
  --rc-accent-soft: rgba(56, 189, 248, 0.1); --rc-accent-soft2: rgba(34, 211, 238, 0.12);
  --rc-accent-soft3: rgba(56, 189, 248, 0.35);
  --rc-hero-from: #0b2534; --rc-alt-from: #0f3044;
  --rc-shadow: rgba(3, 16, 23, 0.8);
  --rc-btn-a: #0284c7; --rc-btn-b: #0891b2;
  --rc-hover: rgba(56, 189, 248, 0.15); --rc-hover-strong: rgba(56, 189, 248, 0.28);
}
html[data-theme="floresta"] {
  --rc-bg: #07140d; --rc-bg-deep: #05100a;
  --rc-surface-95: rgba(15, 36, 24, 0.95);
  --rc-surface-90: rgba(15, 36, 24, 0.9);
  --rc-surface-70: rgba(20, 48, 33, 0.75);
  --rc-text: #e7f5ec; --rc-text-dim: #c3e6cf;
  --rc-muted: #9cc5ad; --rc-muted-2: #9cc5ad;
  --rc-accent: #4ade80; --rc-accent-2: #a3e635;
  --rc-accent-strong: #4ade80; --rc-accent-hover: #86efac;
  --rc-border: #1f4d33; --rc-border-soft: rgba(74, 222, 128, 0.15);
  --rc-accent-soft: rgba(74, 222, 128, 0.1); --rc-accent-soft2: rgba(163, 230, 53, 0.1);
  --rc-accent-soft3: rgba(74, 222, 128, 0.35);
  --rc-hero-from: #0f2418; --rc-alt-from: #143021;
  --rc-shadow: rgba(5, 16, 10, 0.8);
  --rc-btn-a: #15803d; --rc-btn-b: #4d7c0f;
  --rc-hover: rgba(74, 222, 128, 0.15); --rc-hover-strong: rgba(74, 222, 128, 0.28);
}

html[data-theme="claro"] body,
html[data-theme="oceano"] body,
html[data-theme="floresta"] body {
  background: var(--rc-bg);
  color: var(--rc-text);
}
html[data-theme="claro"] .topbar,
html[data-theme="oceano"] .topbar,
html[data-theme="floresta"] .topbar {
  background: var(--rc-surface-95);
  border-bottom-color: var(--rc-border);
}
html[data-theme="claro"] .brand-subtitle,
html[data-theme="oceano"] .brand-subtitle,
html[data-theme="floresta"] .brand-subtitle,
html[data-theme="claro"] .placeholder,
html[data-theme="oceano"] .placeholder,
html[data-theme="floresta"] .placeholder,
html[data-theme="claro"] .footer-inner,
html[data-theme="oceano"] .footer-inner,
html[data-theme="floresta"] .footer-inner,
html[data-theme="claro"] .section-header p,
html[data-theme="oceano"] .section-header p,
html[data-theme="floresta"] .section-header p {
  color: var(--rc-muted);
}
html[data-theme="claro"] .nav-list a,
html[data-theme="oceano"] .nav-list a,
html[data-theme="floresta"] .nav-list a {
  color: var(--rc-text-dim);
}
html[data-theme="claro"] .nav-list a:hover,
html[data-theme="oceano"] .nav-list a:hover,
html[data-theme="floresta"] .nav-list a:hover,
html[data-theme="claro"] .btn.ghost:hover,
html[data-theme="oceano"] .btn.ghost:hover,
html[data-theme="floresta"] .btn.ghost:hover {
  background: var(--rc-hover);
}
html[data-theme="claro"] .nav-toggle,
html[data-theme="oceano"] .nav-toggle,
html[data-theme="floresta"] .nav-toggle {
  color: var(--rc-text);
  border-color: var(--rc-border);
}
html[data-theme="claro"] .hero,
html[data-theme="oceano"] .hero,
html[data-theme="floresta"] .hero {
  background: radial-gradient(circle at top left, var(--rc-hero-from), var(--rc-bg) 55%);
}
html[data-theme="claro"] .hero p,
html[data-theme="oceano"] .hero p,
html[data-theme="floresta"] .hero p,
html[data-theme="claro"] .card p,
html[data-theme="oceano"] .card p,
html[data-theme="floresta"] .card p,
html[data-theme="claro"] .bullet-list,
html[data-theme="oceano"] .bullet-list,
html[data-theme="floresta"] .bullet-list,
html[data-theme="claro"] .hero-card ul,
html[data-theme="oceano"] .hero-card ul,
html[data-theme="floresta"] .hero-card ul {
  color: var(--rc-text-dim);
}
html[data-theme="claro"] .btn.primary,
html[data-theme="oceano"] .btn.primary,
html[data-theme="floresta"] .btn.primary,
html[data-theme="claro"] .badge,
html[data-theme="oceano"] .badge,
html[data-theme="floresta"] .badge {
  background: linear-gradient(135deg, var(--rc-btn-a), var(--rc-btn-b));
  color: #ffffff;
}
html[data-theme="claro"] .btn.primary:hover,
html[data-theme="oceano"] .btn.primary:hover,
html[data-theme="floresta"] .btn.primary:hover {
  background: linear-gradient(135deg, var(--rc-accent-hover), var(--rc-btn-b));
}
html[data-theme="claro"] .btn.ghost,
html[data-theme="oceano"] .btn.ghost,
html[data-theme="floresta"] .btn.ghost {
  border-color: var(--rc-accent-strong);
  color: var(--rc-text);
}
html[data-theme="claro"] .hero-card,
html[data-theme="oceano"] .hero-card,
html[data-theme="floresta"] .hero-card {
  background: radial-gradient(circle at top, var(--rc-accent-soft2), var(--rc-surface-95));
  border-color: var(--rc-accent-soft3);
  box-shadow: 0 18px 40px var(--rc-shadow);
}
html[data-theme="claro"] .section,
html[data-theme="oceano"] .section,
html[data-theme="floresta"] .section {
  background: var(--rc-bg);
}
html[data-theme="claro"] .section.alt,
html[data-theme="oceano"] .section.alt,
html[data-theme="floresta"] .section.alt {
  background: radial-gradient(circle at top right, var(--rc-alt-from), var(--rc-bg));
}
html[data-theme="claro"] .card,
html[data-theme="oceano"] .card,
html[data-theme="floresta"] .card,
html[data-theme="claro"] .carousel-btn,
html[data-theme="oceano"] .carousel-btn,
html[data-theme="floresta"] .carousel-btn {
  background: var(--rc-surface-90);
  border-color: var(--rc-border);
}
html[data-theme="claro"] .carousel-btn,
html[data-theme="oceano"] .carousel-btn,
html[data-theme="floresta"] .carousel-btn {
  color: var(--rc-text);
}
html[data-theme="claro"] .carousel-btn:hover,
html[data-theme="oceano"] .carousel-btn:hover,
html[data-theme="floresta"] .carousel-btn:hover {
  background: var(--rc-hover-strong);
}
html[data-theme="claro"] .links-list a,
html[data-theme="oceano"] .links-list a,
html[data-theme="floresta"] .links-list a,
html[data-theme="claro"] .glossary-link a,
html[data-theme="oceano"] .glossary-link a,
html[data-theme="floresta"] .glossary-link a,
html[data-theme="claro"] .robot-item h4,
html[data-theme="oceano"] .robot-item h4,
html[data-theme="floresta"] .robot-item h4,
html[data-theme="claro"] .glossary-item h3,
html[data-theme="oceano"] .glossary-item h3,
html[data-theme="floresta"] .glossary-item h3 {
  color: var(--rc-accent);
}
html[data-theme="claro"] .links-list a:hover,
html[data-theme="oceano"] .links-list a:hover,
html[data-theme="floresta"] .links-list a:hover {
  color: var(--rc-accent-hover);
}
html[data-theme="claro"] .footer,
html[data-theme="oceano"] .footer,
html[data-theme="floresta"] .footer {
  border-top-color: var(--rc-border);
  background: var(--rc-bg-deep);
}
html[data-theme="claro"] .infra-summary,
html[data-theme="oceano"] .infra-summary,
html[data-theme="floresta"] .infra-summary,
html[data-theme="claro"] .projeto-destaque,
html[data-theme="oceano"] .projeto-destaque,
html[data-theme="floresta"] .projeto-destaque {
  background: linear-gradient(135deg, var(--rc-accent-soft), var(--rc-surface-90));
  border-color: var(--rc-accent-soft3);
}
html[data-theme="claro"] .robot-item,
html[data-theme="oceano"] .robot-item,
html[data-theme="floresta"] .robot-item,
html[data-theme="claro"] .vuln-item,
html[data-theme="oceano"] .vuln-item,
html[data-theme="floresta"] .vuln-item {
  background: var(--rc-surface-70);
  border-color: var(--rc-border-soft);
}
html[data-theme="claro"] .vuln-item h4,
html[data-theme="oceano"] .vuln-item h4,
html[data-theme="floresta"] .vuln-item h4 {
  color: var(--rc-text);
}
html[data-theme="claro"] .robot-item p,
html[data-theme="oceano"] .robot-item p,
html[data-theme="floresta"] .robot-item p,
html[data-theme="claro"] .vuln-item p,
html[data-theme="oceano"] .vuln-item p,
html[data-theme="floresta"] .vuln-item p,
html[data-theme="claro"] .glossary-example,
html[data-theme="oceano"] .glossary-example,
html[data-theme="floresta"] .glossary-example {
  color: var(--rc-muted-2);
}
html[data-theme="claro"] .glossary-example,
html[data-theme="oceano"] .glossary-example,
html[data-theme="floresta"] .glossary-example {
  background: var(--rc-accent-soft);
  border-left-color: var(--rc-accent-strong);
}
html[data-theme="claro"] .glossary-link a,
html[data-theme="oceano"] .glossary-link a,
html[data-theme="floresta"] .glossary-link a {
  border-color: var(--rc-border);
  background: var(--rc-accent-soft);
}
html[data-theme="claro"] .glossary-link a:hover,
html[data-theme="oceano"] .glossary-link a:hover,
html[data-theme="floresta"] .glossary-link a:hover {
  background: var(--rc-hover-strong);
  border-color: var(--rc-accent-strong);
}
/* Badges CVSS: cores semanticas; no tema claro o texto precisa escurecer. */
html[data-theme="claro"] .cvss.critical { background: rgba(220, 38, 38, 0.12); color: #b91c1c; border-color: rgba(220, 38, 38, 0.4); }
html[data-theme="claro"] .cvss.high { background: rgba(217, 119, 6, 0.14); color: #b45309; border-color: rgba(217, 119, 6, 0.4); }
html[data-theme="claro"] .cvss.medium { background: rgba(202, 138, 4, 0.14); color: #a16207; border-color: rgba(202, 138, 4, 0.4); }
html[data-theme="claro"] .cvss.low { background: rgba(22, 163, 74, 0.14); color: #15803d; border-color: rgba(22, 163, 74, 0.4); }

/* Widgets (busca, chat, conteudo dinamico) */
html[data-theme="claro"] .rc-search-input,
html[data-theme="oceano"] .rc-search-input,
html[data-theme="floresta"] .rc-search-input,
html[data-theme="claro"] .rc-chat-input,
html[data-theme="oceano"] .rc-chat-input,
html[data-theme="floresta"] .rc-chat-input {
  border-color: var(--rc-border);
  background: var(--rc-surface-90);
  color: var(--rc-text);
}
html[data-theme="claro"] .rc-search-input:focus,
html[data-theme="oceano"] .rc-search-input:focus,
html[data-theme="floresta"] .rc-search-input:focus {
  border-color: var(--rc-accent-strong);
}
html[data-theme="claro"] .rc-search-dropdown,
html[data-theme="oceano"] .rc-search-dropdown,
html[data-theme="floresta"] .rc-search-dropdown,
html[data-theme="claro"] .rc-chat-panel,
html[data-theme="oceano"] .rc-chat-panel,
html[data-theme="floresta"] .rc-chat-panel {
  background: var(--rc-surface-95);
  border-color: var(--rc-border);
}
html[data-theme="claro"] .rc-search-item,
html[data-theme="oceano"] .rc-search-item,
html[data-theme="floresta"] .rc-search-item,
html[data-theme="claro"] .rc-chat-close,
html[data-theme="oceano"] .rc-chat-close,
html[data-theme="floresta"] .rc-chat-close,
html[data-theme="claro"] .rc-chat-panel,
html[data-theme="oceano"] .rc-chat-panel,
html[data-theme="floresta"] .rc-chat-panel {
  color: var(--rc-text);
}
html[data-theme="claro"] .rc-search-item:hover,
html[data-theme="oceano"] .rc-search-item:hover,
html[data-theme="floresta"] .rc-search-item:hover,
html[data-theme="claro"] .rc-source-chip:hover,
html[data-theme="oceano"] .rc-source-chip:hover,
html[data-theme="floresta"] .rc-source-chip:hover {
  background: var(--rc-hover-strong);
}
html[data-theme="claro"] .rc-search-item-section,
html[data-theme="oceano"] .rc-search-item-section,
html[data-theme="floresta"] .rc-search-item-section,
html[data-theme="claro"] .rc-source-chip,
html[data-theme="oceano"] .rc-source-chip,
html[data-theme="floresta"] .rc-source-chip,
html[data-theme="claro"] .rc-item-link,
html[data-theme="oceano"] .rc-item-link,
html[data-theme="floresta"] .rc-item-link {
  color: var(--rc-accent);
}
html[data-theme="claro"] .rc-chat-title,
html[data-theme="oceano"] .rc-chat-title,
html[data-theme="floresta"] .rc-chat-title {
  background: linear-gradient(135deg, var(--rc-btn-a), var(--rc-btn-b));
  -webkit-background-clip: text;
  background-clip: text;
}
html[data-theme="claro"] .rc-chat-header,
html[data-theme="oceano"] .rc-chat-header,
html[data-theme="floresta"] .rc-chat-header,
html[data-theme="claro"] .rc-chat-form,
html[data-theme="oceano"] .rc-chat-form,
html[data-theme="floresta"] .rc-chat-form {
  border-color: var(--rc-border);
}
html[data-theme="claro"] .rc-msg-user .rc-msg-bubble,
html[data-theme="oceano"] .rc-msg-user .rc-msg-bubble,
html[data-theme="floresta"] .rc-msg-user .rc-msg-bubble,
html[data-theme="claro"] .rc-chat-toggle,
html[data-theme="oceano"] .rc-chat-toggle,
html[data-theme="floresta"] .rc-chat-toggle,
html[data-theme="claro"] .rc-chat-send,
html[data-theme="oceano"] .rc-chat-send,
html[data-theme="floresta"] .rc-chat-send {
  background: linear-gradient(135deg, var(--rc-btn-a), var(--rc-btn-b));
  color: #ffffff;
}
html[data-theme="claro"] .rc-msg-assistant .rc-msg-bubble,
html[data-theme="oceano"] .rc-msg-assistant .rc-msg-bubble,
html[data-theme="floresta"] .rc-msg-assistant .rc-msg-bubble {
  background: var(--rc-hover);
  color: var(--rc-text);
}
html[data-theme="claro"] .rc-source-chip,
html[data-theme="oceano"] .rc-source-chip,
html[data-theme="floresta"] .rc-source-chip {
  border-color: var(--rc-border);
}

/* Cores inline style="" nas paginas. */
html[data-theme="claro"] [style*="color: #a5b4fc"],
html[data-theme="oceano"] [style*="color: #a5b4fc"],
html[data-theme="floresta"] [style*="color: #a5b4fc"] { color: var(--rc-accent) !important; }
html[data-theme="claro"] [style*="color: #94a3b8"],
html[data-theme="oceano"] [style*="color: #94a3b8"],
html[data-theme="floresta"] [style*="color: #94a3b8"] { color: var(--rc-muted) !important; }
html[data-theme="claro"] [style*="color: #e5e7ff"],
html[data-theme="oceano"] [style*="color: #e5e7ff"],
html[data-theme="floresta"] [style*="color: #e5e7ff"] { color: var(--rc-text) !important; }

/* Painel do chat opaco nos temas (o escuro usa rgba .95 com blur da pagina;
   nos temas a superficie translucida deixava o texto de tras vazar). */
html[data-theme="claro"] { --rc-panel-bg: #ffffff; }
html[data-theme="oceano"] { --rc-panel-bg: #0b2534; }
html[data-theme="floresta"] { --rc-panel-bg: #0f2418; }
html[data-theme="claro"] .rc-chat-panel,
html[data-theme="oceano"] .rc-chat-panel,
html[data-theme="floresta"] .rc-chat-panel {
  background: var(--rc-panel-bg);
}
html[data-theme="claro"] .rc-search-dropdown,
html[data-theme="oceano"] .rc-search-dropdown,
html[data-theme="floresta"] .rc-search-dropdown {
  background: var(--rc-panel-bg);
}

/* Botao do seletor de tema na topbar.
   Vale para TODOS os temas (inclusive escuro). O wrapper fica fora do fluxo
   (position:absolute) para nao criar uma linha extra: no desktop ele se
   posiciona na linha do titulo (direita); no mobile, dentro da .nav, na
   mesma linha do botao hamburger (direita). */
.topbar-inner { position: relative; }
.rc-theme-wrap {
  position: absolute;
  top: 0.7rem;
  right: 0;
  display: inline-flex;
}
@media (max-width: 768px) {
  .rc-theme-wrap { top: 0; right: 0; }
}
.rc-theme-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid rgba(148, 163, 255, 0.35);
  border-radius: 999px;
  background: none;
  color: #d5dcff;
  font-size: 0.82rem;
  padding: 0.25rem 0.7rem;
  cursor: pointer;
}
html[data-theme="claro"] .rc-theme-btn,
html[data-theme="oceano"] .rc-theme-btn,
html[data-theme="floresta"] .rc-theme-btn {
  border-color: var(--rc-border);
  color: var(--rc-text-dim);
}
.rc-theme-btn:hover { background: rgba(129, 140, 248, 0.15); }
html[data-theme="claro"] .rc-theme-btn:hover,
html[data-theme="oceano"] .rc-theme-btn:hover,
html[data-theme="floresta"] .rc-theme-btn:hover { background: var(--rc-hover); }
.rc-theme-swatch {
  width: 0.8rem; height: 0.8rem; border-radius: 50%;
  display: inline-block; border: 1px solid rgba(255, 255, 255, 0.3);
}
html[data-theme="claro"] .rc-theme-swatch,
html[data-theme="oceano"] .rc-theme-swatch,
html[data-theme="floresta"] .rc-theme-swatch { border-color: var(--rc-border); }
.rc-theme-menu {
  position: absolute;
  top: calc(100% + 0.4rem);
  right: 0;
  min-width: 10rem;
  background: rgba(15, 23, 42, 0.97);
  border: 1px solid rgba(148, 163, 255, 0.2);
  border-radius: 12px;
  padding: 0.35rem;
  z-index: 90;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}
html[data-theme="claro"] .rc-theme-menu,
html[data-theme="oceano"] .rc-theme-menu,
html[data-theme="floresta"] .rc-theme-menu {
  background: var(--rc-panel-bg);
  border-color: var(--rc-border);
}
.rc-theme-menu button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  border-radius: 8px;
  padding: 0.45rem 0.6rem;
  font-size: 0.88rem;
  color: #f4f5fb;
  cursor: pointer;
}
html[data-theme="claro"] .rc-theme-menu button,
html[data-theme="oceano"] .rc-theme-menu button,
html[data-theme="floresta"] .rc-theme-menu button { color: var(--rc-text); }
.rc-theme-menu button:hover,
.rc-theme-menu button[aria-checked="true"] { background: rgba(129, 140, 248, 0.15); }
html[data-theme="claro"] .rc-theme-menu button:hover,
html[data-theme="oceano"] .rc-theme-menu button:hover,
html[data-theme="floresta"] .rc-theme-menu button:hover,
html[data-theme="claro"] .rc-theme-menu button[aria-checked="true"],
html[data-theme="oceano"] .rc-theme-menu button[aria-checked="true"],
html[data-theme="floresta"] .rc-theme-menu button[aria-checked="true"] { background: var(--rc-hover-strong); }
@media (max-width: 768px) {
  html[data-theme='claro'] .nav-list,
  html[data-theme='oceano'] .nav-list,
  html[data-theme='floresta'] .nav-list { background: var(--rc-panel-bg); border-color: var(--rc-border); }
}
