/* Font serviti dal sito: niente richieste a Google Fonts (più veloce, nessun dato inviato a terzi) */
@font-face { font-family: "Bricolage Grotesque"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/bricolage-grotesque-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Bricolage Grotesque"; font-style: normal; font-weight: 800; font-display: swap; src: url("fonts/bricolage-grotesque-latin-800-normal.woff2") format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/atkinson-hyperlegible-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/atkinson-hyperlegible-latin-700-normal.woff2") format("woff2"); }
/* Layout: una colonna stretta come un estratto conto — prima "cosa ricevi", poi il prossimo accredito, poi il mese voce per voce */
:root {
  --bg: #f3f6f4;
  --surface: #ffffff;
  --fg: #142019;
  --muted: #56655d;
  --line: #d9e2dc;
  --accent: #0b6b4c;
  --accent-soft: #e2f1ea;
  --past: #8a968f;
  --c-pens: #1f5fa8;
  --c-auu: #b4531a;
  --c-adi: #7a3fa0;
  --c-naspi: #5b6b13;
  --c-serv: #2f4858;
  --font-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --font-body: "Atkinson Hyperlegible", "Segoe UI", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1411; --surface: #16201b; --fg: #e5eee9; --muted: #9db0a5; --line: #26332c;
    --accent: #4fd1a1; --accent-soft: #173328; --past: #6d7c74;
    --c-pens: #7fb2f0; --c-auu: #f0a06a; --c-adi: #c79bf0; --c-naspi: #c3d46a; --c-serv: #8fb8cc;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1411; --surface: #16201b; --fg: #e5eee9; --muted: #9db0a5; --line: #26332c;
  --accent: #4fd1a1; --accent-soft: #173328; --past: #6d7c74;
  --c-pens: #7fb2f0; --c-auu: #f0a06a; --c-adi: #c79bf0; --c-naspi: #c3d46a; --c-serv: #8fb8cc;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body {
  background: var(--bg); color: var(--fg);
  font-family: var(--font-body); font-size: 17px; line-height: 1.5;
  padding-inline: 16px; padding-block: 28px 48px;
}
.wrap { max-width: 640px; margin: 0 auto; display: flex; flex-direction: column; gap: 28px; }
h1, h2 { font-family: var(--font-display); text-wrap: balance; margin: 0; }
h1 { font-size: clamp(2rem, 7vw, 2.9rem); font-weight: 800; line-height: 1.05; letter-spacing: -0.02em; }
h2 { font-size: 1.2rem; font-weight: 700; }
.eyebrow { font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); font-weight: 700; margin: 0 0 8px; }
.lede { color: var(--muted); margin: 10px 0 0; max-width: 34em; }
section { display: flex; flex-direction: column; gap: 12px; }

/* scelta prestazioni */
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.choice {
  display: flex; gap: 12px; align-items: flex-start; text-align: left;
  background: var(--surface); border: 2px solid var(--line); border-radius: 12px;
  padding: 14px; cursor: pointer; font: inherit; color: inherit; min-width: 0;
}
.choice:focus-visible, .tab:focus-visible, .seg button:focus-visible, .cal:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.choice[aria-pressed="true"] { border-color: var(--k); background: var(--accent-soft); }
.box { flex: none; width: 22px; height: 22px; border-radius: 6px; border: 2px solid var(--k); margin-top: 2px; display: grid; place-items: center; }
.choice[aria-pressed="true"] .box { background: var(--k); }
.box svg { width: 14px; height: 14px; stroke: var(--surface); fill: none; stroke-width: 3; opacity: 0; }
.choice[aria-pressed="true"] .box svg { opacity: 1; }
.choice strong { display: block; font-weight: 700; }
.choice span.sub { display: block; color: var(--muted); font-size: .88rem; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; background: var(--surface); flex-wrap: wrap; }
.seg button { font: inherit; font-size: .9rem; border: 0; background: none; color: var(--muted); padding: 6px 14px; border-radius: 999px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--c-adi); color: var(--surface); font-weight: 700; }
.adi-opt { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: .92rem; color: var(--muted); }

