/* Switchup BMC Live · foglio di stile
   Allineato al deck "Workshop_BMC_OSA_Switchup_SIM_1.pptx":
   nero #0A0A0A / #15151E · viola #6748FA · lime #A7C919 · teal #00FFD3 · sabbia #E2DFD8
   semantica risposte: 0 rosso #E0343C · 1 ambra #F0A020 · 2 verde #2E9E6B (slide 5 e 8)
   font Manrope + Courier New · card squadrate con blocco d'ombra sfalsato */

:root {
  --ink: #0A0A0A; --ink-2: #15151E; --ink-3: #2C2C3A;
  --paper: #FAF7F2; --paper-2: #FDFCFA; --sand: #E2DFD8;
  --grey: #9A9AA6; --grey-2: #8A8A94; --grey-3: #5F5F6B; --grey-4: #B9B7C9;
  --violet: #6748FA; --violet-soft: #EEEAFF; --lime: #A7C919; --teal: #00FFD3;
  --red: #E0343C; --amber: #F0A020; --green: #2E9E6B; --coral: #FF5A36;

  --font: "Manrope", "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: "Courier New", "Courier Prime", Courier, monospace;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --off: 8px;

  /* tema chiaro (telefono), come le slide chiare del deck */
  --bg: var(--paper); --surface: var(--paper-2); --surface-2: #EFECE6; --line: var(--ink); --line-soft: #D6D3CC;
  --text: var(--ink); --text-2: var(--grey-3); --deco: var(--grey-2); --eyebrow: var(--violet);
}
.theme-dark {
  --bg: var(--ink); --surface: var(--ink-2); --surface-2: #1D1D28; --line: var(--ink-3); --line-soft: #23232F;
  --text: #FFFFFF; --text-2: var(--grey); --deco: var(--grey-2); --eyebrow: var(--teal);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.45; color: var(--text);
  background: var(--bg) url("assets/bg-light.jpg") center / cover no-repeat fixed;
  min-height: 100vh; min-height: 100dvh;
}
.theme-dark body, body.theme-dark { background: var(--ink) url("assets/bg-dark.jpg") center / cover no-repeat fixed; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--violet); }
.hidden { display: none !important; }
.mono { font-family: var(--mono); font-size: 12px; letter-spacing: .18em; text-transform: uppercase; }
.accent { color: var(--violet); }
.theme-dark .accent { color: var(--teal); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* etichetta "tag" del deck: mono su blocco pieno */
.tag { display: inline-block; font-family: var(--mono); font-size: 11px; letter-spacing: .18em; text-transform: uppercase; padding: 5px 12px; color: var(--ink); background: var(--lime); font-weight: 700; }
.tag.violet { background: var(--violet); color: #fff; }
.tag.teal { background: var(--teal); }
.tag.red { background: var(--red); color: #fff; }
.tag.amber { background: var(--amber); }
.tag.green { background: var(--green); color: #fff; }

/* ---------- barra loghi (Switchup a sinistra, bmc.ai a destra, come nel deck) ---------- */
.brandbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 20px; background: var(--ink); color: #fff; }
.brandbar .logos { display: flex; align-items: center; gap: 18px; }
.brandbar .logo { height: 26px; width: auto; display: block; }
.brandbar .logo.bmc { height: 32px; }
.session-pill { font-family: var(--mono); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; padding: 7px 11px; border: 1px solid var(--ink-3); color: var(--sand); white-space: nowrap; }
@media (max-width: 480px) {
  .brandbar { padding: 12px 16px; }
  .brandbar .logo { height: 20px; }
  .brandbar .logo.bmc { height: 26px; }
  .session-pill { font-size: 10px; letter-spacing: .06em; padding: 6px 9px; }
}
.session-pill::before { content: ""; display: inline-block; width: 7px; height: 7px; background: var(--lime); margin-right: 9px; vertical-align: 0; }

/* ---------- pagina partecipante ---------- */
.page { width: min(560px, 100% - 32px); margin: 0 auto; padding-block: 22px 56px; }
.card { background: var(--surface); border: 1px solid var(--line); box-shadow: var(--off) var(--off) 0 var(--violet); padding: 26px 22px; }
.card + .card { margin-top: 22px; }
.card.plain { box-shadow: var(--off) var(--off) 0 var(--ink); }
.eyebrow { font-family: var(--mono); font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--eyebrow); margin-bottom: 14px; }
.eyebrow b { font-weight: 700; color: var(--text); }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(31px, 7.6vw, 42px); line-height: 1.04; letter-spacing: -.02em; font-weight: 800; margin-bottom: 16px; }
h2 { font-size: 24px; line-height: 1.15; letter-spacing: -.015em; font-weight: 800; margin-bottom: 12px; }
h3 { font-size: 15px; font-weight: 800; margin-bottom: 10px; }
.lead { font-size: 17px; color: var(--text-2); margin-bottom: 22px; }
.microcopy { font-size: 13px; color: var(--text-2); margin: 0; }
.facts { display: flex; gap: 20px; margin: 0 0 22px; padding: 0; list-style: none; }
.facts li { font-family: var(--mono); font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--text-2); }
.facts li b { display: block; font-family: var(--font); font-size: 24px; letter-spacing: -.02em; color: var(--violet); text-transform: none; font-weight: 800; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 15px 22px; border: 1px solid var(--ink); font-weight: 800; font-size: 16px; line-height: 1;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), opacity .3s var(--ease), background-color .3s var(--ease);
}
.btn:hover { transition-duration: .1s; }
.btn:disabled { opacity: .35; cursor: not-allowed; }
.btn-primary { background: var(--ink); color: #fff; width: 100%; }
.btn-primary:hover:not(:disabled) { transform: translate(-2px, -2px); box-shadow: 4px 4px 0 var(--violet); }
.btn-ghost { background: var(--surface); color: var(--ink); }
.btn-ghost:hover:not(:disabled) { box-shadow: 3px 3px 0 var(--ink); transform: translate(-1px, -1px); }
.btn-link { background: none; border: 0; color: var(--text-2); text-decoration: underline; text-underline-offset: 3px; padding: 8px 0; font-size: 14px; font-weight: 600; }

/* quiz */
.q-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 10px; }
.q-num { font-family: var(--mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-2); }
.q-num b { color: var(--text); font-weight: 700; }
.q-block { font-family: var(--mono); font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--violet); text-align: right; }
.progress { height: 4px; background: var(--surface-2); margin-bottom: 22px; }
.progress > i { display: block; height: 100%; background: var(--violet); width: 0; transition: width .5s var(--ease); }
.q-title { font-size: clamp(21px, 5.6vw, 26px); line-height: 1.22; letter-spacing: -.015em; font-weight: 800; margin-bottom: 22px; min-height: 3.6em; }

