/* ACi.DO - foglio di stile unico. Un solo carattere (Atkinson Hyperlegible Next), scala 14/16/20/28/44, colori in variabili. */

@font-face {
  font-family: "Atkinson Hyperlegible Next";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/static/fonts/atkinson-hyperlegible-next-latin-400-normal.woff2) format("woff2");
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(/static/fonts/atkinson-hyperlegible-next-latin-700-normal.woff2) format("woff2");
}

:root {
  --paper: #FBFBFC;
  --surface: #F2F4F8;
  --line: #D8DCE6;
  --ink: #17203A;
  --muted: #596280;
  --edge: #8790AA;
  --cobalt: #2F43D1;
  --cobalt-dark: #2335A8;
  --hl: #E8F15A;
  --green: #1E8556;
  --green-dark: #146141;
  --red: #BF3A30;
  --red-dark: #8F271F;
  --t-s: 14px;
  --t-m: 16px;
  --t-l: 20px;
  --t-xl: 28px;
  --t-xxl: 44px;
  --font: "Atkinson Hyperlegible Next", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font: 400 var(--t-m)/1.55 var(--font);
}

h1, h2, h3 { font-weight: 700; line-height: 1.2; margin: 0; text-wrap: balance; }
h1 { font-size: var(--t-xl); margin-bottom: 8px; }
h2 { font-size: var(--t-l); margin-bottom: 8px; }
h3 { font-size: var(--t-m); }
p { margin: 0 0 12px; max-width: 68ch; }
a { color: var(--cobalt); text-underline-offset: 3px; }
a:hover { color: var(--cobalt-dark); }
strong { font-weight: 700; }
code { font: inherit; font-weight: 700; }
small, .small { font-size: var(--t-s); }
.muted { color: var(--muted); }
.muted, .hint { font-size: var(--t-s); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

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

/* il codice breve: il tratto di evidenziatore dietro le lettere */
.code {
  font-weight: 700;
  letter-spacing: .05em;
  padding: 0 .1em;
  box-shadow: inset 0 -.42em 0 var(--hl);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* ---- barra in alto ---- */
.top { border-bottom: 1px solid var(--line); background: var(--paper); }
.bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 24px;
  min-height: 52px;
}
.brand { font-weight: 700; font-size: var(--t-l); letter-spacing: .01em; color: var(--ink); text-decoration: none; }
.brand:hover { color: var(--ink); }
.brand .dot { color: var(--cobalt); }
.top nav { display: flex; flex: 1; gap: 0 20px; overflow-x: auto; white-space: nowrap; }
.top nav a { color: var(--ink); text-decoration: none; padding: 12px 0; font-size: var(--t-m); }
.top nav a:hover { color: var(--cobalt); text-decoration: underline; }
.who { display: flex; align-items: center; gap: 12px; margin: 0; font-size: var(--t-s); color: var(--muted); }
.who .name { overflow-wrap: anywhere; }
.top .login-link { margin-left: auto; font-size: var(--t-m); }

/* ---- colonna principale ---- */
.wrap { max-width: 1080px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }
main.wrap { padding-top: 32px; padding-bottom: 64px; }
.wrap.narrow { max-width: 720px; margin-left: 0; margin-right: auto; }
@media (min-width: 1128px) { .wrap.narrow { margin-left: calc((100% - 1080px) / 2); } }
.back { display: inline-block; margin-bottom: 16px; font-size: var(--t-s); }
.lead { font-size: var(--t-l); color: var(--ink); max-width: 56ch; }

/* ---- sezioni e riquadri ---- */
.section { border-top: 1px solid var(--line); margin-top: 40px; padding-top: 24px; }
.section > h2:first-child { margin-top: 0; }
.panel { background: var(--surface); padding: 24px; margin: 24px 0; border-radius: 10px; }
.panel > h2:first-child { margin-top: 0; }
.panel > :last-child, .section > :last-child { margin-bottom: 0; }
.flush { margin: 0; }

/* ---- moduli ---- */
label { display: block; font-size: var(--t-s); font-weight: 700; margin: 16px 0 6px; }
label.muted { font-weight: 400; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=search], select {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--edge);
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}
input::placeholder { color: var(--muted); opacity: 1; }
input:focus-visible, select:focus-visible { outline: 3px solid var(--cobalt); outline-offset: 0; border-color: var(--cobalt); }
.inline { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 0 16px; align-items: end; }
.inline > div > label:first-child, .inline > label { margin-top: 16px; }
.inline > button, .inline > .btn { align-self: end; justify-self: start; }
.stack { display: block; }
.actions { margin: 24px 0 0; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.check { display: flex; gap: 10px; align-items: center; font-size: var(--t-m); font-weight: 400; margin: 12px 0 0; }
.check input { width: 20px; height: 20px; margin: 0; accent-color: var(--cobalt); flex: none; }

button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 20px;
  border: 1px solid var(--cobalt);
  border-radius: 6px;
  background: var(--cobalt);
  color: #fff;
  font: 700 var(--t-m)/1.2 var(--font);
  text-decoration: none;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, transform .15s ease;
}
button:hover, .btn:hover { background: var(--cobalt-dark); border-color: var(--cobalt-dark); color: #fff; }
button:active, .btn:active { transform: translateY(1px); }
button[hidden] { display: none; }
.btn.sec, button.sec { background: transparent; color: var(--ink); border-color: var(--edge); }
.btn.sec:hover, button.sec:hover { background: var(--surface); color: var(--ink); border-color: var(--ink); }
button.link { min-height: 0; padding: 4px 0; border: 0; background: none; color: var(--cobalt); font-weight: 400; text-decoration: underline; text-underline-offset: 3px; }
button.link:hover { background: none; color: var(--cobalt-dark); }
button.link:active { transform: none; }
button.danger { background: transparent; color: var(--red-dark); border-color: var(--red); }
button.danger:hover { background: var(--red); color: #fff; border-color: var(--red); }

/* ---- messaggi ---- */
.err, .ok { padding: 12px 16px; margin: 16px 0; border-left: 4px solid; border-radius: 0 4px 4px 0; max-width: 68ch; }
.err { background: #FBECEA; border-color: var(--red); color: var(--red-dark); }
.ok { background: #E7F4ED; border-color: var(--green); color: var(--green-dark); }
.err ul { margin: 8px 0 0; padding-left: 20px; }
.empty { padding: 32px 0; font-size: var(--t-l); color: var(--ink); max-width: 40ch; }
.empty .muted { display: block; font-size: var(--t-m); margin-top: 4px; }

/* ---- tabelle ---- */
.scroll { overflow-x: auto; margin: 8px 0 0; }
table { border-collapse: collapse; width: 100%; font-size: var(--t-s); }
caption { text-align: left; }
th, td { text-align: left; padding: 12px 16px 12px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 700; color: var(--muted); border-bottom-color: var(--ink); white-space: nowrap; vertical-align: bottom; }
th:last-child, td:last-child { padding-right: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tbody tr:hover { background: var(--surface); }
table form { margin: 0; }
.trunc { display: block; max-width: 34ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
td.target a { color: var(--ink); }
td.target a:hover { color: var(--cobalt); }
.sub { display: block; color: var(--muted); font-size: var(--t-s); }
.links td { font-size: var(--t-m); }
.links .c-code { white-space: nowrap; }
.links .c-code a { text-decoration: none; }
.hint { margin-top: 12px; }
details.panel { margin: 24px 0; }
details.panel > summary { font-size: var(--t-l); font-weight: 700; color: var(--ink); list-style-position: inside; }
details.panel[open] > summary { margin-bottom: 8px; }
.links .c-code .code { font-size: var(--t-l); }
.links .c-code .sub { font-size: var(--t-s); }
.off td { color: var(--muted); }
.off td a { color: var(--muted); }
.tag { display: inline-block; font-size: var(--t-s); border: 1px solid var(--edge); border-radius: 3px; padding: 0 6px; margin-left: 8px; font-weight: 400; color: var(--muted); letter-spacing: 0; vertical-align: middle; }
.state::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--green); margin-right: 8px; vertical-align: 1px; }
.state.off-state::before { background: var(--edge); }
.state.blocked { color: var(--red-dark); }
.state.blocked::before { background: var(--red); }
.users td .inline { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); align-items: start; }
.users td .inline > div > label:first-child { margin-top: 0; }
.users td .inline > button { align-self: start; margin-top: 22px; }
@media (min-width: 900px) {
  .users td .inline { grid-template-columns: minmax(200px, 1.4fr) 140px minmax(150px, 1fr) 110px 130px auto; }
}
.users td { padding-top: 16px; padding-bottom: 20px; }
.users tbody tr:hover { background: none; }

details { margin-top: 16px; }
summary { cursor: pointer; font-size: var(--t-s); color: var(--cobalt); }
summary:hover { text-decoration: underline; }

/* ---- paginazione e periodi ---- */
.pager { display: flex; gap: 16px; align-items: center; margin: 24px 0 0; font-size: var(--t-s); }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; margin: 16px 0 8px; padding: 0; }
.tabs a, .tabs span { padding: 6px 14px; border-radius: 6px; font-size: var(--t-s); text-decoration: none; color: var(--ink); border: 1px solid var(--line); }
.tabs a:hover { background: var(--surface); color: var(--ink); }
.tabs span[aria-current] { background: var(--ink); border-color: var(--ink); color: #fff; font-weight: 700; }
.filters { margin: 32px 0 0; }
.count { margin: 16px 0 0; }

/* ---- link breve grande, QR, dettaglio ---- */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px 48px; align-items: start; margin: 8px 0 8px; }
.hero .kicker { margin: 0 0 8px; color: var(--muted); font-size: var(--t-s); }
.short { margin: 0 0 20px; font-size: var(--t-xxl); line-height: 1.15; max-width: none; overflow-wrap: anywhere; }
.short a { color: var(--ink); text-decoration: none; }
.short a:hover { color: var(--ink); }
.short .host { font-size: var(--t-l); font-weight: 400; color: var(--muted); letter-spacing: 0; }
.short .code { font-size: var(--t-xxl); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 0 0 16px; }
.meta { margin: 0; color: var(--muted); font-size: var(--t-s); }
.qr { text-align: left; }
.qr img { display: block; width: 176px; height: 176px; image-rendering: pixelated; border: 1px solid var(--line); background: #fff; padding: 8px; }
.qr .downloads { display: flex; gap: 8px; margin: 12px 0 0; }
.qr .btn { min-height: 36px; padding: 4px 14px; font-size: var(--t-s); }
.note { font-size: var(--t-s); color: var(--muted); max-width: 68ch; }

/* ---- grafici ---- */
.chart { display: block; width: 100%; max-width: 720px; height: auto; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { stroke: var(--edge); stroke-width: 1; }
.chart text { fill: var(--muted); font-family: var(--font); font-size: 11px; }
.chart .bar-clicks { fill: var(--cobalt); }
.chart .bar-qr { fill: #8F9BEA; }
.legend { display: flex; gap: 20px; margin: 8px 0 0; font-size: var(--t-s); color: var(--muted); }
.legend .dot { display: inline-block; width: 12px; height: 12px; border-radius: 2px; margin-right: 8px; vertical-align: -1px; }
.legend .dot.k-clicks { background: var(--cobalt); }
.legend .dot.k-qr { background: #8F9BEA; }
.share { display: block; width: 100px; height: 10px; }
.share .bg { fill: var(--line); }
.share .fill { fill: var(--cobalt); }

/* ---- pagine pubbliche (home, 404, pagina intermedia) ---- */
.public h1 { font-size: var(--t-xxl); line-height: 1.1; margin-bottom: 16px; overflow-wrap: anywhere; }
.public main { padding-top: 64px; }
.public .lead { margin-bottom: 24px; }
.go { background: var(--surface); padding: 16px 20px; margin: 0 0 24px; border-radius: 10px; max-width: 68ch; }
.go .kicker { margin: 0 0 4px; color: var(--muted); font-size: var(--t-s); }
.go a { color: var(--ink); font-size: var(--t-l); font-weight: 700; overflow-wrap: anywhere; }
.count-down { font-size: var(--t-xxl); font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---- accesso: pagina divisa ---- */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 100vh; }
.split-form { padding: 32px clamp(24px, 6vw, 96px); display: flex; flex-direction: column; }
.split-form .brand { margin-bottom: 15vh; align-self: flex-start; }
.split-form .box { width: 100%; max-width: 380px; }
.split-form h1 { margin-bottom: 12px; }
.split-form .alt { margin-top: 24px; font-size: var(--t-s); }
.split-demo { background: var(--surface); border-left: 1px solid var(--line); padding: 32px clamp(24px, 6vw, 96px); display: flex; flex-direction: column; justify-content: center; }
.split-demo .example { margin: 0 0 24px; font-size: clamp(44px, 7vw, 96px); line-height: 1.05; font-weight: 700; overflow-wrap: anywhere; max-width: none; }
.split-demo .example .host { color: var(--muted); font-weight: 400; letter-spacing: 0; }
.split-demo p { font-size: var(--t-l); max-width: 30ch; }
@media (max-width: 820px) {
  .split { grid-template-columns: 1fr; min-height: 0; }
  .split-form .brand { margin-bottom: 40px; }
  .split-demo { border-left: 0; border-top: 1px solid var(--line); }
  .split-demo .example { font-size: var(--t-xxl); }
}

/* ---- schermi stretti ---- */
@media (max-width: 720px) {
  .wrap { padding-left: 16px; padding-right: 16px; }
  main.wrap { padding-top: 24px; }
  h1 { font-size: 24px; }
  .public h1 { font-size: 36px; }
  .public main { padding-top: 40px; }
  .hero { grid-template-columns: 1fr; }
  .short, .short .code { font-size: 36px; }
  .panel { padding: 16px; }
  .bar { padding-top: 8px; }
  .top nav { order: 3; flex-basis: 100%; gap: 0 20px; }
  .who { margin-left: auto; }

  /* l'elenco dei link diventa una pila di righe */
  table.links, .links tbody, .links tr, .links td { display: block; }
  .links thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .links tr { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 4px 16px; padding: 16px 0; border-bottom: 1px solid var(--line); }
  .links td { border: 0; padding: 0; text-align: left; }
  .links .c-code { grid-column: 1 / 3; }
  .links .c-state { grid-column: 3; text-align: right; }
  .links .c-target { grid-column: 1 / -1; }
  .links .trunc { max-width: 100%; }
  .links td:nth-child(3)::before { content: "Totali: "; }
  .links td:nth-child(4)::before { content: "30 giorni: "; }
  .links td:nth-child(5)::before { content: "Creato: "; }
  .links td:nth-child(3), .links td:nth-child(4), .links td:nth-child(5) { font-size: var(--t-s); text-align: left; }
  .links td:nth-child(3)::before, .links td:nth-child(4)::before, .links td:nth-child(5)::before { color: var(--muted); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
  button:active, .btn:active { transform: none; }
}

.page-h2 { font-size: var(--t-xl); margin-top: 56px; }
.page-h2 + .tabs { margin-top: 8px; }
