/* CortexLabs — tokens e regras visuais. */

:root {
  --bg: #07131D;
  --section: #102431;
  --card: #193845;
  --action: #09B68C;
  --accent: #00D8CB;
  --text: #F0F6FA;
  --muted: #ADBFCA;
  --on-action: #07131D;
  --line: rgba(240, 246, 250, 0.14);
  --radius: 14px;
  --space: clamp(1rem, 3vw, 2rem);
  --shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: var(--accent); text-underline-offset: 0.2em; }
a:hover { color: var(--text); }

h1, h2, h3 { line-height: 1.2; margin: 0 0 0.6em; }
h1 { font-size: clamp(2rem, 7vw, 3.6rem); letter-spacing: -0.03em; }
h2 { font-size: clamp(1.5rem, 4vw, 2.2rem); letter-spacing: -0.02em; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1rem; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--action); color: var(--on-action);
  padding: 0.75rem 1rem; border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus { left: 0; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

.container { width: min(1120px, 100% - 2 * var(--space)); margin-inline: auto; }

.section { padding: clamp(3rem, 8vw, 5.5rem) 0; }
.section--alt { background: var(--section); }
.section__head { max-width: 46rem; margin-bottom: 2rem; }
.eyebrow {
  display: inline-block; color: var(--accent); font-size: 0.78rem;
  font-weight: 700; letter-spacing: 0.13em; text-transform: uppercase;
  margin-bottom: 0.75rem;
}
.lead { color: var(--muted); font-size: clamp(1.05rem, 2vw, 1.25rem); }

/* Cabeçalho */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(7, 19, 29, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; min-height: 72px; flex-wrap: wrap;
}
.brand img { width: auto; height: 42px; max-width: 190px; }
.brand span { display: block; font-size: 0.7rem; color: var(--muted); letter-spacing: 0.08em; }

.nav-toggle {
  min-width: 44px; min-height: 44px; padding: 0.5rem 0.75rem;
  background: var(--card); color: var(--text); border: 1px solid var(--line);
  border-radius: 10px; font-size: 1rem; cursor: pointer;
}
.site-nav { display: none; }
.site-nav.is-open {
  display: block; width: 100%; padding-bottom: 0.75rem;
}
@media (min-width: 820px) {
  .site-nav, .site-nav.is-open { display: block; width: auto; padding-bottom: 0; }
  .nav-toggle { display: none; }
}
.site-nav ul { list-style: none; display: flex; gap: 0.25rem; margin: 0; padding: 0; flex-wrap: wrap; }
.site-nav a {
  display: inline-flex; align-items: center; min-height: 44px;
  padding: 0.55rem 0.75rem; border-radius: 10px;
  color: var(--muted); text-decoration: none; font-size: 0.95rem;
}
.site-nav a:hover, .site-nav a[aria-current="page"] { background: var(--card); color: var(--text); }
.site-nav a.cta-link { background: var(--action); color: var(--on-action); font-weight: 700; }
.site-nav a.cta-link:hover { background: var(--accent); color: var(--on-action); }

/* Botões */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0.75rem 1.25rem; border-radius: 12px;
  text-decoration: none; font-weight: 700; font-size: 1rem;
  border: 1px solid transparent; cursor: pointer;
}
.btn--primary { background: var(--action); color: var(--on-action); }
.btn--primary:hover { background: var(--accent); color: var(--on-action); }
.btn--ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn--ghost:hover { background: var(--card); color: var(--text); }
.btn-row { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 1.5rem; }

/* Cartões e grades */
.grid { display: grid; gap: 1.25rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 900px) {
  .grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: clamp(1.25rem, 3vw, 1.75rem);
  box-shadow: var(--shadow);
}
.card h3 { margin-top: 0; }
.card p:last-child { margin-bottom: 0; }
.card--flat { box-shadow: none; }

.badge {
  display: inline-flex; align-items: center; min-height: 28px;
  padding: 0.2rem 0.6rem; border-radius: 999px;
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.03em;
  border: 1px solid var(--line); color: var(--muted);
}
.badge--ok { color: var(--accent); border-color: rgba(0, 216, 203, 0.45); }
.badge--review { color: var(--text); border-color: rgba(240, 246, 250, 0.4); }

/* Hero */
.hero { padding: clamp(4rem, 10vw, 7rem) 0 clamp(3rem, 7vw, 5rem); }
.hero__inner { max-width: 52rem; }
.hero h1 { margin-bottom: 1rem; }
.hero__sub { color: var(--muted); font-size: clamp(1.1rem, 2.4vw, 1.35rem); max-width: 44rem; }
.hero__note { margin-top: 2rem; font-size: 0.85rem; color: var(--muted); }

