/* ================================================================
   HOTSPOT MASTER V3 — Design Tokens
   Identidade: "Signal" — inspirada na natureza do produto (rede/hotspot).
   Tipografia: Inter (UI) + JetBrains Mono (dados/numéricos).
   ================================================================ */
:root {
  /* ---- Tipografia ---- */
  --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  /* ---- Espaçamento (escala 4px) ---- */
  --space-1: 4px;  --space-2: 8px;  --space-3: 12px; --space-4: 16px;
  --space-5: 20px; --space-6: 24px; --space-8: 32px; --space-10: 40px;
  --space-12: 48px; --space-16: 64px;

  /* ---- Raio ---- */
  --radius-sm: 6px; --radius-md: 10px; --radius-lg: 14px; --radius-full: 999px;

  /* ---- Sombra ---- */
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
  --shadow-md: 0 4px 12px rgba(16, 24, 40, 0.08);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, 0.14);
  --shadow-modal: 0 24px 60px rgba(8, 12, 20, 0.35);

  /* ---- Transições ---- */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --t-fast: 120ms var(--ease);
  --t-base: 200ms var(--ease);

  /* ---- Sidebar/Topbar dimensões ---- */
  --sidebar-w: 264px;
  --sidebar-w-collapsed: 72px;
  --topbar-h: 64px;

  /* ---- Semânticos (compartilhados entre temas) ---- */
  --success: #16a34a;   --success-bg: #dcfce7;
  --warning: #d97706;   --warning-bg: #fef3c7;
  --danger:  #dc2626;   --danger-bg:  #fee2e2;
  --info:    #0891b2;   --info-bg:    #cffafe;
  --accent:  #06b6d4;
}

/* ================= TEMA CLARO (padrão) ================= */
:root, [data-theme="light"] {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-alt: #eef1f6;
  --surface-hover: #e7ebf2;
  --border: #dde3ec;
  --border-strong: #c6cedb;
  --text: #101828;
  --text-muted: #5a6472;
  --text-faint: #8891a0;

  --primary: #3653f4;
  --primary-hover: #2d46d6;
  --primary-bg: #eaefff;
  --primary-text-on: #ffffff;

  --scrim: rgba(16, 24, 40, 0.5);
  --skeleton-base: #e9edf3;
  --skeleton-shine: #f6f8fb;
}

/* ================= TEMA ESCURO ================= */
[data-theme="dark"] {
  --bg: #0a0e17;
  --surface: #10151f;
  --surface-alt: #161c28;
  --surface-hover: #1c2431;
  --border: #232b3a;
  --border-strong: #2e3849;
  --text: #e8ecf3;
  --text-muted: #8c96a8;
  --text-faint: #626c7d;

  --primary: #5b7bff;
  --primary-hover: #7791ff;
  --primary-bg: #182248;
  --primary-text-on: #ffffff;

  --scrim: rgba(4, 6, 12, 0.65);
  --skeleton-base: #182030;
  --skeleton-shine: #202a3d;

  --success-bg: #113322;
  --warning-bg: #3a2a0d;
  --danger-bg: #3a1616;
  --info-bg: #0d2f38;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; height: 100%;
  background: var(--bg); color: var(--text);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
  transition: background var(--t-base), color var(--t-base);
}
body { font-size: 14px; line-height: 1.5; }
h1,h2,h3,h4 { margin: 0; font-weight: 700; letter-spacing: -0.02em; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--primary); color: #fff; }

.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* Foco visível (acessibilidade) */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--text-faint); }

/* ================================================================
   Acessibilidade (Sprint 3) — fonte ampliada e alto contraste.
   Aplicados via atributos em <html>, no mesmo padrão de [data-theme].
   Reutilizável por qualquer painel (admin/sponsor/client) que carregue
   tokens.css — nenhum novo padrão visual é criado.
   ================================================================ */
:root { --a11y-font-scale: 1; }
html[data-fontsize="large"] { --a11y-font-scale: 1.15; }
html[data-fontsize="xlarge"] { --a11y-font-scale: 1.3; }
body { font-size: calc(14px * var(--a11y-font-scale)); }

html[data-contrast="high"] {
  --border: var(--text-faint);
  --border-strong: var(--text);
  --text-muted: var(--text);
}
html[data-contrast="high"][data-theme="light"] { --bg: #ffffff; --surface-alt: #eaeaea; }
html[data-contrast="high"][data-theme="dark"] { --bg: #000000; --surface: #0a0a0a; --surface-alt: #1a1a1a; }
html[data-contrast="high"] .btn-primary { background: var(--primary); outline: 2px solid var(--text); }
