/* ============================================================
   BayesCore NeuroLab — design system (tema original)
   ============================================================ */
:root {
  --bg: #070b14;
  --bg-2: #0c1220;
  --bg-3: #111a2e;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-2: rgba(255, 255, 255, 0.07);
  --border: rgba(148, 163, 184, 0.16);
  --border-strong: rgba(148, 163, 184, 0.3);
  --text: #e6edf7;
  --text-dim: #9fb0c7;
  --text-faint: #64748b;
  --accent: #22d3ee;
  --accent-2: #8b5cf6;
  --accent-3: #f472b6;
  --grad: linear-gradient(120deg, #22d3ee, #8b5cf6 55%, #f472b6);
  --ok: #34d399;
  --warn: #fbbf24;
  --err: #f87171;
  --radius: 14px;
  --radius-lg: 22px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Sora", var(--font);
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
}
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(60rem 40rem at 85% -10%, rgba(139, 92, 246, 0.14), transparent 60%),
    radial-gradient(50rem 35rem at -10% 20%, rgba(34, 211, 238, 0.10), transparent 60%),
    radial-gradient(40rem 40rem at 50% 120%, rgba(244, 114, 182, 0.07), transparent 60%);
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { max-width: 100%; }

.container { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.container.narrow { max-width: 760px; }

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; line-height: 1.2; }

/* ---------- Navbar ---------- */
.navbar {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(14px);
  background: rgba(7, 11, 20, 0.75);
  border-bottom: 1px solid var(--border);
}
.navbar .inner {
  display: flex; align-items: center; gap: 28px;
  height: 66px;
}
.brand { display: flex; align-items: center; gap: 11px; color: var(--text); font-family: var(--font-display); font-weight: 700; font-size: 1.12rem; }
.brand:hover { text-decoration: none; }
.brand .logo { width: 34px; height: 34px; flex: none; }
.brand em { font-style: normal; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nav-links { display: flex; gap: 4px; align-items: center; margin-left: auto; flex-wrap: wrap; }
.nav-links a {
  color: var(--text-dim); padding: 8px 13px; border-radius: 9px; font-size: 0.94rem; font-weight: 500;
}
.nav-links a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.nav-links a.active { color: var(--text); background: var(--surface-2); }
.nav-user { color: var(--text-faint); font-size: .85rem; padding: 0 6px; }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 20px; border-radius: 11px; border: 1px solid var(--border-strong);
  background: var(--surface-2); color: var(--text); font-weight: 600; font-size: 0.95rem;
  cursor: pointer; transition: all .18s ease; font-family: var(--font); line-height: 1.4;
}
.btn:hover { border-color: var(--accent); text-decoration: none; transform: translateY(-1px); }
.btn.primary {
  background: var(--grad); border: none; color: #06090f;
}
.btn.primary:hover { filter: brightness(1.12); box-shadow: 0 6px 24px rgba(139, 92, 246, .35); }
.btn.ghost { background: transparent; }
.btn.small { padding: 6px 13px; font-size: 0.85rem; border-radius: 9px; }
.btn.danger { border-color: rgba(248, 113, 113, .4); color: var(--err); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* ---------- Cards / superfícies ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 26px;
}
.card.hover:hover { border-color: var(--border-strong); background: var(--surface-2); }
.glass { backdrop-filter: blur(10px); }

.grid { display: grid; gap: 20px; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 960px) { .grid.cols-3, .grid.cols-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; } .navbar .inner { gap: 12px; } }

/* ---------- Hero ---------- */
.hero { padding: 96px 0 72px; text-align: center; position: relative; }
.hero h1 {
  font-size: clamp(2.2rem, 5.4vw, 3.9rem);
  letter-spacing: -0.02em; margin-bottom: 20px;
}
.hero h1 .grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { font-size: 1.18rem; color: var(--text-dim); max-width: 720px; margin: 0 auto 34px; }
.hero .actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.8rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent); border: 1px solid rgba(34, 211, 238, .3);
  padding: 6px 14px; border-radius: 999px; margin-bottom: 26px;
  background: rgba(34, 211, 238, .06);
}

