/* ============================================================
   base.css — Reset + elementos base + utilitários genéricos.
   Não contém regras de tela específicas.
   ============================================================ */

*,
*::before,
*::after { box-sizing: border-box; }

* { margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: var(--font-sans);
  font-size: var(--fs-md);
  line-height: var(--lh-normal);
  color: var(--text);
  background: var(--bg-grad);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden; /* o scroll vive em .view */
}

h1, h2, h3, h4 { line-height: var(--lh-tight); font-weight: var(--fw-bold); }
h1 { font-size: var(--fs-3xl); }
h2 { font-size: var(--fs-2xl); }
h3 { font-size: var(--fs-xl); }
h4 { font-size: var(--fs-lg); }

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: none; }
input, textarea, select { font: inherit; color: inherit; }
img { display: block; max-width: 100%; height: auto; }
ul { list-style: none; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

/* Ícones SVG: linear, branco/adaptável via currentColor */
svg.icon {
  width: 22px;
  height: 22px;
  display: block;
  flex: none;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  color: inherit;
}
svg.icon[data-size="sm"] { width: 18px; height: 18px; }
svg.icon[data-size="lg"] { width: 26px; height: 26px; }
svg.icon[data-size="xl"] { width: 34px; height: 34px; }
svg.icon[data-fill] { fill: currentColor; stroke: none; }

/* Rolagem oculta (mantém o scroll funcional, esconde a barra) */
* {
  scrollbar-width: none;          /* Firefox */
  -ms-overflow-style: none;       /* IE/Edge legado */
}
*::-webkit-scrollbar { width: 0; height: 0; display: none; } /* Chrome/Safari */

/* Utilitários */
.u-row { display: flex; align-items: center; }
.u-col { display: flex; flex-direction: column; }
.u-gap-1 { gap: var(--s-1); }
.u-gap-2 { gap: var(--s-2); }
.u-gap-3 { gap: var(--s-3); }
.u-gap-4 { gap: var(--s-4); }
.u-between { justify-content: space-between; }
.u-center { justify-content: center; align-items: center; }
.u-wrap { flex-wrap: wrap; }
.u-grow { flex: 1 1 auto; min-width: 0; }
.u-muted { color: var(--text-mute); }
.u-dim { color: var(--text-dim); }
.u-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.u-hidden { display: none !important; }
.u-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.section-title {
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  display: flex;
  align-items: center;
  gap: var(--s-2);
}
.section-sub { color: var(--text-mute); font-size: var(--fs-sm); }

.divider { height: 1px; background: var(--border); border: 0; }

/* Estado vazio reutilizável */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--s-3);
  padding: var(--s-7) var(--s-4);
  text-align: center;
  color: var(--text-mute);
}
.empty svg.icon { width: 40px; height: 40px; opacity: 0.6; }

/* ============================================================
   Transições globais
   ============================================================ */

/* Entrada suave ao trocar de tela (aplicada pelo router ao nó montado) */
.route-enter { animation: route-enter .26s cubic-bezier(0.2,0.8,0.3,1) both; }
@keyframes route-enter { from { opacity: 0; transform: translateY(8px); } }

/* Cross-fade de cores ao alternar tema claro/escuro (transitório) */
.theme-anim,
.theme-anim *:not(.icon):not(svg):not(path) {
  transition: background-color .32s ease, color .32s ease,
              border-color .32s ease, fill .32s ease, box-shadow .32s ease !important;
}

@media (prefers-reduced-motion: reduce) {
  .route-enter { animation: none; }
  .theme-anim, .theme-anim * { transition: none !important; }
}
