/* Pagine pubbliche di iAutFit: informativa e assistenza.
   Colori e caratteri dall'identità BRAND-03 (src/theme/tokens.ts), serviti da qui:
   nessuna richiesta a terzi per chi legge l'informativa. */

@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("fonts/atkinson-next-400.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("fonts/atkinson-next-700.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("fonts/plus-jakarta-sans-600.ttf") format("truetype");
  font-weight: 600;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --surface: #f6f5fa;
  --surface-selected: #efebff;
  --text: #22212b;
  --text-secondary: #625c70;
  --brand: #6344dc;
  --border: #91869f;
  --focus: #6344dc;
  --warning: #825500;
  --warning-bg: #fff4dc;
  --radius-card: 20px;
  --radius-inner: 12px;
  --font-body: "Atkinson Hyperlegible Next", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17151f;
    --surface: #24202e;
    --surface-selected: #34284d;
    --text: #f5f3ff;
    --text-secondary: #b9b2c7;
    --brand: #b9a9ff;
    --border: #847890;
    --focus: #b9a9ff;
    --warning: #f1cc81;
    --warning-bg: #3a2f17;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
}

.page {
  max-width: 46rem;
  margin: 0 auto;
  padding: 0 16px 64px;
}

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 16px;
  top: 16px;
  padding: 8px 12px;
  background: var(--bg);
  border: 2px solid var(--focus);
  border-radius: 8px;
  z-index: 1;
}

header.site {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 0 8px;
}
header.site nav a {
  margin-left: 16px;
}
.logo {
  display: block;
  height: 32px;
  width: auto;
}
.logo .symbol {
  fill: var(--brand);
}
.logo .word {
  fill: var(--text);
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
}
h1 {
  font-size: clamp(1.75rem, 1.4rem + 1.6vw, 2.25rem);
  margin: 32px 0 8px;
}
h2 {
  font-size: 1.375rem;
  margin: 48px 0 12px;
  scroll-margin-top: 16px;
}
h3 {
  font-size: 1.125rem;
  margin: 28px 0 8px;
  scroll-margin-top: 16px;
}

p,
ul,
ol,
dl {
  margin: 0 0 14px;
}
ul,
ol {
  padding-left: 1.3em;
}
li + li {
  margin-top: 6px;
}

a {
  color: var(--brand);
  text-underline-offset: 2px;
}
a:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}

strong {
  font-weight: 700;
}

.meta {
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.draft {
  background: var(--warning-bg);
  color: var(--warning);
  border-left: 4px solid var(--warning);
  border-radius: var(--radius-inner);
  padding: 12px 16px;
  margin: 16px 0 24px;
  font-weight: 700;
}

.box {
  background: var(--surface-selected);
  border-radius: var(--radius-card);
  padding: 20px 24px;
  margin: 24px 0;
}
.box h2 {
  margin-top: 0;
}
.box ul {
  margin-bottom: 0;
}

.card {
  background: var(--surface);
  border-radius: var(--radius-card);
  padding: 16px 20px;
  margin: 16px 0;
}

.toc ol {
  columns: 2 14rem;
  column-gap: 32px;
}
.toc li {
  break-inside: avoid;
}

dl.facts {
  display: grid;
  grid-template-columns: minmax(7rem, max-content) 1fr;
  gap: 6px 16px;
}
dl.facts dt {
  font-weight: 700;
}
dl.facts dd {
  margin: 0;
}
@media (max-width: 30rem) {
  dl.facts {
    grid-template-columns: 1fr;
    gap: 2px;
  }
  dl.facts dd {
    margin-bottom: 10px;
  }
}

.table-wrap {
  overflow-x: auto;
  margin: 16px 0 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-inner);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  line-height: 1.45;
}
caption {
  text-align: left;
  font-weight: 700;
  padding: 12px 14px 4px;
}
th,
td {
  text-align: left;
  vertical-align: top;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
}
thead th {
  border-top: 0;
  background: var(--surface);
}

details {
  background: var(--surface);
  border-radius: var(--radius-inner);
  padding: 0 16px;
  margin: 10px 0;
}
summary {
  cursor: pointer;
  font-weight: 700;
  padding: 14px 0;
}
details[open] summary {
  padding-bottom: 6px;
}
details > :last-child {
  padding-bottom: 14px;
}

footer.site {
  margin-top: 56px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.95rem;
}
footer.site p {
  margin-bottom: 6px;
}

@media print {
  .skip,
  header.site nav,
  .toc {
    display: none;
  }
  body {
    font-size: 11pt;
  }
  a {
    color: inherit;
  }
}

/* Tabelle a più colonne: su un telefono ogni riga diventa una scheda. */
tbody th {
  font-weight: 700;
}
@media (max-width: 36rem) {
  table.stack thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }
  table.stack,
  table.stack caption,
  table.stack tbody,
  table.stack tr,
  table.stack th,
  table.stack td {
    display: block;
  }
  table.stack tr {
    border-top: 1px solid var(--border);
    padding: 6px 0;
  }
  table.stack th,
  table.stack td {
    border-top: 0;
    padding: 4px 14px;
  }
  table.stack th {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.05rem;
    padding-top: 8px;
  }
  table.stack td::before {
    content: attr(data-label) ": ";
    font-weight: 700;
  }
}
