/* ============================================================
   Legal pages — Tutela Debitori
   Shared CSS per Privacy, Termini, Cookie, Recesso
   ============================================================ */

:root {
  --navy-1: #0A1326;
  --navy-2: #142042;
  --navy-3: #1F2D52;
  --gold-1: #FFD86B;
  --gold-2: #F5C84B;
  --gold-3: #D9A93B;
  --gold-4: #B8862A;
  --gold-soft: rgba(245, 200, 75, 0.12);
  --white: #ffffff;
  --bg-soft: #F4F6FB;
  --text: #0A1326;
  --text-body: #2A3450;
  --text-muted: #56638A;
  --border: rgba(20, 32, 66, 0.1);
  --focus-ring: #1A57FF;
  --r-sm: 12px;
  --r-md: 18px;
  --font-system-sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-system-serif: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
  --max-w: 1240px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-system-sans);
  font-size: 17px;
  line-height: 1.7;
  color: var(--text-body);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a {
  color: var(--navy-1);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 600;
}
a:hover, a:focus-visible { color: var(--gold-4); }

:focus { outline: none; }
:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
  border-radius: 4px;
}

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  background: var(--navy-1);
  color: var(--white);
  padding: 14px 22px;
  border-radius: 8px;
  font-weight: 700;
  z-index: 200;
  transition: top 0.2s ease;
  border: 2px solid var(--gold-2);
  text-decoration: none;
}
.skip-link:focus { top: 16px; color: var(--white); }

.container { width: 100%; max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }

/* ============================================================
   NAV
   ============================================================ */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,0.92);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--border);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 80px; }
.logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
}
.logo img { display: block; width: auto; max-width: 100%; }
.logo-nav img { height: 56px; }
.logo-footer img { height: 48px; }
@media (max-width: 720px) {
  .logo-nav img { height: 48px; }
}
@media (max-width: 520px) {
  .logo-nav img { height: 42px; }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 24px;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: 14px;
  border: none;
  text-decoration: none;
  cursor: pointer;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
  line-height: 1;
}
.btn-primary {
  background: linear-gradient(135deg, var(--gold-1) 0%, var(--gold-2) 50%, var(--gold-3) 100%);
  color: var(--navy-1);
  box-shadow: 0 10px 24px rgba(245, 200, 75, 0.35);
}
.btn-primary:hover, .btn-primary:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 16px 36px rgba(245, 200, 75, 0.5);
  color: var(--navy-1);
}

/* ============================================================
   LEGAL HERO
   ============================================================ */
.legal-hero {
  padding: clamp(48px, 7vw, 80px) 0 clamp(32px, 5vw, 56px);
  background:
    radial-gradient(800px 400px at 100% 0%, var(--gold-soft), transparent 60%),
    linear-gradient(180deg, var(--bg-soft) 0%, var(--white) 100%);
  border-bottom: 1px solid var(--border);
}
.legal-hero .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--gold-4);
  background: var(--gold-soft);
  padding: 9px 16px;
  border-radius: 999px;
  margin-bottom: 20px;
  border: 1px solid rgba(245, 200, 75, 0.45);
}
.legal-hero h1 {
  font-family: var(--font-system-sans);
  font-weight: 900;
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1.05;
  letter-spacing: -0.025em;
  text-transform: uppercase;
  color: var(--navy-1);
  margin: 0 0 16px;
}
.legal-hero h1 .gold {
  background: linear-gradient(135deg, var(--gold-3) 0%, var(--gold-4) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.legal-hero .updated {
  display: inline-block;
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 8px;
}
.breadcrumb {
  display: flex;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--text-muted); font-weight: 500; }
.breadcrumb a:hover { color: var(--navy-1); }
.breadcrumb .sep { opacity: 0.5; }
.breadcrumb [aria-current="page"] { color: var(--navy-1); font-weight: 700; }

/* ============================================================
   LEGAL CONTENT
   ============================================================ */
.legal-wrap { display: grid; grid-template-columns: 240px 1fr; gap: 64px; }
.legal-toc {
  position: sticky;
  top: 100px;
  align-self: start;
  padding: 24px 20px;
  background: var(--bg-soft);
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}
.legal-toc h2 {
  font-family: var(--font-system-sans);
  font-weight: 800;
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin: 0 0 12px;
}
.legal-toc ol {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: toc;
}
.legal-toc li {
  counter-increment: toc;
  padding: 4px 0;
  font-size: 13px;
  line-height: 1.4;
}
.legal-toc li::before {
  content: counter(toc, decimal-leading-zero) ". ";
  color: var(--gold-4);
  font-weight: 700;
}
.legal-toc a {
  color: var(--text-body);
  text-decoration: none;
  font-weight: 500;
}
.legal-toc a:hover, .legal-toc a:focus-visible { color: var(--gold-4); }

.legal-content {
  font-size: 16px;
  color: var(--text-body);
  max-width: 760px;
}
.legal-content h2 {
  font-family: var(--font-system-sans);
  font-weight: 900;
  font-size: clamp(1.4rem, 2.5vw, 1.8rem);
  text-transform: uppercase;
  letter-spacing: -0.015em;
  color: var(--navy-1);
  margin: 56px 0 16px;
  padding-top: 8px;
  scroll-margin-top: 100px;
}
.legal-content h2:first-child { margin-top: 0; }
.legal-content h2 .num {
  display: inline-block;
  margin-right: 12px;
  color: var(--gold-4);
  font-size: 1rem;
  font-family: var(--font-system-sans);
  font-weight: 800;
  letter-spacing: 0.1em;
  vertical-align: middle;
}
.legal-content h3 {
  font-family: var(--font-system-sans);
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--navy-1);
  margin: 32px 0 12px;
}
.legal-content p { margin: 0 0 16px; line-height: 1.75; }
.legal-content strong { color: var(--navy-1); font-weight: 700; }
.legal-content ul, .legal-content ol {
  margin: 0 0 20px;
  padding-left: 24px;
}
.legal-content li {
  margin-bottom: 8px;
  line-height: 1.65;
}
.legal-content li::marker { color: var(--gold-4); font-weight: 700; }
.legal-content blockquote {
  border-left: 4px solid var(--gold-2);
  padding: 16px 24px;
  background: var(--gold-soft);
  border-radius: 0 12px 12px 0;
  margin: 24px 0;
  font-style: italic;
  color: var(--navy-1);
}
.legal-content code {
  background: var(--bg-soft);
  padding: 2px 8px;
  border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.92em;
  color: var(--navy-1);
}
.legal-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 40px 0;
}

