/* Pagine legali (cookie policy): stessa palette e tipografia della home. */
:root {
  --navy: #0B1A2E;
  --navy-2: #13283F;
  --navy-line: #1F3550;
  --paper: #F5F7FA;
  --ink: #0B1A2E;
  --muted: #5E6E82;
  --sky: #8FC1FF;
  --blue: #2A63F0;
  --coral: #FF6A3D;
  --rule: #DCE3EC;
  --gutter: clamp(20px, 5vw, 48px);
}

html { scroll-padding-top: 24px; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: 'Bricolage Grotesque', sans-serif; font-size: 17px; line-height: 1.65; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
:focus-visible { outline: 3px solid #2F6BFF; outline-offset: 3px; border-radius: 6px; }
.legal-top :focus-visible, .legal-footer :focus-visible { outline-color: var(--sky); }

.skip-link { position: absolute; left: 16px; top: -80px; z-index: 10; background: var(--blue); color: #fff; padding: 12px 20px; border-radius: 999px; font-weight: 600; text-decoration: none; transition: top .2s ease; }
.skip-link:focus { top: 16px; }

/* ---------- Testata ---------- */
.legal-top { background: var(--navy); color: var(--paper); padding: 24px var(--gutter) clamp(56px, 9vw, 104px); position: relative; overflow: hidden; }
.legal-top::after { content: ""; position: absolute; right: -6%; bottom: -55%; width: 46%; min-width: 320px; aspect-ratio: 1; border-radius: 50%; border: 26px solid #2F6BFF; opacity: .16; pointer-events: none; }
.legal-top nav { position: relative; z-index: 1; display: flex; justify-content: space-between; align-items: center; gap: 16px; max-width: 1040px; margin: 0 auto; }
.legal-logo { display: flex; align-items: center; gap: 9px; text-decoration: none; font-family: 'Sora', sans-serif; font-weight: 700; font-size: 21px; letter-spacing: -.05em; }
.legal-nav { display: flex; gap: 6px; background: var(--navy-2); border-radius: 999px; padding: 6px; font-size: 15px; font-weight: 500; }
.legal-nav a { padding: 8px 16px; border-radius: 999px; text-decoration: none; transition: background-color .15s ease; }
.legal-nav a:hover { background: var(--navy-line); }
.legal-lang { font-family: 'Geist Mono', monospace; font-size: 13px; color: var(--sky); }
.legal-hero { position: relative; z-index: 1; max-width: 1040px; margin: clamp(48px, 8vw, 96px) auto 0; }
.legal-kicker { display: inline-block; margin: 0 0 20px; font-family: 'Geist Mono', monospace; font-size: 13px; background: var(--coral); color: var(--navy); padding: 6px 14px; border-radius: 999px; }
.legal-hero h1 { margin: 0; font-size: clamp(48px, 9vw, 112px); font-weight: 800; letter-spacing: -.055em; line-height: .9; }
.legal-lead { margin: 24px 0 0; max-width: 560px; font-size: clamp(18px, 2vw, 21px); line-height: 1.45; color: #D6DEE8; }

/* ---------- Corpo ---------- */
.legal-body { max-width: 1040px; margin: 0 auto; padding: 0 var(--gutter) clamp(64px, 10vw, 120px); display: grid; grid-template-columns: minmax(0, 1fr) 300px; column-gap: 64px; }
.legal-body > section { grid-column: 1; max-width: 680px; padding-top: 48px; }
/* z-index: il riquadro sale sopra la testata blu; senza, la testata ne copriva l'inizio. */
.legal-summary { grid-column: 2; grid-row: 1 / span 20; align-self: start; position: sticky; z-index: 2; top: 24px; margin-top: -40px; background: #fff; border: 1px solid var(--rule); border-radius: 20px; padding: 24px; box-shadow: 0 24px 48px -28px rgba(11, 26, 46, .35); }
.legal-summary__label { margin: 0 0 8px; font-family: 'Geist Mono', monospace; font-size: 12px; color: var(--blue); text-transform: uppercase; letter-spacing: .06em; }
.legal-summary ul { margin: 0 0 20px; padding-left: 18px; font-size: 15px; line-height: 1.55; }
.legal-summary li + li { margin-top: 8px; }

h2 { margin: 0 0 12px; font-size: clamp(24px, 3vw, 30px); font-weight: 700; letter-spacing: -.03em; line-height: 1.15; }
p { margin: 0 0 14px; }
.legal-body a:not(.legal-btn) { color: var(--blue); text-underline-offset: 3px; }
.legal-list { margin: 0 0 14px; padding-left: 20px; }
.legal-list li + li { margin-top: 4px; }
.legal-table--stack td:nth-child(3) { width: auto; }
code { font-family: 'Geist Mono', monospace; font-size: .85em; background: #E8EEF6; padding: 2px 6px; border-radius: 6px; white-space: nowrap; }

.legal-table { overflow-x: auto; margin: 20px 0; border: 1px solid var(--rule); border-radius: 14px; background: #fff; }
table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.5; }
th { text-align: left; font-family: 'Geist Mono', monospace; font-size: 12px; font-weight: 500; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; background: #F0F4F9; }
th, td { padding: 12px 16px; vertical-align: top; }
tbody tr + tr td { border-top: 1px solid var(--rule); }
th:nth-child(3), td:nth-child(3) { width: 46%; }
td:first-child { white-space: nowrap; }
td:nth-child(4) { min-width: 96px; }

.legal-facts { margin: 24px 0 0; display: grid; gap: 0; border-top: 1px solid var(--rule); }
.legal-facts > div { display: grid; grid-template-columns: 180px 1fr; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--rule); }
.legal-facts dt { font-family: 'Geist Mono', monospace; font-size: 13px; color: var(--muted); padding-top: 3px; }
.legal-facts dd { margin: 0; }

.legal-btn { display: inline-block; text-decoration: none; font: inherit; font-weight: 600; font-size: 15px; background: var(--blue); color: #fff; border: 0; border-radius: 999px; padding: 12px 22px; cursor: pointer; transition: transform .15s ease, background-color .15s ease; }
.legal-btn:hover { background: #3B72FF; transform: translateY(-1px); }
.legal-btn:active { transform: translateY(0); }

/* ---------- Piede ---------- */
.legal-footer { background: var(--navy); color: #A3B4C8; padding: 28px var(--gutter); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; font-family: 'Geist Mono', monospace; font-size: 12px; }
.legal-footer a { text-decoration: none; color: #D6DEE8; }
.legal-link { font: inherit; color: #D6DEE8; background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.legal-link:hover, .legal-footer a:hover { color: #fff; }

@media (max-width: 860px) {
  .legal-body { grid-template-columns: minmax(0, 1fr); }
  .legal-summary { grid-column: 1; grid-row: auto; position: relative; z-index: 2; margin-top: -32px; }
}
@media (max-width: 600px) {
  /* Le tabelle diventano schede: nome e durata in alto, tipo e descrizione sotto. */
  .legal-table thead { display: none; }
  .legal-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 14px 16px; }
  .legal-table tbody tr + tr { border-top: 1px solid var(--rule); }
  .legal-table tbody tr + tr td { border-top: 0; }
  .legal-table td { padding: 0; width: auto; min-width: 0; white-space: normal; }
  .legal-table td:nth-child(4) { grid-column: 2; grid-row: 1; max-width: 9em; font-size: 13px; color: var(--muted); text-align: right; }
  .legal-table td:nth-child(2) { grid-column: 1 / -1; font-family: 'Geist Mono', monospace; font-size: 12px; color: var(--muted); }
  .legal-table td:nth-child(3) { grid-column: 1 / -1; }
  /* Tabelle con molto testo: ogni cella a tutta larghezza, con la sua etichetta. */
  .legal-table--stack tr { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .legal-table--stack td, .legal-table--stack td:nth-child(n) { grid-column: 1; grid-row: auto; max-width: none; text-align: left; font-family: inherit; font-size: 15px; color: inherit; }
  .legal-table--stack td[data-label]:not(:first-child)::before { content: attr(data-label); display: block; font-family: 'Geist Mono', monospace; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
}
@media (max-width: 560px) {
  .legal-facts > div { grid-template-columns: 1fr; gap: 4px; }
  .legal-nav .legal-back { padding-inline: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .skip-link, .legal-btn, .legal-nav a { transition: none; }
}
