/*
 * Tecnoimpianti brand (tecnoimpiantilucca.it) on top of the Matrix structure (matrix.css).
 * Colours from the site: ti-blue #3D97CD, ti-green #4CB772, ti-dark #1D1D1B, ti-light #EAEAEA,
 * the logo mark uses a blue -> green gradient. Typeface: Nexa (Book / Bold / XBold / Heavy).
 * Loaded after matrix.css, so these values override the Matrix ones.
 */

@font-face { font-family: "TI Nexa"; font-weight: 400; font-style: normal; font-display: swap; src: url("../fonts/nexa-400.d2dab0612115.woff2") format("woff2"); }
@font-face { font-family: "TI Nexa"; font-weight: 500; font-style: normal; font-display: swap; src: url("../fonts/nexa-400.d2dab0612115.woff2") format("woff2"); }
@font-face { font-family: "TI Nexa"; font-weight: 600; font-style: normal; font-display: swap; src: url("../fonts/nexa-700.89ce204957c7.woff2") format("woff2"); }
@font-face { font-family: "TI Nexa"; font-weight: 700; font-style: normal; font-display: swap; src: url("../fonts/nexa-700.89ce204957c7.woff2") format("woff2"); }
@font-face { font-family: "TI Nexa"; font-weight: 800; font-style: normal; font-display: swap; src: url("../fonts/nexa-800.27c6310614cb.woff2") format("woff2"); }
@font-face { font-family: "TI Nexa"; font-weight: 900; font-style: normal; font-display: swap; src: url("../fonts/nexa-900.6d3c98f58692.woff2") format("woff2"); }

:root {
  --ti-blue: #3d97cd;
  --ti-green: #4cb772;
  --ti-dark: #1d1d1b;
  --ti-light: #eaeaea;
  --ti-gradient: linear-gradient(90deg, var(--ti-blue), var(--ti-green));

  --mx-font-ui: "TI Nexa", Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mx-font-display: "TI Nexa", Inter, system-ui, sans-serif;

  --mx-brand-solid: var(--ti-blue);
  --mx-brand-subtle: #e8f3fa;
  --mx-neutral-text-ink: var(--ti-dark);
  --mx-neutral-surface-solid: var(--ti-dark);

  /* status and info in the brand hues */
  --mx-success-indicator: var(--ti-green);
  --mx-success-canvas: #e7f6ec;
  --mx-success-text: #237a43;
  --mx-success-border: #9fdbb4;
  --mx-info-solid: var(--ti-blue);
  --mx-info-canvas: #e8f3fa;
  --mx-info-text: #1f6c9c;
  --mx-system-focus-ring: var(--ti-blue);
}

html.dark {
  --mx-brand-subtle: #12283a;
  --mx-neutral-surface-canvas: var(--ti-dark);
  --mx-neutral-surface-raised: #262624;
  --mx-neutral-surface-sunken: #141413;
  --mx-neutral-surface-control: #353533;
  --mx-neutral-text-ink: var(--ti-light);
  --mx-neutral-surface-solid: var(--ti-light);
  --mx-neutral-text-on-ink: var(--ti-dark);

  --mx-success-indicator: var(--ti-green);
  --mx-success-canvas: #0f2a1a;
  --mx-success-text: #8fd9a9;
  --mx-success-border: #237a43;
  --mx-info-solid: var(--ti-blue);
  --mx-info-canvas: #0f2333;
  --mx-info-text: #8cc6ea;
  --mx-system-focus-ring: #6fb4de;

  --color-primary-600: #3a3a38;
  --color-primary-700: #4a4a48;
}

/* the whole admin in Nexa (Unfold ships Inter) */
html body, body .font-sans { font-family: var(--mx-font-ui); }

/* headings in the site's voice: Nexa heavy weights */
.pm-h1 { font-weight: 800; letter-spacing: 0.01em; }
.pm-kpi-value, .pm-tile-value, .pm-statusbar-item strong, .pm-syn-value { font-weight: 800; }