/* Avisos e observações */
.notice {
  border-left: 4px solid var(--accent); background: var(--card);
  padding: 1rem 1.25rem; border-radius: 0 var(--radius) var(--radius) 0;
  margin: 1.5rem 0;
}
.notice--warn { border-left-color: #f0c674; }
.notice strong { display: block; margin-bottom: 0.25rem; }
.slot {
  display: inline-block; padding: 0.15rem 0.5rem; border-radius: 6px;
  border: 1px dashed var(--muted); color: var(--muted); font-size: 0.9rem;
}

/* Listas e tabelas */
ul.clean { list-style: none; padding: 0; margin: 0 0 1rem; }
ul.clean li { padding-left: 1.25rem; position: relative; margin-bottom: 0.5rem; }
ul.clean li::before { content: "›"; position: absolute; left: 0; color: var(--accent); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; min-width: 34rem; }
th, td { text-align: left; padding: 0.85rem 1rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--accent); font-size: 0.85rem; letter-spacing: 0.04em; }
tbody tr:last-child td { border-bottom: 0; }

/* Vitrine de demonstrações */
.filters { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.filters button {
  min-height: 44px; padding: 0.5rem 0.9rem; border-radius: 10px;
  background: var(--card); color: var(--muted); border: 1px solid var(--line);
  cursor: pointer; font: inherit; font-size: 0.9rem;
}
.filters button[aria-pressed="true"] { background: var(--action); color: var(--on-action); font-weight: 700; }
.demo { display: flex; flex-direction: column; }
.demo__media { background: var(--bg); border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.demo__media { display: flex; align-items: center; min-height: 180px; }
.demo img { width: 100%; height: auto; object-fit: contain; }
.demo__media--icon { justify-content: center; padding: 1.5rem; }
.model-icon {
  width: 52px; height: 52px;
  stroke: var(--accent); stroke-width: 2;
  fill: none; stroke-linecap: round; stroke-linejoin: round;
}
.demo figcaption { margin-top: 0.75rem; color: var(--muted); font-size: 0.82rem; }
.demo h3 { margin: 0.75rem 0 0.35rem; }

/* Formulário */
.form-grid { display: grid; gap: 1.25rem; grid-template-columns: 1fr; }
@media (min-width: 700px) { .form-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.field { display: flex; flex-direction: column; gap: 0.35rem; }
.field label { font-weight: 600; font-size: 0.95rem; }
.field input, .field select, .field textarea {
  width: 100%; min-height: 46px; padding: 0.65rem 0.75rem;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--line); border-radius: 10px; font: inherit;
}
.field textarea { min-height: 130px; resize: vertical; }
.field small { color: var(--muted); font-size: 0.82rem; }
.field .error { color: #ff9d9d; font-size: 0.85rem; min-height: 1.2em; }
.fieldset { border: 0; padding: 0; margin: 0 0 1.5rem; }
.fieldset legend { font-size: 1.15rem; font-weight: 700; margin-bottom: 0.75rem; padding: 0; }
.option {
  display: flex; align-items: flex-start; gap: 0.65rem;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 0.85rem 1rem; min-height: 48px; cursor: pointer;
}
.option input { margin-top: 0.3rem; accent-color: var(--action); }
.steps { display: flex; gap: 0.5rem; margin-bottom: 2rem; flex-wrap: wrap; }
.steps li {
  list-style: none; padding: 0.45rem 0.8rem; border-radius: 999px;
  border: 1px solid var(--line); color: var(--muted); font-size: 0.85rem;
}
.steps li[aria-current="step"] { background: var(--action); color: var(--on-action); font-weight: 700; border-color: transparent; }
.step { display: none; }
.step.is-active { display: block; }
.review-list { background: var(--card); border-radius: var(--radius); padding: 1rem 1.25rem; }
.review-list dl { display: grid; grid-template-columns: 1fr; gap: 0.5rem; margin: 0; }
@media (min-width: 600px) { .review-list dl { grid-template-columns: 12rem 1fr; } }
.review-list dt { color: var(--muted); }
.review-list dd { margin: 0; overflow-wrap: anywhere; }

/* Rodapé */
.site-footer { background: var(--section); border-top: 1px solid var(--line); padding: 2.5rem 0; }
.footer-inner { display: flex; gap: 1.5rem; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; }
.footer-inner ul { list-style: none; padding: 0; margin: 0; }
.footer-inner li { margin-bottom: 0.4rem; }
.footer-inner a { color: var(--muted); text-decoration: none; }
.footer-inner a:hover { color: var(--text); text-decoration: underline; }
.footer-note { color: var(--muted); font-size: 0.85rem; max-width: 34rem; margin-top: 1.5rem; }
/* Portal do cliente */
.portal-auth { max-width: 34rem; }
.portal-topbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.portal-topbar p { margin: 0; }
.portal-tabs { display: grid; grid-template-columns: 1fr; gap: 0.5rem; margin-bottom: 1.5rem; }
@media (min-width: 640px) { .portal-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 900px) { .portal-tabs { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.portal-tab {
  min-height: 48px; padding: 0.75rem 1.25rem; border-radius: 12px;
  background: var(--card); color: var(--text); border: 1px solid var(--line);
  font: inherit; font-weight: 700; font-size: 1rem; cursor: pointer;
}
.portal-tab:hover { border-color: var(--accent); }
.portal-tab[aria-selected="true"] { background: var(--action); color: var(--on-action); border-color: transparent; }
.portal-tab[aria-selected="true"]:hover { background: var(--accent); color: var(--on-action); }
.portal-panel[hidden] { display: none; }
.portal-panel h2 { margin-top: 0; }
.portal-note {
  display: inline-block; padding: 0.35rem 0.8rem; border-radius: 999px;
  background: var(--section); color: var(--accent); border: 1px solid var(--line);
  font-size: 0.85rem; font-weight: 700;
}
.portal-hint { color: var(--muted); margin-top: 1rem; }
.portal-controls { display: grid; grid-template-columns: 1fr; gap: 0.9rem; margin: 1.25rem 0; }
.portal-status { min-height: 1.2em; color: var(--accent); font-size: 0.9rem; }
.portal-empty { color: var(--muted); margin: 1rem 0 0; }
.portal-case__title { font-weight: 700; font-size: 1.1rem; margin-bottom: 0.25rem; }
.portal-case__meta { color: var(--muted); font-size: 0.9rem; }
.portal-timeline { list-style: none; padding: 0; margin: 1.5rem 0 0; }
.portal-timeline__item {
  position: relative; display: grid; gap: 0.15rem;
  padding: 0 0 1.25rem 1.25rem; border-left: 2px solid var(--line);
}
.portal-timeline__item:last-child { border-left-color: transparent; padding-bottom: 0; }
.portal-timeline__item::before {
  content: ""; position: absolute; left: -6px; top: 0.35rem;
  width: 10px; height: 10px; border-radius: 50%; background: var(--muted);
}
.portal-timeline__item--done::before { background: var(--action); }
.portal-timeline__item--active::before { background: var(--accent); }
.portal-timeline__label { font-size: 1rem; }
.portal-timeline__status { color: var(--accent); font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.portal-timeline__detail { color: var(--muted); font-size: 0.9rem; }
.portal-list, .portal-chat { display: grid; gap: 0.75rem; }
.portal-chat {
  max-height: 24rem; overflow-y: auto; margin-top: 1rem;
  border: 1px solid var(--line); border-radius: 12px; padding: 0.75rem;
}
.portal-chat__user, .portal-chat__agent, .portal-message, .portal-document {
  background: var(--section); border: 1px solid var(--line);
  border-radius: 10px; padding: 0.75rem 0.9rem;
}
.portal-chat__agent { border-left: 4px solid var(--accent); }
.portal-chat__user { border-left: 4px solid var(--action); }
.portal-chat__author, .portal-message__author, .portal-document__title { display: block; font-size: 0.9rem; }
.portal-chat__text, .portal-message__text { margin: 0.35rem 0; overflow-wrap: anywhere; }
.portal-chat__meta, .portal-message__meta, .portal-document__kind, .portal-document__status { color: var(--muted); font-size: 0.8rem; }
.portal-document__kind, .portal-document__status { display: block; margin-top: 0.2rem; }
.portal-panel h3 { margin: 1.5rem 0 0; }
.admin-topbar-actions { margin: 0; }
.admin-list { display: grid; gap: 0.75rem; }
.admin-row {
  display: grid; gap: 0.2rem; padding: 0.85rem 1rem;
  background: var(--section); border: 1px solid var(--line); border-radius: 10px;
}
.admin-row__title { font-weight: 700; overflow-wrap: anywhere; }
.admin-row__meta { color: var(--muted); font-size: 0.85rem; overflow-wrap: anywhere; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
