/* Flogect — legal & support pages (Assistenza, Privacy, Termini di Flogect Me). */

@font-face {
  font-family: "Archivo";
  src: url("assets/fonts/archivo-latin-var.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --ink: #16212C;
  --ink-2: #52606D;
  --ink-soft: #9AA6B2;
  --ground: #F4F5F2;
  --paper: #FFFFFF;
  --rule: rgba(22, 33, 44, 0.14);
  --rule-strong: rgba(22, 33, 44, 0.32);
  --rule-dark: rgba(244, 245, 242, 0.16);
  --teal: #156E6B;
  --teal-hover: #105A57;
  --teal-fill: #24A8A7;
  --teal-light: #3FBDB7;
  --orange: #F29A2E;
  --orange-ink: #9A5A0C;

  --font: "Archivo", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --fs-h1: clamp(2.125rem, 1.6rem + 1.9vw, 3.25rem);
  --fs-h2: clamp(1.25rem, 1.12rem + 0.45vw, 1.5rem);
  --fs-body: 1.0625rem;
  --fs-small: 0.875rem;
  --fs-label: 0.8125rem;

  --s1: 8px; --s2: 16px; --s3: 24px; --s4: 40px; --s5: 64px; --s6: 104px;
  --gutter: 40px;
  --maxw: 1240px;
  --r-ctl: 6px;
  --r-panel: 8px;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --t-press: 120ms;
  --t-fast: 200ms;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 100px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; }

::selection { background: rgba(36, 168, 167, 0.28); color: var(--ink); }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; border-radius: 2px; }
.site-footer :focus-visible { outline-color: var(--teal-light); }

.skip-link {
  position: absolute; left: var(--s2); top: -100px; z-index: 100;
  background: var(--ink); color: var(--ground); padding: 12px 16px; border-radius: var(--r-ctl);
  font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: var(--s2); }

.wrap { width: min(var(--maxw), 100% - 2 * var(--gutter)); margin-inline: auto; }

/* ---------- Header (same system as the homepage, quieter: no sales CTA) ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--ground); border-bottom: 1px solid var(--rule); }
.header-inner { height: 76px; display: flex; align-items: center; justify-content: space-between; gap: var(--s3); }
.brand { display: inline-flex; align-items: center; gap: 12px; min-height: 44px; text-decoration: none; color: var(--ink); }
.brand img { width: 36px; height: 36px; border-radius: var(--r-ctl); }
.brand-name { display: flex; flex-direction: column; font-size: 1.125rem; font-weight: 700; line-height: 1.1; font-stretch: 108%; letter-spacing: -0.01em; }
.brand-name small { font-size: 0.75rem; font-weight: 400; font-stretch: 100%; color: var(--ink-2); letter-spacing: 0.04em; margin-top: 2px; }

.nav-links { display: flex; align-items: center; gap: 32px; list-style: none; }
.nav-links a {
  display: inline-flex; align-items: center; min-height: 44px;
  font-size: 0.9375rem; text-decoration: none; color: var(--ink);
  background: linear-gradient(var(--orange), var(--orange)) left calc(100% - 8px) / 0 2px no-repeat;
  transition: background-size var(--t-fast) var(--ease-out);
}
.nav-links a[aria-current="page"] { background-size: 100% 2px; }
@media (hover: hover) and (pointer: fine) { .nav-links a:hover { background-size: 100% 2px; } }
.menu-toggle { display: none; }

/* ---------- Document toolbar: where am I + document language ---------- */
.doc-bar { border-bottom: 1px solid var(--rule); }
.doc-bar-inner { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); flex-wrap: wrap; min-height: 64px; padding-top: 10px; padding-bottom: 10px; }
.crumbs { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; list-style: none; font-size: var(--fs-small); color: var(--ink-2); }
.crumbs li + li::before { content: "/"; margin-right: 10px; color: var(--ink-soft); }
.crumbs a { display: inline-flex; align-items: center; min-height: 44px; color: var(--teal); text-underline-offset: 4px; }
.crumbs [aria-current="page"] { color: var(--ink); font-weight: 600; }