/* eyebrow: brand gradient bar instead of the Matrix red chevron, uppercase with wide tracking like the site menu */
.pm-eyebrow { text-transform: uppercase; letter-spacing: 0.14em; font-size: 11px; font-weight: 700; }
.pm-eyebrow::before { content: ""; width: 18px; height: 3px; border-radius: 2px; background: var(--ti-gradient); }

/* sidebar logo: let the wide wordmark breathe */
#nav-sidebar-inner img, [data-pm-logo] { max-height: 26px; }

/* brand accent on the selected chip and the active range */
.pm-segmented button.is-active { box-shadow: var(--mx-elevation-1), inset 0 -2px 0 var(--ti-blue); }

/* login and other unauthenticated pages */
.pm-auth-title { display: flex; flex-direction: column; gap: 12px; padding-bottom: 24px; margin-bottom: 32px; border-bottom: 1px solid var(--mx-neutral-line-border); }
.pm-auth-logo { height: 28px; width: auto; align-self: flex-start; margin-bottom: 16px; }
.pm-auth-logo-dark, html.dark .pm-auth-logo-light { display: none; }
html.dark .pm-auth-logo-dark { display: block; }
.pm-auth-title .pm-eyebrow { display: inline-flex; align-items: center; gap: 8px; color: var(--mx-neutral-text-secondary); }
.pm-auth-title h1 { margin: 0; font-size: 28px; line-height: 36px; font-weight: 800; color: var(--mx-neutral-text-ink); }

/* login side panel: Unfold sets only background-size: cover (top-left crop); keep the art centred */
body.login #page > .bg-cover { background-position: center; background-repeat: no-repeat; }
.pm-auth-logo { height: 34px; }
/* login button in the brand blue (in dark mode the neutral primary was a grey that looked disabled) */
body.login .submit-row button[type=submit], body.login button[type=submit].submit-row, body.login .submit-row[type=submit] {
  background: var(--ti-blue); border-color: var(--ti-blue); color: #fff;
}
body.login .submit-row button[type=submit]:hover, body.login .submit-row[type=submit]:hover { background: #2f80b3; border-color: #2f80b3; }

/* "Early access" badge (top bar + login) and its explanation popover */
.pm-beta {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border-radius: 999px;
  font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; white-space: nowrap;
  color: #fff; background: var(--ti-gradient); cursor: pointer; border: 0;
}
.pm-beta:hover { filter: brightness(1.06); }
.pm-beta:focus-visible { outline: 2px solid var(--mx-system-focus-ring); outline-offset: 2px; }
.pm-beta-static { cursor: default; align-self: flex-start; }
.pm-beta-dot { width: 6px; height: 6px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 3px rgba(255,255,255,0.3); }
.pm-beta-pop {
  position: fixed; inset: 64px 16px auto auto; margin: 0; width: min(360px, calc(100vw - 32px));
  padding: 16px 18px; border: 1px solid var(--mx-neutral-line-border); border-radius: 12px;
  background: var(--mx-neutral-surface-raised); color: var(--mx-neutral-text-ink);
  box-shadow: 0 12px 32px rgba(0,0,0,0.18); font-size: 13px; line-height: 1.5;
}
.pm-beta-pop::backdrop { background: transparent; }
.pm-beta-pop-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 14px; }
.pm-beta-tag { padding: 2px 8px; border-radius: 999px; background: var(--ti-gradient); color: #fff; font-size: 10px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.pm-beta-pop p { margin: 0 0 6px; color: var(--mx-neutral-text-secondary); }
.pm-beta-pop p:last-child { margin-bottom: 0; }
.pm-auth-eyebrow-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
@media (max-width: 640px) {
  .pm-userlinks .pm-beta { height: 32px; padding: 0 10px; }
  .pm-userlinks .pm-beta span:last-child { font-size: 0; }
  .pm-userlinks .pm-beta span:last-child::after { content: "Beta"; font-size: 11px; }
}
/* Tecnoimpianti Connect lockup is wider than the plain logo: fit the sidebar width */
#nav-sidebar-inner img, [data-pm-logo] { max-width: 100%; height: auto; }
.pm-auth-logo { height: 30px; max-width: 100%; }
