/* ------------------------------------------------------------------
   Billy Suite – tema dell'interfaccia sui design token del brand
   (assets/brand/06_colori/tokens.css, guida in docs/BRAND_SVILUPPO.md).

   Caricato DOPO i CSS del template (Frest) e di assets/css/style.css: porta colori, font e raggi
   sulle variabili --billy-*. Il colore del prodotto arriva da data-product su <html>,
   la modalità scura da data-theme. Qui non si scrivono esadecimali: solo variabili.
   ------------------------------------------------------------------ */

/* Variabili del "Billy Visual Refresh" (style.css) ricollegate ai token del brand */
:root {
    --billy-bg: var(--billy-sfondo);
    --billy-surface: var(--billy-superficie);
    --billy-primary: var(--billy-prodotto);
    --billy-primary-dark: var(--billy-notte);
    --billy-accent: var(--billy-corallo);
    --billy-font-main: var(--billy-font-testi);
    --billy-radius-global: var(--billy-raggio-m);
    --billy-text: var(--billy-testo);
    --billy-muted: var(--billy-testo-secondario);
    --billy-border: var(--billy-bordo);
}

body {
    background: var(--billy-sfondo);
    color: var(--billy-testo);
}

html body h1, html body h2, html body h3, html body h4, html body h5, html body h6,
html body .card-title {
    font-family: var(--billy-font-titoli) !important;
    color: var(--billy-testo);
}
html body h1, html body h2, html body h3 { font-weight: 700; }
html body h4, html body h5, html body h6, html body .card-title { font-weight: 600; }
html body .btn, html body label { font-weight: 500; }

a { color: var(--billy-prodotto-testo); }
a:hover, a:focus { color: var(--billy-notte); }

/* Colore primario del template -> colore del prodotto */
.btn-primary,
.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active,
.btn-primary:not(:disabled):not(.disabled):active {
    background-color: var(--billy-prodotto) !important;
    border-color: var(--billy-prodotto) !important;
    color: var(--billy-bianco) !important;
}
.btn-primary:hover { filter: brightness(0.94); }

.btn-outline-primary {
    color: var(--billy-prodotto-testo) !important;
    border-color: var(--billy-prodotto) !important;
    background-color: transparent !important;
}
.btn-outline-primary:hover {
    background-color: var(--billy-prodotto) !important;
    color: var(--billy-bianco) !important;
}

.btn-light-primary,
.badge-light-primary,
.bg-light-primary,
.bg-rgba-primary {
    background-color: var(--billy-prodotto-tinta) !important;
    color: var(--billy-prodotto-testo) !important;
}
.btn-light-primary:hover {
    background-color: var(--billy-prodotto) !important;
    color: var(--billy-bianco) !important;
}

.bg-primary,
.badge-primary,
.progress-bar,
.bullet-primary,
.page-item.active .page-link,
.nav-pills .nav-link.active,
.nav-pills .show > .nav-link {
    background-color: var(--billy-prodotto) !important;
    border-color: var(--billy-prodotto) !important;
    color: var(--billy-bianco) !important;
}

.text-primary,
.primary,
.page-link {
    color: var(--billy-prodotto-testo) !important;
}

.border-primary { border-color: var(--billy-prodotto) !important; }

/* Interruttori, checkbox e radio */
.custom-control-input:checked ~ .custom-control-label::before,
.custom-switch .custom-control-input:checked ~ .custom-control-label::before {
    background-color: var(--billy-prodotto) !important;
    border-color: var(--billy-prodotto) !important;
}

/* Campi: bordo e alone nel colore del prodotto */
.form-control:focus,
.custom-select:focus,
.select2-container--default.select2-container--focus .select2-selection--multiple,
.select2-container--default.select2-container--open .select2-selection--single {
    border-color: var(--billy-prodotto) !important;
    box-shadow: 0 0 0 3px var(--billy-prodotto-tinta) !important;
}

/* Menu laterale: voce attiva nel colore del prodotto */
.main-menu.menu-light .navigation > li.active > a,
.main-menu.menu-light .navigation > li ul .active > a,
.main-menu.menu-dark .navigation > li.active > a {
    background: var(--billy-prodotto) !important;
    box-shadow: none !important;
    color: var(--billy-bianco) !important;
}
.main-menu.menu-light .navigation > li.active > a i,
.main-menu.menu-light .navigation > li ul .active > a i {
    color: var(--billy-bianco) !important;
}

/* Logo nel menu e nella barra (file SVG del brand) */
/* Larghezza fissa (decisa con Armando): con width auto l'SVG si allargava fino a riempire il menu aperto */
.navbar-brand .logo-full { width: 150px !important; max-width: 150px; height: auto !important; }
.navbar-brand .logo-mini { width: 28px !important; height: auto !important; }
.billy-brand-logo-mobile { height: 28px; width: auto; margin-top: 10px; }

/* Stati di sistema */
.text-success { color: var(--billy-successo) !important; }
.text-danger { color: var(--billy-errore) !important; }
.text-warning { color: var(--billy-avviso) !important; }
.text-info { color: var(--billy-info) !important; }

/* Mascotte (Billy Bot): contenitore dell'SVG animato inserito da assets/js/billy-bot.js */
.billy-bot-slot { display: inline-block; line-height: 0; }
.billy-bot-slot:empty { min-height: 1px; }
.billy-sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* Assistente AI (chatbot): colori del brand e mascotte nell'intestazione */
.billy-chatbot-toggle {
    background: var(--billy-notte) !important;
    padding: 0;
    overflow: hidden;
}
.billy-chatbot-toggle .billy-chatbot-avatar { width: 100%; height: 100%; display: block; }
.billy-chatbot-header {
    background: var(--billy-notte) !important;
    color: var(--billy-lino) !important;
}
.billy-chatbot-identity { display: flex; align-items: center; gap: 10px; }
.billy-chatbot-bot { /* sotto i 64 px la guida vuole solo la testa */
    width: 64px; flex: 0 0 64px; margin: -6px 0;
    background: var(--billy-lino); border-radius: var(--billy-raggio-m); padding: 4px;
}
#billy-chatbot-root, #billy-chatbot-root * { font-family: var(--billy-font-testi); }
.billy-chatbot-send { background: var(--billy-prodotto) !important; }

/* Pagina di accesso: stili in login.php (Fase 4B) */