/* prossimo accredito */
.next {
  background: var(--surface); border-radius: 16px; padding: 20px;
  border: 1px solid var(--line); display: flex; gap: 18px; align-items: center; flex-wrap: wrap;
}
.tear {
  flex: none; width: 92px; border-radius: 10px; overflow: hidden; text-align: center;
  border: 1px solid var(--line); background: var(--bg);
}
.tear .m { background: var(--k, var(--accent)); color: var(--surface); font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; font-weight: 700; padding: 4px 0; }
.tear .d { font-family: var(--font-display); font-size: 2.6rem; font-weight: 800; line-height: 1.1; padding: 4px 0 0; font-variant-numeric: tabular-nums; }
.tear .w { font-size: .78rem; color: var(--muted); padding-bottom: 6px; }
.next-body { flex: 1 1 220px; min-width: 0; }
.next-label { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0; }
.next-what { font-family: var(--font-display); font-size: 1.45rem; font-weight: 700; margin: 2px 0; }
.count { font-size: 1.05rem; margin: 0; }
.count b { color: var(--accent); font-variant-numeric: tabular-nums; }

/* mesi */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab {
  font: inherit; font-size: .95rem; border: 1px solid var(--line); background: var(--surface); color: var(--fg);
  padding: 8px 16px; border-radius: 999px; cursor: pointer;
}
.tab[aria-selected="true"] { background: var(--fg); color: var(--bg); border-color: var(--fg); font-weight: 700; }
.ledger { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.row { display: grid; grid-template-columns: 64px 1fr; gap: 14px; padding: 14px 16px; border-top: 1px solid var(--line); align-items: start; }
.row:first-child { border-top: 0; }
.row .date { text-align: center; font-variant-numeric: tabular-nums; }
.row .date .dd { font-family: var(--font-display); font-size: 1.7rem; font-weight: 800; line-height: 1; display: block; }
.row .date .ww { font-size: .78rem; color: var(--muted); text-transform: capitalize; }
.row .info { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.tag { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.tag::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--k); }
.row .note { color: var(--muted); font-size: .9rem; margin: 0; }
.row .meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: .85rem; }
.pill { font-size: .78rem; font-weight: 700; padding: 2px 9px; border-radius: 999px; }
.pill.done { background: var(--line); color: var(--muted); }
.pill.soon { background: var(--accent-soft); color: var(--accent); }
.row.past .dd, .row.past .tag { color: var(--past); }
.cal { color: var(--accent); font-weight: 700; text-decoration: none; }
.cal:hover { text-decoration: underline; }
.empty { padding: 22px 16px; color: var(--muted); }

.ad { border: 1px dashed var(--line); border-radius: 12px; padding: 18px; text-align: center; color: var(--past); font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; }
.ad small { display: block; letter-spacing: 0; text-transform: none; margin-top: 4px; font-variant-numeric: tabular-nums; }

/* Banner in alto: 320×100 su telefono, 728×90 da computer */
.top-ad { max-width: 728px; margin: 0 auto 24px; }
.top-ad .ad { height: 100px; display: flex; flex-direction: column; justify-content: center; padding: 8px; }
@media (min-width: 760px) { .top-ad .ad { height: 90px; } }

