/**
 * Copyright (c) Asernet Srl.
 *
 * @author    Asernet Srl <assistenza@asernet.it>
 * @license   Proprietary
 *
 * Colori del front office (www.mazzeosrl.it) al posto del nero del back office.
 *
 * Il tema admin usa il nero #1d1d1b (--cdk-primary-800) sia per le superfici
 * (header, pulsanti primari, schede attive) sia per il testo normale: cambiare
 * la variabile renderebbe verde tutto il testo. Qui si ricolorano solo le
 * superfici, una per una. Il resto (testi, grigi, blu del menu) resta com'e'.
 *
 * I verdi sono quelli del tema del front office (mazzeotheme):
 *   --mwl-green       = --color-primary-accessible (#4ca748 scurito del 15%),
 *                       il verde dei pulsanti, leggibile con testo bianco;
 *   --mwl-green-dark  = --color-primary-dark, l'hover dei pulsanti;
 *   --mwl-green-ring  = --color-primary a meta' opacita', per il focus.
 *
 * !important per lo stesso motivo di whitelabel.css: sulle pagine Symfony il
 * theme.css del core arriva dopo i CSS dei moduli.
 */

:root {
  --mwl-green: #418e3d;
  --mwl-green-dark: #2a5c28;
  --mwl-green-darker: #224a20;
  --mwl-green-ring: rgba(76, 167, 72, 0.5);
}

/* Header: barra in alto, Symfony e legacy. */
body.ps-bo-rebrand {
  --cdk-header-bg: var(--mwl-green);
}

body.ps-bo-rebrand .main-header,
body.ps-bo-rebrand #header_infos {
  background: var(--mwl-green) !important;
}

/* Pulsanti primari. */
body.ps-bo-rebrand .btn-primary {
  color: #fff !important;
  background-color: var(--mwl-green) !important;
  border-color: var(--mwl-green) !important;
}

body.ps-bo-rebrand .btn-primary:hover {
  background-color: var(--mwl-green-dark) !important;
  border-color: var(--mwl-green-dark) !important;
}

body.ps-bo-rebrand .btn-primary:focus,
body.ps-bo-rebrand .btn-primary.focus {
  background-color: var(--mwl-green-dark) !important;
  border-color: var(--mwl-green-dark) !important;
  box-shadow: 0 0 0 0.2rem var(--mwl-green-ring) !important;
}

body.ps-bo-rebrand .btn-primary:not(:disabled):not(.disabled):active,
body.ps-bo-rebrand .btn-primary:not(:disabled):not(.disabled).active,
body.ps-bo-rebrand .show > .btn-primary.dropdown-toggle {
  background-color: var(--mwl-green-darker) !important;
  border-color: var(--mwl-green-darker) !important;
}

/* Disabilitato: resta il grigio del core, non un verde spento. */
body.ps-bo-rebrand .btn-primary:disabled,
body.ps-bo-rebrand .btn-primary.disabled {
  background-color: var(--cdk-primary-500, #bbb) !important;
  border-color: var(--cdk-primary-500, #bbb) !important;
}

/* Pulsanti con bordo primario. */
body.ps-bo-rebrand .btn-outline-primary {
  color: var(--mwl-green) !important;
  border-color: var(--mwl-green) !important;
}

body.ps-bo-rebrand .btn-outline-primary:hover,
body.ps-bo-rebrand .btn-outline-primary:not(:disabled):not(.disabled):active,
body.ps-bo-rebrand .btn-outline-primary:not(:disabled):not(.disabled).active,
body.ps-bo-rebrand .show > .btn-outline-primary.dropdown-toggle {
  color: #fff !important;
  background-color: var(--mwl-green) !important;
  border-color: var(--mwl-green) !important;
}

/* Pulsante tondo "+" in basso a destra (azioni della pagina su mobile). */
body.ps-bo-rebrand .btn-floating > .btn {
  background-color: var(--mwl-green) !important;
  border-color: var(--mwl-green) !important;
}

body.ps-bo-rebrand .btn-floating .btn-floating-item:hover {
  background: var(--mwl-green) !important;
}

/* Schede: sottolineatura della scheda attiva. */
body.ps-bo-rebrand .nav-tabs .nav-link.active,
body.ps-bo-rebrand .nav-tabs .nav-item.show .nav-link {
  border-bottom-color: var(--mwl-green) !important;
}

/* Caselle, radio e interruttori selezionati. */
body.ps-bo-rebrand .md-checkbox [type=checkbox]:checked + .md-checkbox-control::before,
body.ps-bo-rebrand .md-checkbox .indeterminate + .md-checkbox-control::before,
body.ps-bo-rebrand .custom-control-input:checked ~ .custom-control-label::before,
body.ps-bo-rebrand .custom-checkbox .custom-control-input:indeterminate ~ .custom-control-label::before {
  background-color: var(--mwl-green) !important;
  border-color: var(--mwl-green) !important;
}

body.ps-bo-rebrand .ps-radio [type=radio] + label::after,
body.ps-bo-rebrand .form-check-radio input:checked ~ .form-check-round,
body.ps-bo-rebrand .form-check-round::after {
  background-color: var(--mwl-green) !important;
  border-color: var(--mwl-green) !important;
}

/* Voci attive dei menu a tendina, badge, barre di avanzamento. */
body.ps-bo-rebrand .dropdown-item.active,
body.ps-bo-rebrand .dropdown-item:active,
body.ps-bo-rebrand .badge-primary,
body.ps-bo-rebrand .bg-primary,
body.ps-bo-rebrand .progress-bar {
  background-color: var(--mwl-green) !important;
}

body.ps-bo-rebrand .border-primary {
  border-color: var(--mwl-green) !important;
}
