/* Magazzino Borz — font, colori (tema), base tipografica.
   Stile di riferimento: azienda.borz.it (Inter + Space Grotesk, blu Borz, grigi acciaio, forme a pillola). */

/* Font variabili del sito aziendale (licenza OFL, vedi assets/brand/LEGGIMI.txt) */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("../brand/inter-latin-wght-normal.woff2") format("woff2"); }
@font-face { font-family: "Space Grotesk"; font-style: normal; font-weight: 300 700; font-display: swap; src: url("../brand/space-grotesk-latin-wght-normal.woff2") format("woff2"); }

:root {
  /*
   * TEMA — tutti i colori dell'app sono qui (e solo qui), presi da azienda.borz.it.
   * Tema scuro: i due blocchi sotto, con gli stessi nomi.
   */
  /* tavolozza del sito */
  --paper: #fbfcfd;
  --white: #ffffff;
  --steel-50: #f7f8f9;
  --steel-100: #eef0f2;
  --steel-200: #d9dde2;
  --steel-300: #b8c0c8;
  --steel-400: #919da9;
  --steel-500: #687380;
  --steel-700: #4b5560;
  --steel-800: #414951;
  --ink-0: #0c1216;
  --brand-50: #eef8fd;
  --brand-100: #d8effa;
  --brand-400: #41b3e2;
  --brand-500: #1ba7e0;
  --brand-600: #0d79ab;
  --brand-700: #0d6692;
  --brand-950: #0b2e43;
  --amber: #f0b323;

  /* ruoli usati dai componenti */
  --bg: var(--paper);
  --surface: var(--white);
  --surface-2: var(--steel-50);
  --soft: var(--steel-100);           /* sfondi leggeri: selezioni, righe evidenziate */
  --ink: var(--ink-0);
  --muted: var(--steel-500);           /* testo secondario (4,6:1 su bianco) */
  --line: var(--steel-200);            /* bordi sottili */
  --line-strong: #848f9b;              /* bordo dei campi (≥ 3:1 sul bianco) */
  --nav-ink: var(--steel-800);

  --primary: var(--brand-600);         /* azione principale (bianco su brand-600: 4,9:1) */
  --primary-hover: var(--brand-700);
  --on-primary: var(--white);
  --dark: var(--ink-0);                /* pulsante scuro come nel sito */
  --dark-hover: var(--brand-600);
  --on-dark: var(--white);
  --indicator: var(--brand-500);       /* sottolineature e indicatori della voce attiva */
  --ring-hover: var(--brand-400);
  --sel: var(--ink-0);                 /* chip selezionati */
  --on-sel: var(--white);
  --link: var(--brand-600);
  --link-hover: var(--brand-700);
  --focus: var(--brand-600);
  --tint: var(--brand-50);             /* fondo azzurrino per note e voce attiva */

  /* significati */
  --in: #17703f;
  --in-bg: #e8f5ed;
  --on-in: #ffffff;
  --out: #b03a22;
  --out-bg: #fcece8;
  --warn: #6b4a00;                     /* testo su giallo chiaro */
  --warn-bg: #fdf3d8;
  --below: var(--amber);               /* sotto scorta */
  --danger: #b03a22;
  --on-danger: #ffffff;

  --scrim: rgba(12, 18, 22, .45);
  --shadow: 0 2px 24px -6px rgba(12, 18, 22, .08);
  --shadow-hover: 0 18px 50px -16px rgba(12, 18, 22, .22);
  --shadow-pop: 0 18px 50px -12px rgba(12, 18, 22, .28);

  /* alias usati nel codice esistente */
  --yellow: var(--below);
  --on-yellow: var(--ink-0);
  --steel: var(--link);
  --steel-soft: var(--soft);
  --on-steel: var(--on-sel);
  --accent: var(--primary);

  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-d: "Space Grotesk", "Inter", system-ui, sans-serif;
  --font-c: var(--font-d);

  --r-sm: 6px;
  --r: 12px;
  --r-lg: 16px;
  --r-xl: 24px;
  --pill: 999px;
  --tap: 56px;
  --ctl: 48px;
  --gap: 16px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --tabbar-h: calc(66px + var(--safe-b));

  color-scheme: light;
}