/* ---------- Hero em duas colunas + cérebro interativo ---------- */
.hero-split { text-align: left; padding: 72px 0 56px; }
.hero-split h1 { font-size: clamp(1.5rem, 2.9vw, 2.3rem); }
.hero-grid {
  display: grid; grid-template-columns: 0.95fr 1.05fr;
  gap: 36px; align-items: center;
}
.hero-split .lead { margin: 0 0 34px; max-width: none; }
.hero-split .actions { justify-content: flex-start; }

.brain-stage {
  position: relative; user-select: none;
  /* amplia o cérebro além da coluna (o ponteiro segue o mesmo box, então a
     máscara continua alinhada) */
  width: 112%; margin-left: -6%;
  animation: brainFloat 7s ease-in-out infinite;
}
.brain-stage img { display: block; width: 100%; height: auto; pointer-events: none; }
.brain-base { filter: drop-shadow(0 0 34px rgba(139, 92, 246, 0.22)); }
.brain-reveal {
  position: absolute; top: 0; left: 0; width: 100%; height: auto;
  filter: drop-shadow(0 0 22px rgba(34, 211, 238, 0.35)) saturate(1.15) brightness(1.08);
  -webkit-mask-image: radial-gradient(circle var(--brain-r, 0px) at var(--brain-x, 50%) var(--brain-y, 50%), #000 45%, transparent 100%);
          mask-image: radial-gradient(circle var(--brain-r, 0px) at var(--brain-x, 50%) var(--brain-y, 50%), #000 45%, transparent 100%);
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
}
@keyframes brainFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}
/* Sem mouse (touch): mostra as fibras pulsando suavemente, sem máscara */
@media (hover: none) {
  .brain-reveal { -webkit-mask-image: none; mask-image: none; opacity: 0.55; animation: brainPulse 4.5s ease-in-out infinite; }
}
@keyframes brainPulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.8; }
}
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 30px; }
  .brain-stage { max-width: 420px; margin: 0 auto; }
}

/* ---------- Seções ---------- */
.section { padding: 66px 0; }
.section-title { font-size: 1.9rem; margin-bottom: 10px; }
.section-sub { color: var(--text-dim); margin-bottom: 38px; max-width: 640px; }
.section.center { text-align: center; }
.section.center .section-sub { margin-left: auto; margin-right: auto; }

/* ---------- Stats ---------- */
.stats-band { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; }
.stat { text-align: center; padding: 22px 34px; min-width: 180px; flex: 1; }
.stat .num { font-family: var(--font-display); font-size: 2.2rem; font-weight: 700; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat .lbl { color: var(--text-dim); font-size: 0.9rem; margin-top: 4px; }

/* ---------- Modalidades / features ---------- */
.mod-icon {
  width: 46px; height: 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, rgba(34,211,238,.15), rgba(139,92,246,.15));
  border: 1px solid var(--border); font-size: 1.3rem; margin-bottom: 14px;
}
.card h3 { font-size: 1.08rem; margin-bottom: 8px; }
.card p.dim { color: var(--text-dim); font-size: 0.93rem; }

/* ---------- Formulários ---------- */
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 0.88rem; font-weight: 600; color: var(--text-dim); margin-bottom: 7px; }
.input, select.input, textarea.input {
  width: 100%; padding: 11px 15px; border-radius: 11px;
  background: var(--bg-2); border: 1px solid var(--border);
  color: var(--text); font-size: 0.97rem; font-family: var(--font);
  transition: border-color .15s ease;
}
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(34, 211, 238, .12); }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239fb0c7' stroke-width='2' fill='none'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px; }
.hint { font-size: 0.8rem; color: var(--text-faint); margin-top: 5px; }

