/* ============================================================
   WESTIGen — Sito istituzionale (main.css)
   Posizionamento: "fabbrica del software normativo".
   Design system condiviso con tributi-comunali.westigen.com:
   palette blu istituzionale + ambra, accenti emerald/red,
   sezioni dark slate. Font: Inter. HTML+CSS puro, zero build.
   ============================================================ */

/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--color-fg);
  background: var(--color-bg);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* ---------- Design tokens ---------- */
:root {
  /* Primario — blu istituzionale */
  --color-primary: #0d3a82;
  --color-primary-hover: #0a2d66;
  --color-primary-soft: #e8efff;

  /* Accento — ambra/tabacco (metafora "fabbrica") */
  --color-accent: #b8721d;
  --color-accent-soft: #fdf3e2;

  /* Emerald — determinismo, sicurezza, "i pezzi" */
  --color-emerald: #166534;
  --color-emerald-soft: #dcfce7;

  /* Red — errore, architettura agentica (comparazioni VS) */
  --color-danger: #c0392b;
  --color-danger-soft: #fde6e3;

  /* Purple — documentazione */
  --color-purple: #6d28d9;
  --color-purple-soft: #f3eafd;

  /* Neutri */
  --color-bg: #ffffff;
  --color-fg: #1a1f2e;
  --color-muted: #5a6478;
  --color-border: #e2e7f0;
  --color-muted-bg: #f5f7fa;

  /* Dark (hero finale + pull-quote + footer) */
  --color-dark: #0f172a;
  --color-dark-2: #1e293b;
  --color-dark-fg: #f1f5f9;
  --color-dark-fg-muted: #94a3b8;

  /* Layout */
  --container-max: 1140px;
  --container-narrow: 920px;
  --header-h: 64px;

  /* Radii & shadow */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 6px 24px rgba(15, 23, 42, 0.08);
}

