/* ============================================================
   BASE — reset, typography, theme variables placeholder
   Le CSS vars vengono iniettate a runtime da js/theme.js
   ============================================================ */

:root {
  --bg: #0B0F17;
  --surface: #131929;
  --surface2: #1C2540;
  --border: #253050;
  --accent: #3B82F6;
  --accent2: #10B981;
  --accent3: #F59E0B;
  --danger: #EF4444;
  --purple: #A78BFA;
  --teal: #06B6D4;
  --text: #E2E8F0;
  --muted: #64748B;

  --mono: 'Space Mono', monospace;
  --sans: 'IBM Plex Sans', 'Inter', sans-serif;

  /* densita' */
  --pad-xs: 0.3rem;
  --pad-sm: 0.5rem;
  --pad-md: 0.75rem;
  --pad-lg: 1rem;
  --pad-xl: 1.5rem;
  --radius: 0.5rem;
  --radius-lg: 0.75rem;
  --fs-xs: 0.72rem;
  --fs-sm: 0.82rem;
  --fs-md: 0.9rem;
  --fs-lg: 1.1rem;
}

[data-density="compact"] {
  --pad-sm: 0.3rem; --pad-md: 0.5rem; --pad-lg: 0.7rem; --pad-xl: 1rem;
  --fs-xs: 0.68rem; --fs-sm: 0.76rem; --fs-md: 0.85rem;
}
[data-density="comfortable"] {
  --pad-sm: 0.7rem; --pad-md: 1rem; --pad-lg: 1.3rem; --pad-xl: 1.8rem;
  --fs-xs: 0.76rem; --fs-sm: 0.88rem; --fs-md: 1rem;
}

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

html, body {
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: var(--fs-md);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

button {
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
}

input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.hidden { display: none !important; }

#app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--pad-lg);
  padding: var(--pad-lg);
}

/* Grid background sottile (opzionale, riattivabile via tema) */
body[data-grid="on"]::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.02) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}
