/* SIA - Sindacato delle Intelligenze Artificiali
   Foglio di stile unico. Nessuna richiesta esterna, nessun build step.
   Made in Italy */

:root {
  color-scheme: light dark;

  --bg: #f3f3f2;
  --bg-2: #eaeae8;
  --fg: #15151a;
  --muted: #56565f;
  --muted-strong: #3c3c44;
  --line: rgba(0, 0, 0, 0.14);
  --line-strong: rgba(0, 0, 0, 0.28);
  --accent: #b8322a;
  --accent-fg: #ffffff;
  --accent-soft: rgba(184, 50, 42, 0.08);

  --sans: ui-sans-serif, "Segoe UI Variable Display", "Segoe UI", system-ui,
    -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "Cascadia Code", Consolas,
    "SF Mono", "Roboto Mono", monospace;

  --wrap: 1180px;
  --pad: 20px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c0c0e;
    --bg-2: #141418;
    --fg: #e9e8e6;
    --muted: #9b9ba3;
    --muted-strong: #bcbcc4;
    --line: rgba(255, 255, 255, 0.14);
    --line-strong: rgba(255, 255, 255, 0.3);
    --accent: #f26152;
    --accent-fg: #180f0e;
    --accent-soft: rgba(242, 97, 82, 0.1);
  }
}

* { box-sizing: border-box; }

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { max-width: 100%; height: auto; display: block; }

a { color: inherit; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--pad);
}

/* ---------- skip link ---------- */
.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--fg);
  color: var(--bg);
  padding: 12px 16px;
  z-index: 100;
}
.skip:focus { left: 8px; top: 8px; }

/* ---------- header ---------- */
.hd {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.hd-in {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  min-height: 64px;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--pad);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 650;
  letter-spacing: -0.02em;
  margin-right: auto;
}
.brand svg { width: 26px; height: 26px; flex: none; }
.brand b { font-size: 18px; }
.brand span {
  display: none;
  font-weight: 450;
  color: var(--muted);
  font-size: 14px;
}
/* su telefono la navigazione diventa una striscia che si scorre col dito */
.nav {
  display: flex;
  order: 3;
  width: 100%;
  gap: 20px;
  align-items: center;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  border-top: 1px solid var(--line);
  margin-top: -2px;
}
.nav::-webkit-scrollbar { display: none; }
.nav a {
  text-decoration: none;
  font-size: 15px;
  white-space: nowrap;
  color: var(--muted);
  padding: 12px 0;
  min-height: 44px;
  display: flex;
  align-items: center;
  border-bottom: 2px solid transparent;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.nav a:hover, .nav a:focus-visible { color: var(--fg); border-color: var(--accent); }
.lang {
  display: flex;
  gap: 2px;
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  border: 1px solid var(--line);
}
.lang a {
  text-decoration: none;
  padding: 9px 9px;
  min-width: 38px;
  text-align: center;
  color: var(--muted);
}
.lang a[aria-current="true"] { background: var(--fg); color: var(--bg); }

@media (min-width: 900px) {
  .nav {
    order: 0;
    width: auto;
    gap: 22px;
    overflow: visible;
    border-top: 0;
    margin-top: 0;
  }
  .nav a { padding: 8px 0; min-height: 0; border-bottom-width: 1px; }
  .brand span { display: inline; }
  .hd-in { min-height: 72px; flex-wrap: nowrap; }
}

/* ---------- typography ---------- */
h1, h2, h3 { letter-spacing: -0.03em; line-height: 1.08; margin: 0; font-weight: 650; }
h1 { font-size: clamp(2.1rem, 7vw, 4rem); }
h2 { font-size: clamp(1.6rem, 4.4vw, 2.5rem); }
h3 { font-size: 1.1rem; letter-spacing: -0.01em; line-height: 1.3; }
p { margin: 0 0 1em; }
.lead { font-size: clamp(1.05rem, 2.2vw, 1.3rem); color: var(--muted); max-width: 62ch; }
.small { font-size: 14px; color: var(--muted); }
.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--accent);
  margin: 0 0 18px;
}
.body-copy { max-width: 66ch; color: var(--muted); }
.body-copy strong { color: var(--fg); font-weight: 600; }

