/* START – Circular Tourism Tool: grafica (nuova rispetto al sito WordPress). Colori dai loghi del progetto. */
:root { --ink: #1c2b36; --muted: #5b6b78; --bg: #f3f7f9; --card: #fff; --line: #dbe5ea; --brand: #1b86a6; --brand-d: #135f78; --accent: #0b4f73; --focus: #ff9d00; --radius: 14px; }
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; color: var(--ink); background: linear-gradient(180deg, #e8f2f6 0, var(--bg) 280px); min-height: 100vh; display: flex; flex-direction: column; }
.wrap { width: 100%; max-width: 880px; margin: 0 auto; padding: 0 16px; }
main { flex: 1; padding-top: 18px; padding-bottom: 36px; outline: none; }
a { color: var(--brand-d); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.top { background: rgba(255, 255, 255, .85); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 8px; padding-bottom: 8px; }
.brand img { display: block; height: 46px; width: auto; }
.langs { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.lang { border: 1px solid var(--line); background: #fff; color: var(--accent); border-radius: 999px; padding: 6px 12px; font: 600 13px/1 inherit; cursor: pointer; }
.lang.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.lang:hover:not(.on) { background: #eaf4f8; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin: 14px 0; box-shadow: 0 1px 2px rgba(20, 60, 80, .05), 0 6px 18px rgba(20, 60, 80, .04); }
h1 { font-size: 1.9rem; line-height: 1.2; margin: 0 0 4px; color: var(--accent); }
h2 { font-size: 1.35rem; margin: 0 0 14px; color: var(--accent); }
h3 { margin: 0; font-size: 1.1rem; }
.sub { margin: 0 0 14px; font-size: 1.1rem; color: var(--brand-d); font-weight: 600; }
.note { font-size: .9rem; color: var(--muted); }
.note.ko { color: #a02020; } .note.ok { color: #0b6b4f; }
.intro .btn { margin-top: 8px; }

.btn { border: 0; background: var(--brand); color: #fff; font: 600 1rem/1 inherit; padding: 13px 24px; border-radius: 999px; cursor: pointer; box-shadow: 0 2px 6px rgba(27, 134, 166, .3); transition: background .15s, transform .05s; }
.btn:hover { background: var(--brand-d); } .btn:active { transform: translateY(1px); }
.btn.ghost { background: #fff; color: var(--accent); border: 1px solid var(--line); box-shadow: none; }
.btn.ghost:hover { background: #eaf4f8; }
.actions { display: flex; justify-content: space-between; gap: 10px; margin: 16px 0 0; }
.actions.wrapact { flex-wrap: wrap; justify-content: center; }

.progress { margin: 6px 0 4px; display: flex; align-items: center; gap: 12px; font-size: .9rem; color: var(--muted); }
.progress .bar { flex: 1; height: 8px; background: #dbe7ed; border-radius: 99px; overflow: hidden; }
.progress .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), #00917a); border-radius: 99px; transition: width .3s; }

/* separatore con ombra (non border-top: il bordo di un fieldset passa dietro la legend e la attraversa) */
fieldset.q { border: 0; margin: 0; padding: 16px 0 12px; min-width: 0; box-shadow: 0 -1px 0 var(--line); }
fieldset.q:first-of-type { box-shadow: none; padding-top: 4px; }
/* legend flottante a tutta larghezza: cosi' sta dentro il fieldset invece di "cavalcarne" il bordo superiore */
fieldset.q legend { float: left; width: 100%; padding: 0; font-weight: 600; display: flex; gap: 10px; align-items: flex-start; margin-bottom: 10px; }
fieldset.q .opts { clear: both; }
.qn { flex: none; display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: #e6f1f5; color: var(--accent); font-size: .85rem; }
fieldset.q.miss { background: #fff4f2; border-radius: 10px; padding-left: 10px; padding-right: 10px; box-shadow: inset 0 0 0 2px #e9a89f; }
.opts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.opt { display: block; cursor: pointer; }
.opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.opt span { display: flex; align-items: center; justify-content: center; text-align: center; min-height: 44px; padding: 8px 10px; border: 1.5px solid var(--line); border-radius: 10px; background: #fafcfd; font-size: .95rem; transition: border-color .12s, background .12s; }
.opt:hover span { border-color: var(--brand); }
.opt input:checked + span { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.opt input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.warn { margin: 12px 0 0; padding: 10px 14px; background: #fff4f2; color: #8a2a20; border: 1px solid #e9a89f; border-radius: 10px; }

.field { margin: 0 0 14px; } .field label { display: block; font-weight: 600; margin-bottom: 4px; }
.field select { width: 100%; padding: 11px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; font: inherit; }
.consent { display: block; margin-top: 10px; }

.result { text-align: center; }
.clover { width: min(280px, 70vw); height: auto; margin: 6px auto 4px; display: block; }
.legend { list-style: none; margin: 8px auto; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 18px; max-width: 560px; text-align: left; font-size: .9rem; }
.legend li { display: flex; align-items: center; gap: 8px; } .legend i { flex: none; width: 14px; height: 14px; border-radius: 4px; }
.code { font-size: .9rem; color: var(--muted); margin: 8px 0 0; letter-spacing: .04em; }
.rec-title { margin: 26px 0 0; }
.rec { border-left: 8px solid var(--c); }
.rec header { display: flex; gap: 14px; align-items: center; margin-bottom: 10px; }
.badge { flex: none; display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--c); color: #fff; font-weight: 700; font-size: 1.1rem; text-shadow: 0 1px 1px rgba(0, 0, 0, .25); }
.rec .lvl { margin: 0; color: var(--muted); font-size: .92rem; }
.rec .body p { margin: 0 0 12px; text-align: left; }
.rec .body h4 { margin: 16px 0 8px; font-size: 1rem; }
.rec .body a img { vertical-align: middle; margin-right: 6px; }
.rec .body > p:last-child a { display: inline-block; }

.foot { background: #123c53; color: #d6e4eb; padding: 22px 0 28px; font-size: .8rem; margin-top: 10px; }
.foot img { display: block; max-width: 100%; height: auto; margin-bottom: 10px; }
.foot p { margin: 0; max-width: 760px; }

@media (max-width: 640px) {
  .opts { grid-template-columns: repeat(2, 1fr); }
  .legend { grid-template-columns: 1fr; }
  .card { padding: 16px; } h1 { font-size: 1.55rem; }
  .brand img { height: 38px; }
  .actions { flex-direction: column-reverse; } .actions .btn { width: 100%; }
}
@media print {
  .top, .actions, .foot img { display: none; } body { background: #fff; }
  .card { box-shadow: none; break-inside: avoid; } .rec { border-left-width: 6px; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

/* pulsanti dell'introduzione (Riprendi / Scarica / Importa / Ricomincia) e riga di stato */
.row-btns { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.meta { text-align: center; margin: 14px 0 0; }
.foot .credit { margin: 0 0 8px; font-weight: 600; letter-spacing: .02em; color: #fff; }

/* ---- stampa / PDF dei risultati: logo del progetto in intestazione, loghi dei partner in fondo ---- */
.print-only { display: none; }
@media print {
  @page { size: A4; margin: 12mm; }
  .print-only { display: block; }
  .print-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 0 0 14px; padding: 0 0 8px; border-bottom: 3px solid var(--brand); }
  .print-head img { height: 36px; width: auto; }
  .print-head .pt { text-align: right; font-size: 11pt; font-weight: 700; color: var(--accent); line-height: 1.3; }
  .print-head .pt span { display: block; font-weight: 400; font-size: 9pt; color: #555; }
  .print-foot { margin: 16px 0 0; padding: 10px 0 0; border-top: 1px solid #c8d3d9; text-align: center; break-inside: avoid; }
  .print-foot .lab { font-size: 7.5pt; letter-spacing: .16em; text-transform: uppercase; color: #555; margin: 0 0 6px; }
  .print-foot img { width: 100%; max-width: 186mm; height: auto; }
  /* testo UE e crediti: in nero su bianco (il logo bianco non si vede su carta) */
  .foot { background: #fff !important; color: #444 !important; padding: 8px 0 0; margin: 0; font-size: 7.5pt; }
  .foot .credit { color: #444; font-weight: 600; }
  .meta { display: none; }
}