.lang-switch { display: inline-flex; align-items: center; gap: 12px; }
.lang-switch-label { font-size: var(--fs-label); font-weight: 600; color: var(--ink-2); }
.lang-switch-options { display: inline-grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border: 1px solid var(--rule-strong); border-radius: var(--r-ctl); }
.lang-switch button {
  min-height: 44px; min-width: 92px; padding: 0 14px; border: 0; border-radius: 4px; cursor: pointer;
  background: transparent; font-size: 0.875rem; font-weight: 600; color: var(--ink-2);
  transition: background-color var(--t-fast) ease, color var(--t-fast) ease;
}
.lang-switch button[aria-pressed="true"] { background: var(--teal); color: #fff; }
.lang-switch button:active { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) { .lang-switch button[aria-pressed="false"]:hover { color: var(--ink); background: rgba(22, 33, 44, 0.05); } }

/* ---------- Document layout ---------- */
.doc { padding-top: var(--s5); padding-bottom: var(--s6); }
.js .doc:not(.is-active) { display: none; }
html:not(.js) .doc + .doc { border-top: 1px solid var(--rule-strong); }

.doc-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; }
.doc-head { grid-column: 4 / span 8; margin-bottom: var(--s5); }
.doc-kicker { display: inline-block; padding-top: 12px; border-top: 2px solid var(--ink); font-size: var(--fs-small); font-weight: 600; color: var(--ink-2); }
.doc-head h1 { margin-top: var(--s3); font-size: var(--fs-h1); line-height: 1.05; letter-spacing: -0.02em; font-weight: 620; font-stretch: 106%; }
.doc-updated { margin-top: var(--s2); font-size: var(--fs-small); color: var(--ink-2); }
.doc-lede { margin-top: var(--s3); max-width: 60ch; font-size: 1.125rem; line-height: 1.55; color: var(--ink-2); }
.doc-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; margin-top: var(--s4); }

/* Table of contents */
.doc-toc { grid-column: 1 / span 3; align-self: start; position: sticky; top: 100px; max-height: calc(100vh - 120px); overflow: auto; padding-right: 8px; }
.toc-title { position: sticky; top: 0; z-index: 1; background: var(--ground); padding-bottom: 10px; border-bottom: 1px solid var(--rule-strong); font-size: var(--fs-label); font-weight: 700; color: var(--ink); }
.toc-list { list-style: none; }
.toc-list a {
  display: flex; gap: 10px; align-items: baseline; min-height: 44px; padding-top: 10px; padding-bottom: 10px;
  border-bottom: 1px solid var(--rule);
  font-size: var(--fs-small); line-height: 1.35; color: var(--ink-2); text-decoration: none;
  transition: color var(--t-fast) ease;
}
.toc-list a .toc-n { flex: none; min-width: 2.2ch; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--orange-ink); }
.toc-list a[aria-current="location"] { color: var(--teal); font-weight: 600; }
@media (hover: hover) and (pointer: fine) { .toc-list a:hover { color: var(--ink); } }
.toc-mobile { display: none; }

/* Content column: documentary reading measure */
.doc-content { grid-column: 4 / span 8; max-width: 36rem; }
.doc-section { padding-top: var(--s4); padding-bottom: var(--s4); border-top: 1px solid var(--rule); }
.doc-section:first-child { border-top: 1px solid var(--rule-strong); }
.doc-section h2 { display: flex; gap: 12px; align-items: baseline; margin-bottom: var(--s3); font-size: var(--fs-h2); line-height: 1.25; font-weight: 620; font-stretch: 104%; letter-spacing: -0.005em; }
.doc-section h2 .sec-n { flex: none; color: var(--orange-ink); font-variant-numeric: tabular-nums; }
.doc-section p + p, .doc-section p + ul, .doc-section ul + p { margin-top: var(--s2); }
.doc-section p, .doc-section li { line-height: 1.7; }
.doc-section ul { list-style: none; }
.doc-section ul li { position: relative; padding-left: 22px; }
.doc-section ul li + li { margin-top: 10px; }
.doc-section ul li::before { content: ""; position: absolute; left: 0; top: 0.72em; width: 8px; height: 2px; background: var(--orange); }
.doc-section strong { font-weight: 650; }
.doc-content a, .doc-head a:not(.btn) { color: var(--teal); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; overflow-wrap: anywhere; }
@media (hover: hover) and (pointer: fine) { .doc-content a:hover { color: var(--teal-hover); text-decoration-thickness: 2px; } }

.doc-head { grid-row: 1; }
.doc-toc { grid-row: 2; }
.doc-content { grid-row: 2; }
.doc-kicker img { display: inline-block; vertical-align: middle; width: 40px; height: 40px; margin-right: 12px; border: 1px solid var(--rule); border-radius: var(--r-panel); background: var(--paper); }
.doc-head-support .doc-kicker { display: inline-flex; align-items: center; }
.doc-head-support .doc-updated { margin-top: 0; }
.doc-related { margin-top: var(--s5); }
.related-title { padding-bottom: 10px; font-size: var(--fs-label); font-weight: 700; color: var(--ink-2); }
.doc-section .related li { padding-left: 0; margin-top: 0; }
.doc-section .related li::before { display: none; }

