/* ═══════════════════════════════════════════════════
   OFFICINA DIGITALE — assets/legal.css
   Stile dei documenti legali (privacy, cookie, termini, condizioni)
   ═══════════════════════════════════════════════════
   Volutamente diverso dal resto del sito: sono documenti, vanno letti e
   spesso stampati. Font di sistema, nessuna risorsa esterna — la CSP di
   queste pagine è molto più stretta di quella del sito.
   ═══════════════════════════════════════════════════ */

:root {
  --ink:        #16161d;   /* testo principale            */
  --ink-soft:   #4a4a5a;   /* testo secondario            */
  --ink-faint:  #71717f;   /* metadati, note              */
  --rule:       #e3e3ea;   /* linee e bordi               */
  --rule-soft:  #f0f0f4;
  --paper:      #ffffff;
  --paper-alt:  #f7f7fa;   /* fondo di sommario e tabelle */
  --accent:     #5b21b6;
  --accent-dk:  #4c1d95;
  --warn-bg:    #fff8e6;
  --warn-rule:  #e8c96a;
  --warn-ink:   #6b4e0a;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

/* ── INTESTAZIONE ────────────────────────────────────────────────── */
.doc-head {
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
}

.doc-head-inner,
.doc-body,
.doc-foot-inner {
  max-width: 820px;
  margin: 0 auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.doc-head-inner {
  padding-top: 1.4rem;
  padding-bottom: 1.4rem;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.doc-brand {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
}

.doc-brand span { color: var(--accent); }

.doc-back {
  font-size: 0.88rem;
  color: var(--ink-soft);
  text-decoration: none;
}

.doc-back:hover { color: var(--accent); text-decoration: underline; }

/* ── CORPO DEL DOCUMENTO ─────────────────────────────────────────── */
.doc-body {
  padding-top: 3rem;
  padding-bottom: 4rem;
}

.doc-title {
  font-size: clamp(1.7rem, 4.5vw, 2.3rem);
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.6rem;
}

.doc-subtitle {
  font-size: 1.05rem;
  color: var(--ink-soft);
  margin-bottom: 1.4rem;
}

.doc-meta {
  font-size: 0.85rem;
  color: var(--ink-faint);
  padding-bottom: 1.8rem;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 2.4rem;
}

.doc-meta strong { color: var(--ink-soft); font-weight: 600; }

/* ── SOMMARIO ────────────────────────────────────────────────────── */
.doc-toc {
  background: var(--paper-alt);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 1.4rem 1.6rem;
  margin-bottom: 3rem;
}

.doc-toc h2 {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 0.8rem;
}

.doc-toc ol {
  margin: 0;
  padding-left: 1.3rem;
  font-size: 0.95rem;
}

.doc-toc li { margin-bottom: 0.3rem; }
.doc-toc a { color: var(--accent); text-decoration: none; }
.doc-toc a:hover { text-decoration: underline; }

/* ── TITOLI DI SEZIONE ───────────────────────────────────────────── */
.doc-body h2 {
  font-size: 1.32rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-top: 3rem;
  margin-bottom: 0.9rem;
  padding-top: 0.4rem;
  scroll-margin-top: 1rem;
}

.doc-body h3 {
  font-size: 1.06rem;
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 0.6rem;
  color: var(--ink);
}

.doc-body p { margin-bottom: 1.05rem; }

.doc-body ul,
.doc-body ol {
  margin: 0 0 1.2rem 0;
  padding-left: 1.4rem;
}

.doc-body li { margin-bottom: 0.45rem; }

.doc-body a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.doc-body a:hover { color: var(--accent-dk); }

.doc-body strong { font-weight: 600; }

/* ── TABELLE ─────────────────────────────────────────────────────── */
.doc-table-wrap {
  overflow-x: auto;
  margin-bottom: 1.6rem;
  border: 1px solid var(--rule);
  border-radius: 6px;
}

.doc-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  min-width: 520px;
}

.doc-body th,
.doc-body td {
  text-align: left;
  vertical-align: top;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--rule-soft);
}

.doc-body th {
  background: var(--paper-alt);
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  border-bottom: 1px solid var(--rule);
}

.doc-body tbody tr:last-child td { border-bottom: none; }

.doc-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.86em;
  background: var(--paper-alt);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 0.08em 0.35em;
  word-break: break-word;
}