/* ---------- Flash ---------- */
.flash-wrap { position: fixed; top: 80px; right: 20px; z-index: 100; display: flex; flex-direction: column; gap: 10px; max-width: 380px; }
.flash {
  padding: 13px 40px 13px 16px; border-radius: 12px; font-size: 0.92rem; position: relative;
  border: 1px solid var(--border-strong); background: var(--bg-3); box-shadow: 0 10px 30px rgba(0,0,0,.45);
  animation: slideIn .25s ease;
}
.flash.success { border-color: rgba(52, 211, 153, .5); }
.flash.error { border-color: rgba(248, 113, 113, .55); }
.flash.warning { border-color: rgba(251, 191, 36, .5); }
.flash .close { position: absolute; top: 8px; right: 10px; background: none; border: none; color: var(--text-faint); cursor: pointer; font-size: 1rem; }
@keyframes slideIn { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Dataset cards ---------- */
.ds-card { display: flex; flex-direction: column; gap: 10px; }
.ds-card .ds-id { font-family: var(--mono); font-size: 0.78rem; color: var(--accent); }
.ds-card h3 { font-size: 1.02rem; line-height: 1.4; }
.ds-card h3 a { color: var(--text); }
.ds-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }
.tag {
  font-size: 0.72rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  padding: 3px 10px; border-radius: 999px; border: 1px solid var(--border);
  color: var(--text-dim); background: var(--surface);
}
.tag.mod { color: var(--accent); border-color: rgba(34, 211, 238, .35); }

/* ---------- Tabelas ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
table.data { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
table.data th, table.data td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--border); }
table.data th { color: var(--text-faint); font-size: 0.78rem; text-transform: uppercase; letter-spacing: .07em; }
table.data tr:last-child td { border-bottom: none; }
table.data tr:hover td { background: var(--surface); }

/* ---------- File browser ---------- */
.file-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--border); font-size: 0.93rem; }
.file-row:last-child { border-bottom: none; }
.file-row:hover { background: var(--surface); }
.file-row .name { flex: 1; word-break: break-all; }
.file-row .size { color: var(--text-faint); font-size: 0.82rem; white-space: nowrap; }
.file-icon { flex: none; opacity: .8; }

/* ---------- Readme / markdown ---------- */
.md { color: var(--text-dim); font-size: 0.95rem; }
.md h1, .md h2, .md h3 { color: var(--text); margin: 1.2em 0 0.5em; }
.md h1 { font-size: 1.3rem; } .md h2 { font-size: 1.15rem; } .md h3 { font-size: 1.02rem; }
.md p { margin: 0.7em 0; }
.md ul, .md ol { margin: 0.7em 0 0.7em 1.4em; }
.md code { font-family: var(--mono); font-size: 0.85em; background: var(--bg-3); padding: 2px 6px; border-radius: 6px; }
.md pre { background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px; padding: 14px; overflow-x: auto; margin: 0.9em 0; }
.md pre code { background: none; padding: 0; }
.md a { word-break: break-all; }
.md strong { color: var(--text); }
.md blockquote { border-left: 3px solid var(--accent-2); padding-left: 14px; margin: .8em 0; }
.md table { border-collapse: collapse; margin: .8em 0; display: block; overflow-x: auto; }
.md th, .md td { border: 1px solid var(--border); padding: 6px 10px; }

/* ---------- Chat ---------- */
.chat-layout { display: grid; grid-template-columns: 290px 1fr; gap: 22px; align-items: start; }
@media (max-width: 880px) { .chat-layout { grid-template-columns: 1fr; } }
.chat-sidebar { position: sticky; top: 86px; max-height: calc(100vh - 110px); overflow-y: auto; }
.convo-item { display: block; padding: 11px 14px; border-radius: 10px; color: var(--text-dim); font-size: 0.9rem; border: 1px solid transparent; margin-bottom: 4px; }
.convo-item:hover { background: var(--surface-2); text-decoration: none; }
.convo-item.active { background: var(--surface-2); border-color: var(--border-strong); color: var(--text); }
.convo-item .when { display: block; font-size: 0.72rem; color: var(--text-faint); margin-top: 2px; }
.chat-main { display: flex; flex-direction: column; min-height: 68vh; }
.chat-scroll { flex: 1; overflow-y: auto; padding: 8px 4px; display: flex; flex-direction: column; gap: 18px; max-height: 62vh; }
.msg { display: flex; gap: 12px; max-width: 92%; }
.msg .avatar {
  width: 36px; height: 36px; border-radius: 10px; flex: none; display: flex; align-items: center; justify-content: center;
  font-size: 1rem; font-weight: 700; font-family: var(--font-display);
}
.msg.user { align-self: flex-end; flex-direction: row-reverse; }
.msg.user .avatar { background: var(--surface-2); border: 1px solid var(--border-strong); }
.msg.assistant .avatar { background: var(--grad); color: #06090f; }
.msg .bubble {
  padding: 13px 17px; border-radius: 16px; font-size: 0.95rem;
  background: var(--surface-2); border: 1px solid var(--border);
}
.msg.user .bubble { background: rgba(34, 211, 238, .1); border-color: rgba(34, 211, 238, .25); }
.msg .meta { font-size: 0.72rem; color: var(--text-faint); margin-top: 6px; }
.chat-input-bar { display: flex; gap: 10px; margin-top: 18px; align-items: flex-end; }
.chat-input-bar textarea { resize: none; min-height: 52px; max-height: 200px; }
.typing { display: inline-flex; gap: 5px; padding: 6px 2px; }
.typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: blink 1.2s infinite; }
.typing span:nth-child(2) { animation-delay: .2s; } .typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 60%, 100% { opacity: .25; } 30% { opacity: 1; } }
.dataset-pill {
  display: inline-flex; align-items: center; gap: 7px; font-size: 0.8rem;
  background: rgba(139, 92, 246, .12); border: 1px solid rgba(139, 92, 246, .35);
  color: #c4b5fd; padding: 5px 13px; border-radius: 999px;
}

