/* ===================================================================
   HaccpInstant — Brand Foundation
   Tokens che guidano tutta la UI (landing + app React).
   Font self-hostati — nessuna dipendenza da CDN esterne (CSP-safe).
   =================================================================== */

/* ── Self-hosted fonts ──────────────────────────────────────────── */
@font-face {
  font-family: "Instrument Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/InstrumentSerif-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Instrument Serif";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/InstrumentSerif-400-italic.woff2") format("woff2");
}
@font-face {
  font-family: "Inter Tight";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/InterTight-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Inter Tight";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/InterTight-500-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Inter Tight";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/InterTight-600-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Inter Tight";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/InterTight-700-normal.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/JetBrainsMono-500-normal.woff2") format("woff2");
}

:root {
  /* ── Brand colours ─────────────────────────────────────────── */
  /* Primary: forest green — colore istituzionale del brand */
  --hi-green-950: #041509;
  --hi-green-900: #0C2A22;   /* bg sezione dark (hero, how-it-works, footer) */
  --hi-green-800: #134039;   /* hover scuro del primario */
  --hi-green-700: #1B5E4F;   /* primario — forest green */
  --hi-green-600: #288A75;   /* hover, tint scuro */
  --hi-green-500: #33AE93;
  --hi-green-400: #4DCBB0;
  --hi-green-300: #84DBC8;
  --hi-green-200: #BCEBE1;
  --hi-green-100: #DFF6F1;
  --hi-green-50:  #F3FBFA;

  /* Accent: warm orange — "umano, anti-burocrazia" */
  --hi-orange-950: #2D0E05;
  --hi-orange-900: #5C1D0A;
  --hi-orange-800: #922D12;
  --hi-orange-700: #C24A1E;
  --hi-orange-600: #E15A28;
  --hi-orange-500: #FF6B35;
  --hi-orange-400: #FF8E62;
  --hi-orange-300: #FFC1A6;
  --hi-orange-200: #FFD9C7;
  --hi-orange-100: #FFE4D6;
  --hi-orange-50:  #FFF4EE;

  /* Paper / neutrals (warm-leaning) */
  --hi-paper:     #F8F6EF;   /* sfondo "carta" */
  --hi-paper-2:   #F1EEE3;
  --hi-cream:     #EAE5D3;
  --hi-ink:       #15201A;   /* testo principale */
  --hi-ink-soft:  #3A4A41;
  --hi-mute:      #6B7A6F;
  --hi-line:      #E2DDC9;
  --hi-white:     #FFFFFF;

  /* Header glassmorphism background */
  --hi-header-bg: rgba(248, 246, 239, 0.86);

  /* Status (per UI mockups) */
  --hi-success: var(--hi-green-700);
  --hi-warning: #E0A82E;
  --hi-danger:  #C44545;

  /* ── Typography ───────────────────────────────────────────── */
  --hi-font-display: "Instrument Serif", "Times New Roman", serif;
  --hi-font-body:    "Inter Tight", "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --hi-font-mono:    "JetBrains Mono", ui-monospace, monospace;

  /* ── Geometry ─────────────────────────────────────────────── */
  --hi-radius-sm: 6px;
  --hi-radius:    10px;
  --hi-radius-lg: 16px;
  --hi-radius-xl: 24px;

  --hi-shadow-sm:  0 1px 2px rgba(15, 32, 26, 0.06);
  --hi-shadow:     0 8px 24px -8px rgba(15, 32, 26, 0.18), 0 2px 6px rgba(15, 32, 26, 0.06);
  --hi-shadow-lg:  0 24px 60px -20px rgba(15, 32, 26, 0.32), 0 8px 20px -8px rgba(15, 32, 26, 0.14);
}

/* ── Reset & base ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--hi-font-body);
  font-feature-settings: "ss01", "cv11";
  color: var(--hi-ink);
  background: var(--hi-paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.5;
}

img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }

/* ── Type utilities ─────────────────────────────────────────── */
.hi-display {
  font-family: var(--hi-font-display);
  font-weight: 400;
  letter-spacing: -0.015em;
  line-height: 1.02;
  font-style: normal;
}
.hi-display em {
  font-style: italic;
  font-weight: 400;
}
.hi-eyebrow {
  font-family: var(--hi-font-mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--hi-mute);
  font-weight: 500;
}
.hi-mono { font-family: var(--hi-font-mono); }

/* ── Container ──────────────────────────────────────────────── */
.hi-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 28px;
}

/* ── Buttons ────────────────────────────────────────────────── */
.hi-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 22px;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.005em;
  border-radius: var(--hi-btn-radius, 999px);
  border: 1px solid transparent;
  text-decoration: none;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
  white-space: nowrap;
}
.hi-btn:hover { transform: translateY(-1px); }
.hi-btn-primary {
  background: var(--hi-green-700);
  color: white;
}
.hi-btn-primary:hover { background: var(--hi-green-600); }
.hi-btn-accent {
  background: var(--hi-orange-500);
  color: white;
}
.hi-btn-accent:hover { background: var(--hi-orange-600); }
.hi-btn-ghost {
  background: transparent;
  color: var(--hi-ink);
  border-color: var(--hi-ink);
}
.hi-btn-ghost:hover { background: var(--hi-ink); color: var(--hi-paper); }
.hi-btn-ghost-light {
  background: transparent;
  color: var(--hi-paper);
  border-color: rgba(255,255,255,0.4);
}
.hi-btn-ghost-light:hover { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.7); }

