/* ============================================================
   /sociale/ — programma «Dr. Arrigoni per il Sociale»
   Usa i token di styles.css. Nessun colore nuovo.
   Il questionario è progettato per un dito anziano su uno schermo
   piccolo: bersagli grandi, testo grande, contrasto alto.
   ============================================================ */

/* ---------- QUESTIONARIO ---------- */
.q-main {
  min-height: 100vh;
  background: var(--paper-2);
  padding: clamp(1.2rem, 4vw, 3rem) 1rem clamp(2rem, 6vw, 4rem);
  display: flex; justify-content: center;
}
.q-shell { width: min(620px, 100%); }

.q-program {
  font-family: var(--sans); font-size: .78rem; font-weight: 700;
  letter-spacing: .16em; text-transform: uppercase; color: var(--teal);
  margin: 0 0 1.1rem; text-align: center;
}

.q-privacy {
  background: var(--teal-tint); border-radius: 14px;
  padding: 1rem 1.15rem; margin: 0 0 1.4rem;
  font-family: var(--sans); font-size: 1rem; line-height: 1.5; color: var(--ink-2);
}
.q-privacy strong { color: var(--teal-700); }

.q-card {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: 18px; padding: clamp(1.2rem, 4vw, 1.9rem);
  box-shadow: 0 12px 34px rgba(28,38,39,.06);
}

.q-step {
  font-family: var(--sans); font-size: .82rem; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft);
  margin: 0 0 .5rem;
}
.q-bar { height: 5px; background: var(--paper-3); border-radius: 99px; overflow: hidden; margin: 0 0 1.4rem; }
.q-bar i { display: block; height: 100%; background: var(--teal); border-radius: 99px; transition: width .25s ease; }

.q-domanda {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(1.45rem, 5.2vw, 1.95rem); line-height: 1.2;
  color: var(--ink); margin: 0 0 1.3rem; letter-spacing: -.01em;
}
.q-hint { font-family: var(--sans); font-size: .95rem; color: var(--ink-soft); margin: -.8rem 0 1.2rem; }

/* bersagli grandi: il vincolo più importante di tutta la pagina */
.q-opts { display: flex; flex-direction: column; gap: .65rem; }
.q-opt {
  display: flex; align-items: center; gap: .9rem;
  min-height: 62px; padding: .9rem 1.1rem;
  background: var(--paper); border: 2px solid var(--line-2); border-radius: 14px;
  font-family: var(--sans); font-size: 1.12rem; font-weight: 500; color: var(--ink);
  text-align: left; cursor: pointer; width: 100%;
  transition: border-color .15s ease, background .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.q-opt:hover { border-color: var(--teal); background: var(--teal-tint); }
.q-opt:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }
.q-opt[aria-pressed="true"] { border-color: var(--teal); background: var(--teal-tint); }
.q-opt .dot {
  width: 26px; height: 26px; flex: none; border-radius: 50%;
  border: 2px solid var(--line-2); display: grid; place-items: center;
}
.q-opt[aria-pressed="true"] .dot { border-color: var(--teal); background: var(--teal); }
.q-opt[aria-pressed="true"] .dot::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: #fff; }

.q-nav { display: flex; gap: .7rem; margin-top: 1.5rem; align-items: center; }
.q-nav .spacer { flex: 1; }
.q-btn {
  font-family: var(--sans); font-size: 1.02rem; font-weight: 600;
  min-height: 54px; padding: 0 1.5rem; border-radius: 12px; cursor: pointer;
  border: 2px solid transparent; transition: background .15s ease;
}
.q-btn-primary { background: var(--teal); color: #fff; }
.q-btn-primary:hover { background: var(--teal-deep); }
.q-btn-primary[disabled] { background: var(--line-2); color: var(--ink-soft); cursor: not-allowed; }
.q-btn-ghost { background: transparent; color: var(--ink-soft); border-color: var(--line-2); }
.q-btn-ghost:hover { color: var(--ink); border-color: var(--ink-soft); }
.q-btn:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }

.q-skip { font-family: var(--sans); font-size: .95rem; color: var(--ink-soft); background: none; border: 0; cursor: pointer; text-decoration: underline; padding: .6rem 0; }

.q-codice {
  font-family: var(--sans); font-size: 1.5rem; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; text-align: center;
  width: 100%; min-height: 64px; padding: .8rem 1rem;
  border: 2px solid var(--line-2); border-radius: 14px; color: var(--ink);
}
.q-codice:focus { outline: none; border-color: var(--teal); }

