/* ZeraSync 2 — tokens e base. Fonte da verdade do visual: docs/DESIGN.md.
   "Parece o WhatsApp, com a cara da Zera": estrutura azul-aço, verde do WhatsApp
   para enviar/conectar, violeta = IA, âmbar = nota interna.
   Tema por data-theme no <html>, aplicado por js/tema-inicial.js antes do 1º paint. */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/static/assets/inter-latin.woff2') format('woff2');
}

:root {
  color-scheme: light;

  /* superfícies */
  --bg: #f2f4f7;
  --sup: #ffffff;
  --sup-2: #f8fafc;
  --afundado: #eceff3;
  --hover: rgba(22, 32, 43, 0.045);
  --ativo: rgba(91, 122, 153, 0.12);
  --vidro: rgba(255, 255, 255, 0.78);
  --linha: #e2e7ed;
  --linha-forte: #cbd3dc;

  /* texto */
  --txt: #16202b;
  --txt-2: #4a5868;
  --txt-3: #5a6877;   /* 5,2:1 sobre --bg (o #677585 dava 4,3:1; revisão da rodada 4) */
  --txt-inv: #ffffff;

  /* marca */
  --zera: #5b7a99;
  --zera-forte: #46617c;
  --zera-txt: #46617c;       /* marca como TEXTO (no escuro clareia; o --zera-forte é fundo de botão) */
  --zera-suave: rgba(91, 122, 153, 0.12);
  --zera-brilho: rgba(91, 122, 153, 0.30);
  --zera-noite: #141c25;          /* trilho lateral (igual nos dois temas) */
  --zera-noite-2: #1b2531;

  /* WhatsApp */
  --wa: #25d366;
  --wa-forte: #128c4b;
  --wa-txt: #0e6d3a;   /* verde como TEXTO pequeno sobre --wa-suave (o --wa-forte dava 3,9:1 ali) */
  --wa-tinta: #053b1d;
  --wa-suave: rgba(37, 211, 102, 0.14);

  /* IA */
  --ia: #7c5cff;
  --ia-forte: #5b3fd6;
  --ia-suave: rgba(124, 92, 255, 0.12);
  --ia-grad: linear-gradient(135deg, #6d5dfc 0%, #9b5cff 100%);

  /* nota interna */
  --nota: #f5b544;
  --nota-bg: #fff6e0;
  --nota-txt: #6b4200;

  /* estados (cor / texto forte AA / fundo) */
  --ok: #10a37f;     --ok-forte: #0a7a5f;     --ok-bg: rgba(16, 163, 127, 0.12);
  --alerta: #d98324; --alerta-forte: #8a5210; --alerta-bg: rgba(217, 131, 36, 0.14);
  --erro: #d64545;   --erro-forte: #a52d2d;   --erro-bg: rgba(214, 69, 69, 0.12);
  --info: #5b7a99;   --info-forte: #3f5771;   --info-bg: rgba(91, 122, 153, 0.14);

  /* conversa (WhatsApp claro) */
  --chat-bg: #efeae2;
  --chat-desenho: 0.06;
  --bolha-cliente: #ffffff;
  --bolha-equipe: #d9fdd3;
  --bolha-ia: #efeaff;
  --bolha-ia-borda: #ddd3ff;
  --bolha-robo: #e6eef6;
  --bolha-sombra: 0 1px 0.5px rgba(11, 20, 26, 0.13);
  --tique: #8696a0;
  --tique-lido: #53bdeb;

  /* forma */
  --raio-p: 8px;
  --raio: 10px;
  --raio-c: 14px;
  --raio-g: 18px;
  --sombra-1: 0 1px 2px rgba(22, 32, 43, 0.06), 0 2px 8px rgba(22, 32, 43, 0.05);
  --sombra-2: 0 6px 24px rgba(22, 32, 43, 0.12), 0 1px 3px rgba(22, 32, 43, 0.08);
  --sombra-3: 0 24px 64px rgba(22, 32, 43, 0.22), 0 2px 6px rgba(22, 32, 43, 0.08);
  --anel-foco: 0 0 0 3px var(--zera-brilho);

  /* movimento */
  --t-rapido: 120ms cubic-bezier(0.4, 0, 0.2, 1);
  --t-estado: 180ms cubic-bezier(0.22, 0.61, 0.36, 1);
  --t-entrada: 260ms cubic-bezier(0.16, 1, 0.3, 1);

  --fonte: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --fonte-mono: 'Cascadia Code', 'JetBrains Mono', ui-monospace, Consolas, monospace;

  --trilho: 68px;
  --topo: 56px;
  --lista: 360px;
  --detalhes: 340px;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b141a;
  --sup: #111b21;
  --sup-2: #17222a;
  --afundado: #0d171d;
  --hover: rgba(233, 237, 239, 0.06);
  --ativo: rgba(143, 176, 207, 0.16);
  --vidro: rgba(17, 27, 33, 0.82);
  --linha: #222e35;
  --linha-forte: #2f3d46;

  --txt: #e9edef;
  --txt-2: #aebac1;
  --txt-3: #8696a0;
  --txt-inv: #0b141a;

  --zera: #8fb0cf;
  --zera-forte: #4f6d8c;     /* fundo do botão primário: branco por cima dá 5,4:1 */
  --zera-txt: #8fb0cf;       /* texto em azul-aço sobre fundo escuro: 7,6:1 */
  --zera-suave: rgba(143, 176, 207, 0.14);
  --zera-brilho: rgba(143, 176, 207, 0.34);
  --zera-noite: #0a1016;
  --zera-noite-2: #121a22;

  --wa-forte: #3ddc7f;
  --wa-txt: #3ddc7f;
  --wa-suave: rgba(37, 211, 102, 0.16);
  --ia: #9b85ff;
  --ia-forte: #b6a6ff;
  --ia-suave: rgba(155, 133, 255, 0.16);
  --nota-bg: #3a2e12;
  --nota-txt: #f3d08a;

  --ok: #2ea88a;     --ok-forte: #5cc9ae;     --ok-bg: rgba(46, 168, 138, 0.16);
  --alerta: #e0a458; --alerta-forte: #ecbe83; --alerta-bg: rgba(224, 164, 88, 0.16);
  --erro: #e5716f;   --erro-forte: #f0918f;   --erro-bg: rgba(229, 113, 111, 0.16);
  --info: #8fb0cf;   --info-forte: #b3cbe2;   --info-bg: rgba(143, 176, 207, 0.16);

  --chat-bg: #0b141a;
  --chat-desenho: 0.045;
  --bolha-cliente: #202c33;
  --bolha-equipe: #005c4b;
  --bolha-ia: #2a2450;
  --bolha-ia-borda: #4a3f8f;
  --bolha-robo: #1c2b3a;
  --bolha-sombra: 0 1px 0.5px rgba(0, 0, 0, 0.35);
  --tique: #8696a0;

  --sombra-1: 0 1px 2px rgba(0, 0, 0, 0.4);
  --sombra-2: 0 8px 28px rgba(0, 0, 0, 0.5);
  --sombra-3: 0 24px 64px rgba(0, 0, 0, 0.6);
}

* { box-sizing: border-box; }
/* o atributo hidden sempre vence: botão, aba e caixa em flex têm display próprio e o ignoravam */
[hidden] { display: none !important; }
html, body {
  margin: 0; padding: 0; height: 100%;
  background: var(--bg); color: var(--txt);
  font-family: var(--fonte); font-size: 14px; line-height: 1.45;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'cv11', 'ss01', 'ss03';
  text-rendering: optimizeLegibility;
}
body.sem-scroll { overflow: hidden; }
img, svg, video { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--zera-txt); text-decoration: none; }
html[data-theme="dark"] a { color: var(--zera); }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -0.01em; }
h1 { font-size: 20px; font-weight: 700; }
h2 { font-size: 17px; font-weight: 650; }
h3 { font-size: 15px; font-weight: 600; }
p { margin: 0; }
hr { border: 0; border-top: 1px solid var(--linha); margin: 12px 0; }

