/* =========================================================================
   Naturalnzeb.it — Design tokens
   Colori, tipografia, spazio, raggi, ombre.
   Import this file and use the variables.
   ========================================================================= */

/* Inter via Google Fonts. If you need offline/self-hosted, replace with @font-face
   pointing at fonts/Inter-*.woff2 (files not yet provided — ask the client). */
@import url('https://rsms.me/inter/inter.css');

:root {
  /* ---- Brand colors -------------------------------------------------- */
  --green-primary: #4a7055;   /* salvia, brand */
  --green-deep:    #254e35;   /* bosco scuro: titoli, "nero" del brand */
  --lime-accent:   #bbbf26;   /* UNA volta per schermata, mai campiture */

  /* ---- Neutrals ------------------------------------------------------ */
  --bg:           #ffffff;
  --ink:          #1f2a23;    /* corpo del testo, quasi-nero verde */
  --ink-soft:     #5a665e;    /* testo secondario */
  --rule:         #e4e7e3;    /* linee sottili */
  --surface-soft: #f5f6f2;    /* sfondi rari (zebra, callout) */

  /* ---- Semantic (state) --------------------------------------------- */
  --ok:    #4a7055;            /* coincide col brand: positività sobria */
  --warn:  #b58b00;            /* ambra desaturata, mai giallo squillante */
  --error: #a83a2a;            /* rosso mattone */
  --info:  #3a5d7a;            /* blu petrolio sobrio */

  /* ---- Type family --------------------------------------------------- */
  --ff-sans:  'Inter', 'Inter Variable', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --ff-mono:  'JetBrains Mono', 'SF Mono', 'Consolas', ui-monospace, monospace;

  /* ---- Type scale (base size / line-height / weight) ---------------- */
  --fs-display: 56px;  --lh-display: 1.05; --fw-display: 700;
  --fs-h1:      40px;  --lh-h1:      1.15; --fw-h1:      700;
  --fs-h2:      28px;  --lh-h2:      1.20; --fw-h2:      700;
  --fs-h3:      20px;  --lh-h3:      1.30; --fw-h3:      600;
  --fs-lead:    19px;  --lh-lead:    1.50; --fw-lead:    400;
  --fs-body:    16px;  --lh-body:    1.55; --fw-body:    400;
  --fs-small:   14px;  --lh-small:   1.50; --fw-small:   400;
  --fs-micro:   12px;  --lh-micro:   1.40; --fw-micro:   500;

  /* ---- Spacing (4-pt scale) ----------------------------------------- */
  --space-1:   4px;
  --space-2:   8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-6:  24px;
  --space-8:  32px;
  --space-12: 48px;
  --space-16: 64px;
  --space-24: 96px;
  --space-32: 128px;

  /* ---- Radii --------------------------------------------------------- */
  --radius-sm:  4px;
  --radius-md:  8px;
  --radius-btn: 6px;

  /* ---- Borders ------------------------------------------------------- */
  --border: 1px solid var(--rule);

  /* ---- Shadows (kept minimal) --------------------------------------- */
  --shadow-card:    0 1px 2px rgba(37, 78, 53, 0.06), 0 2px 8px rgba(37, 78, 53, 0.04);
  --shadow-popover: 0 6px 24px rgba(37, 78, 53, 0.10);

  /* ---- Motion -------------------------------------------------------- */
  --ease-std:    cubic-bezier(0.2, 0, 0.2, 1);
  --dur-fast:    120ms;
  --dur-base:    180ms;

  /* ---- Layout -------------------------------------------------------- */
  --max-page:    1200px;
  --max-prose:    720px;
  --header-h:     72px;
}

/* =========================================================================
   Base typography & reset
   ========================================================================= */
html, body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--ff-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-weight: var(--fw-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'ss01', 'cv11'; /* Inter tabular cues; cosmetic */
}

