/* tokens.css — unica fonte dei token visivi, caricata dal pannello e dalle pagine di auth.
   I quattro colori brand arrivano dalle impostazioni (App.Color*): Template e le viste di auth
   li riscrivono in un <style> inline dopo questo file. Qui ci sono i default WAS. */
:root {
  --accent:          #5B3CF5;
  --accent-dark:     #3D3DF2;
  --accent-light:    #ede9fe;
  --accent-end:      #7F40FF;
  /* Gradiente e testo accentato derivano solo dai colori delle impostazioni */
  --accent-gradient: linear-gradient(135deg, var(--accent-dark) 0%, var(--accent-end) 100%);
  --accent-text:     var(--accent-dark);

  --color-bg:      var(--accent-light);
  --color-surface: #ffffff;
  --color-border:  rgba(0,0,0,0.08);

  /* testo: valori ricalcolati per contrasto >= 4.5:1 su --color-bg */
  --color-text-1: #344050;
  --color-text-2: #4a5768;
  --color-text-3: #5b6a7f;
  --color-text-4: #66738a;

  --color-success: #00864e;  --color-success-bg: #ccf6e4;
  --color-danger:  #e63757;  --color-danger-bg:  #fdd8df;
  --color-warning: #f5803e;  --color-warning-bg: #fde3d1;
  --color-info:    #27bcfd;  --color-info-bg:    #d0f2ff;

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --radius-pill: 160px;

  --shadow-sm:   0 2px 4px rgba(0,0,0,.04);
  --shadow-card: 0 10px 24px rgba(52,64,80,.10), 0 2px 6px rgba(0,0,0,.04);

  --font-body: 'Inter', system-ui, sans-serif;
  --font-head: 'Inter', system-ui, sans-serif;

  /* Bootstrap segue i token senza riscrivere componenti */
  --bs-body-font-family: var(--font-body);
  --bs-body-color:       var(--color-text-2);
  --bs-body-bg:          var(--color-bg);
  --bs-border-radius:    var(--radius-md);
  --bs-border-radius-sm: var(--radius-sm);
  --bs-border-radius-lg: var(--radius-lg);
  --bs-primary:          var(--accent);
  --bs-link-color:       var(--accent-text);
}
.btn-primary {
  --bs-btn-bg: var(--accent);             --bs-btn-border-color: var(--accent);
  --bs-btn-hover-bg: var(--accent-dark);  --bs-btn-hover-border-color: var(--accent-dark);
  --bs-btn-active-bg: var(--accent-dark); --bs-btn-active-border-color: var(--accent-dark);
  background-image: var(--accent-gradient);
}

/* Bootstrap 5.3 pesca --bs-body-bg (= --color-bg, la tinta chiara) per tabelle,
   modali, card, menu e campi: qui li riportiamo a bianco. La tinta chiara resta
   per sfondo pagina, hover delle righe, badge ed evidenze. */
.table {
  --bs-table-bg: var(--color-surface);
  --bs-table-hover-bg: var(--accent-light);
}
.modal, .card, .dropdown-menu, .list-group, .offcanvas, .accordion, .popover, .toast {
  --bs-body-bg: var(--color-surface);
}
.form-control, .form-select { background-color: var(--color-surface); }
h1, h2, h3, h4, h5, h6 { font-family: var(--font-head); color: var(--color-text-1); }

/* Le dichiarazioni storiche più specifiche restano nei fogli dei componenti,
   caricati dopo questo file: questi selettori tengono Inter come font unico
   senza duplicare i token nei singoli moduli. */
html body,
html body button,
html body input,
html body select,
html body textarea { font-family: var(--font-body); }
html body h1,
html body h2,
html body h3,
html body h4,
html body h5,
html body h6,
html body .g-brand-name,
html body .g-page-title,
html body .g-user-dropdown-name,
html body .g-notify-dropdown-header,
html body .avatar-display,
html body .card-header .mb-0,
html body .modal-title,
html body .stat-card-value { font-family: var(--font-head); }