.answers { display: grid; gap: 14px; margin-bottom: 24px; }
.answer {
  --c: var(--ink);
  display: grid; grid-template-columns: 46px 1fr; gap: 14px; align-items: center;
  text-align: left; padding: 12px 14px 12px 12px;
  background: var(--surface); border: 1px solid var(--ink);
  transition: box-shadow .3s var(--ease), transform .3s var(--ease);
}
.answer.s0 { --c: var(--red); } .answer.s1 { --c: var(--amber); } .answer.s2 { --c: var(--green); }
.answer:hover { transition-duration: .1s; box-shadow: 3px 3px 0 var(--c); }
.answer .n { font-family: var(--font); font-size: 22px; font-weight: 800; width: 46px; height: 46px; display: grid; place-items: center; background: var(--c); color: #fff; }
.answer.s1 .n { color: var(--ink); }
.answer strong { display: block; font-size: 16px; font-weight: 800; }
.answer span { display: block; font-size: 13px; color: var(--text-2); margin-top: 2px; }
.answer.selected { box-shadow: var(--off) var(--off) 0 var(--c); transform: translate(-2px, -2px); border-width: 1px; }
.answer.selected strong { color: var(--ink); }
.nav { display: flex; gap: 12px; }
.nav .btn-primary { flex: 1; width: auto; }
.nav .btn-ghost { min-width: 110px; }
.kbd-hint { margin-top: 12px; }
@media (hover: none) { .kbd-hint { display: none; } }

/* risultato */
.score-wrap { display: flex; align-items: baseline; gap: 8px; margin: 4px 0 10px; }
.score { font-size: 92px; font-weight: 800; letter-spacing: -.04em; line-height: .95; font-variant-numeric: tabular-nums; color: var(--ink); }
.score.consapevole { color: var(--green); } .score.parziale { color: var(--amber); } .score.implicito { color: var(--red); }
.score-max { font-family: var(--mono); font-size: 16px; letter-spacing: .1em; color: var(--text-2); }
.badge { display: inline-block; font-family: var(--mono); font-size: 11px; letter-spacing: .18em; text-transform: uppercase; padding: 6px 12px; font-weight: 700; color: #fff; background: var(--ink); margin-bottom: 18px; }
.badge.consapevole { background: var(--green); }
.badge.parziale { background: var(--amber); color: var(--ink); }
.badge.implicito { background: var(--red); }
.areas { list-style: none; padding: 0; margin: 0 0 8px; }
.areas li { display: grid; grid-template-columns: 34px 1fr auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.areas li:last-child { border-bottom: 0; }
.areas .rank { font-family: var(--mono); font-size: 12px; color: var(--violet); font-weight: 700; }
.areas strong { display: block; font-size: 15px; font-weight: 800; }
.areas span { font-size: 13px; color: var(--text-2); }
.areas .pts { font-family: var(--mono); font-size: 12px; color: var(--text-2); white-space: nowrap; }
.areas .pts b { color: var(--text); font-weight: 700; }
.bars { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; height: 10px; margin: 16px 0 6px; }
.bars i { background: var(--surface-2); }
.bars i.s0 { background: var(--red); } .bars i.s1 { background: var(--amber); } .bars i.s2 { background: var(--green); }
.bars-legend { display: flex; gap: 14px; font-family: var(--mono); font-size: 11px; color: var(--text-2); letter-spacing: .1em; margin-bottom: 4px; }
.bars-legend i { display: inline-block; width: 9px; height: 9px; margin-right: 6px; vertical-align: 0; }

/* contatti */
.lead-card { box-shadow: var(--off) var(--off) 0 var(--lime); }
.field { display: grid; gap: 6px; margin-bottom: 12px; }
.field label { font-family: var(--mono); font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--text-2); }
.field label i { font-style: normal; color: var(--deco); text-transform: none; letter-spacing: 0; }
.field input { width: 100%; padding: 13px 14px; border: 1px solid var(--ink); background: var(--surface); transition: box-shadow .3s var(--ease); }
.field input:focus { outline: 0; box-shadow: 3px 3px 0 var(--violet); transition-duration: .1s; }
.field input:user-invalid { box-shadow: 3px 3px 0 var(--red); }
.consent { display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: start; margin: 6px 0 16px; font-size: 13px; color: var(--text-2); }
.consent input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--violet); }
.consent a { color: var(--text); }
.lead-actions { display: grid; gap: 8px; }
.note-ok { background: var(--ink); color: #fff; padding: 14px 16px; font-size: 14px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.alert { box-shadow: var(--off) var(--off) 0 var(--red); }
.alert strong { color: var(--red); }
.foot { margin-top: 26px; display: flex; justify-content: space-between; gap: 12px; align-items: center; }

/* ---------- dashboard (tema scuro del deck) ---------- */
.dash { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; height: 100dvh; overflow: hidden; }
.dash .brandbar { padding: 14px 28px 6px; background: transparent; }
.dash .brandbar .logo { height: 30px; }
.dash .brandbar .logo.bmc { height: 40px; }
.toolbar { display: flex; align-items: center; gap: 10px; }
.status { font-family: var(--mono); font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--grey); display: inline-flex; align-items: center; gap: 8px; }
.status i { width: 9px; height: 9px; background: var(--grey-3); }
.status.live i { background: var(--lime); animation: beat 2.2s var(--ease) infinite; }
.status.error i { background: var(--red); }
@keyframes beat { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
.btn-sm { padding: 9px 14px; font-size: 13px; }
.dash .btn-ghost { background: transparent; color: #fff; border-color: var(--ink-3); }
.dash .btn-ghost:hover { box-shadow: 3px 3px 0 var(--violet); border-color: var(--violet); }

.dash-main {
  display: grid; gap: 22px;
  grid-template-rows: auto minmax(0, 1.5fr) minmax(0, 1fr);
  padding: 4px 28px 22px; width: 100%; min-height: 0;
}

/* titolo + striscia dati compatta */
.topline { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: end; }
.topline .eyebrow { margin-bottom: 6px; }
.topline h1 { font-size: clamp(26px, 2.5vw, 38px); margin: 0; line-height: 1.05; }
.topstats { display: grid; grid-template-columns: repeat(4, auto); gap: 14px; }
.ts { --c: var(--violet); display: grid; gap: 3px; align-content: start; padding: 10px 16px 10px 14px; background: var(--ink-2); border: 1px solid var(--ink-3); border-left: 4px solid var(--c); min-width: 150px; max-width: 260px; transition: border-color .3s var(--ease), transform .3s var(--ease); }
.ts.critical { --c: var(--red); } .ts.solid { --c: var(--green); }
.ts-label { font-family: var(--mono); font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: var(--grey); }
.ts b { font-size: 30px; font-weight: 800; letter-spacing: -.03em; line-height: 1; color: #fff; font-variant-numeric: tabular-nums; }
.ts b small { font-family: var(--mono); font-size: 12px; font-weight: 400; letter-spacing: .08em; color: var(--grey); margin-left: 4px; }
.ts b.t { font-size: 20px; letter-spacing: -.01em; line-height: 1.1; }
.ts.critical b.t { color: var(--coral); } .ts.solid b.t { color: var(--teal); }
.ts-sub { font-size: 11px; color: var(--grey); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ts.flash { transform: translate(-2px, -2px); border-color: var(--lime); transition-duration: .1s; }

/* HERO: profilo della sala */
.hero { background: var(--ink-2); border: 1px solid var(--ink-3); box-shadow: var(--off) var(--off) 0 var(--violet); padding: 22px 26px 24px; display: grid; grid-template-rows: auto auto minmax(0, 1fr); gap: 16px; min-height: 0; }
.hero-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.hero h2 { margin: 0; font-size: 18px; font-weight: 800; color: #fff; }
.hero .mono { font-size: 10px; color: var(--grey-2); }
.prop { display: flex; height: 34px; background: var(--ink-3); overflow: hidden; }
.prop i { display: flex; align-items: center; justify-content: center; width: 0; min-width: 0; transition: width .8s var(--ease); font-family: var(--font); font-size: 14px; font-weight: 800; letter-spacing: .02em; color: rgba(255,255,255,.95); overflow: hidden; }
.prop i.consapevole { background: var(--green); } .prop i.parziale { background: var(--amber); color: var(--ink); } .prop i.implicito { background: var(--red); }
.prop i span { white-space: nowrap; padding: 0 10px; }
.profiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; min-height: 0; }
.profile { --c: var(--green); border: 1px solid var(--ink-3); background: var(--ink); box-shadow: var(--off) var(--off) 0 var(--c); padding: 18px 22px 18px; display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; gap: 6px; min-height: 0; container-type: size; }
.profile.parziale { --c: var(--amber); } .profile.implicito { --c: var(--red); }
.profile .range { justify-self: start; font-family: var(--mono); font-size: 11px; letter-spacing: .16em; padding: 4px 9px; background: var(--c); color: #fff; font-weight: 700; }
.profile.parziale .range { color: var(--ink); }
.profile .big { display: flex; align-items: baseline; gap: 12px; color: var(--c); line-height: .9; margin-top: 4px; }
/* il numero scala sull'altezza della CARD (cqh), non della finestra: non tocca mai il titolo */
.profile .big { min-height: 0; overflow: hidden; }
.profile .big b { font-size: clamp(40px, min(9vw, 46cqh), 168px); font-weight: 800; letter-spacing: -.055em; font-variant-numeric: tabular-nums; }
.profile .big span { font-size: clamp(16px, min(2vw, 11cqh), 34px); font-weight: 800; color: var(--sand); font-variant-numeric: tabular-nums; }
@container (max-height: 260px) { .profile p { display: none; } }
@container (max-height: 200px) { .profile h3 { font-size: 14px; } .profile .range { font-size: 10px; padding: 3px 8px; } }
.profile h3 { margin: 0; font-size: clamp(16px, 1.3vw, 22px); font-weight: 800; color: #fff; }
.profile p { margin: 0; font-size: clamp(12px, .9vw, 14px); color: var(--grey); line-height: 1.35; min-height: 2.7em; }

/* fascia bassa: risposte per domanda + QR */
.bottom { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 22px; min-height: 0; }
.panel { background: var(--ink-2); border: 1px solid var(--ink-3); box-shadow: var(--off) var(--off) 0 var(--violet); padding: 16px 22px 12px; display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 6px; min-height: 0; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.panel h3 { margin: 0; font-size: 15px; font-weight: 800; color: #fff; }
.panel .legend { display: flex; gap: 16px; font-family: var(--mono); font-size: 10px; letter-spacing: .08em; color: var(--grey); }
.panel .legend i { display: inline-block; width: 9px; height: 9px; margin-right: 7px; }
.chart-wrap { position: relative; min-height: 0; height: 100%; }
.chart-wrap canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; }

/* QR: card bianca con blocco nero, barra lime con l'URL (slide 58) */
.qr { display: grid; grid-template-columns: auto; grid-template-rows: auto minmax(0, 1fr); gap: 10px; align-content: start; justify-items: center; text-align: center; background: var(--paper-2); color: var(--ink); border: 1px solid var(--ink); box-shadow: var(--off) var(--off) 0 var(--ink); padding: 16px 18px; width: 232px; }
.qr .qr-eyebrow { font-family: var(--mono); font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: var(--violet); margin-bottom: 4px; }
.qr h2 { font-size: 19px; margin-bottom: 4px; line-height: 1.1; }
.qr p { font-size: 11px; color: var(--grey-3); margin: 0; line-height: 1.35; }
.qr .url { display: none; }
#qrcode { background: #fff; padding: 6px; border: 1px dashed var(--violet); line-height: 0; }
#qrcode img, #qrcode canvas { display: block; }

/* avvisi: toast fisso, non entra nella griglia e non sposta la fotografia */
.err.panel { position: fixed; right: 28px; bottom: 52px; z-index: 5; max-width: 520px; box-shadow: var(--off) var(--off) 0 var(--red); display: block; }
.err strong { color: var(--coral); }

/* piè di pagina come nel deck */
.deckfoot { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 6px 28px 14px; font-family: var(--mono); font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--grey-2); }
.deckfoot .num { background: var(--violet); color: #fff; padding: 4px 8px; letter-spacing: .1em; font-weight: 700; }

/* schermi bassi (proiettori 720p/768p): meno aria, niente commento sotto le card, tutto resta nel viewport */
@media (max-height: 820px) {
  .dash .brandbar { padding: 10px 28px 4px; }
  .dash .brandbar .logo { height: 26px; }
  .dash .brandbar .logo.bmc { height: 34px; }
  .dash-main { gap: 16px; padding: 2px 28px 16px; }
  .topline h1 { font-size: clamp(22px, 2.2vw, 30px); }
  .ts { padding: 8px 14px 8px 12px; min-width: 130px; }
  .ts b { font-size: 24px; }
  .ts b.t { font-size: 17px; }
  .hero { padding: 14px 20px 16px; gap: 10px; }
  .hero h2 { font-size: 16px; }
  .prop { height: 26px; }
  .prop i { font-size: 12px; }
  .profiles { gap: 16px; }
  .profile { padding: 12px 16px 12px; gap: 4px; grid-template-rows: auto minmax(0, 1fr) auto; }
  .profile .range { font-size: 10px; padding: 3px 8px; }
  .profile h3 { font-size: clamp(14px, 1.2vw, 18px); }
  .profile p { display: none; }
  .panel { padding: 12px 18px 10px; }
  /* QR in orizzontale: testo a sinistra, codice a destra, così sta nella riga bassa */
  .qr { padding: 12px 14px; width: 290px; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto; align-items: center; justify-items: start; text-align: left; gap: 12px; }
  .qr h2 { font-size: 16px; margin-bottom: 2px; }
  .qr p { display: none; }
  .topline h1 { font-size: clamp(20px, 2vw, 26px); }
  .deckfoot { padding: 4px 28px 10px; font-size: 10px; }
}

/* modalità embed: dentro una slide o iframe. Via QR, toolbar e piè di pagina, resta la fotografia. */
.embed .toolbar .btn, .embed .qr, .embed .deckfoot { display: none; }
.embed .dash-main { padding: 4px 22px 22px; }
.embed .bottom { grid-template-columns: minmax(0, 1fr); }

@media (max-width: 1100px) {
  .dash { height: auto; overflow: visible; }
  .dash-main { grid-template-rows: auto auto auto; }
  .topline { grid-template-columns: 1fr; }
  .topstats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ts { max-width: none; }
  .profiles { grid-template-columns: 1fr; }
  .bottom { grid-template-columns: 1fr; }
  .panel.low { min-height: 320px; }
  .qr { width: auto; }
}
@media (max-width: 760px) {
  .dash .brandbar { flex-wrap: wrap; }
  .topstats { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* altezze intermedie (portatili 864-900px): card QR piu compatta, resta nella fascia bassa */
@media (max-height: 900px) {
  .qr { padding: 12px 14px; }
  .qr p { display: none; }
}
