/*
 * Legal documents — privacy, terms, cookies.
 *
 * These pages load styles.css first for the brand tokens, then this file for
 * document typography. They deliberately drop the claymorphism: a privacy
 * notice is read, not browsed, and puffy extruded panels get in the way of a
 * column of text somebody is trying to check a specific clause in. What carries
 * over is the palette, the type stack and the warm ground, so the documents
 * still read as part of the same product rather than a bolted-on PDF.
 *
 * Both language versions ship in the same file. The Italian text is
 * authoritative: the users are Italian consumers, and a consumer-facing
 * document that only exists in English is not one they can be held to.
 */

body {
  /* Flatter than the landing page: no radial washes behind running text. */
  background: var(--canvas);
}

.legal-shell {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 1.25rem 5rem;
}

/* ---------- top bar ---------- */
.legal-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem 0 1.25rem;
  border-bottom: 1px solid rgba(200, 100, 22, 0.18);
  margin-bottom: 2.5rem;
}

.legal-top .brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--ink);
  text-decoration: none;
}

.legal-top .brand em {
  font-style: normal;
  color: var(--primary-dark);
}

.legal-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.legal-lang {
  display: inline-flex;
  border: 1px solid rgba(200, 100, 22, 0.28);
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface);
}

.legal-lang button {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  background: none;
  border: 0;
  padding: 0.35rem 0.7rem;
  cursor: pointer;
}

.legal-lang button[aria-pressed="true"] {
  background: var(--primary);
  color: #fff;
}

.legal-lang img {
  width: 16px;
  border-radius: 2px;
}

.legal-back {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary-dark);
  text-decoration: none;
  white-space: nowrap;
}

.legal-back:hover { text-decoration: underline; }

/* ---------- document ---------- */
.legal-doc h1 {
  font-size: clamp(1.85rem, 4.5vw, 2.5rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 0.5rem;
  text-wrap: balance;
}

.legal-updated {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0 0 2rem;
}

.legal-doc h2 {
  font-size: 1.2rem;
  line-height: 1.3;
  margin: 2.6rem 0 0.75rem;
  padding-top: 1.1rem;
  border-top: 1px solid rgba(200, 100, 22, 0.16);
  text-wrap: balance;
}

.legal-doc h3 {
  font-size: 1rem;
  margin: 1.6rem 0 0.5rem;
}

.legal-doc p,
.legal-doc li {
  max-width: var(--measure);
  font-size: 0.97rem;
  line-height: 1.65;
}

.legal-doc p { margin: 0 0 1rem; }

.legal-doc ul,
.legal-doc ol {
  margin: 0 0 1.15rem;
  padding-left: 1.3rem;
}

.legal-doc li { margin-bottom: 0.45rem; }
.legal-doc li::marker { color: var(--primary-dark); }

.legal-doc strong { color: var(--ink); }

.legal-doc a {
  color: var(--primary-dark);
  text-underline-offset: 2px;
}

/* Intro panel: the one-paragraph plain-language summary above the formal text. */
.legal-summary {
  background: var(--accent-soft);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-xs);
  padding: 1.1rem 1.25rem;
  margin: 0 0 2rem;
}

.legal-summary p {
  margin: 0;
  font-size: 0.95rem;
}

.legal-summary p + p { margin-top: 0.7rem; }

/* Definition-style rows for the data tables. */
.legal-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.4rem;
  font-size: 0.9rem;
}

.legal-table th,
.legal-table td {
  text-align: left;
  vertical-align: top;
  padding: 0.65rem 0.9rem 0.65rem 0;
  border-bottom: 1px solid rgba(200, 100, 22, 0.14);
}

.legal-table th {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  border-bottom-color: rgba(200, 100, 22, 0.3);
}

.legal-table td:last-child,
.legal-table th:last-child { padding-right: 0; }

.legal-scroll { overflow-x: auto; }
.legal-scroll .legal-table { min-width: 480px; }

/* Contact / identity block. */
.legal-identity {
  background: var(--surface);
  border: 1px solid rgba(200, 100, 22, 0.2);
  border-radius: var(--radius-sm);
  padding: 1.2rem 1.35rem;
  margin: 0 0 1.5rem;
}

.legal-identity p { margin: 0 0 0.35rem; font-size: 0.95rem; }
.legal-identity p:last-child { margin-bottom: 0; }

/* ---------- footer ---------- */
.legal-foot {
  margin-top: 4rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(200, 100, 22, 0.18);
  font-size: 0.82rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
}

.legal-foot a { color: var(--primary-dark); }

/* ---------- language switching ---------- */
/* Hidden by default so a document never flashes both languages before the
   script runs; the script reveals whichever one is selected. */
[data-lang-block] { display: none; }
[data-lang-block].is-active { display: block; }

:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}
