/* ─────────────────────────────────────────────────────────────────────────
   Motor gráfico "vidro fino" — acabamento de todas as páginas
   - todo texto fica num card fino, com vidro discreto, como um adesivo na página (canto de 4 px);
   - ao passar o mouse o card sobe, acende a borda e ganha um brilho que segue o ponteiro;
   - barras de menu uniformes e leves: texto pequeno, sem pílulas, sublinhado no ativo;
   - a cor de destaque sai da foto de fundo (motor.js) e volta à cor da marca sem foto;
   - tipografia com papéis (títulos condensados, rótulos em mono) e movimento discreto;
   - temas escuro (padrão) e claro: data-tema no <html>, trocado pelo tema.js.
   Tudo fica sob html.motor-novo (classe posta no <html> de cada página).
   Para um componente novo virar card: inclua-o na lista CARDS abaixo e em motor.js, ou use data-card.
   ───────────────────────────────────────────────────────────────────────── */

/* ── Tokens ──────────────────────────────────────────────────────────────── */
html.motor-novo {
  --m-ease: cubic-bezier(.21, .61, .35, 1);
  --m-f-display: 'Archivo', system-ui, -apple-system, sans-serif;
  --m-f-body: 'Archivo', system-ui, -apple-system, sans-serif;
  --m-f-mono: 'IBM Plex Mono', ui-monospace, monospace;
  --m-r: 4px;
  /* cores da marca (o motor.js troca pelas da foto de fundo) — canais RGB separados por espaço */
  --m-accent-rgb: 244 214 123;   /* destaque para textos e bordas (claro, sobre o escuro) */
  --m-solid-rgb: 246 184 0;       /* destaque sólido para botões (texto branco por cima) */
  --m-tint-rgb: 246 184 0;        /* tom médio, mistura leve nos cards e barras */
  --m-ink-rgb: 112 87 16;         /* destaque para textos no tema claro */
  --m-accent-solid: rgb(var(--m-solid-rgb));
  --m-accent-hover: color-mix(in srgb, rgb(var(--m-solid-rgb)) 86%, #fff);
  --m-gut: 20px;

  /* escuro (padrão) */
  --m-page: #0f0f11;
  --m-surface: #151517;
  --m-surface-2: #1b1b1e;
  --m-line: rgb(255 255 255 / .08);
  --m-line-2: rgb(255 255 255 / .15);
  --m-text: #ededed;
  --m-soft: rgb(237 237 237 / .72);
  --m-accent: rgb(var(--m-accent-rgb));
  --m-accent-line: rgb(var(--m-accent-rgb) / .45);
  --m-bar: color-mix(in srgb, rgb(14 14 16 / .84) 92%, rgb(var(--m-tint-rgb) / .84));
  --m-input: #101012;
  --m-card: color-mix(in srgb, rgb(21 21 23 / .8) 91%, rgb(var(--m-tint-rgb) / .8));
  --m-glow: rgb(var(--m-accent-rgb) / .38);
  --m-veu: 9 9 10;
  color-scheme: dark;
  background: var(--m-page);
  color: var(--m-text);
}
html.motor-novo[data-tema="claro"] {
  --m-page: #f3f3f4;
  --m-surface: #ffffff;
  --m-surface-2: #f7f7f8;
  --m-line: rgb(0 0 0 / .09);
  --m-line-2: rgb(0 0 0 / .16);
  --m-text: #1a1a1c;
  --m-soft: #555559;
  --m-accent: rgb(var(--m-ink-rgb));
  --m-accent-line: rgb(var(--m-solid-rgb) / .4);
  --m-bar: color-mix(in srgb, rgb(255 255 255 / .88) 94%, rgb(var(--m-tint-rgb) / .88));
  --m-input: #ffffff;
  --m-card: color-mix(in srgb, rgb(255 255 255 / .84) 95%, rgb(var(--m-tint-rgb) / .84));
  --m-glow: rgb(var(--m-solid-rgb) / .26);
  --m-veu: 243 243 244;
  color-scheme: light;
}
@media (max-width: 620px) { html.motor-novo { --m-gut: 16px; } }

/* ── Tipografia ─────────────────────────────────────────────────────────── */
html.motor-novo body {
  font-family: var(--m-f-body);
  background: var(--m-page);
  color: var(--m-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
html.motor-novo :is(h1, h2, h3, .preco, .kpi b) {
  font-family: var(--m-f-display);
  font-stretch: 80%;
  font-weight: 700;
  letter-spacing: -.01em;
  font-synthesis: none;
  text-wrap: balance;
}
html.motor-novo h1 { font-size: clamp(1.8rem, 2.9vw, 2.5rem); line-height: 1.05; }
html.motor-novo h2 { font-size: clamp(1.45rem, 2.3vw, 2rem); line-height: 1.08; }
html.motor-novo h3 { font-stretch: 86%; font-size: 1.08rem; letter-spacing: 0; }
html.motor-novo :is(p, li) { text-wrap: pretty; }
html.motor-novo :is(.eyebrow, .badge, .fine, kbd, .selo, .kpi small, .tabela th, .brand small) { font-family: var(--m-f-mono); }
html.motor-novo .eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: .66rem; font-weight: 500; letter-spacing: .22em; text-transform: uppercase;
  color: var(--m-accent);
}
html.motor-novo .eyebrow::before { content: ""; width: 18px; height: 1px; background: currentColor; }
html.motor-novo :is(.preco, .kpi b, .tabela .num) { font-variant-numeric: tabular-nums lining-nums; }
html.motor-novo ::selection { background: rgb(var(--m-accent-rgb) / .4); color: #fff; }
html.motor-novo a { color: var(--m-accent); }
html.motor-novo .brand { color: var(--m-text); }
html.motor-novo .brand small { color: var(--m-soft); }

/* ── Fundo: foto nítida com véu de leitura (mais forte à esquerda, onde fica o texto) ── */
html.motor-novo body.fundo-foto::before {
  filter: saturate(1.04) contrast(1.03);
  background:
    linear-gradient(90deg, rgb(var(--m-veu) / .86) 0%, rgb(var(--m-veu) / .6) 40%, rgb(var(--m-veu) / .25) 70%, rgb(var(--m-veu) / .15) 100%),
    linear-gradient(180deg, rgb(var(--m-veu) / .55) 0%, rgb(var(--m-veu) / .1) 30%, rgb(var(--m-veu) / .35) 70%, rgb(var(--m-veu) / .9) 100%),
    var(--foto-pagina) 62% 50% / cover no-repeat;
}
html.motor-novo body.fundo-foto { background: var(--m-page); }

/* ── Cards finos: todo bloco de texto vira um "adesivo" de vidro discreto ── */
html.motor-novo :is(.card, .section .head, .hero-texto, .footer-bottom, .kpi, .bloco, .vazio, .alerta, .cab,
                    .tabela-rolagem, .modal, .toast, .auth-caixa, [data-card]) {
  --m-spot: linear-gradient(transparent, transparent);
  background: var(--m-spot), var(--m-card);
  border: 1px solid var(--m-line);
  border-radius: var(--m-r);
  box-shadow: 0 1px 0 rgb(255 255 255 / .03) inset;
  backdrop-filter: blur(8px) saturate(1.15);
  -webkit-backdrop-filter: blur(8px) saturate(1.15);
  color: var(--m-text);
  transition: opacity .6s var(--m-ease), transform .35s var(--m-ease), border-color .35s var(--m-ease), box-shadow .35s var(--m-ease);
}
/* destaque ao passar o mouse: sobe, a borda acende e um brilho segue o ponteiro (--mx/--my do motor.js) */
html.motor-novo :is(.card, .section .head, .hero-texto, .kpi, .bloco, [data-card]):hover {
  --m-spot: radial-gradient(320px circle at var(--mx, 50%) var(--my, 0%), rgb(var(--m-accent-rgb) / .13), transparent 62%);
  transform: translateY(-3px);
  border-color: var(--m-accent-line);
  box-shadow: 0 0 0 1px rgb(var(--m-accent-rgb) / .14), 0 14px 34px -14px var(--m-glow), 0 4px 12px rgb(0 0 0 / .28);
}
html.motor-novo .card.destaque { border-color: var(--m-accent-line); box-shadow: inset 0 2px 0 var(--m-accent); }
html.motor-novo :is(.modal, .toast, .auth-caixa) { background: var(--m-surface); }
html.motor-novo :is(.card, .section .head, .hero-texto, .bloco, .kpi, .footer-bottom) :is(p, li, small, .lead) { color: var(--m-soft); }
html.motor-novo :is(.card, .section .head, .hero-texto, .bloco, .kpi) :is(h1, h2, h3, b, strong) { color: var(--m-text); }
html.motor-novo .card .ico { border-radius: 3px; border: 1px solid var(--m-line-2); color: var(--m-accent); }
html.motor-novo .section .head { max-width: 820px; margin-inline: auto; padding: 16px 22px; }
html.motor-novo .hero-texto { padding: 22px 24px; }
html.motor-novo .muted { color: var(--m-soft); opacity: 1; }

/* ── Barras de menu: uniformes e leves ──────────────────────────────────── */
html.motor-novo .topbar {
  background: var(--m-bar);
  backdrop-filter: blur(14px) saturate(1.1);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
  border-bottom: 1px solid var(--m-line);
}
html.motor-novo .topbar.m-rolou { background: rgb(14 14 16 / .96); }
html.motor-novo[data-tema="claro"] .topbar.m-rolou { background: rgb(255 255 255 / .97); }
/* itens de todas as barras: mesmo texto, sem pílula, sublinhado no ativo */
html.motor-novo :is(.menu a:not(.btn), .chips button, .lateral-menu a) {
  background: none; border: 0; border-radius: 0; box-shadow: none;
  color: var(--m-soft); font-family: var(--m-f-body); font-size: .84rem; font-weight: 500; letter-spacing: .01em;
  transition: color .2s var(--m-ease), box-shadow .2s var(--m-ease);
}
html.motor-novo .chips button {
  min-height: 40px; padding: 0 12px;
  font-family: var(--m-f-mono); font-size: .7rem; letter-spacing: .12em; text-transform: uppercase;
}
html.motor-novo :is(.menu a:not(.btn), .chips button, .lateral-menu a):hover { color: var(--m-text); }
html.motor-novo :is(.chips button.on, .chips button[aria-pressed="true"], .menu a[aria-current]) {
  color: var(--m-text);
  box-shadow: inset 0 -2px 0 var(--m-accent);
}
html.motor-novo .lateral { background: var(--m-surface); border-right: 1px solid var(--m-line); }
html.motor-novo .lateral-menu a { padding: 9px 12px; }
html.motor-novo .lateral-menu a[aria-current] { color: var(--m-text); box-shadow: inset 2px 0 0 var(--m-accent); }
html.motor-novo .lateral-pe { border-color: var(--m-line); color: var(--m-soft); }

/* cards que ocupam a largura toda respeitam a mesma margem do .wrap */
html.motor-novo .wrap.footer-bottom {
  width: auto; max-width: none;
  margin-left: max(var(--m-gut), calc((100% - 1180px) / 2 + var(--m-gut)));
  margin-right: max(var(--m-gut), calc((100% - 1180px) / 2 + var(--m-gut)));
}

/* ── Botões e campos ────────────────────────────────────────────────────── */
html.motor-novo .btn {
  border-radius: var(--m-r); letter-spacing: .01em;
  background: transparent; border: 1px solid var(--m-line-2); color: var(--m-text);
  transition: background .2s var(--m-ease), border-color .2s var(--m-ease);
}
html.motor-novo .btn:hover { border-color: var(--m-accent-line); background: rgb(var(--m-accent-rgb) / .1); }
html.motor-novo .btn.btn-primary { background: var(--m-accent-solid); border-color: var(--m-accent-solid); color: #fff; }
html.motor-novo .btn.btn-primary:hover { background: var(--m-accent-hover); border-color: var(--m-accent-hover); }
html.motor-novo :is(input, select, textarea) {
  border-radius: 3px; border: 1px solid var(--m-line-2); background: var(--m-input); color: var(--m-text);
}
html.motor-novo :is(input, select, textarea):focus { border-color: var(--m-accent); outline: 0; box-shadow: 0 0 0 3px rgb(var(--m-accent-rgb) / .2); }
html.motor-novo :is(.btn, .chips button, .lateral-menu a, a):focus-visible { outline: 2px solid var(--m-accent); outline-offset: 3px; }
html.motor-novo .selo { border-radius: 2px; }
html.motor-novo .tabela th { font-size: .66rem; letter-spacing: .12em; text-transform: uppercase; background: var(--m-surface-2); color: var(--m-soft); }
html.motor-novo .tabela :is(th, td) { border-color: var(--m-line); }
html.motor-novo .tabela tr.clicavel:hover td { background: rgb(var(--m-accent-rgb) / .06); }
html.motor-novo .tema-alternar { background: var(--m-surface); border-color: var(--m-line-2); color: var(--m-text); }
html.motor-novo .modal-topo .x { color: var(--m-soft); }

/* ── Movimento: entrada escalonada e revelação ao rolar ─────────────────── */
@keyframes m-sobe { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
html.motor-novo .hero-texto > * { animation: m-sobe .7s var(--m-ease) both; }
html.motor-novo .hero-texto > :nth-child(1) { animation-delay: .1s; }
html.motor-novo .hero-texto > :nth-child(2) { animation-delay: .2s; }
html.motor-novo .hero-texto > :nth-child(3) { animation-delay: .3s; }
html.motor-novo .hero-texto > :nth-child(n+4) { animation-delay: .4s; }
html.motor-novo .m-reveal { opacity: 0; transform: translateY(12px); transition: opacity .6s var(--m-ease), transform .6s var(--m-ease); }
html.motor-novo .m-reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html.motor-novo *, html.motor-novo *::before, html.motor-novo *::after { animation: none !important; transition: none !important; }
  html.motor-novo .m-reveal { opacity: 1; transform: none; }
}
