/* ── Reset & Variabili cliniche ──────────────────────────────────────────────── */
:root {
  /* Palette clinica */
  --blue-900:  #003670;
  --blue-800:  #0057A8;
  --blue-700:  #1A6DC4;
  --blue-600:  #2E86DE;
  --blue-100:  #E8F1FB;
  --blue-50:   #F0F6FF;

  --green-700: #1A7A4A;
  --green-100: #E6F7EE;

  --red-700:   #C0392B;
  --red-100:   #FDECEA;

  --amber-700: #B7791F;
  --amber-100: #FEF3C7;

  --gray-900:  #1A1F2E;
  --gray-800:  #2D3446;
  --gray-700:  #3D4560;
  --gray-600:  #5A6380;
  --gray-500:  #7D8699;
  --gray-400:  #A8B0C0;
  --gray-300:  #CDD2DC;
  --gray-200:  #E2E6EE;
  --gray-100:  #F4F6F9;
  --gray-50:   #F9FAFB;
  --white:     #FFFFFF;

  /* Tipografia */
  --font:      'Inter', system-ui, sans-serif;
  --font-mono: 'Courier New', monospace;

  /* Spaziature */
  --radius-sm: 4px;
  --radius:    8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  /* Ombre */
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.06);
  --shadow-sm: 0 1px 4px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow:    0 2px 8px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.10), 0 2px 6px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12), 0 4px 12px rgba(0,0,0,0.08);

  /* Layout */
  --sidebar-w:       240px;
  --sidebar-w-mini:  64px;
  --topbar-h:        60px;
  --transition:      all .15s ease;
}

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

html { font-size: 14px; -webkit-font-smoothing: antialiased; }

body {
  font-family: var(--font);
  background:  var(--gray-100);
  color:       var(--gray-800);
  line-height: 1.5;
  min-height:  100vh;
}

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

button { cursor: pointer; }
a      { text-decoration: none; color: inherit; }
img    { max-width: 100%; }

/* Scrollbar */
::-webkit-scrollbar       { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--gray-100); }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }

/* Animazioni base */
@keyframes spin    { to { transform: rotate(360deg); } }
@keyframes fadeIn  { from { opacity:0; transform:translateY(-6px); } to { opacity:1; transform:translateY(0); } }
@keyframes fadeUp  { from { opacity:0; transform:translateY(10px); } to { opacity:1; transform:translateY(0); } }
@keyframes pulse   { 0%,100% { opacity:1; } 50% { opacity:.4; } }
@keyframes slideIn { from { transform:translateX(-8px); opacity:0; } to { transform:translateX(0); opacity:1; } }

.fade-in  { animation: fadeIn  .2s ease forwards; }
.fade-up  { animation: fadeUp  .25s ease forwards; }
.pulse    { animation: pulse   1.5s ease-in-out infinite; }

/* Spinner */
.spinner {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,.25);
  border-top-color: white;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  vertical-align: middle;
}
.spinner-dark {
  border-color: var(--gray-200);
  border-top-color: var(--gray-500);
}

/* Utility */
.hidden   { display: none !important; }
.required { color: var(--red-700); margin-left: 2px; }
.mono     { font-family: var(--font-mono); }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Screen switcher */
.screen         { display: none !important; }
.screen.active  { display: flex !important; }
.page           { display: none; }
.page.active    { display: block; animation: fadeUp .2s ease; }

/* Honeypot antispam */
.hp-field {
  position: absolute; left: -9999px; top: -9999px;
  opacity: 0; height: 0; overflow: hidden; pointer-events: none;
}

/* Print */
@media print {
  .sidebar, .topbar, .mon-bar, .no-print { display: none !important; }
  .main { margin-left: 0 !important; }
  body  { background: white; }
}