.linkbtn { font: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.cals { display: inline-flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.cals .sep { color: var(--past); }
.hint { margin: 0; font-size: .85rem; color: var(--muted); background: var(--accent-soft); border-radius: 8px; padding: 8px 12px; }

/* Layout con colonne pubblicitarie laterali: visibili solo su schermi larghi */
.layout { display: grid; grid-template-columns: minmax(0, 1fr); justify-content: center; gap: 32px; }
.rail { display: none; }
@media (min-width: 1040px) {
  .layout { grid-template-columns: 160px minmax(0, 640px) 160px; }
  .rail { display: block; }
  .rail .ad { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 24px); width: 160px; height: 600px; display: flex; flex-direction: column; justify-content: center; padding: 12px; }
}
@media (min-width: 1360px) {
  .layout { grid-template-columns: 300px minmax(0, 640px) 300px; }
  .rail .ad { width: 300px; }
}
.why { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; }
.why ul { margin: 6px 0 0; padding-left: 1.1em; display: flex; flex-direction: column; gap: 6px; }
.why p { margin: 0; }
footer { font-size: .82rem; color: var(--muted); display: flex; flex-direction: column; gap: 6px; }
footer a { color: var(--muted); }
@media (prefers-reduced-motion: no-preference) {
  .next { transition: border-color .2s; }
}

/* --- Pagine per singola ricerca --- */
.crumbs { font-size: .85rem; color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 10px; padding: 0; list-style: none; }
.crumbs a { color: var(--muted); }
.crumbs li + li::before { content: "›"; margin-right: 6px; color: var(--past); }
.answer {
  background: var(--surface); border: 1px solid var(--line); border-left: 6px solid var(--k, var(--accent));
  border-radius: 14px; padding: 16px 18px; font-size: 1.12rem; line-height: 1.45; margin: 0;
}
.answer p { margin: 0; }
.answer p + p { margin-top: 8px; font-size: 1rem; color: var(--muted); }
.updated { font-size: .82rem; color: var(--muted); margin: 8px 0 0; }
.share { display: flex; gap: 10px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; font: inherit; font-weight: 700; font-size: .95rem;
  border-radius: 999px; padding: 10px 18px; text-decoration: none; cursor: pointer; border: 1px solid var(--line);
  background: var(--surface); color: var(--fg);
}
.btn.wa { background: var(--accent); color: var(--surface); border-color: var(--accent); }
.btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.btn svg { width: 18px; height: 18px; fill: currentColor; }
.prose { display: flex; flex-direction: column; gap: 10px; }
.prose p { margin: 0; max-width: 38em; }
.prose h2 { margin-top: 6px; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; }
.faq details + details { margin-top: 8px; }
.faq summary { font-weight: 700; cursor: pointer; }
.faq details p { margin: 8px 0 0; color: var(--muted); }
.links { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px; list-style: none; margin: 0; padding: 0; }
.links a {
  display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px;
  color: var(--fg); text-decoration: none; font-weight: 700; font-size: .95rem;
}
.links a:hover { border-color: var(--accent); }
.links a span { display: block; font-weight: 400; color: var(--muted); font-size: .85rem; }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; font-size: .95rem; }
th, td { text-align: left; padding: 10px 14px; border-top: 1px solid var(--line); white-space: nowrap; }
thead th { border-top: 0; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
tr.is-past td { color: var(--past); }
tr.is-now td { background: var(--accent-soft); font-weight: 700; }
.mid-ad .ad { height: 250px; display: flex; flex-direction: column; justify-content: center; }

/* --- Blog --- */
.cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.card a {
  display: flex; flex-direction: column; gap: 6px; height: 100%; text-decoration: none; color: var(--fg);
  background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--k, var(--accent));
  border-radius: 12px; padding: 14px 16px;
}
.card a:hover { border-color: var(--k, var(--accent)); }
.card a:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.card strong { font-family: var(--font-display); font-weight: 700; font-size: 1.08rem; line-height: 1.25; text-wrap: balance; }
.card-cat { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; color: var(--k, var(--accent)); }
.card-desc { color: var(--muted); font-size: .9rem; }
h2 a { color: inherit; text-decoration: none; }
h2 a:hover { text-decoration: underline; }
.toc { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; }
.toc p { margin: 0 0 6px; font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
.toc ol { margin: 0; padding-left: 1.2em; display: flex; flex-direction: column; gap: 4px; }
.toc a { color: var(--accent); text-decoration: none; }
.toc a:hover { text-decoration: underline; }
.article h2 { margin-top: 14px; scroll-margin-top: 16px; }
.prose ul, .prose ol { margin: 0; padding-left: 1.2em; display: flex; flex-direction: column; gap: 6px; max-width: 38em; }
.article .table-wrap { margin: 4px 0; }
.sources a { color: var(--accent); }
.sources li { font-size: .92rem; }

/* barra con il nome del sito */
.brandbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.brand { font-family: var(--font-display); font-weight: 800; font-size: 1.25rem; color: var(--fg); text-decoration: none; letter-spacing: -.01em; }
.brand b { color: var(--accent); font-weight: 800; }
.brandbar nav { display: flex; gap: 16px; font-size: .95rem; }
.brandbar nav a { color: var(--muted); text-decoration: none; }
.brandbar nav a:hover, .brand:hover b { text-decoration: underline; }
@media (max-width: 420px) {
  .brandbar { flex-wrap: nowrap; }
  .brand { font-size: 1.08rem; }
  .brandbar nav { gap: 12px; font-size: .88rem; }
}