/* ============================================================
   TABELLE COOKIE / DATI
   ============================================================ */
.legal-content .table-wrap {
  overflow-x: auto;
  margin: 24px 0;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
}
.legal-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  background: var(--white);
}
.legal-content table th {
  background: var(--navy-1);
  color: var(--white);
  text-align: left;
  padding: 12px 16px;
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom: 2px solid var(--gold-2);
}
.legal-content table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.legal-content table tr:last-child td { border-bottom: none; }
.legal-content table tr:nth-child(even) td { background: var(--bg-soft); }
.legal-content table code {
  display: inline-block;
  white-space: nowrap;
}

/* ============================================================
   CALLOUT
   ============================================================ */
.legal-callout {
  background: linear-gradient(135deg, var(--bg-soft) 0%, var(--gold-soft) 100%);
  border: 1px solid rgba(245, 200, 75, 0.4);
  border-radius: var(--r-md);
  padding: 24px 28px;
  margin: 32px 0;
  font-size: 15px;
}
.legal-callout-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  color: var(--navy-1);
  text-transform: uppercase;
  font-size: 13px;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}
.legal-callout-title svg { color: var(--gold-3); flex-shrink: 0; }
.legal-callout p:last-child { margin-bottom: 0; }

/* Buttons inside content */
.legal-content .cta-block {
  background: linear-gradient(135deg, var(--navy-1) 0%, var(--navy-3) 100%);
  color: var(--white);
  padding: 28px 32px;
  border-radius: var(--r-md);
  margin: 32px 0;
  text-align: center;
}
.legal-content .cta-block h3 {
  color: var(--white);
  font-size: 1.15rem;
  margin: 0 0 8px;
  text-transform: uppercase;
}
.legal-content .cta-block p {
  color: rgba(255,255,255,0.85);
  margin-bottom: 16px;
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  background: #050912;
  color: #C8D0E5;
  padding: 64px 0 32px;
  font-size: 14px;
  margin-top: 80px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 48px;
}
.footer h4 {
  color: var(--white);
  font-family: var(--font-system-sans);
  font-weight: 900;
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin: 0 0 18px;
}
.footer ul { list-style: none; padding: 0; margin: 0; }
.footer li { padding: 5px 0; }
.footer a {
  color: #C8D0E5;
  text-decoration: none;
  font-weight: 500;
  transition: color .2s ease;
}
.footer a:hover, .footer a:focus-visible {
  color: var(--gold-1);
  text-decoration: underline;
  text-underline-offset: 4px;
}
.footer .logo .logo-name { color: var(--white); }
.footer .logo .logo-name .gold { color: var(--gold-1); }
.footer .logo .logo-tagline { color: rgba(255,255,255,0.7); }
.footer-bottom {
  padding-top: 32px;
  border-top: 1px solid rgba(255,255,255,0.12);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 13px;
  color: #B0BAD6;
}
.footer-disclaimer {
  font-size: 13px;
  line-height: 1.7;
  color: #B0BAD6;
  margin-top: 24px;
  max-width: 800px;
}
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 500px) { .footer-grid { grid-template-columns: 1fr; } }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .legal-wrap { grid-template-columns: 1fr; gap: 32px; }
  .legal-toc {
    position: relative;
    top: auto;
    max-height: none;
  }
  .legal-toc ol { columns: 2; column-gap: 24px; }
}
@media (max-width: 520px) {
  .legal-hero { padding: 32px 0 24px; }
  .legal-content h2 { font-size: 1.4rem; margin-top: 40px; }
  .legal-content { font-size: 15px; }
  .legal-toc ol { columns: 1; }
  .container { padding: 0 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