/* An email that stands alone in its paragraph becomes a full-size target; inline links stay inline. */
.doc-section p > a[href^="mailto:"]:only-child { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }

/* Contact callout (support) */
.callout { margin-top: var(--s3); padding: 20px 24px; background: var(--paper); border: 1px solid var(--rule-strong); border-radius: var(--r-panel); }
.callout-title { font-size: var(--fs-label); font-weight: 700; color: var(--ink-2); }
.callout-mail { display: inline-flex; align-items: center; min-height: 44px; font-size: 1.25rem; font-weight: 620; }
.callout p:last-child { font-size: var(--fs-small); color: var(--ink-2); }

/* Topic list (support) */
.topic-list { display: grid; grid-template-columns: 1fr 1fr; column-gap: 32px; margin-top: var(--s3) !important; border-top: 1px solid var(--rule); }
.doc-section .topic-list li { padding: 12px 0 12px 22px; margin: 0; border-bottom: 1px solid var(--rule); }
.doc-section .topic-list li::before { top: 1.45em; }

/* Related documents */
.related { list-style: none; border-top: 1px solid var(--rule); }
.related { padding-top: 4px; }
.related li { border-bottom: 1px solid var(--rule); padding-top: 4px; padding-bottom: 4px; }
.related a { display: flex; align-items: center; justify-content: space-between; min-height: 48px; text-decoration: none !important; font-weight: 600; color: var(--ink) !important; }
.related a::after { content: ""; width: 16px; height: 16px; flex: none; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.6'%3E%3Cpath d='M2 8h11M9 4l4 4-4 4'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.6'%3E%3Cpath d='M2 8h11M9 4l4 4-4 4'/%3E%3C/svg%3E") center / contain no-repeat; color: var(--teal); transition: transform var(--t-fast) var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .related a:hover { color: var(--teal) !important; } .related a:hover::after { transform: translateX(3px); } }
.doc-note { margin-top: var(--s4); padding-top: var(--s2); border-top: 1px solid var(--rule); font-size: var(--fs-small); color: var(--ink-2); line-height: 1.6; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 0 20px;
  border: 0; border-radius: var(--r-ctl); background: var(--teal); color: #fff;
  font-weight: 600; font-size: 0.9375rem; line-height: 1.2; text-decoration: none; overflow-wrap: anywhere;
  transition: background-color var(--t-fast) ease, transform var(--t-press) var(--ease-out);
}
.btn .arrow { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; transition: transform var(--t-fast) var(--ease-out); }
.btn:active { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) { .btn:hover { background: var(--teal-hover); } .btn:hover .arrow { transform: translateX(3px); } }

/* ---------- Footer (as the homepage) ---------- */
.site-footer { background: var(--ink); color: var(--ground); padding-top: var(--s5); }
.footer-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; row-gap: var(--s4); padding-bottom: var(--s5); }
.footer-brand { grid-column: 1 / span 6; }
.site-footer .brand { color: var(--ground); }
.site-footer .brand-name small { color: var(--ink-soft); }
.footer-brand p { margin-top: var(--s2); color: var(--ink-soft); max-width: 36ch; }
.footer-mail { margin-top: var(--s1) !important; }
.footer-mail a { display: inline-flex; align-items: center; min-height: 44px; color: var(--ground); font-weight: 600; text-underline-offset: 5px; }
.footer-col { grid-column: span 3; }
.footer-title { font-size: var(--fs-label); font-weight: 700; color: var(--ink-soft); margin-bottom: 8px; }
.footer-col ul { list-style: none; }
.footer-col a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; color: var(--ground); font-size: 0.9375rem; }
.footer-col a[aria-current="page"] { text-decoration: underline; text-underline-offset: 5px; text-decoration-color: var(--orange); }
@media (hover: hover) and (pointer: fine) { .footer-col a:hover { text-decoration: underline; text-underline-offset: 5px; } }
.footer-base { display: flex; justify-content: space-between; gap: var(--s2); flex-wrap: wrap; padding-top: 20px; padding-bottom: 28px; border-top: 1px solid var(--rule-dark); font-size: var(--fs-small); color: var(--ink-soft); }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  :root { --gutter: 24px; }
  .menu-toggle {
    display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px;
    border: 1px solid var(--rule-strong); border-radius: var(--r-ctl); background: transparent; cursor: pointer;
    font-size: 0.9375rem; font-weight: 600;
  }
  .menu-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
  .menu-toggle path { transform-box: fill-box; transform-origin: center; transition: transform var(--t-fast) var(--ease-out); }
  .menu-toggle[aria-expanded="true"] .l1 { transform: translateY(4px) rotate(45deg); }
  .menu-toggle[aria-expanded="true"] .l2 { transform: translateY(-4px) rotate(-45deg); }
  .nav-links {
    position: absolute; left: 0; right: 0; top: 100%;
    display: grid; gap: 0; padding-top: 8px; padding-bottom: 16px; padding-left: var(--gutter); padding-right: var(--gutter);
    background: var(--ground); border-bottom: 1px solid var(--rule-strong);
    opacity: 0; visibility: hidden; transform: translateY(-8px);
    transition: opacity 150ms ease, transform 150ms ease, visibility 0s linear 150ms;
  }
  .nav-links.is-open { box-shadow: 0 0 0 100vh rgba(22, 33, 44, 0.32); clip-path: inset(0 0 -100vh 0); opacity: 1; visibility: visible; transform: none; transition: opacity var(--t-fast) var(--ease-out), transform var(--t-fast) var(--ease-out), visibility 0s; }
  .nav-links li { border-bottom: 1px solid var(--rule); padding-top: 4px; padding-bottom: 4px; }
  .nav-links li:last-child { border-bottom: 0; }
  .nav-links a { min-height: 48px; width: 100%; font-size: 1.125rem; background: none; }
  .nav-links a[aria-current="page"] { color: var(--teal); }
  html:not(.js) .nav-links { position: static; opacity: 1; visibility: visible; transform: none; padding: 0; border: 0; display: flex; flex-wrap: wrap; gap: 0 16px; }
  html:not(.js) .nav-links li { border: 0; }
  html:not(.js) .menu-toggle { display: none; }

  .doc { padding-top: var(--s4); padding-bottom: var(--s5); }
  .doc-head, .doc-content { grid-column: 1 / -1; }
  .doc-head { margin-bottom: var(--s4); }
  .doc-toc { display: none; }
  .toc-mobile { grid-row: 2; }
  .doc-content { grid-row: 3; }
  .toc-mobile { display: block; grid-column: 1 / -1; margin-bottom: var(--s4); padding-top: 4px; padding-bottom: 4px; border-top: 1px solid var(--rule-strong); border-bottom: 1px solid var(--rule-strong); }
  .toc-mobile summary {
    display: flex; align-items: center; justify-content: space-between; min-height: 48px; cursor: pointer; list-style: none;
    font-size: var(--fs-small); font-weight: 700;
  }
  .toc-mobile summary::-webkit-details-marker { display: none; }
  .toc-mobile summary::after {
    content: ""; width: 10px; height: 10px; margin-right: 4px; border-right: 1.75px solid currentColor; border-bottom: 1.75px solid currentColor;
    transform: translateY(-3px) rotate(45deg); transition: transform var(--t-fast) var(--ease-out);
  }
  .toc-mobile[open] summary::after { transform: translateY(2px) rotate(-135deg); }
  .toc-mobile .toc-list { padding-bottom: 8px; border-top: 1px solid var(--rule); }
  .toc-mobile .toc-list li:last-child a { border-bottom: 0; }
  .doc-content > article > .doc-section:first-child, .doc-content > .doc-section:first-child { border-top: 0; padding-top: 0; }

  .footer-brand { grid-column: 1 / -1; }
  .footer-col { grid-column: span 6; }
}

@media (max-width: 640px) {
  :root { --gutter: 16px; }
  html { scroll-padding-top: 84px; }
  .header-inner { height: 64px; }
  .site-header .brand img { width: 32px; height: 32px; }
  .doc-bar-inner { flex-direction: column; align-items: flex-start; gap: 4px; }
  .lang-switch { width: 100%; justify-content: space-between; }
  .lang-switch-options { flex: 1; max-width: 240px; }
  .lang-switch button { min-width: 0; }
  .doc-lede { font-size: 1.0625rem; }
  .doc-actions .btn { width: 100%; }
  .topic-list { grid-template-columns: 1fr; }
  .callout { padding: 16px 18px; }
  .callout-mail { font-size: 1.125rem; }
  .footer-col { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  .btn:active, .lang-switch button:active { transform: none; }
  .nav-links, .nav-links.is-open { transform: none !important; }
}