/* Tema scuro: base ink / brand-950, testi acciaio chiari, stesso blu */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c1216; --surface: #121b21; --surface-2: #16212a; --soft: #1b2a35;
    --ink: #eef0f2; --muted: #a3adb8; --line: #25323c; --line-strong: #5d6a77; --nav-ink: #d9dde2;
    --primary: var(--brand-400); --primary-hover: #6cc5ea; --on-primary: #0c1216;
    --dark: #eef0f2; --dark-hover: var(--brand-400); --on-dark: #0c1216;
    --indicator: var(--brand-400); --sel: #eef0f2; --on-sel: #0c1216;
    --link: var(--brand-400); --link-hover: #6cc5ea; --focus: var(--brand-400); --tint: var(--brand-950);
    --in: #6fd39b; --in-bg: #12301f; --out: #ff9a85; --out-bg: #3a1c16;
    --warn: #f6cd6a; --warn-bg: #33270b; --danger: #ff9a85; --on-danger: #2a0d07;
    --scrim: rgba(0, 0, 0, .6); --shadow: 0 2px 24px -6px rgba(0, 0, 0, .5);
    --shadow-hover: 0 18px 50px -16px rgba(0, 0, 0, .7); --shadow-pop: 0 18px 50px -12px rgba(0, 0, 0, .75);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0c1216; --surface: #121b21; --surface-2: #16212a; --soft: #1b2a35;
  --ink: #eef0f2; --muted: #a3adb8; --line: #25323c; --line-strong: #5d6a77; --nav-ink: #d9dde2;
  --primary: var(--brand-400); --primary-hover: #6cc5ea; --on-primary: #0c1216;
  --dark: #eef0f2; --dark-hover: var(--brand-400); --on-dark: #0c1216;
  --indicator: var(--brand-400); --sel: #eef0f2; --on-sel: #0c1216;
  --link: var(--brand-400); --link-hover: #6cc5ea; --focus: var(--brand-400); --tint: var(--brand-950);
  --in: #6fd39b; --in-bg: #12301f; --out: #ff9a85; --out-bg: #3a1c16;
  --warn: #f6cd6a; --warn-bg: #33270b; --danger: #ff9a85; --on-danger: #2a0d07;
  --scrim: rgba(0, 0, 0, .6); --shadow: 0 2px 24px -6px rgba(0, 0, 0, .5);
  --shadow-hover: 0 18px 50px -16px rgba(0, 0, 0, .7); --shadow-pop: 0 18px 50px -12px rgba(0, 0, 0, .75);
  color-scheme: dark;
}

@media (min-width: 900px) {
  :root { --ctl: 42px; --tap: 44px; }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--safe-t) + 16px); }
@media (max-width: 899px) {
  html { scroll-padding-bottom: calc(var(--tabbar-h) + 96px); }
  /* con la barra delle azioni fissa (e un avviso sopra) ciò che si porta in vista resta più in alto */
  html:has(.main .actions-sticky) { scroll-padding-bottom: calc(var(--tabbar-h) + 250px); }
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.55 var(--font);
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  min-height: 100dvh;
}
h1, h2, h3, h4 { margin: 0; font-family: var(--font-d); font-weight: 600; line-height: 1.12; letter-spacing: -0.025em; }
p { margin: 0; }
a { color: var(--link); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--link-hover); }
img, svg { display: block; }
ul, ol { margin: 0; padding: 0; list-style: none; }
dl, dd { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
table { border-collapse: collapse; }
kbd { font: 600 12px/1 var(--font-d); }
.num, .qty, .qty-big, .mv-delta, .tile dd, .fig dd, .inv-sys-n, .td-qty { font-variant-numeric: tabular-nums; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
:focus:not(:focus-visible) { outline: none; }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 8px; top: -60px; z-index: 100;
  background: var(--dark); color: var(--on-dark); padding: 10px 16px; border-radius: var(--pill); font: 600 15px var(--font-d);
}
.skip-link:focus { top: calc(8px + var(--safe-t)); }

.ico { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.print-only { display: none; }
.nowrap { white-space: nowrap; }
.muted { color: var(--muted); }
.strong { font-weight: 600; }

/* Etichetta maiuscola spaziata (come "DA OLTRE 40 ANNI"): al massimo una per pagina */
.eyebrow { font: 600 12px/1.2 var(--font-d); letter-spacing: .2em; text-transform: uppercase; color: var(--link); }

/* Logo Borz: PNG 1x/2x con sfondo trasparente */
.brand-logo { display: block; height: 40px; width: auto; flex: none; }

/* Avvio */
.boot { min-height: 100dvh; display: grid; place-items: center; }
.boot-msg { display: grid; justify-items: center; gap: 12px; font: 600 15px var(--font-d); letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.boot-msg .brand-logo { height: 68px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
