/* Foglio di stile unico, mobile-first, senza dipendenze */
:root {
  --ink: #16212b;
  --ink-2: #33414d;
  --muted: #5b6573;
  --line: #e2e4dd;
  --bg: #f7f6f1;
  --surface: #ffffff;
  --brand: #0f3d3e;
  --brand-2: #17595a;
  --brand-soft: #e3efee;
  --accent: #f2a007;
  --accent-ink: #1b1400;
  --accent-soft: #fff4d9;
  --ok: #1a7f4b;
  --ok-soft: #e2f4ea;
  --warn: #9a5b00;
  --warn-soft: #fff1d6;
  --bad: #b3261e;
  --bad-soft: #fde7e5;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 32, 0.05), 0 8px 24px rgba(16, 24, 32, 0.06);
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font: 17px/1.6 var(--font); color: var(--ink); background: var(--bg); }
img, svg { max-width: 100%; }
a { color: var(--brand-2); text-underline-offset: 2px; }
a:hover { color: var(--brand); }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.015em; margin: 0 0 0.5em; }
h1 { font-size: clamp(1.9rem, 4.6vw, 2.9rem); }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 760px; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.center { text-align: center; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; border-radius: 8px; z-index: 50; }
.skip:focus { left: 8px; }

/* intestazione */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 62px; }
.logo { display: inline-flex; align-items: center; gap: 9px; font-weight: 800; font-size: 1.12rem; color: var(--brand); text-decoration: none; letter-spacing: -0.02em; }
.logo svg { width: 30px; height: 30px; flex: none; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a { color: var(--ink-2); text-decoration: none; padding: 8px 10px; border-radius: 8px; font-size: 0.95rem; font-weight: 500; }
.nav a:hover { background: var(--brand-soft); color: var(--brand); }
.nav .btn { margin-left: 6px; }
.nav-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font: inherit; font-size: 0.9rem; color: var(--ink); }
@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 62px; background: var(--surface); border-bottom: 1px solid var(--line); flex-direction: column; align-items: stretch; padding: 10px 16px 16px; box-shadow: var(--shadow); }
  .nav.open { display: flex; }
  .nav a { padding: 12px 10px; font-size: 1rem; }
  .nav .btn { margin: 8px 0 0; text-align: center; }
}

