/* ==========================================================================
   Eco to go — design tokens v2 (landing di emergenza)
   Fonte di verità: design-system-v2.md (stessa cartella).
   Legenda commenti:
     [osservato]       = valore presente nello snapshot Wayback 16/07/2026 o nel logo
     [scelta di design] = valore deciso per la v2, non misurato sul sito
   Solo tema chiaro: niente dark mode (scelta di design).
   ========================================================================== */

/* Figtree — SIL Open Font License 1.1 (Erik Kennedy). Variabile 300–900.
   File da mettere in ./fonts/ (non incluso):
   https://cdn.jsdelivr.net/fontsource/fonts/figtree:vf@latest/latin-wght-normal.woff2
   https://cdn.jsdelivr.net/fontsource/fonts/figtree:vf@latest/latin-ext-wght-normal.woff2
   (npm: @fontsource-variable/figtree — oppure Google Fonts "Figtree") */
@font-face {
  font-family: "Figtree";
  src: url("./fonts/figtree-latin-wght-normal.woff2") format("woff2-variations"),
       url("./fonts/figtree-latin-wght-normal.woff2") format("woff2");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Figtree";
  src: url("./fonts/figtree-latin-ext-wght-normal.woff2") format("woff2-variations"),
       url("./fonts/figtree-latin-ext-wght-normal.woff2") format("woff2");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  /* ---- Colore: neutri ---------------------------------------------------- */
  --color-bg: #ffffff;              /* [osservato] sfondo pagina e card */
  --color-surface: #ffffff;         /* [osservato] card, header, input */
  --color-surface-subtle: #f6f8f7;  /* [osservato] superficie soft (dropdown) — fondo foto prodotto, footer */
  --color-surface-hover: #edf5ee;   /* [osservato] hover riga menu */
  --color-text: #1a1f1b;            /* [osservato] 16.72:1 su bianco */
  --color-text-muted: #4a524c;      /* [osservato] 8.07:1 su bianco */
  --color-text-subtle: #6b7570;     /* [osservato] 4.77:1 SOLO su bianco (4.47 su subtle: no) */
  --color-border: #e4e9e5;          /* [osservato] hairline decorativa 1px */
  --color-border-strong: #868f89;   /* [scelta di design] bordo input/controlli, 3.33:1 */
  --color-border-hover: #c9d1cb;    /* [cambio v2, review DSE] hover card, più morbido di border-strong */
  --color-media-bg: #f3f1ec;        /* [cambio v2, Notpla/DSE] neutro caldo per foto e footer */

  /* ---- Colore: brand ----------------------------------------------------- */
  --color-brand: #0f6c35;           /* [osservato, marchio] VERDE SICURO PER TESTO: 6.53:1 */
  --color-brand-hover: #0f661e;     /* [osservato, nastro FINE SERIE] 7.14:1 con bianco */
  --color-brand-active: #1a5c24;    /* [osservato, testo chip] 8.08:1 con bianco */
  --color-brand-strong: #1a5c24;    /* [osservato] testo verde su fondi soft */
  --color-brand-soft: #eef7eb;      /* [osservato] fondo stato attivo */
  --color-brand-tint: rgba(122, 181, 92, 0.12); /* [osservato] inset ring storico */
  /* Verdi chiari: SOLO fill, icone, decoro. Mai testo su bianco (≈2:1). */
  --color-brand-logo: #6fb86e;      /* [osservato, logo.png] 2.40:1 */
  --color-brand-leaf: #7ab55c;      /* [osservato, "Brand Green" nel CSS] 2.44:1 */
  --color-brand-lime: #88c83c;      /* [osservato, favicon] 2.02:1; icon.png campiona #8BCA3E */

  /* ---- Colore: stati ----------------------------------------------------- */
  --color-warning-soft: #fff6e5;    /* [scelta di design] fondo avviso */
  --color-warning-border: #f3ddb3;  /* [scelta di design] hairline avviso */
  --color-warning-text: #8a5300;    /* [scelta di design] 5.90:1 su warning-soft */
  --color-warning-dot: #eb9155;     /* [osservato] arancio snapshot — solo pallino, decoro */
  --color-danger: #b42318;          /* [scelta di design] 6.57:1 (il #D44946 storico fa 4.34) */
  --color-danger-soft: #fef3f2;     /* [scelta di design] */
  --color-success: var(--color-brand);
  --color-focus: #0f6c35;           /* = brand, 6.53:1 su bianco */

  /* ---- Tipografia -------------------------------------------------------- */
  --font-sans: "Figtree", ui-sans-serif, system-ui, -apple-system, "Segoe UI",
    Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;

  /* scala [scelta di design]; il sito storico mostra solo 32/700/1.1 e 15px */
  --text-xs: 0.75rem;     /* 12px — badge */
  --text-sm: 0.8125rem;   /* 13px — codice, meta */
  --text-base-sm: 0.875rem; /* 14px — bottoni, chip, avviso, label */
  --text-base: 1rem;      /* 16px — body */
  --text-lg: 1.125rem;    /* 18px — lead, valore contatto */
  --text-xl: 1.25rem;     /* 20px — titolo card contatto */
  --text-2xl: 1.5rem;     /* 24px — h2 */
  --text-display: clamp(1.75rem, 1.2rem + 1.8vw, 2.5rem); /* 28→40px [cambio v2, DSE #5] */

  --leading-tight: 1.05;  /* display [cambio v2, DSE #5] */
  --leading-snug: 1.25;   /* h2, h3, nomi prodotto */
  --leading-normal: 1.5;  /* body */
  --leading-relaxed: 1.6; /* paragrafi lunghi */

  --tracking-display: -0.03em;
  --tracking-heading: -0.015em;
  --tracking-normal: 0;
  --tracking-caps: 0.04em; /* solo badge xs maiuscoli, max 1 per card */

  /* ---- Spaziatura (base 4px) [scelta di design] ------------------------- */
  --space-0: 0;
  --space-1: 0.25rem;  /* 4 */
  --space-2: 0.5rem;   /* 8 */
  --space-3: 0.75rem;  /* 12 */
  --space-4: 1rem;     /* 16 */
  --space-5: 1.25rem;  /* 20 */
  --space-6: 1.5rem;   /* 24 */
  --space-8: 2rem;     /* 32 */
  --space-10: 2.5rem;  /* 40 */
  --space-12: 3rem;    /* 48 */
  --space-16: 4rem;    /* 64 */
  --space-20: 5rem;    /* 80 */

  /* ---- Raggi [osservati: 8, 10, 12, 999] -------------------------------- */
  --radius-sm: 8px;     /* input piccoli, badge quadrati, thumb interne */
  --radius-md: 10px;    /* bottoni, input, chip filtro */
  --radius-lg: 12px;    /* card, avviso, pannelli */
  --radius-pill: 999px; /* solo badge e pallini */

  /* ---- Bordi ------------------------------------------------------------- */
  --border-hairline: 1px solid var(--color-border);
  --border-control: 1px solid var(--color-border-strong);
  --border-brand: 1px solid var(--color-brand);

  /* ---- Ombre: hairline prima di tutto ----------------------------------- */
  --shadow-none: none;
  --shadow-xs: 0 1px 2px rgba(26, 31, 27, 0.05);      /* [scelta di design] bottoni secondari, input */
  --shadow-overlay: 0 8px 24px rgba(26, 31, 27, 0.08); /* [osservato] SOLO dropdown/popover */

  /* ---- Focus ------------------------------------------------------------- */
  --focus-ring-width: 2px;
  --focus-ring-offset: 2px;
  --focus-ring: 0 0 0 var(--focus-ring-offset) var(--color-bg),
                0 0 0 calc(var(--focus-ring-offset) + var(--focus-ring-width)) var(--color-focus);

  /* ---- Layout ------------------------------------------------------------ */
  --container-max: 90rem;       /* 1440px, catalogo con sidebar */
  --container-pad: 1rem;        /* <640px */
  --container-pad-md: 1.5rem;   /* ≥640px */
  --container-pad-lg: 2rem;     /* ≥1024px */
  --header-h: 4rem;              /* 64px [cambio v2, review DSE #11] */
  --measure: 40rem;             /* max larghezza paragrafi (~70 caratteri) */
  /* breakpoint (solo riferimento, le media query non leggono le var):
     sm 30rem/480px · md 40rem/640px · lg 64rem/1024px · xl 80rem/1280px */

  /* ---- Movimento [osservato: 0.15s / 0.2s ease nel CSS custom] ---------- */
  --duration-instant: 0ms;
  --duration-fast: 150ms;   /* [osservato] background-color, color */
  --duration-base: 200ms;   /* [osservato] color */
  --duration-slow: 240ms;   /* [scelta di design] apertura pannelli/ toast */
  --ease-standard: ease;    /* [osservato] */
  --ease-out: cubic-bezier(0.2, 0, 0, 1); /* [scelta di design] entrate */

  /* ---- Z-index ----------------------------------------------------------- */
  --z-base: 0;
  --z-sticky: 20;
  --z-overlay: 40;
  --z-skip: 100;
}

/* Focus visibile globale: anello 2px brand con stacco bianco 2px */
:where(a, button, input, select, textarea, summary, [tabindex]):focus { outline: none; }
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: var(--focus-ring-width) solid var(--color-focus);
  outline-offset: var(--focus-ring-offset);
}
/* Su controlli con bordo (input, chip) si usa il box-shadow per seguire il raggio */
:where(input, select, textarea):focus-visible {
  outline: none;
  border-color: var(--color-brand);
  box-shadow: var(--focus-ring);
}
@media (forced-colors: active) {
  :where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
    outline: 2px solid CanvasText;
    box-shadow: none;
  }
}

/* Movimento ridotto: niente transizioni, niente smooth scroll */
@media (prefers-reduced-motion: reduce) {
  :root {
    --duration-fast: 0ms;
    --duration-base: 0ms;
    --duration-slow: 0ms;
  }
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