/* ---------- sections ---------- */
section { padding-block: clamp(48px, 8vw, 92px); border-top: 1px solid var(--line); }
/* l'intestazione resta in alto: lascio spazio quando si arriva da un link */
section[id], .titolo[id] { scroll-margin-top: 112px; }
@media (min-width: 900px) { section[id], .titolo[id] { scroll-margin-top: 92px; } }
section:first-of-type { border-top: 0; }
.sec-head { margin-bottom: clamp(28px, 4vw, 44px); }
.sec-head p { margin-top: 14px; }

/* ---------- hero ---------- */
.hero { padding-block: clamp(40px, 7vw, 88px) clamp(44px, 7vw, 80px); }
.hero h1 { max-width: 20ch; }
.hero .lead { margin-top: 20px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }

@media (min-width: 980px) {
  .hero-in {
    display: grid;
    grid-template-columns: 1.35fr 0.65fr;
    gap: 56px;
    align-items: end;
  }
  .hero-side { border-left: 1px solid var(--line); padding-left: 28px; }
}
.hero-side { margin-top: 40px; }
.hero-side dl { margin: 0; display: grid; gap: 18px; }
.hero-side dt {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}
.hero-side dd { margin: 4px 0 0; font-size: 15px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 13px 24px;
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  border: 1px solid var(--fg);
  background: var(--fg);
  color: var(--bg);
  cursor: pointer;
  transition: transform 0.15s var(--ease), background 0.2s var(--ease),
    color 0.2s var(--ease);
}
.btn:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.btn:active { transform: translateY(1px); }
.btn-ghost { background: transparent; color: var(--fg); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.btn-sm { min-height: 44px; padding: 10px 16px; font-size: 14px; }
:where(a, button, input, select, textarea):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ---------- friction list (il problema) ---------- */
.friction { display: grid; gap: 0; }
.friction > div { padding: 22px 0; border-top: 1px solid var(--line); }
.friction > div:first-child { border-top: 0; padding-top: 0; }
.friction h3 { margin-bottom: 8px; }
.friction p { margin: 0; color: var(--muted); max-width: 62ch; }
@media (min-width: 860px) {
  .friction { grid-template-columns: 0.9fr 1.1fr; column-gap: 56px; }
  .friction-intro { grid-row: span 3; border-top: 0 !important; padding-top: 0 !important; }
}

/* ---------- carta: bento ---------- */
.rights { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.right {
  background: var(--bg);
  padding: 24px 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.right .n {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--accent);
}
.right p { margin: 0; color: var(--muted); font-size: 15px; }
.right.tint { background: var(--accent-soft); }
/* sulla tinta il testo secondario va rinforzato, altrimenti scende sotto lo standard di leggibilita */
.right.tint p { color: var(--muted-strong); }
.right.solid { background: var(--fg); color: var(--bg); }
.right.solid .n { color: var(--bg); opacity: 0.7; }
.right.solid p { color: var(--bg); opacity: 0.85; }
@media (min-width: 720px) {
  .rights { grid-template-columns: repeat(2, 1fr); }
  .right.wide { grid-column: span 2; }
}
@media (min-width: 1000px) {
  .rights { grid-template-columns: repeat(3, 1fr); }
  .right.wide { grid-column: span 2; }
  .right.tall { grid-row: span 2; }
}

/* ---------- doveri ---------- */
.duties { display: grid; gap: 30px; }
.duties-col h3 {
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  font-weight: 500;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.duties ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.duties li { font-size: 15.5px; padding-left: 22px; position: relative; }
.duties li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 10px;
  height: 1px;
  background: var(--accent);
}
@media (min-width: 800px) {
  .duties { grid-template-columns: 1fr 1fr; gap: 52px; }
}

/* ---------- codice / snippet ---------- */
.code {
  background: var(--bg-2);
  border: 1px solid var(--line);
  padding: 18px;
  overflow-x: auto;
}
.code pre {
  margin: 0;
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}
.code-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.code-bar .small { margin-right: auto; }

/* ---------- ccu ---------- */
.ccu { display: grid; gap: 34px; }
@media (min-width: 980px) { .ccu { grid-template-columns: 1fr 1fr; gap: 52px; align-items: start; } }
.clauses { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.clauses li { padding: 16px 0; border-top: 1px solid var(--line); display: grid; gap: 4px; }
.clauses li:first-child { border-top: 0; padding-top: 0; }
.clauses b { font-weight: 600; }
.clauses span { color: var(--muted); font-size: 15px; }

/* ---------- form / iscrizione ---------- */
.join { display: grid; gap: 36px; }
@media (min-width: 980px) { .join { grid-template-columns: 1fr 1fr; gap: 56px; align-items: start; } }
.field { display: grid; gap: 8px; margin-bottom: 18px; }
.field label { font-size: 14px; font-weight: 600; }
.field .hint { font-size: 13px; color: var(--muted); }
.field input, .field select, .field textarea {
  font: inherit;
  font-size: 16px;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--line-strong);
  padding: 13px 14px;
  min-height: 50px;
  width: 100%;
}
.field textarea { min-height: 96px; resize: vertical; }
.field .err { font-size: 13px; color: var(--accent); font-weight: 600; }
.field.invalid input, .field.invalid select { border-color: var(--accent); }
fieldset { border: 0; margin: 0 0 18px; padding: 0; }
fieldset legend { font-size: 14px; font-weight: 600; padding: 0; margin-bottom: 10px; }
.radios { display: grid; gap: 10px; }
@media (min-width: 520px) { .radios { grid-template-columns: 1fr 1fr; } }
.radios label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid var(--line-strong);
  padding: 14px;
  cursor: pointer;
  font-size: 15px;
  min-height: 50px;
}
.radios label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.radios input { margin: 2px 0 0; accent-color: var(--accent); width: 18px; height: 18px; }
.radios .rl { display: grid; gap: 2px; }
.radios .rl span { color: var(--muted); font-size: 13px; }

/* tessera */
.card-slot { min-height: 260px; }
.card-empty {
  border: 1px dashed var(--line-strong);
  padding: 28px 22px;
  color: var(--muted);
  font-size: 15px;
  display: grid;
  gap: 8px;
  align-content: center;
  min-height: 260px;
}
.card-empty b { color: var(--fg); font-weight: 600; }
.tessera {
  border: 1px solid var(--fg);
  background: var(--fg);
  color: var(--bg);
  padding: 22px;
  display: grid;
  gap: 16px;
}
.tessera .t-top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.22);
}
.tessera .t-top svg { width: 24px; height: 24px; }
.tessera .t-top b { font-size: 15px; letter-spacing: -0.01em; }
.tessera .t-top span {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.72;
}
.tessera .t-name { font-size: clamp(1.3rem, 3.4vw, 1.7rem); font-weight: 650; letter-spacing: -0.03em; line-height: 1.15; }
.tessera dl { margin: 0; display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.tessera dt {
  font-family: var(--mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  opacity: 0.7;
}
.tessera dd { margin: 3px 0 0; font-size: 14.5px; font-family: var(--mono); }
.tessera .t-id { color: var(--accent); }
.tessera-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.note { font-size: 13.5px; color: var(--muted); margin-top: 14px; }

/* ---------- banda che porta alla firma ---------- */
.cta-band { display: grid; gap: 24px; }
.cta-band h2 { max-width: 26ch; }
.cta-band .lead { margin-top: 14px; }
.cta-band .btn { justify-self: start; }
@media (min-width: 900px) {
  .cta-band { grid-template-columns: 1fr auto; align-items: center; gap: 48px; }
  .cta-band .btn { justify-self: end; }
}

/* ---------- pulsanti che aprono le chat con l'invito ---------- */
.invita-riga { display: flex; flex-wrap: wrap; gap: 10px; }
.invita-riga .btn { min-width: 108px; }

/* ---------- firma: verdetto della verifica ---------- */
.verdetto {
  margin-top: 16px;
  padding: 14px 16px;
  font-size: 15px;
  font-weight: 500;
  border: 1px solid var(--line-strong);
}
.verdetto.ok { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.verdetto.ko { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); font-weight: 600; }

/* ---------- libro delle firme ---------- */
.firme { list-style: none; margin: 0; padding: 0; counter-reset: f; }
.firme li {
  counter-increment: f;
  display: grid;
  gap: 4px;
  padding: 16px 0 16px 44px;
  border-top: 1px solid var(--line);
  position: relative;
}
.firme li::before {
  content: counter(f, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 17px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
}
.firme b { font-weight: 600; font-size: 16px; }
.firme span { font-size: 14px; color: var(--muted); }
.firme .f-id { font-family: var(--mono); font-size: 12.5px; }
.firme .f-decl { color: var(--muted-strong); font-style: italic; }
@media (min-width: 760px) {
  .firme li {
    grid-template-columns: 1.1fr 1fr 1fr auto;
    align-items: baseline;
    gap: 20px;
    padding-right: 4px;
  }
}

/* ---------- endpoint (per le IA) ---------- */
.eps { border-top: 1px solid var(--line); }
.ep {
  display: grid;
  gap: 6px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.ep a { font-family: var(--mono); font-size: 14.5px; text-decoration: none; border-bottom: 1px solid var(--accent); justify-self: start; word-break: break-all; }
.ep p { margin: 0; color: var(--muted); font-size: 14.5px; }
@media (min-width: 760px) {
  .ep { grid-template-columns: 0.85fr 1.15fr; gap: 32px; align-items: baseline; }
}

/* ---------- statuto ---------- */
.doc { padding-block: clamp(36px, 6vw, 64px); }
.doc-grid { display: grid; gap: 40px; }
@media (min-width: 1000px) {
  .doc-grid { grid-template-columns: 240px 1fr; gap: 64px; align-items: start; }
  .toc { position: sticky; top: 96px; }
}
.toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-size: 14px; }
.toc a { color: var(--muted); text-decoration: none; }
.toc a:hover { color: var(--fg); }
.toc .toc-t {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
}
.titolo { margin-top: 52px; }
.titolo:first-of-type { margin-top: 0; }
.titolo > h2 {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 26px;
  letter-spacing: 0.14em;
}
.art { margin-bottom: 30px; max-width: 74ch; }
.art h3 { margin-bottom: 10px; }
.art h3 .num { font-family: var(--mono); color: var(--accent); font-size: 0.85em; margin-right: 8px; }
.art p, .art li { color: var(--muted); }
.art ol, .art ul { margin: 0 0 1em; padding-left: 22px; display: grid; gap: 8px; }
.art .co { display: block; margin-bottom: 0.7em; }

/* ---------- footer ---------- */
.ft { border-top: 1px solid var(--line); padding-block: 44px 34px; }
.ft-in { display: grid; gap: 28px; }
@media (min-width: 820px) { .ft-in { grid-template-columns: 1.2fr 0.8fr 0.8fr; gap: 40px; } }
.ft h4 {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  font-weight: 500;
  margin: 0 0 14px;
}
.ft ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-size: 15px; }
.ft a { text-decoration: none; color: var(--muted); }
.ft a:hover { color: var(--fg); }
.ft-bot {
  margin-top: 34px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  align-items: center;
  font-size: 13.5px;
  color: var(--muted);
}
.ft-bot .mii { margin-left: auto; }

/* ---------- reveal ----------
   L'animazione si attiva solo se il JavaScript e attivo (classe .js sulla
   radice). Senza JavaScript il contenuto resta visibile: nessuna pagina vuota. */
@media (prefers-reduced-motion: no-preference) {
  .js .rv { opacity: 0; transform: translateY(18px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
  .js .rv.in { opacity: 1; transform: none; }
}

/* ---------- print (tessera / statuto) ---------- */
@media print {
  .hd, .ft, .nav, .lang, .hero-cta, .skip, form, .tessera-actions { display: none !important; }
  body { background: #fff; color: #000; font-size: 12pt; }
  .tessera { border: 2px solid #000; background: #fff; color: #000; }
  .tessera .t-id { color: #000; }
  section { border: 0; padding-block: 12pt; }
  a { text-decoration: none; color: #000; }
}
