/* ════════════════════════════════════════════════════════════════════════
   base.css — reset + estilos globais + acessibilidade (docs/03 §4)
   ════════════════════════════════════════════════════════════════════════ */

:root {
  /* safe-area (notch / barras do SO) — usados pelos componentes */
  --safe-top:    env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left:   env(safe-area-inset-left, 0px);
  --safe-right:  env(safe-area-inset-right, 0px);

  /* ícones */
  --icon-size:    20px;
  --icon-size-sm: 16px;
}

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

* { margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--fw-regular);
  line-height: 1.5;
  color: var(--text);
  background: var(--bg-subtle);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, video, svg { display: block; max-width: 100%; }
video { height: auto; }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }

a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 { line-height: 1.2; letter-spacing: var(--tracking-tight); font-weight: var(--fw-semibold); }

ul, ol { list-style: none; }

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

/* ---------- skip link ---------- */
.u-skip-link {
  position: absolute;
  top: -999px; left: var(--space-2);
  z-index: var(--z-toast);
  padding: var(--space-2) var(--space-4);
  background: var(--bg-inverted);
  color: var(--text-inverted);
  border-radius: var(--radius-md);
}
.u-skip-link:focus { top: var(--space-2); }

/* ---------- utilitárias mínimas ---------- */
.u-visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.u-hidden { display: none !important; }

/* ---------- layout shell do app ---------- */
#app-root {
  display: block;
  min-height: 100dvh;
}

/* Login e Player ocupam a tela inteira, sem o chrome do app (sidebar/header). */
body[data-view="player"] app-sidebar,
body[data-view="player"] app-header,
body[data-view="player"] .app-backdrop,
body[data-view="login"] app-sidebar,
body[data-view="login"] app-header,
body[data-view="login"] .app-backdrop {
  display: none !important;
}
body[data-view="player"] {
  background: #000;
  overflow: hidden;
}

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