/* ---------- Layout utilities ---------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
}
.container-narrow { max-width: var(--container-narrow); }

@media (max-width: 640px) {
  .container { padding: 0 18px; }
}

.section { padding: 80px 0; }
.section-sm { padding: 52px 0; }
.section-alt { background: var(--color-muted-bg); }
.section-dark { background: var(--color-dark); color: var(--color-dark-fg); }
.section-dark .lead { color: var(--color-dark-fg-muted); }
.section-dark h2, .section-dark h3 { color: var(--color-dark-fg); }

.center { text-align: center; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mt-8 { margin-top: 32px; }

/* ---------- Typography ---------- */
.eyebrow {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 12px;
}
.section-dark .eyebrow { color: #fbbf24; }

h1, h2, h3, h4 { line-height: 1.22; font-weight: 700; color: var(--color-fg); }

.h-hero { font-size: clamp(2.1rem, 5.2vw, 3.4rem); font-weight: 800; letter-spacing: -0.025em; }
.h-section { font-size: clamp(1.7rem, 3.6vw, 2.4rem); font-weight: 800; letter-spacing: -0.015em; }
.lead { font-size: 1.16rem; color: var(--color-muted); }
.lead-narrow { max-width: 680px; }

.text-gradient {
  background: linear-gradient(90deg, var(--color-primary), #2563eb 55%, var(--color-emerald));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--color-border);
}
.nav {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: -0.01em;
  font-size: 1.05rem;
  color: var(--color-fg);
}
.brand-mark {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--color-primary), #2563eb);
  color: #fff;
  display: grid; place-items: center;
  font-weight: 800; font-size: 1rem;
}
.brand-sub { color: var(--color-muted); font-weight: 500; font-size: 0.9rem; }

.nav-menu { display: flex; align-items: center; gap: 18px; }
.nav-menu a {
  font-size: 0.92rem; font-weight: 500; color: var(--color-muted);
  white-space: nowrap;
  transition: color 140ms ease;
}
.nav-menu a:hover { color: var(--color-primary); }
/* Il bottone CTA nel menu mantiene il proprio colore (vince su .nav-menu a) */
.nav-menu a.btn-primary,
.nav-menu a.btn-primary:hover { color: #fff; }

.nav-toggle {
  display: none;
  background: none; border: none; cursor: pointer;
  width: 40px; height: 40px;
  color: var(--color-fg);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 600; font-size: 0.95rem;
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 140ms ease, transform 140ms ease, box-shadow 140ms ease;
  white-space: nowrap;
}
.btn-primary { background: var(--color-primary); color: #fff; }
.btn-primary:hover { background: var(--color-primary-hover); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--color-primary); border-color: var(--color-border); }
.btn-ghost:hover { border-color: var(--color-primary); background: var(--color-primary-soft); }
.btn-light { background: #fff; color: var(--color-primary); }
.btn-light:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-lg { padding: 14px 26px; font-size: 1rem; }

/* ---------- Badge BETA ---------- */
.badge-beta {
  display: inline-block;
  background: #fbbf24;
  color: #1a1f2e;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  margin-left: 8px;
  vertical-align: middle;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 84px 0 72px;
  background:
    radial-gradient(1100px 460px at 75% -8%, rgba(37, 99, 235, 0.10), transparent 60%),
    radial-gradient(900px 420px at 8% 110%, rgba(22, 101, 52, 0.08), transparent 55%),
    var(--color-bg);
  overflow: hidden;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--color-primary-soft);
  color: var(--color-primary);
  font-size: 0.82rem; font-weight: 600;
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 22px;
}
.hero h1 { max-width: 880px; }
.hero .lead { margin-top: 20px; max-width: 660px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 32px; }

/* ---------- Grid & Cards ---------- */
.grid { display: grid; gap: 22px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 26px;
  box-shadow: var(--shadow-sm);
}
.card h3 { font-size: 1.12rem; margin-bottom: 8px; }
.card p { color: var(--color-muted); font-size: 0.97rem; }
.card-accent-blue { border-top: 3px solid var(--color-primary); }
.card-accent-amber { border-top: 3px solid var(--color-accent); }
.card-accent-emerald { border-top: 3px solid var(--color-emerald); }
.card-accent-purple { border-top: 3px solid var(--color-purple); }

/* Tag chips */
.tag {
  display: inline-block;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em;
  padding: 3px 9px; border-radius: 5px; margin-bottom: 12px;
  text-transform: uppercase;
}
.tag-blue { background: var(--color-primary-soft); color: var(--color-primary); }
.tag-amber { background: var(--color-accent-soft); color: var(--color-accent); }
.tag-emerald { background: var(--color-emerald-soft); color: var(--color-emerald); }
.tag-purple { background: var(--color-purple-soft); color: var(--color-purple); }

/* ---------- Pipeline (3-step) ---------- */
.pipeline { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; align-items: stretch; gap: 12px; }
.pipeline .arrow { display: grid; place-items: center; color: var(--color-muted); font-size: 1.6rem; }
.step {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  background: var(--color-bg);
}
.step.is-amber { border-color: #f0cd97; background: var(--color-accent-soft); }
.step.is-emerald { border-color: #a7e0bd; background: var(--color-emerald-soft); }
.step h3 { font-size: 1.05rem; }
.step .badge-stage {
  display: inline-block; font-size: 0.7rem; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 5px; margin-bottom: 10px;
}
.step.is-amber .badge-stage { background: var(--color-accent); color: #fff; }
.step.is-emerald .badge-stage { background: var(--color-emerald); color: #fff; }
.step:first-child .badge-stage { background: var(--color-primary); color: #fff; }

/* ---------- Comparison VS ---------- */
.vs-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.vs-card { border-radius: var(--radius-lg); padding: 26px; border: 1px solid var(--color-border); }
.vs-bad { border-color: #f0c2bb; background: var(--color-danger-soft); }
.vs-good { border-color: #a7e0bd; background: var(--color-emerald-soft); }
.vs-card h3 { display: flex; align-items: center; gap: 10px; font-size: 1.12rem; }
.vs-icon { width: 26px; height: 26px; border-radius: 999px; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 0.95rem; flex: none; }
.vs-bad .vs-icon { background: var(--color-danger); }
.vs-good .vs-icon { background: var(--color-emerald); }
.vs-list { margin-top: 14px; display: grid; gap: 9px; }
.vs-list li { font-size: 0.95rem; color: var(--color-fg); padding-left: 22px; position: relative; }
.vs-list li::before { content: "→"; position: absolute; left: 0; color: var(--color-muted); }

/* ---------- Sovranità (numbered) ---------- */
.num-card { position: relative; overflow: hidden; }
.num-card .num {
  position: absolute; top: -10px; right: 10px;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 5.5rem; font-weight: 700;
  color: rgba(13, 58, 130, 0.08);
  line-height: 1;
}

/* ---------- Comparison table ---------- */
.table-wrap { border: 1px solid var(--color-border); border-radius: var(--radius-lg); overflow: hidden; }
table.compare { width: 100%; border-collapse: collapse; }
table.compare th, table.compare td { padding: 14px 18px; text-align: left; font-size: 0.95rem; border-bottom: 1px solid var(--color-border); }
table.compare thead th { background: var(--color-muted-bg); font-weight: 700; }
table.compare tbody tr:last-child td { border-bottom: none; }
table.compare td.dim { font-weight: 600; }
table.compare .col-industrial { background: rgba(22, 101, 52, 0.06); }
table.compare thead .col-industrial { background: var(--color-emerald-soft); color: var(--color-emerald); }

/* ---------- Pull-quote ---------- */
.pull-quote { background: var(--color-dark); padding: 80px 0; }
.pull-quote blockquote { max-width: 56rem; margin: 0 auto; text-align: center; padding: 0 1rem; }
.pull-quote .mark { font-family: Georgia, serif; font-size: 5.5rem; color: rgba(252, 211, 77, 0.4); line-height: 1; display: block; }
.pull-quote .qtext { color: #fff; font-size: clamp(1.5rem, 3.5vw, 2.4rem); font-weight: 800; letter-spacing: -0.02em; margin-top: 4px; }
.pull-quote .qtext .accent {
  background: linear-gradient(90deg, #fcd34d, #6ee7b7);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.pull-quote .attr { margin-top: 22px; font-size: 0.78rem; color: var(--color-dark-fg-muted); text-transform: uppercase; letter-spacing: 0.12em; }

/* ---------- Screenshots piattaforma ---------- */
.shots-stack { display: grid; gap: 40px; max-width: 980px; margin-inline: auto; }
.shot { margin: 0; }
.shot img {
  width: 100%;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  background: var(--color-muted-bg);
}
.shot figcaption {
  margin-top: 14px;
  font-size: 0.96rem;
  color: var(--color-muted);
  text-align: center;
  max-width: 680px;
  margin-inline: auto;
}
.shot figcaption strong { color: var(--color-fg); }

/* ---------- Example (tributi) callout ---------- */
.example-banner {
  display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 36px; align-items: center;
  background: linear-gradient(120deg, var(--color-primary-soft), #fff 70%);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 36px;
}
.example-banner .stat-row { display: flex; gap: 28px; margin-top: 18px; flex-wrap: wrap; }
.example-banner .stat .n { font-size: 1.9rem; font-weight: 800; color: var(--color-primary); }
.example-banner .stat .l { font-size: 0.85rem; color: var(--color-muted); }

/* ---------- Stato "in arrivo" ---------- */
.btn.is-soon { opacity: 0.6; cursor: default; pointer-events: none; }
.footer-soon { color: var(--color-dark-fg-muted); font-size: 0.92rem; display: block; padding: 4px 0; }
.footer-soon em { opacity: 0.7; font-style: italic; }

/* ---------- Final CTA ---------- */
.cta-final { text-align: center; }
.cta-final .lead { max-width: 620px; margin: 16px auto 0; }
.cta-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 30px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--color-dark-2); color: var(--color-dark-fg); padding: 56px 0 32px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; }
.site-footer h4 { font-size: 0.95rem; color: #fff; margin-bottom: 14px; }
.site-footer a { color: var(--color-dark-fg-muted); font-size: 0.92rem; display: block; padding: 4px 0; transition: color 140ms ease; }
.site-footer a:hover { color: #fff; }
.footer-brand p { color: var(--color-dark-fg-muted); font-size: 0.92rem; max-width: 360px; margin-top: 12px; }
.footer-bottom { margin-top: 40px; padding-top: 24px; border-top: 1px solid rgba(255,255,255,0.1); font-size: 0.85rem; color: var(--color-dark-fg-muted); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .example-banner { grid-template-columns: 1fr; }
}
@media (max-width: 1024px) {
  .nav-toggle { display: grid; place-items: center; }
  .nav-menu {
    display: none;
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    width: 100%;
    margin: 0;
    background: #fff;
    border-bottom: 1px solid var(--color-border);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 20px 20px;
    box-shadow: var(--shadow-md);
  }
  .nav-menu.open { display: flex; }
  .nav-menu li { width: 100%; }
  .nav-menu a {
    display: block;
    width: 100%;
    padding: 14px 0;
    border-bottom: 1px solid var(--color-border);
    white-space: normal;
  }
  .nav-menu a.btn-primary {
    margin-top: 12px;
    text-align: center;
    border-bottom: none;
    justify-content: center;
  }
}
@media (max-width: 800px) {
  .pipeline { grid-template-columns: 1fr; }
  .pipeline .arrow { transform: rotate(90deg); }
  .vs-grid { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .grid-4 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
}
