/* ================================================================
   FISCALLE — DESIGN LAYER V2 "PREMIUM" · v1.36.0
   ----------------------------------------------------------------
   Layer ADITIVO carregado após style.css. Nada aqui remove
   funcionalidade: se este arquivo faltar, o app volta ao visual
   v1.35 intacto. Rollback = remover 1 <link> por página.

   Pilares:
   1. Tipografia display (Fraunces) nos momentos de marca
   2. Sidebar dark-ink premium (profundidade real, foco no conteúdo)
   3. Aurora ambiente + grain (textura, não decoração)
   4. Micro-interações: spotlight, shine, reveal em cascata (fx.js)
   5. prefers-reduced-motion + dark mode + WCAG preservados
   ================================================================ */

:root {
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  /* Tinta profunda da marca (sidebar, footer, momentos dark) */
  --ink-0: #0E0719;
  --ink-1: #140A26;
  --ink-2: #1B0E33;
  --ink-3: #241341;
  --ink-line: rgba(255, 255, 255, 0.07);
  --ink-text: rgba(255, 255, 255, 0.64);
  --ink-text-hi: rgba(255, 255, 255, 0.94);
  --ink-text-lo: rgba(255, 255, 255, 0.46);
  /* Acentos vivos (uso pontual) */
  --v2-green: var(--brand-green);
  --v2-violet: #8B5CF6;
  --v2-grad-line: linear-gradient(90deg, var(--v2-green), var(--v2-violet));
  /* Spotlight dos cards (fx.js alimenta --mx/--my) */
  --spot-color: rgba(124, 58, 237, 0.055);
  /* Glass */
  --glass-bg: rgba(255, 255, 255, 0.78);
  --glass-blur: saturate(180%) blur(20px);
}
[data-theme="dark"] {
  --spot-color: rgba(154, 209, 91, 0.06);
  --glass-bg: rgba(23, 30, 44, 0.78);
}

/* ================================================================
   1 · AMBIENTE — aurora sutil + grain em todas as páginas
   ================================================================ */
body { position: relative; }
body::before {
  content: ''; position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(900px 600px at 8% -10%, rgba(75, 0, 130, 0.05), transparent 60%),
    radial-gradient(800px 540px at 96% -6%, rgba(116, 187, 63, 0.05), transparent 60%);
}
body::after {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  opacity: 0.028;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
[data-theme="dark"] body::before {
  background:
    radial-gradient(900px 600px at 8% -10%, rgba(139, 92, 246, 0.07), transparent 60%),
    radial-gradient(800px 540px at 96% -6%, rgba(154, 209, 91, 0.05), transparent 60%);
}
[data-theme="dark"] body::after { opacity: 0.04; }

/* ================================================================
   2 · SIDEBAR DARK-INK — o salto de percepção do app
   ================================================================ */
.sidebar {
  background: linear-gradient(178deg, var(--ink-1) 0%, var(--ink-0) 100%);
  border-right: 1px solid var(--ink-line);
}
/* Aurora interna no topo da sidebar */
.sidebar::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 220px; pointer-events: none;
  background:
    radial-gradient(420px 200px at 20% -40px, rgba(139, 92, 246, 0.20), transparent 70%),
    radial-gradient(360px 180px at 90% -60px, rgba(154, 209, 91, 0.10), transparent 70%);
}
.sidebar-brand { border-bottom: 1px solid var(--ink-line); position: relative; }
.sidebar-brand-icon {
  background: rgba(255, 255, 255, 0.96); border-radius: 11px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35), inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}