:focus-visible { outline: 2px solid var(--zera); outline-offset: 2px; border-radius: var(--raio-p); }
:focus:not(:focus-visible) { outline: none; }
::selection { background: var(--zera-brilho); }

/* rolagem discreta */
* { scrollbar-width: thin; scrollbar-color: var(--linha-forte) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--linha-forte); border-radius: 999px; border: 3px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-track { background: transparent; }

/* utilitários */
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--fonte-mono); font-size: 12.5px; }
.fraco { color: var(--txt-3); }
.suave { color: var(--txt-2); }
.cortar { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.linha { display: flex; align-items: center; gap: 8px; min-width: 0; }
.coluna { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.cresce { flex: 1 1 auto; min-width: 0; }
.esconder { display: none !important; }
.so-leitor { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.espaco { flex: 1; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* animações de entrada reutilizáveis */
@keyframes surgir { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes aparecer { from { opacity: 0; } to { opacity: 1; } }
@keyframes pulso-ia { 0%, 100% { box-shadow: 0 0 0 0 rgba(124, 92, 255, 0.45); } 50% { box-shadow: 0 0 0 4px rgba(124, 92, 255, 0); } }
@keyframes brilho-skeleton { from { background-position: -320px 0; } to { background-position: 320px 0; } }
@keyframes piscar-alvo { 0%, 100% { box-shadow: var(--sombra-1); } 30%, 70% { box-shadow: 0 0 0 3px var(--zera), var(--sombra-2); } }

/* ------------------------------------------------------------------ movimento (lib/animacao.js) */
@keyframes pop { 0% { transform: scale(.82); } 60% { transform: scale(1.12); } 100% { transform: none; } }
@keyframes flash-destaque { 0% { background-color: var(--zera-brilho); } 100% { background-color: transparent; } }
@keyframes brilho-passa { from { transform: translateX(-120%) skewX(-18deg); } to { transform: translateX(220%) skewX(-18deg); } }
@keyframes degrade-vivo { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }
@keyframes flutuar { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@keyframes respirar { 0%, 100% { opacity: .55; transform: scale(1); } 50% { opacity: .9; transform: scale(1.06); } }
.entra { animation: surgir 360ms cubic-bezier(.16, 1, .3, 1) both; }
.pop { animation: pop 340ms cubic-bezier(.16, 1, .3, 1); }
.destaque-novo { animation: flash-destaque 1.6s ease-out; }