/* ---------- Código copiável ---------- */
.code-block { position: relative; background: var(--bg-2); border: 1px solid var(--border); border-radius: 12px; padding: 15px 48px 15px 17px; font-family: var(--mono); font-size: 0.84rem; overflow-x: auto; white-space: pre; color: #b8c7de; }
.copy-btn { position: absolute; top: 9px; right: 9px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; color: var(--text-dim); padding: 4px 9px; font-size: .75rem; cursor: pointer; }
.copy-btn:hover { color: var(--text); border-color: var(--accent); }

/* ---------- Modal ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(4, 7, 14, .78); z-index: 90; display: none; align-items: flex-start; justify-content: center; padding: 60px 20px; overflow-y: auto; backdrop-filter: blur(4px); }
.modal-backdrop.open { display: flex; }
.modal { width: 100%; max-width: 680px; background: var(--bg-2); border: 1px solid var(--border-strong); border-radius: var(--radius-lg); padding: 30px; }
.modal h3 { margin-bottom: 6px; }

/* ---------- Admin ---------- */
.prov-card { border-left: 3px solid var(--border-strong); }
.prov-card.enabled { border-left-color: var(--ok); }
.badge-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--text-faint); margin-right: 7px; }
.badge-dot.on { background: var(--ok); box-shadow: 0 0 8px rgba(52, 211, 153, .7); }

/* ---------- Footer ---------- */
footer.site { border-top: 1px solid var(--border); margin-top: 60px; padding: 44px 0 34px; color: var(--text-faint); font-size: 0.88rem; }
footer.site a { color: var(--text-dim); }
.footer-logos {
  display: flex; gap: 22px; justify-content: center; align-items: center; flex-wrap: wrap;
}
.footer-logos img {
  height: 74px; width: auto;
  background: #fff; border-radius: 14px; padding: 10px 18px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
}

/* ---------- Utilidades ---------- */
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 40px; }
.mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.flex { display: flex; gap: 12px; align-items: center; } .flex.between { justify-content: space-between; } .flex.wrap { flex-wrap: wrap; }
.dim { color: var(--text-dim); } .faint { color: var(--text-faint); } .small { font-size: 0.85rem; }
.mono { font-family: var(--mono); }
.text-center { text-align: center; }
.w-100 { width: 100%; }
.page-head { padding: 42px 0 8px; }
.page-head h1 { font-size: 1.75rem; }
.divider { border: none; border-top: 1px solid var(--border); margin: 28px 0; }

/* ---------- Seletor de idioma (pt/en/es) na barra de navegação ---------- */
.idioma {
  display: inline-flex;
  gap: 2px;
  margin-left: 10px;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2, rgba(255, 255, 255, .04));
}
.idioma a {
  padding: 3px 9px;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .05em;
  color: var(--text-faint);
  line-height: 1.5;
}
.idioma a:hover { color: var(--text); text-decoration: none; }
.idioma a.atual {
  background: var(--accent, #6ea8fe);
  color: #0b1020;
}
@media (max-width: 720px) {
  .idioma { margin-left: 4px; }
  .idioma a { padding: 3px 7px; }
}