/* Headings — frase normale, niente uppercase forzato */
h1, .h1 {
  font-size: var(--fs-h1); line-height: var(--lh-h1); font-weight: var(--fw-h1);
  color: var(--green-deep);
  letter-spacing: -0.01em;
  margin: 0;
}
h2, .h2 {
  font-size: var(--fs-h2); line-height: var(--lh-h2); font-weight: var(--fw-h2);
  color: var(--green-deep);
  letter-spacing: -0.005em;
  margin: 0;
}
h3, .h3 {
  font-size: var(--fs-h3); line-height: var(--lh-h3); font-weight: var(--fw-h3);
  color: var(--green-deep);
  margin: 0;
}
.display {
  font-size: var(--fs-display); line-height: var(--lh-display); font-weight: var(--fw-display);
  color: var(--green-deep);
  letter-spacing: -0.015em;
}
.lead {
  font-size: var(--fs-lead); line-height: var(--lh-lead); font-weight: var(--fw-lead);
  color: var(--ink);
}
p { margin: 0 0 1em; max-width: var(--max-prose); }
small, .small { font-size: var(--fs-small); line-height: var(--lh-small); color: var(--ink-soft); }
.micro {
  font-size: var(--fs-micro); line-height: var(--lh-micro); font-weight: var(--fw-micro);
  color: var(--ink-soft);
}
.eyebrow {
  font-size: var(--fs-micro); font-weight: 600;
  color: var(--green-primary);
  letter-spacing: 0.04em;
  text-transform: none; /* lowercase di principio; opzionale per lettering tecnico */
}

/* Links — verde primario, hover scurisce + sottolinea sempre */
a {
  color: var(--green-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: color var(--dur-fast) var(--ease-std);
}
a:hover { color: var(--green-deep); text-decoration-thickness: 1.5px; }
a:focus-visible { outline: 2px solid var(--green-primary); outline-offset: 2px; border-radius: 2px; }

/* Code & technical strings */
code, kbd, pre {
  font-family: var(--ff-mono);
  font-size: 0.92em;
}
code {
  background: var(--surface-soft);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  padding: 1px 5px;
}

/* Rules & dividers */
hr {
  border: 0; border-top: 1px solid var(--rule);
  margin: var(--space-8) 0;
}

/* The single allowed "accent" treatment — use sparingly */
.accent-mark {
  position: relative;
  display: inline-block;
}
.accent-mark::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -3px;
  height: 3px;
  background: var(--lime-accent);
}

/* =========================================================================
   Buttons (minimal canonical primitives)
   ========================================================================= */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--ff-sans); font-weight: 600; font-size: 15px;
  padding: 10px 18px;
  border-radius: var(--radius-btn);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-std),
              border-color var(--dur-fast) var(--ease-std),
              color var(--dur-fast) var(--ease-std),
              transform var(--dur-fast) var(--ease-std);
  text-decoration: none;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--green-primary); outline-offset: 2px; }

.btn-primary {
  background: var(--green-primary);
  color: #fff;
}
.btn-primary:hover { background: var(--green-deep); }

.btn-secondary {
  background: transparent;
  color: var(--green-deep);
  border-color: var(--rule);
}
.btn-secondary:hover { border-color: var(--green-deep); }

.btn-tertiary {
  background: transparent;
  color: var(--green-primary);
  padding-left: 0; padding-right: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.btn-tertiary:hover { color: var(--green-deep); }

/* Badge / tag */
.badge {
  display: inline-flex; align-items: center;
  font-size: var(--fs-micro); font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px; /* pillole consentite SOLO per badge testuali piccoli */
  border: 1px solid var(--rule);
  color: var(--green-deep);
  background: #fff;
}
.badge-accent {
  /* da usare con criterio — è il "punto focale" */
  border-color: var(--lime-accent);
  color: var(--green-deep);
}

/* Form */
.field {
  display: flex; flex-direction: column; gap: 6px;
}
.field label { font-size: var(--fs-small); font-weight: 600; color: var(--green-deep); }
.field input, .field select, .field textarea {
  font-family: var(--ff-sans); font-size: var(--fs-body);
  padding: 10px 12px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  transition: border-color var(--dur-fast) var(--ease-std);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--green-primary);
  box-shadow: 0 0 0 3px rgba(74, 112, 85, 0.12);
}

/* Card */
.card {
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  padding: var(--space-6);
}