/* ── Section spacing ────────────────────────────────────────── */
.hi-section {
  padding: var(--hi-section-pad, 120px) 0;
}
@media (max-width: 720px) {
  .hi-section { padding: 80px 0; }
}

/* ── Tag chip ───────────────────────────────────────────────── */
.hi-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  font-family: var(--hi-font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: var(--hi-paper-2);
  border: 1px solid var(--hi-line);
  color: var(--hi-ink-soft);
}
.hi-chip-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--hi-green-500);
}

/* ── Decorative rule ────────────────────────────────────────── */
.hi-rule {
  height: 1px;
  background: var(--hi-line);
  border: 0;
  width: 100%;
}

/* ── Hero grid — two-column responsive ──────────────────────── */
@media (max-width: 980px) {
  .hi-hero-grid { grid-template-columns: 1fr !important; gap: 32px !important; min-height: auto !important; }
  .hi-hero-grid h1 { max-width: 100% !important; }
  .hi-hero-grid > div:last-child { justify-content: center !important; margin-bottom: -60px; }
}

/* ── Landing layout — responsive breakpoints ────────────────── */
@media (max-width: 980px) {
  .hi-features-head { grid-template-columns: 1fr !important; gap: 24px !important; }
  .hi-features-head p { justify-self: start !important; }
  .hi-features-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .hi-demo-grid { grid-template-columns: 1fr !important; gap: 48px !important; }
  .hi-howitworks-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .hi-howitworks-grid > div {
    border-right: none !important;
    border-bottom: 1px solid rgba(255,255,255,0.15) !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  .hi-pricing-grid { grid-template-columns: 1fr !important; }
  .hi-footer-grid { grid-template-columns: 1fr 1fr !important; }
  .hi-header-nav { display: none !important; }
}
@media (max-width: 600px) {
  .hi-features-grid { grid-template-columns: 1fr !important; }
  .hi-howitworks-grid { grid-template-columns: 1fr !important; }
  .hi-footer-grid { grid-template-columns: 1fr !important; }
}

/* ── Force light-mode palette — marketing/landing page ──────────── */
/*    Overrides html.dark inheritance via scoped custom properties.  */
/*    Also neutralises Tailwind dark: utilities for public pages.    */
.hi-force-light {
  --hi-paper:     #F8F6EF;
  --hi-paper-2:   #F1EEE3;
  --hi-cream:     #EAE5D3;
  --hi-ink:       #15201A;
  --hi-ink-soft:  #3A4A41;
  --hi-mute:      #6B7A6F;
  --hi-line:      #E2DDC9;
  --hi-white:     #FFFFFF;
  --hi-header-bg: rgba(248, 246, 239, 0.86);
  color: var(--hi-ink);
}

/* Override Tailwind dark: background utilities inside force-light */
html.dark .hi-force-light .dark\:bg-neutral-700 { background-color: var(--hi-cream) !important; }
html.dark .hi-force-light .dark\:bg-neutral-800 { background-color: #ffffff !important; }
html.dark .hi-force-light .dark\:bg-neutral-900 { background-color: #ffffff !important; }
html.dark .hi-force-light .dark\:bg-neutral-950 { background-color: var(--hi-paper) !important; }
html.dark .hi-force-light .dark\:hover\:bg-neutral-700:hover { background-color: var(--hi-cream) !important; }
html.dark .hi-force-light .dark\:hover\:bg-neutral-800:hover { background-color: var(--hi-cream) !important; }

/* Override Tailwind dark: text utilities inside force-light */
html.dark .hi-force-light .dark\:text-white { color: var(--hi-ink) !important; }
html.dark .hi-force-light .dark\:text-neutral-50 { color: var(--hi-ink) !important; }
html.dark .hi-force-light .dark\:text-neutral-100 { color: var(--hi-ink) !important; }
html.dark .hi-force-light .dark\:text-neutral-200 { color: var(--hi-ink) !important; }
html.dark .hi-force-light .dark\:text-neutral-300 { color: var(--hi-ink-soft) !important; }
html.dark .hi-force-light .dark\:text-neutral-400 { color: var(--hi-mute) !important; }
html.dark .hi-force-light .dark\:text-neutral-500 { color: var(--hi-mute) !important; }

/* Override Tailwind dark: border utilities inside force-light */
html.dark .hi-force-light .dark\:border-neutral-600 { border-color: var(--hi-line) !important; }
html.dark .hi-force-light .dark\:border-neutral-700 { border-color: var(--hi-line) !important; }
html.dark .hi-force-light .dark\:border-neutral-800 { border-color: var(--hi-line) !important; }
html.dark .hi-force-light .dark\:border-neutral-900 { border-color: var(--hi-line) !important; }

/* Override Tailwind dark: placeholder utilities inside force-light */
html.dark .hi-force-light .dark\:placeholder\:text-neutral-500::placeholder { color: var(--hi-mute) !important; }

/* ── Dark mode variable overrides ───────────────────────────────── */
html.dark {
  --hi-paper:     #0F1B14;
  --hi-paper-2:   #162019;
  --hi-cream:     #1E2D26;
  --hi-white:     #1A261F;
  --hi-ink:       #EEE8D8;
  --hi-ink-soft:  #C4BFAE;
  --hi-mute:      #7A8C82;
  --hi-line:      #2A3B32;
  --hi-header-bg: rgba(15, 27, 20, 0.86);
}