/* ── RIQUADRI ────────────────────────────────────────────────────── */
.doc-callout {
  background: var(--paper-alt);
  border-left: 3px solid var(--accent);
  border-radius: 0 6px 6px 0;
  padding: 1.1rem 1.3rem;
  margin: 0 0 1.6rem;
  font-size: 0.95rem;
}

.doc-callout p:last-child { margin-bottom: 0; }

.doc-notice {
  background: var(--warn-bg);
  border: 1px solid var(--warn-rule);
  border-radius: 6px;
  padding: 1.1rem 1.3rem;
  margin-bottom: 2.4rem;
  font-size: 0.95rem;
  color: var(--warn-ink);
}

.doc-notice strong { color: var(--warn-ink); }
.doc-notice p:last-child { margin-bottom: 0; }

/* ── PIEDE ───────────────────────────────────────────────────────── */
.doc-foot {
  border-top: 1px solid var(--rule);
  background: var(--paper-alt);
}

.doc-foot-inner {
  padding-top: 2rem;
  padding-bottom: 2.5rem;
  font-size: 0.85rem;
  color: var(--ink-faint);
}

.doc-foot-links {
  margin-bottom: 0.8rem;
  display: flex;
  gap: 1.2rem;
  flex-wrap: wrap;
}

.doc-foot-links a { color: var(--ink-soft); text-decoration: none; }
.doc-foot-links a:hover { color: var(--accent); text-decoration: underline; }

/* ── ACCESSIBILITÀ ───────────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

.doc-skip {
  position: absolute;
  left: -9999px;
  top: 0;
}

.doc-skip:focus {
  left: 1rem;
  top: 1rem;
  z-index: 10;
  background: var(--accent);
  color: #fff;
  padding: 0.6rem 1.1rem;
  border-radius: 0 0 4px 4px;
  text-decoration: none;
}

/* ── STAMPA ──
   Questi documenti finiscono spesso in PDF allegati a contratti. */
@media print {
  .doc-head, .doc-foot, .doc-toc, .doc-skip { display: none; }
  body { font-size: 11pt; line-height: 1.5; color: #000; background: #fff; }
  .doc-body { max-width: none; padding: 0; }
  .doc-body h2 { page-break-after: avoid; margin-top: 1.6rem; }
  .doc-body h3 { page-break-after: avoid; }
  .doc-table-wrap, table, tr, .doc-callout, .doc-notice { page-break-inside: avoid; }
  .doc-body a { color: #000; text-decoration: underline; }
  /* link leggibili su carta */
  .doc-body a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 0.85em;
    color: #444;
    word-break: break-all;
  }
  .doc-table-wrap { border: 1px solid #999; }
  .doc-body th, .doc-body td { border-bottom: 1px solid #ccc; }
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  .doc-body { padding-top: 2rem; }
  .doc-toc { padding: 1.1rem 1.2rem; }
}


/* ── SWITCH DI LINGUA ──
   La lingua attiva è uno stato, non un link. Solo l'altra è cliccabile. */
.nav-lang {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  border: 1px solid var(--rule);
  border-radius: 100px;
  padding: 0.15rem 0.18rem;
  white-space: nowrap;
  margin-left: auto;
  margin-right: 1rem;
}
.nav-lang .lang-cur,
.nav-lang .lang-alt {
  display: block;
  padding: 0.18rem 0.6rem;
  border-radius: 100px;
  line-height: 1.3;
  text-decoration: none;
}
.nav-lang .lang-cur { background: var(--accent); color: #fff; }
.nav-lang .lang-alt { color: var(--ink-faint); transition: color 0.2s, background 0.2s; }
.nav-lang .lang-alt:hover { color: var(--accent); background: var(--paper-alt); }