.q-done { text-align: center; padding: 1rem 0 .5rem; }
.q-done .tick { width: 68px; height: 68px; margin: 0 auto 1.1rem; border-radius: 50%; background: var(--teal-tint); display: grid; place-items: center; }
.q-done .tick svg { width: 34px; height: 34px; stroke: var(--teal); fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.q-done h2 { font-family: var(--serif); font-weight: 500; font-size: 1.85rem; margin: 0 0 .6rem; color: var(--ink); }
.q-done p { font-family: var(--sans); font-size: 1.05rem; color: var(--ink-2); margin: 0 0 1.2rem; line-height: 1.55; }

.q-err { background: #fdf2f2; border: 1px solid #f3c9c9; color: #8c2f2f; border-radius: 12px; padding: .9rem 1.1rem; font-family: var(--sans); font-size: 1rem; margin-bottom: 1rem; }
.q-anteprima { background: #fff8e6; border: 1px solid #f0dca8; color: #6b5312; border-radius: 12px; padding: .9rem 1.1rem; font-family: var(--sans); font-size: .95rem; margin-bottom: 1rem; }

.q-foot { font-family: var(--sans); font-size: .95rem; text-align: center; margin: 1.6rem 0 0; color: var(--ink-soft); }
.q-foot a { color: var(--teal); }
.q-fallback { font-family: var(--sans); background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 1.2rem; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- RISULTATI ---------- */
.res-main { padding-bottom: clamp(3rem, 8vw, 6rem); }
.res-loading { font-family: var(--sans); color: var(--ink-soft); }

.res-tot {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: .8rem 1.6rem;
  border-bottom: 2px solid var(--ink); padding-bottom: 1rem; margin-bottom: 2rem;
}
.res-tot .n { font-family: var(--serif); font-size: clamp(2.6rem, 8vw, 4rem); line-height: 1; color: var(--teal-700); }
.res-tot .lab { font-family: var(--sans); font-size: 1.05rem; color: var(--ink-2); }
.res-tot .upd { font-family: var(--sans); font-size: .9rem; color: var(--ink-soft); margin-left: auto; }

.res-tappe { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .9rem; margin-bottom: 2.4rem; }
.res-tappa { background: var(--paper-2); border: 1px solid var(--line); border-radius: 14px; padding: 1rem 1.1rem; font-family: var(--sans); }
.res-tappa .cod { font-size: .78rem; font-weight: 700; letter-spacing: .1em; color: var(--teal); }
.res-tappa .tit { font-family: var(--serif); font-size: 1.2rem; margin: .25rem 0 .35rem; color: var(--ink); }
.res-tappa .meta { font-size: .92rem; color: var(--ink-soft); }
.res-tappa .n { font-size: 1.5rem; font-weight: 700; color: var(--ink); margin-top: .5rem; }

.res-dom { margin-bottom: 2.2rem; }
.res-dom h3 { font-family: var(--serif); font-weight: 500; font-size: clamp(1.2rem, 3.4vw, 1.5rem); line-height: 1.25; margin: 0 0 1rem; color: var(--ink); }
.res-riga { display: grid; grid-template-columns: minmax(120px, 190px) 1fr auto; gap: .9rem; align-items: center; margin-bottom: .6rem; font-family: var(--sans); font-size: 1rem; }
.res-riga .et { color: var(--ink-2); }
.res-riga .track { height: 22px; background: var(--paper-3); border-radius: 6px; overflow: hidden; }
.res-riga .fill { height: 100%; background: var(--teal); border-radius: 0 6px 6px 0; }
.res-riga .val { font-weight: 700; color: var(--ink); min-width: 84px; text-align: right; font-variant-numeric: tabular-nums; }
.res-riga .val span { font-weight: 400; color: var(--ink-soft); }

.res-parziale { background: var(--teal-tint); border-radius: 14px; padding: 1.2rem 1.4rem; font-family: var(--sans); color: var(--ink-2); line-height: 1.55; }
.res-azioni { margin: 2rem 0; }
.res-nota { background: var(--paper-2); border-left: 3px solid var(--teal); border-radius: 0 14px 14px 0; padding: 1.3rem 1.5rem; font-family: var(--sans); }
.res-nota h2 { font-family: var(--sans); font-size: .82rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--teal-700); margin: 0 0 .7rem; }
.res-nota p { font-size: 1rem; line-height: 1.6; color: var(--ink-2); margin: 0 0 .7rem; }
.res-nota p:last-child { margin-bottom: 0; }

@media (max-width: 560px) {
  .res-riga { grid-template-columns: 1fr auto; }
  .res-riga .track { grid-column: 1 / -1; order: 3; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* scelta multipla: pallino quadrato, per dire senza parole che se ne può scegliere più di uno */
.q-opt-multi .dot { border-radius: 6px; }
.q-opt-multi[aria-pressed="true"] .dot::after { border-radius: 2px; width: 11px; height: 11px; }