/* pulsanti e campi */
.btn { display: inline-block; font: inherit; font-weight: 700; line-height: 1.2; padding: 13px 20px; border-radius: 10px; border: 1px solid transparent; background: var(--accent); color: var(--accent-ink); text-decoration: none; cursor: pointer; text-align: center; transition: transform 0.05s ease, filter 0.15s ease; }
.btn:hover { filter: brightness(0.96); color: var(--accent-ink); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.6; cursor: progress; }
.btn.ghost { background: transparent; border-color: var(--brand); color: var(--brand); }
.btn.ghost:hover { background: var(--brand-soft); color: var(--brand); }
.btn.dark { background: var(--brand); color: #fff; }
.btn.dark:hover { color: #fff; filter: brightness(1.12); }
.btn.small { padding: 9px 14px; font-size: 0.92rem; }
.btn.block { display: block; width: 100%; }
label { font-weight: 600; font-size: 0.93rem; display: block; margin-bottom: 5px; }
input[type='email'], input[type='text'], select { width: 100%; font: inherit; padding: 12px 13px; border: 1px solid #c5cad0; border-radius: 10px; background: #fff; color: var(--ink); min-height: 48px; }
input:focus, select:focus { border-color: var(--brand-2); outline: 3px solid var(--brand-soft); }
.field { margin-bottom: 14px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; font-size: 0.9rem; color: var(--ink-2); }
.check input { width: 20px; height: 20px; margin-top: 3px; flex: none; accent-color: var(--brand); }
.hp { position: absolute !important; left: -6000px !important; height: 1px; width: 1px; overflow: hidden; }
.form-msg { margin: 10px 0 0; padding: 12px 14px; border-radius: 10px; font-size: 0.95rem; }
.form-msg.ok { background: var(--ok-soft); color: #0e5a33; }
.form-msg.err { background: var(--bad-soft); color: var(--bad); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.chip span { display: inline-block; padding: 8px 13px; border: 1px solid #c5cad0; border-radius: 999px; font-size: 0.92rem; background: #fff; }
.chip input:checked + span { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }

/* hero */
.hero { background: linear-gradient(180deg, #ffffff 0%, var(--bg) 100%); padding: 44px 0 36px; border-bottom: 1px solid var(--line); }
.hero-grid { display: grid; gap: 30px; align-items: start; }
@media (min-width: 900px) { .hero-grid { grid-template-columns: 1.08fr 0.92fr; gap: 48px; } .hero { padding: 64px 0 56px; } }
.eyebrow { display: inline-block; font-size: 0.82rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--brand-2); background: var(--brand-soft); padding: 5px 11px; border-radius: 999px; margin-bottom: 14px; }
.lead { font-size: clamp(1.08rem, 2vw, 1.25rem); color: var(--ink-2); max-width: 60ch; }
.ticks { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 8px; }
.ticks li { padding-left: 30px; position: relative; }
.ticks li::before { content: ''; position: absolute; left: 2px; top: 0.36em; width: 18px; height: 18px; border-radius: 50%; background: var(--ok-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath d='M5 9.4l2.6 2.6L13 6.6' fill='none' stroke='%231a7f4b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat; }
.signup { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 22px; box-shadow: var(--shadow); }
.signup h2 { font-size: 1.3rem; margin-bottom: 4px; }
.signup .counter { margin: 2px 0 14px; padding: 10px 12px; background: var(--accent-soft); border-radius: 10px; font-size: 0.95rem; }
.signup .counter b { font-size: 1.1rem; }
.signup .fine { margin: 10px 0 0; font-size: 0.82rem; color: var(--muted); }
.two { display: grid; gap: 12px; }
@media (min-width: 520px) { .two { grid-template-columns: 1fr 1fr; } }

/* sezioni */
.section { padding: 48px 0; }
.section.alt { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.section-head p { margin: 0; color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 26px; }
@media (min-width: 760px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat b { display: block; font-size: 1.7rem; line-height: 1.15; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat span { font-size: 0.86rem; color: var(--muted); }
.steps { display: grid; gap: 16px; counter-reset: step; }
@media (min-width: 800px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.step { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; counter-increment: step; }
.step::before { content: counter(step); display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 800; margin-bottom: 10px; }
.step p { margin: 0; color: var(--ink-2); }

/* schede bando */
.cards { display: grid; gap: 12px; }
@media (min-width: 820px) { .cards.two-col { grid-template-columns: 1fr 1fr; } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; }
.card:hover { border-color: #c4c9c2; box-shadow: var(--shadow); }
.card h3 { margin: 0; font-size: 1.06rem; line-height: 1.35; }
.card h3 a { color: var(--ink); text-decoration: none; }
.card h3 a:hover { color: var(--brand-2); text-decoration: underline; }
.card .meta { font-size: 0.86rem; color: var(--muted); }
.card .facts { display: flex; flex-wrap: wrap; gap: 6px 8px; margin-top: 4px; align-items: center; }
.badge { display: inline-block; font-size: 0.78rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); white-space: nowrap; }
.badge.soon { background: var(--bad-soft); color: var(--bad); }
.badge.mid { background: var(--warn-soft); color: var(--warn); }
.badge.open { background: var(--ok-soft); color: #0e5a33; }
.badge.closed { background: #ececec; color: #555; }
.badge.plain { background: #eef0ec; color: var(--ink-2); font-weight: 600; }
.amount { font-weight: 700; font-size: 0.92rem; }
.more-link { display: inline-block; margin-top: 16px; font-weight: 700; }

/* griglie di link (regioni, categorie) */
.linkgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; list-style: none; padding: 0; margin: 0; }
.linkgrid a { display: flex; justify-content: space-between; gap: 10px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; text-decoration: none; color: var(--ink); font-weight: 600; }
.linkgrid a:hover { border-color: var(--brand-2); color: var(--brand); }
.linkgrid span { font-weight: 700; font-size: 0.85rem; color: var(--muted); font-variant-numeric: tabular-nums; }

/* pagina di elenco e filtri */
.page-head { background: var(--surface); border-bottom: 1px solid var(--line); padding: 30px 0 26px; }
.page-head h1 { font-size: clamp(1.6rem, 3.6vw, 2.3rem); }
.crumbs { font-size: 0.86rem; color: var(--muted); margin-bottom: 10px; }
.crumbs a { color: var(--muted); }
.filters { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: grid; gap: 10px; margin-bottom: 16px; }
@media (min-width: 800px) { .filters { grid-template-columns: 1.4fr 1fr 1fr 1fr; } }
.filters label { font-size: 0.8rem; color: var(--muted); margin-bottom: 3px; }
.result-count { font-size: 0.92rem; color: var(--muted); margin: 0 0 10px; }

/* scheda di dettaglio */
.detail { display: grid; gap: 26px; padding: 28px 0 56px; }
@media (min-width: 940px) { .detail { grid-template-columns: minmax(0, 1fr) 340px; gap: 40px; } }
.detail h2 { font-size: 1.3rem; margin-top: 1.6em; }
.prose p, .prose li { color: var(--ink-2); }
.prose ul { padding-left: 1.2em; }
.facts-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 18px; margin: 18px 0; }
.facts-box dl { margin: 0; }
.facts-box div { display: grid; grid-template-columns: 42% 58%; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.facts-box div:last-child { border-bottom: 0; }
.facts-box dt { color: var(--muted); font-size: 0.9rem; }
.facts-box dd { margin: 0; font-weight: 600; font-size: 0.97rem; overflow-wrap: anywhere; }
.notice { padding: 13px 15px; border-radius: 12px; background: var(--warn-soft); color: #5c3a00; font-size: 0.93rem; margin: 16px 0; }
.notice.closed { background: #ececec; color: #333; }
.notice.info { background: var(--brand-soft); color: var(--brand); }
.aside { position: sticky; top: 82px; align-self: start; display: grid; gap: 16px; }
@media (max-width: 939px) { .aside { position: static; } }
.source-note { font-size: 0.84rem; color: var(--muted); border-top: 1px solid var(--line); padding-top: 14px; margin-top: 26px; }

/* prezzi */
.pricing { display: grid; gap: 16px; align-items: stretch; }
@media (min-width: 860px) { .pricing { grid-template-columns: repeat(3, 1fr); } }
.plan { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 24px 22px; display: flex; flex-direction: column; }
.plan.featured { border: 2px solid var(--brand); box-shadow: var(--shadow); position: relative; }
.plan.featured::before { content: 'Il più scelto'; position: absolute; top: -13px; left: 20px; background: var(--brand); color: #fff; font-size: 0.75rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.plan h3 { font-size: 1.25rem; margin-bottom: 2px; }
.plan .price { font-size: 2.3rem; font-weight: 800; letter-spacing: -0.03em; margin: 10px 0 0; line-height: 1.1; }
.plan .price small { font-size: 1rem; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.plan .per { font-size: 0.86rem; color: var(--muted); min-height: 1.4em; margin-bottom: 14px; }
.plan ul { list-style: none; padding: 0; margin: 0 0 20px; display: grid; gap: 9px; flex: 1; }
.plan li { padding-left: 26px; position: relative; font-size: 0.95rem; color: var(--ink-2); }
.plan li::before { content: '✓'; position: absolute; left: 3px; color: var(--ok); font-weight: 800; }
.toggle { display: inline-flex; background: #e9ebe5; border-radius: 999px; padding: 4px; margin: 0 auto 22px; }
.toggle button { font: inherit; font-weight: 600; font-size: 0.92rem; border: 0; background: transparent; padding: 8px 16px; border-radius: 999px; cursor: pointer; color: var(--ink-2); }
.toggle button[aria-pressed='true'] { background: var(--surface); color: var(--brand); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1); }

/* FAQ e contenuti */
details.faq { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 0 16px; margin-bottom: 10px; }
details.faq summary { cursor: pointer; font-weight: 700; padding: 14px 0; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after { content: '+'; font-size: 1.3rem; line-height: 1; color: var(--brand-2); }
details.faq[open] summary::after { content: '–'; }
details.faq p { color: var(--ink-2); }
.article { padding: 34px 0 60px; }
.article h2 { margin-top: 1.7em; }
.article h3 { margin-top: 1.4em; }
.article table { width: 100%; border-collapse: collapse; margin: 1em 0; font-size: 0.95rem; }
.article th, .article td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.article th { background: #f0f1ec; }
.cta-band { background: var(--brand); color: #fff; border-radius: 18px; padding: 28px 24px; display: grid; gap: 14px; align-items: center; }
@media (min-width: 760px) { .cta-band { grid-template-columns: 1fr auto; padding: 32px 36px; } }
.cta-band h2 { color: #fff; margin: 0 0 4px; }
.cta-band p { margin: 0; color: #d5e6e5; }

/* area personale */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; }
.panel h2 { font-size: 1.15rem; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.danger { color: var(--bad); }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--brand-2); text-decoration: underline; cursor: pointer; }
.pill { display: inline-block; font-size: 0.8rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); }
.testbar { background: #4a2a00; color: #ffe2a8; text-align: center; font-size: 0.85rem; padding: 6px 12px; }

/* piè di pagina */
.site-footer { background: #10262a; color: #c9d6d6; padding: 40px 0 28px; margin-top: 40px; font-size: 0.92rem; }
.site-footer a { color: #e6efef; }
.foot-grid { display: grid; gap: 26px; }
@media (min-width: 760px) { .foot-grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; } }
.site-footer h4 { color: #fff; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.07em; margin: 0 0 10px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 7px; }
.legal { border-top: 1px solid rgba(255, 255, 255, 0.14); margin-top: 28px; padding-top: 18px; font-size: 0.8rem; color: #9fb1b1; }
@media print { .site-header, .site-footer, .aside, .signup { display: none; } body { background: #fff; } }
