/* YML2 theme overrides for default-template (logged-in) pages.
   The dashboards / forms fall back to the default templates, which use
   bootstrap-italia + main.css whose PRIMARY colour is blue (#0066cc). Under the
   YML2 theme we remap that blue to the YML2 brand red so the logged-in areas
   match the rest of the theme. Loaded AFTER bootstrap-italia + main.css and
   AFTER yml2.css, so it wins.

   Scope note: these selectors target bootstrap/default classes (.btn-primary,
   .text-primary, --bs-primary, etc.) that do NOT appear on the yml2-native
   pages (home, offers, chi siamo…), so those pages are unaffected. */

:root {
  /* YML2 brand red, as a concrete hex (from --red oklch(.63 .245 24)). */
  --yml2-red: #e5322d;
  --yml2-red-dark: #b3221e;
  --yml2-gold: #f2c04c;

  /* Bootstrap-italia primary family -> yml2 red. */
  --bs-primary: var(--yml2-red);
  --bs-primary-rgb: 229, 50, 45;
  --bs-link-color: var(--yml2-red);
  --bs-link-color-rgb: 229, 50, 45;
  --bs-link-hover-color: var(--yml2-red-dark);
  --primary: var(--yml2-red);
}

/* Buttons */
.btn-primary,
.btn-primary:focus {
  background-color: var(--yml2-red) !important;
  border-color: var(--yml2-red) !important;
  color: #fff !important;
}
.btn-primary:hover,
.btn-primary:active {
  background-color: var(--yml2-red-dark) !important;
  border-color: var(--yml2-red-dark) !important;
}
.btn-outline-primary {
  /* bootstrap-italia 2.x draws the outline button's ring with an inset
     box-shadow (not border-color) and hardcodes the blue #06c, so we must
     override BOTH the text colour and that box-shadow. */
  color: var(--yml2-red) !important;
  border-color: var(--yml2-red) !important;
  box-shadow: inset 0 0 0 2px var(--yml2-red) !important;
}
.btn-outline-primary:hover,
.btn-outline-primary:active,
.btn-outline-primary:focus {
  background-color: var(--yml2-red) !important;
  border-color: var(--yml2-red) !important;
  box-shadow: inset 0 0 0 2px var(--yml2-red) !important;
  color: #fff !important;
}

/* Links / text / backgrounds that used the blue primary.
   NOTE: no bare `a{}` rule — that would also recolour the yml2-native pages,
   which set link colours per-section. We only touch bootstrap/default classes,
   none of which appear on the yml2-native templates. */
.text-primary { color: var(--yml2-red) !important; }
.bg-primary { background-color: var(--yml2-red) !important; }
.border-primary { border-color: var(--yml2-red) !important; }
.link-primary { color: var(--yml2-red) !important; }
.badge.bg-primary { background-color: var(--yml2-red) !important; }

/* Common dashboard component blues (main.css BEM classes) */
[class*="__link"].is-active,
.dashboard-hero,
.dashboard-sidebar__link.is-active {
  --accent: var(--yml2-red);
}

/* Form controls focus ring */
.form-control:focus,
.form-select:focus {
  border-color: var(--yml2-red);
  box-shadow: 0 0 0 .2rem rgba(229, 50, 45, .2);
}

/* Progress bars / spinners that inherit primary */
.progress-bar { background-color: var(--yml2-red); }
.spinner-border.text-primary { color: var(--yml2-red) !important; }