.sidebar-brand-text strong { color: #fff; letter-spacing: -0.01em; }
.sidebar-brand-text small { color: var(--ink-text-lo); }

.sidebar-section-label { color: var(--ink-text-lo); }
.sidebar .nav-chevron { color: var(--ink-text-lo); }

.sidebar-link { color: var(--ink-text); font-weight: 500; }
.sidebar-link svg { opacity: 0.85; transition: transform var(--motion-fast) var(--ease-out), opacity var(--motion-fast) var(--ease-out); }
.sidebar-link:hover { background: rgba(255, 255, 255, 0.06); color: var(--ink-text-hi); }
.sidebar-link:hover svg { opacity: 1; transform: translateX(1px); }
.sidebar-link.active {
  background: linear-gradient(90deg, rgba(139, 92, 246, 0.22), rgba(139, 92, 246, 0.08));
  color: #fff; font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(139, 92, 246, 0.25);
}
.sidebar-link.active::before {
  background: var(--v2-grad-line); width: 3px; height: 60%;
  box-shadow: 0 0 12px rgba(154, 209, 91, 0.5);
}
.sidebar-link.active svg { opacity: 1; color: var(--v2-green); }
.sidebar-footer { border-top: 1px solid var(--ink-line); }

/* Badges da sidebar sobre fundo escuro */
.sidebar .nav-badge {
  background: var(--v2-green); color: #10250A; font-weight: 800;
  margin-left: auto; font-size: 0.62rem; padding: 1px 7px; border-radius: 999px;
}
.sidebar .nav-badge-alert { background: #F59E0B; color: #3D2800; }
.sidebar .nav-badge-novo { background: var(--v2-violet); color: #fff; }

/* Scrollbar fina e escura dentro da sidebar */
.sidebar-nav::-webkit-scrollbar { width: 6px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.14); border-radius: 3px; }

/* Backdrop mobile mais cinematográfico */
.sidebar-backdrop { background: rgba(10, 5, 20, 0.55); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }

/* Focus visível sobre tinta escura */
.sidebar a:focus-visible, .sidebar button:focus-visible {
  box-shadow: 0 0 0 2px var(--ink-0), 0 0 0 4px var(--v2-green);
}

/* ================================================================
   3 · TOPBAR — vidro de verdade
   ================================================================ */
.topbar {
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  transition: box-shadow var(--motion-base) var(--ease-out), border-color var(--motion-base) var(--ease-out);
}
[data-theme="dark"] .topbar { border-bottom-color: rgba(255, 255, 255, 0.06); }
body.fx-scrolled .topbar { box-shadow: 0 8px 24px -12px rgba(15, 23, 42, 0.12); }
[data-theme="dark"] body.fx-scrolled .topbar { box-shadow: 0 8px 24px -12px rgba(0, 0, 0, 0.5); }
.cmd-trigger { border: 1px solid var(--color-border); border-radius: 9px; }
.cmd-trigger:hover { border-color: var(--brand-purple); }
.cmd-shortcut {
  font-size: 0.68rem; font-weight: 600; color: var(--color-text-mute);
  border: 1px solid var(--color-border); border-radius: 5px; padding: 1px 5px;
  background: var(--color-bg-soft);
}
.topbar-public-brand {
  display: inline-flex;
  align-items: baseline;
  gap: .42rem;
  color: var(--color-text);
  text-decoration: none;
}
.topbar-public-brand strong {
  color: var(--brand-purple);
  font-family: var(--font-display);
  font-size: 1.08rem;
  letter-spacing: -.015em;
}
.topbar-public-brand span { color: var(--color-text-mute); font-size: .7rem; font-weight: 650; }

/* ================================================================
   4 · TIPOGRAFIA DISPLAY — Fraunces nos momentos de marca
   ================================================================ */
.page-head h1,
.hoje-hero h1,
.v2-display {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
  font-feature-settings: normal;
}
.page-head h1 { font-size: 2.1rem; line-height: 1.12; }
.page-head { padding: 2.1rem 0 1.2rem; }
.page-head p { font-size: 1.02rem; max-width: 64ch; }
.hoje-hero h1 { font-size: 1.95rem; }
/* Páginas públicas: hero entra na mesma família display da marca
   (o letter-spacing apertado dos <style> locais sai em outro lote) */
.pub-hero h1 { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.012em; }

/* ================================================================
   5 · CARDS — spotlight + elevação viva
   ================================================================ */
.card { border-radius: 16px; }
/* fx.js adiciona .fx-spot e alimenta --mx/--my no pointermove */
.fx-spot {
  background-image: radial-gradient(480px circle at var(--mx, 50%) var(--my, 50%), var(--spot-color), transparent 55%);
}
.card-clickable:hover {
  box-shadow: 0 16px 40px -12px rgba(75, 0, 130, 0.18), 0 0 0 1px rgba(124, 58, 237, 0.18);
  border-color: transparent;
}
[data-theme="dark"] .card-clickable:hover {
  box-shadow: 0 16px 40px -12px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(139, 92, 246, 0.35);
}
.card-icon { border-radius: 12px; }
.card:hover .card-icon { transform: scale(1.06) rotate(-2deg); }

/* Mini-stats com presença */
.mini-stat { position: relative; }
.mini-stat-value { font-size: 1.85rem; font-weight: 800; letter-spacing: -0.02em; }
.mini-stat:hover { transform: translateY(-2px); }

/* ================================================================
   6 · BOTÕES — gradiente vivo + shine sweep
   ================================================================ */
.btn-primary {
  background: linear-gradient(135deg, #4A1D8F 0%, var(--brand-purple) 55%, #2E0D5E 100%);
  position: relative; overflow: hidden; isolation: isolate;
}
.btn-primary::after {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.22) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform 0.7s var(--ease-out);
}
.btn-primary:hover::after { transform: translateX(120%); }
.btn-primary:hover { background: linear-gradient(135deg, #54249E 0%, #45198A 55%, #36106B 100%); }
.btn-green { position: relative; overflow: hidden; isolation: isolate; }
.btn-green::after {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.25) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform 0.7s var(--ease-out);
}
.btn-green:hover::after { transform: translateX(120%); }

/* Contraste do botão secundário em dark (roxo-escuro sobre cinza-escuro era ilegível) */
[data-theme="dark"] .btn-secondary { color: #C9BCEF; border-color: rgba(201, 188, 239, 0.35); }
[data-theme="dark"] .btn-secondary:hover { background: rgba(139, 92, 246, 0.16); border-color: #C9BCEF; }

/* ================================================================
   7 · FORMULÁRIOS — foco com anel da marca
   ================================================================ */
.form-input, .form-select, .form-textarea { border-radius: 10px; }
.form-input:hover, .form-select:hover, .form-textarea:hover { border-color: var(--color-border-strong); }
.form-input:focus, .form-select:focus, .form-textarea:focus {
  box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.12), 0 1px 2px rgba(15, 23, 42, 0.05);
}

/* ================================================================
   8 · FOOTER — tinta profunda com linha-aurora
   ================================================================ */
.footer {
  background: linear-gradient(180deg, #130A26 0%, var(--ink-0) 100%);
  position: relative;
}
.footer::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: var(--v2-grad-line); opacity: 0.55;
}
.footer h4 {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--v2-green);
}
.footer a { transition: color var(--motion-fast) var(--ease-out), transform var(--motion-fast) var(--ease-out); }
.footer a:hover { color: #fff; transform: translateX(2px); }
[data-theme="dark"] .footer { background: linear-gradient(180deg, #0D0718 0%, #080411 100%); }

/* ================================================================
   9 · BOTTOM NAV (mobile) — vidro com pill ativa
   ================================================================ */
@media (max-width: 900px) {
  .bottom-nav {
    background: var(--glass-bg);
    -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
    border-top: 1px solid rgba(15, 23, 42, 0.06);
    box-shadow: 0 -8px 24px -12px rgba(15, 23, 42, 0.10);
  }
  [data-theme="dark"] .bottom-nav { border-top-color: rgba(255, 255, 255, 0.07); }
  [data-theme="dark"] .bottom-nav-link.active { color: #D8CCFF !important; }
  .bottom-nav-link { position: relative; }
  .bottom-nav-link.active::before {
    content: ''; position: absolute; top: 6px; width: 36px; height: 3px;
    left: 50%; transform: translateX(-50%);
    background: var(--v2-grad-line); border-radius: 999px;
  }
}

/* ================================================================
   10 · REVEAL EM CASCATA — fx.js aplica .fx-r e troca por .fx-in
   (progressivo: sem JS, nada é escondido)
   ================================================================ */
.fx-r { opacity: 0; transform: translateY(14px); }
.fx-in {
  opacity: 1; transform: none;
  transition: opacity 0.65s var(--ease-out) var(--fx-d, 0ms),
              transform 0.65s var(--ease-out) var(--fx-d, 0ms);
}
/* O reveal substitui a cascata automática antiga (evita animação dupla) */
body.fx-on main > section, body.fx-on main > .card, body.fx-on main > div { animation: none; }
body.fx-on main.container { animation: none; }

/* ================================================================
   11 · HERO DO APP (dashboard "hoje") — profundidade de marca
   ================================================================ */
.hoje-hero {
  background:
    radial-gradient(560px 300px at 88% -20%, rgba(154, 209, 91, 0.25), transparent 65%),
    radial-gradient(640px 360px at -10% 120%, rgba(139, 92, 246, 0.35), transparent 65%),
    linear-gradient(135deg, var(--ink-2) 0%, var(--ink-1) 60%, var(--ink-0) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 24px 64px -24px rgba(20, 10, 38, 0.45);
}
.hoje-hero::after {
  background: radial-gradient(circle, rgba(255, 255, 255, 0.10) 0%, transparent 70%);
}

/* Veredito "Estou em dia?" no mobile: o texto encolhia até ~120px em vez
   de quebrar linha (flex:1 + min-width:0 derrotava o flex-wrap) */
@media (max-width: 560px) {
  .dash-verdict .dash-verdict-txt { min-width: min(100%, 13rem); }
  .dash-verdict .dash-verdict-cta { margin-left: 0; }
}

/* ================================================================
   12 · TABELAS E LISTAS — hover com acento
   ================================================================ */
.table tbody tr:hover { box-shadow: inset 3px 0 0 var(--v2-violet); }

/* ================================================================
   13 · MODAIS — entrada com mola sutil
   ================================================================ */
@keyframes v2ModalIn {
  from { opacity: 0; transform: translateY(14px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-overlay.open .modal { animation: v2ModalIn 0.34s var(--ease-spring) both; }

/* ================================================================
   14 · LANDING — classes do hero cinematográfico (index.html)
   ================================================================ */
.v2-hero {
  position: relative; overflow: hidden;
  background: linear-gradient(180deg, #FDFCFF 0%, #FBFBFD 100%);
}
[data-theme="dark"] .v2-hero { background: linear-gradient(180deg, #1A2230 0%, #1F2937 100%); }
.v2-aurora { position: absolute; inset: 0; pointer-events: none; }
.v2-aurora i {
  content: ''; position: absolute; border-radius: 50%;
  filter: blur(72px); opacity: 0.5; will-change: transform;
}
.v2-aurora i:nth-child(1) {
  width: 520px; height: 520px; top: -200px; left: -120px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.35), transparent 70%);
  animation: v2drift1 26s ease-in-out infinite alternate;
}
.v2-aurora i:nth-child(2) {
  width: 460px; height: 460px; top: -140px; right: -100px;
  background: radial-gradient(circle, rgba(154, 209, 91, 0.30), transparent 70%);
  animation: v2drift2 32s ease-in-out infinite alternate;
}
.v2-aurora i:nth-child(3) {
  width: 380px; height: 380px; bottom: -180px; left: 38%;
  background: radial-gradient(circle, rgba(75, 0, 130, 0.18), transparent 70%);
  animation: v2drift3 38s ease-in-out infinite alternate;
}
@keyframes v2drift1 { to { transform: translate(70px, 50px) scale(1.12); } }
@keyframes v2drift2 { to { transform: translate(-60px, 70px) scale(1.08); } }
@keyframes v2drift3 { to { transform: translate(50px, -40px) scale(1.15); } }

.v2-eyebrow {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-size: 0.78rem; font-weight: 600; letter-spacing: 0.02em;
  color: var(--brand-purple); background: rgba(124, 58, 237, 0.07);
  border: 1px solid rgba(124, 58, 237, 0.16);
  padding: 0.4rem 0.9rem; border-radius: 999px; margin-bottom: 1.5rem;
}
[data-theme="dark"] .v2-eyebrow { color: #C4B0EC; background: rgba(139, 92, 246, 0.12); border-color: rgba(139, 92, 246, 0.3); }
.v2-eyebrow .dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--v2-green);
  box-shadow: 0 0 0 0 rgba(154, 209, 91, 0.55);
  animation: v2dot 2.4s ease-out infinite;
}
@keyframes v2dot { 70% { box-shadow: 0 0 0 7px rgba(154, 209, 91, 0); } 100% { box-shadow: 0 0 0 0 rgba(154, 209, 91, 0); } }

.v2-h1 {
  font-family: var(--font-display); font-weight: 560;
  font-size: clamp(2.7rem, 5.6vw, 4.6rem);
  letter-spacing: -0.015em; line-height: 1.04;
  color: var(--color-text); margin-bottom: 1.5rem;
}
.v2-h1 em {
  font-style: italic; font-weight: 600;
  background: linear-gradient(110deg, #4D7E28, #3B1474 70%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
[data-theme="dark"] .v2-h1 em { background: linear-gradient(110deg, var(--v2-green), #B8A2E0 70%); -webkit-background-clip: text; background-clip: text; }

.v2-st {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(1.7rem, 3vw, 2.4rem); letter-spacing: -0.01em; line-height: 1.15;
}

/* Painel-vitrine (mockup flutuante do hero) */
.v2-stage { position: relative; }
.v2-stage .v2-stage-card {
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.72);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 24px 64px -16px rgba(59, 20, 116, 0.22),
    0 64px 120px -48px rgba(116, 187, 63, 0.18);
  transform: perspective(1200px) rotateX(var(--ty, 0deg)) rotateY(var(--tx, 0deg));
  transition: transform 0.18s ease-out;
}
[data-theme="dark"] .v2-stage .v2-stage-card {
  background: rgba(30, 39, 54, 0.78); border-color: rgba(255, 255, 255, 0.1);
}
.v2-stage::after {
  content: ''; position: absolute; inset: auto 8% -26px 8%; height: 40px;
  background: radial-gradient(50% 100% at 50% 0%, rgba(20, 10, 38, 0.18), transparent 70%);
  filter: blur(8px); z-index: -1;
}

/* Faixa de números (prova social) */
.v2-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem;
  padding: 2rem 0;
}
@media (max-width: 900px) { .v2-stats { grid-template-columns: repeat(2, 1fr); } }
.v2-stat { text-align: center; padding: 1.4rem 1rem; }
.v2-stat b {
  display: block; font-size: clamp(1.9rem, 3vw, 2.6rem); font-weight: 800;
  letter-spacing: -0.03em; color: var(--color-text);
  font-variant-numeric: tabular-nums;
}
.v2-stat b .grad {
  background: linear-gradient(110deg, #4D7E28, #3B1474);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
[data-theme="dark"] .v2-stat b .grad { background: linear-gradient(110deg, var(--v2-green), #B8A2E0); -webkit-background-clip: text; background-clip: text; }
.v2-stat > span { font-size: 0.85rem; color: var(--color-text-mute); font-weight: 500; }

/* CTA final — painel de tinta com aurora */
.v2-cta {
  position: relative; overflow: hidden; border-radius: 28px;
  background:
    radial-gradient(640px 320px at 85% -10%, rgba(154, 209, 91, 0.22), transparent 60%),
    radial-gradient(720px 400px at 0% 110%, rgba(139, 92, 246, 0.30), transparent 60%),
    linear-gradient(135deg, var(--ink-2) 0%, var(--ink-0) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: clamp(2.5rem, 6vw, 4.5rem);
  text-align: center; color: #fff;
  box-shadow: 0 32px 80px -32px rgba(20, 10, 38, 0.5);
}
.v2-cta::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.v2-cta h2 {
  font-family: var(--font-display); font-weight: 600; color: #fff;
  font-size: clamp(1.9rem, 4vw, 3rem); letter-spacing: -0.01em; margin-bottom: 1rem;
}
.v2-cta p { color: rgba(255, 255, 255, 0.72); max-width: 56ch; margin: 0 auto 2rem; }

/* Navegação da landing com vidro real */
.landing-nav {
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
}

/* ================================================================
   15 · SCORE RING VIVO — glow, respiração e estado 100
   ================================================================ */
.score-fg { filter: drop-shadow(0 0 6px rgba(139, 92, 246, 0.35)); }
.score-ring-wrap.s100 .score-fg { filter: drop-shadow(0 0 10px rgba(154, 209, 91, 0.65)); }
@keyframes v2ScorePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.035); }
}
.score-ring-wrap.s100 { animation: v2ScorePulse 2.6s var(--ease-in-out) 3; }

/* ================================================================
   16 · LOADER-ASSINATURA "ll" — as duas barras do Fisca‖e
   (substitui o spinner genérico; mesma classe, zero JS novo)
   ================================================================ */
.spinner {
  width: 22px; height: 18px; border: none; border-radius: 0;
  animation: none; position: relative; display: inline-block;
}
.spinner::before, .spinner::after {
  content: ''; position: absolute; bottom: 0; width: 7px; height: 100%;
  border-radius: 3px; transform-origin: bottom;
  animation: v2llPulse 0.9s var(--ease-in-out) infinite;
}
.spinner::before { left: 2px; background: var(--brand-purple); }
.spinner::after { right: 2px; background: var(--v2-green); animation-delay: 0.45s; }
.btn-primary .spinner::before, .v2-cta .spinner::before { background: rgba(255, 255, 255, 0.95); }
.btn-primary .spinner::after, .v2-cta .spinner::after { background: var(--v2-green); }
@keyframes v2llPulse {
  0%, 100% { transform: scaleY(0.45); opacity: 0.6; }
  50% { transform: scaleY(1); opacity: 1; }
}

/* ================================================================
   17 · EMPTY STATES COM ALMA
   ================================================================ */
.v2-empty { text-align: center; padding: 2rem 1.5rem; }
.v2-empty svg { width: 56px; height: 56px; margin: 0 auto 0.85rem; display: block; }

/* ================================================================
   19 · CHECKBOX QUE SE DESENHA — checklists (Lei 15.377, NR1)
   Escopo: apenas dentro de .checklist e .fv-check (não afeta forms)
   ================================================================ */
.checklist input[type="checkbox"] {
  appearance: none; -webkit-appearance: none;
  width: 22px; height: 22px; border-radius: 7px; cursor: pointer;
  border: 2px solid var(--color-border-strong);
  background: var(--color-surface);
  display: inline-grid; place-items: center; flex-shrink: 0;
  transition: border-color var(--motion-fast) var(--ease-out),
              background var(--motion-fast) var(--ease-out),
              transform var(--motion-instant) var(--ease-out);
}
.checklist input[type="checkbox"]:hover { border-color: var(--brand-purple); }
.checklist input[type="checkbox"]:active { transform: scale(0.9); }
.checklist input[type="checkbox"]::before {
  content: ''; width: 12px; height: 12px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 13l5 5L20 7'/%3E%3C/svg%3E") center / contain no-repeat;
  transform: scale(0); opacity: 0;
  transition: transform 0.32s var(--ease-spring), opacity 0.12s var(--ease-out);
}
.checklist input[type="checkbox"]:checked {
  background: linear-gradient(135deg, var(--brand-green-dark), var(--brand-purple));
  border-color: transparent;
}
.checklist input[type="checkbox"]:checked::before { transform: scale(1); opacity: 1; }

/* ================================================================
   20 · BARRA DE PROGRESSO DE LEITURA — páginas de conteúdo longo
   (fx.js cria #v2Readbar quando body[data-readbar] existe)
   ================================================================ */
#v2Readbar {
  position: fixed; top: 0; left: 0; height: 3px; width: 100%;
  z-index: 200; pointer-events: none;
  background: var(--v2-grad-line);
  transform-origin: left; transform: scaleX(0);
}

/* ================================================================
   22 · CINEMA — MORFOSE CARD→PÁGINA (View Transitions)
   fx.js marca o elemento clicado com view-transition-name: vt-hero;
   o destino (h1 da página ou painel da ferramenta) recebe o mesmo
   nome → o navegador anima a transformação. Progressivo: sem
   suporte, a navegação é a de sempre.
   ================================================================ */
::view-transition-group(vt-hero) {
  animation-duration: 0.5s;
  animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
}
::view-transition-old(vt-hero),
::view-transition-new(vt-hero) {
  height: 100%; width: 100%;
  object-fit: none; object-position: top left;
  overflow: clip;
}

/* ================================================================
   23 · CINEMA — CONSULTA CNPJ EM TRÊS ATOS
   ================================================================ */
/* Ato 1 — o palco: ficha em skeleton com radar varrendo */
.cnpj-stage { position: relative; overflow: hidden; padding: 0.5rem 0.25rem; }
.cnpj-stage::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(100deg, transparent 30%, rgba(139, 92, 246, 0.10) 50%, transparent 70%);
  animation: cnpjSweep 1.4s var(--ease-in-out) infinite;
}
@keyframes cnpjSweep { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.cnpj-stage .sk { background: var(--color-border); border-radius: 7px; opacity: 0.55; }
[data-theme="dark"] .cnpj-stage .sk { background: rgba(255, 255, 255, 0.10); }
.cnpj-stage-status {
  display: flex; align-items: center; gap: 0.6rem; margin-top: 1.1rem;
  font-size: 0.85rem; color: var(--color-text-soft); font-weight: 600;
}
.cnpj-radar {
  width: 30px; height: 30px; border-radius: 50%; position: relative; flex: 0 0 auto;
  border: 2px solid rgba(139, 92, 246, 0.3);
}
.cnpj-radar::before {
  content: ''; position: absolute; inset: -2px; border-radius: 50%;
  border: 2px solid transparent; border-top-color: var(--v2-violet);
  animation: cnpjSpin 0.9s linear infinite;
}
.cnpj-radar::after {
  content: ''; position: absolute; inset: 8px; border-radius: 50%;
  background: var(--v2-green);
  animation: cnpjPing 1.8s var(--ease-out) infinite;
}
@keyframes cnpjSpin { to { transform: rotate(360deg); } }
@keyframes cnpjPing {
  0% { transform: scale(0.5); opacity: 1; }
  70%, 100% { transform: scale(1.4); opacity: 0; }
}

/* Ato 2 — a revelação: campos preenchem em cascata */
.cnpj-cascade > * { animation: cnpjRise 0.5s var(--ease-out) both; }
.cnpj-cascade > *:nth-child(1) { animation-delay: 0.00s; }
.cnpj-cascade > *:nth-child(2) { animation-delay: 0.06s; }
.cnpj-cascade > *:nth-child(3) { animation-delay: 0.12s; }
.cnpj-cascade > *:nth-child(4) { animation-delay: 0.18s; }
.cnpj-cascade > *:nth-child(5) { animation-delay: 0.24s; }
.cnpj-cascade > *:nth-child(6) { animation-delay: 0.30s; }
.cnpj-cascade > *:nth-child(7) { animation-delay: 0.36s; }
.cnpj-cascade > *:nth-child(n+8) { animation-delay: 0.42s; }
@keyframes cnpjRise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* Ato 3 — o carimbo de cartório */
.cnpj-stamp {
  animation: cnpjStamp 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) 0.45s both;
  transform-origin: center;
}
@keyframes cnpjStamp {
  0% { opacity: 0; transform: scale(2.4) rotate(-8deg); }
  60% { opacity: 1; transform: scale(0.94) rotate(1deg); }
  100% { opacity: 1; transform: scale(1) rotate(0); }
}

/* Cenografia — skyline de traço fino atrás da ficha */
.cnpj-scene { position: relative; }
.cnpj-scene::before {
  content: ''; position: absolute; inset: auto 0 0 0; height: 180px;
  pointer-events: none; opacity: 0.05; z-index: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 800 180' fill='none' stroke='%233B1474' stroke-width='2'%3E%3Cpath d='M0 180V90h60v90M60 180V40h70v140M130 180V110h50v70M180 180V20h80v160M205 50h30M205 80h30M205 110h30M260 180V70h60v110M320 180V100h70v80M390 180V30h75v150M415 60h25M415 90h25M415 120h25M465 180V120h55v60M520 180V55h65v125M545 85h15M545 115h15M585 180V95h60v85M645 180V45h70v135M670 75h20M670 105h20M715 180V125h55v55M770 180V85h30v95'/%3E%3C/svg%3E") bottom center / cover no-repeat;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 60%);
  mask-image: linear-gradient(180deg, transparent, #000 60%);
}
[data-theme="dark"] .cnpj-scene::before { opacity: 0.08; filter: invert(1); }
.cnpj-scene > * { position: relative; z-index: 1; }

/* ================================================================
   24 · CINEMA — DESDOBRAMENTO de painéis de ferramenta
   (fallback do fx.js para navegadores sem View Transitions)
   ================================================================ */
.fx-unfold { animation: fxUnfold 0.45s var(--ease-out) both; transform-origin: top center; }
@keyframes fxUnfold {
  from { opacity: 0; transform: perspective(900px) rotateX(-7deg) translateY(14px); }
  to { opacity: 1; transform: none; }
}

/* ================================================================
   25 · RESILIÊNCIA VISUAL — MOBILE, OVERFLOW E RODAPÉ COMPACTO
   ================================================================ */
/* Todo filho de grid pode encolher. Sem isso, textos, tabelas e inputs
   impõem sua largura mínima intrínseca e empurram o viewport no mobile. */
:where(
  .grid,
  .grid-2,
  .grid-3,
  .grid-4,
  .grid-3-md-2,
  [class$="-grid"],
  [class*="-grid "]
) > * {
  min-width: 0;
}

/* Flexíveis e cards também precisam permitir quebra de conteúdo real. */
:where(.card, .flex, .flex-col, .topbar, .topbar-empresa, .topbar-actions) > * {
  min-width: 0;
}
:where(
  .card,
  .alert,
  .page-head,
  .topbar-empresa,
  .footer-compact,
  .demo-banner-text,
  .cnpj-scene
) {
  overflow-wrap: anywhere;
}

/* Linhas de resultado: o valor continua alinhado à direita, mas ambos os
   lados podem encolher e quebrar sem criar rolagem horizontal. */
:where(.fer-result-row, .calc-result-row, .rx-row, .cf-row) {
  gap: 0.75rem;
  align-items: flex-start;
  flex-wrap: wrap;
}
:where(.fer-result-row, .calc-result-row, .rx-row, .cf-row) > * {
  min-width: 0;
  overflow-wrap: anywhere;
}
:where(.fer-result-row, .calc-result-row, .rx-row, .cf-row) > :first-child {
  flex: 1 1 11rem;
}
:where(.fer-result-row, .calc-result-row, .rx-row, .cf-row) > :last-child {
  flex: 0 1 auto;
  max-width: min(60%, 32rem);
  margin-left: auto;
  text-align: right;
}

/* Rodapé interno: uma assinatura curta, sem repetir a arquitetura inteira
   da sidebar. As três áreas refluem sem larguras mínimas artificiais. */
.footer.footer-compact {
  margin-top: clamp(2.5rem, 6vw, 4.5rem);
  padding: 1.25rem 0 calc(1rem + env(safe-area-inset-bottom, 0px));
}
.footer-compact-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.8rem 1.5rem;
}
.footer-compact-brand {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.25rem 0.65rem;
  min-width: 0;
}
.footer-compact-brand strong {
  color: #fff;
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}
.footer-compact-brand span {
  color: var(--ink-text);
  font-size: 0.78rem;
}
.footer-compact-links {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.15rem 0.85rem;
  min-width: 0;
}
.footer-compact .footer-compact-links a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0.2rem 0;
  color: var(--ink-text);
  font-size: 0.78rem;
  line-height: 1.35;
}
.footer-compact .footer-compact-links a:hover {
  color: #fff;
  transform: none;
}
.footer-compact-meta {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.3rem 1rem;
  min-width: 0;
  padding-top: 0.75rem;
  border-top: 1px solid var(--ink-line);
  color: var(--ink-text);
  font-size: 0.7rem;
  line-height: 1.4;
}
.footer-compact-meta small {
  flex-basis: 100%;
  color: inherit;
  font-size: inherit;
}

/* Banner de demonstração: compacto, seguro para safe-area e sem texto
   espremido pelo CTA. A regra posterior vence o estilo local da landing. */
.demo-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem max(0.8rem, env(safe-area-inset-right, 0px))
    calc(0.65rem + env(safe-area-inset-bottom, 0px))
    max(0.8rem, env(safe-area-inset-left, 0px));
  gap: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(115deg, #35105f 0%, var(--brand-purple) 58%, #568f2d 100%);
  color: #fff;
  text-align: center;
  box-shadow: 0 -10px 30px rgba(15, 23, 42, 0.2);
}
.demo-banner-text {
  flex: 1 1 22rem;
  min-width: 0;
  line-height: 1.45;
}
.demo-banner .btn {
  flex: 0 0 auto;
  min-height: 44px;
  border-color: rgba(255,255,255,.65);
  background: #fff;
  color: var(--brand-purple);
}

/* Contraste para componentes que ainda trazem branco fixo nas páginas. */
[data-theme="dark"] :where(
  .alert-big,
  .compliance-card,
  .filter-pill:not(.active):not(.filter-lemb-active)
) {
  background: var(--color-surface) !important;
  color: var(--color-text);
}
[data-theme="dark"] .filter-pill:not(.active):not(.filter-lemb-active) {
  border-color: var(--color-border) !important;
}
[data-theme="dark"] .text-brand-purple,
[data-theme="dark"] .topbar-empresa strong,
[data-theme="dark"] .topbar-public-brand strong { color: #C9BCEF !important; }
[data-theme="dark"] .bottom-nav-link.active svg {
  stroke: #D8CCFF !important;
}
#fbModalOverlay .fb-settings-link {
  color: var(--brand-purple);
  font-weight: 700;
}
[data-theme="dark"] #fbModalOverlay .fb-settings-link {
  color: #D8CCFF !important;
}
[data-theme="dark"] .calc-result-row[style*="#92400e"] {
  color: #FCD34D !important;
}
[data-theme="dark"] .demo-banner {
  background: rgba(8, 4, 17, 0.96);
  border-top-color: rgba(255, 255, 255, 0.14);
}

@media (max-width: 900px) {
  /* A largura útil cresce no telefone, sem remover o respiro lateral. */
  .container {
    padding-inline: max(1rem, env(safe-area-inset-left, 0px))
      max(1rem, env(safe-area-inset-right, 0px));
  }

  /* Rótulos longos deixam de forçar botões para fora da tela. */
  .btn { white-space: normal; text-align: center; }

  /* Alvos de toque principais seguem o piso recomendado de 44 × 44 px. */
  :where(
    button,
    .btn,
    .bottom-nav-link,
    .sidebar-link,
    .nf-tab,
    .tab,
    .filter-pill,
    .share-btn,
    [role="button"],
    summary
  ) {
    min-height: 44px;
  }
  button { min-width: 44px; }
  :where(.form-input, .form-select, .form-textarea) { min-height: 44px; }
  .checklist label { min-height: 44px; }
  .lmb-checkrow { min-height: 44px; }

  /* WhatsApp e feedback repetem acessos existentes. O pânico permanece como
     único FAB, imediatamente acima da bottom-nav. */
  .wa-float,
  #fbFloatBtn,
  #scrollTopBtn {
    display: none !important;
  }
  #panicoFloatBtn {
    display: grid !important;
    right: max(0.75rem, env(safe-area-inset-right, 0px)) !important;
    bottom: calc(76px + env(safe-area-inset-bottom, 0px)) !important;
    width: 48px !important;
    height: 48px !important;
  }

  .footer.footer-compact {
    margin-top: 2.5rem;
    padding-block: 1rem calc(0.9rem + env(safe-area-inset-bottom, 0px));
  }
  .footer-compact-inner { grid-template-columns: minmax(0, 1fr); gap: 0.65rem; }
  .footer-compact-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: stretch;
    gap: 0 0.75rem;
  }
  .footer-compact .footer-compact-links a {
    min-height: 44px;
    padding: 0.35rem 0;
  }
  .footer-compact-meta { gap: 0.25rem 0.75rem; padding-top: 0.65rem; }
}

@media (max-width: 560px) {
  :where(.fer-result-row, .calc-result-row, .rx-row, .cf-row) > :last-child {
    max-width: 100%;
  }
  .demo-banner.show {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }
  .demo-banner-text { font-size: 0.78rem; }
}

@media (max-width: 380px) {
  .demo-banner.show { grid-template-columns: minmax(0, 1fr); }
  .demo-banner .btn { width: 100%; }
}

/* ================================================================
   26 · ACESSIBILIDADE DE MOVIMENTO — desliga tudo
   ================================================================ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
  }
  .v2-aurora i, .v2-eyebrow .dot { animation: none !important; }
  .fx-r { opacity: 1 !important; transform: none !important; }
  .btn-primary::after, .btn-green::after { display: none; }
  .v2-stage .v2-stage-card { transform: none !important; }
  .score-ring-wrap.s100 { animation: none !important; }
  ::view-transition-old(root), ::view-transition-new(root),
  ::view-transition-group(vt-hero),
  .cnpj-stage::after, .cnpj-radar::before, .cnpj-radar::after,
  .cnpj-cascade > *, .cnpj-stamp, .fx-unfold { animation: none !important; }
}
