:root {
  /* Tema chiaro con palette brand SecurValue */
  --bg: #ffffff;
  --bg-soft: #f4f8fc;        /* azzurrino di sfondo */
  --panel: #ffffff;
  --line: #d7e3ef;           /* bordi chiari */
  --text: #14304a;           /* blu navy testo */
  --muted: #5f7891;
  --accent: #1C5A90;         /* blu SecurValue (primario) */
  --accent2: #649DD3;        /* azzurro SecurValue */
  --accent-soft: #DAECF3;    /* azzurro chiarissimo */
  --danger: #d23b57;
  --mono: ui-monospace, "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg-soft); color: var(--text); font-family: var(--sans); }
body {
  min-height: 100vh;
  background-image:
    radial-gradient(ellipse at top, rgba(100,157,211,.16), transparent 55%),
    linear-gradient(rgba(28,90,144,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(28,90,144,.035) 1px, transparent 1px);
  background-size: auto, 32px 32px, 32px 32px;
}
.mono { font-family: var(--mono); }
.accent { color: var(--accent); }
.accent2 { color: var(--accent2); }
.danger { color: var(--danger); }
.muted { color: var(--muted); }
.hidden { display: none !important; }

/* ---------- Logo ---------- */
.logo { display: block; height: 46px; width: auto; margin: 0 0 20px; }

/* ---------- Survey (mobile) ---------- */
.wrap { max-width: 560px; margin: 0 auto; padding: 28px 16px 64px; }
.brand { font-family: var(--mono); font-size: 13px; letter-spacing: .15em; color: var(--accent2); text-transform: uppercase; font-weight: 600; }
h1 { font-size: 28px; line-height: 1.15; margin: 8px 0 8px; color: var(--accent); }
.lead { color: var(--muted); margin: 0 0 24px; }
.q { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px; margin-bottom: 14px; box-shadow: 0 2px 10px rgba(28,90,144,.05); }
.q h2 { font-size: 17px; margin: 0 0 12px; line-height: 1.35; color: var(--text); }
.q .num { font-family: var(--mono); color: var(--accent2); font-size: 12px; display: block; margin-bottom: 6px; font-weight: 600; }
.opts { display: grid; gap: 8px; }
.opt {
  width: 100%; text-align: left; padding: 13px 14px; border-radius: 10px; font-size: 15px;
  background: #fff; color: var(--text); border: 1px solid var(--line); cursor: pointer;
  font-family: inherit; transition: border-color .15s, background .15s;
}
.opt:hover { border-color: var(--accent2); }
.opt.sel { border-color: var(--accent); background: rgba(100,157,211,.16); font-weight: 600; }
input[type=text] {
  width: 100%; padding: 13px 14px; border-radius: 10px; font-size: 16px; font-family: inherit;
  background: #fff; color: var(--text); border: 1px solid var(--line); outline: none;
}
input[type=text]:focus { border-color: var(--accent); }
.btn {
  display: block; width: 100%; padding: 16px; border: 0; border-radius: 12px; cursor: pointer;
  background: var(--accent); color: #fff; font-weight: 700; font-size: 17px; font-family: inherit; margin-top: 8px;
  transition: background .15s;
}
.btn:hover:not(:disabled) { background: #16496f; }
.btn:disabled { opacity: .4; cursor: default; }
.fine { font-size: 11px; color: #8497a8; margin-top: 28px; line-height: 1.5; }

/* trappola */
.q.trap { border-color: var(--accent2); background: linear-gradient(180deg, rgba(100,157,211,.08), #fff); }
.trap h2 { color: var(--accent); }
.trap-sub { margin: -4px 0 10px; color: var(--danger); font-weight: 700; font-size: 14px; }
.social { display: inline-block; font-family: var(--mono); font-size: 12px; color: var(--muted); background: var(--bg-soft); border: 1px solid var(--line); border-radius: 99px; padding: 4px 10px; margin-bottom: 14px; }
.field-label { display: block; font-size: 13px; font-weight: 600; color: var(--text); margin: 10px 0 5px; }
.consent { display: flex; align-items: flex-start; gap: 9px; margin-top: 14px; font-size: 13px; color: var(--muted); line-height: 1.4; cursor: pointer; }
.consent input { margin-top: 2px; width: 17px; height: 17px; accent-color: var(--accent); flex: 0 0 auto; }

/* thank-you on phone */
.reveal h1 { color: var(--accent); font-size: 26px; }
.thanks-icon {
  width: 84px; height: 84px; margin: 12px 0 20px; border-radius: 50%;
  background: rgba(100,157,211,.16); border: 2px solid var(--accent);
  color: var(--accent); font-size: 44px; line-height: 80px; text-align: center;
  animation: pop .45s cubic-bezier(.2,.9,.3,1.4);
}
@keyframes pop { from { opacity: 0; transform: scale(.5); } to { opacity: 1; transform: none; } }
.facts { display: grid; gap: 10px; margin: 20px 0; }
.fact {
  background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--accent);
  border-radius: 10px; padding: 12px 14px; opacity: 0; transform: translateY(6px);
  animation: in .4s forwards;
}
.fact .k { font-family: var(--mono); font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.fact .v { font-size: 16px; margin-top: 3px; word-break: break-word; }
.fact.warn { border-left-color: var(--danger); }
@keyframes in { to { opacity: 1; transform: none; } }

/* ---------- Projector screen ---------- */
.screen { min-height: 100vh; display: flex; flex-direction: column; padding: 4vh 5vw; }
.screen .top { display: flex; justify-content: space-between; align-items: center; font-family: var(--mono); color: var(--muted); font-size: 1.1vw; }
.screen .top .logo { height: 4vh; margin: 0; }
.slide { flex: 1; display: none; flex-direction: column; justify-content: center; }
.slide.on { display: flex; animation: fade .5s; }
@keyframes fade { from { opacity: 0; transform: scale(.985); } to { opacity: 1; transform: none; } }
.slide h2 { font-size: 3.4vw; margin: 0 0 3vh; line-height: 1.1; color: var(--accent); }
.slide h2 small { display: block; font-size: 1.3vw; color: var(--accent2); font-family: var(--mono); letter-spacing: .15em; text-transform: uppercase; margin-bottom: 1.5vh; font-weight: 600; }
.big { font-size: 11vw; font-weight: 800; font-family: var(--mono); color: var(--accent); line-height: 1; }
.qrbox { display: flex; gap: 5vw; align-items: center; }
.qr { background: #fff; padding: 1.2vw; border-radius: 1vw; width: 34vw; max-width: 70vh; border: 1px solid var(--line); box-shadow: 0 6px 30px rgba(28,90,144,.12); }
.qr svg { display: block; width: 100%; height: auto; }
.url { font-family: var(--mono); font-size: 1.6vw; color: var(--accent); margin-top: 2vh; word-break: break-all; font-weight: 600; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(26vw, 1fr)); gap: 2vw; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 1vw; padding: 2vw; box-shadow: 0 4px 18px rgba(28,90,144,.06); }
.card h3 { margin: 0 0 1.5vh; font-size: 1.2vw; font-family: var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .1em; font-weight: 600; }
.stat { font-size: 4.5vw; font-weight: 800; font-family: var(--mono); color: var(--accent); line-height: 1; }
.stat.red { color: var(--danger); }
.stat-l { font-size: 1.3vw; color: var(--text); margin-top: 1vh; line-height: 1.3; }
.bars { display: grid; gap: 1.1vh; }
.bar { display: grid; grid-template-columns: 30% 1fr 3.5vw; gap: 1vw; align-items: center; font-size: 1.25vw; }
.bar .lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar .track { height: 2.2vh; background: #e4edf5; border-radius: 99px; overflow: hidden; }
.bar .fill { height: 100%; background: linear-gradient(90deg, var(--accent2), var(--accent)); border-radius: 99px; width: 0; transition: width 1s cubic-bezier(.2,.8,.2,1); }
.bar .n { font-family: var(--mono); text-align: right; color: var(--muted); }
.bar.correct .lbl { color: var(--accent); font-weight: 700; }
.bar.correct .fill { background: linear-gradient(90deg, #2f8f5a, #57c98a); }
.bar.correct .n { color: var(--accent); font-weight: 700; }
.punch { font-size: 2.4vw; line-height: 1.35; max-width: 75vw; color: var(--text); }
.hint { position: fixed; bottom: 1.5vh; right: 2vw; font-family: var(--mono); font-size: .9vw; color: #b3c2d1; }
.admin { position: fixed; bottom: 1.5vh; left: 2vw; display: flex; gap: .6vw; opacity: .3; transition: opacity .2s; }
.admin:hover { opacity: 1; }
.admin button { background: var(--panel); color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px; font-family: var(--mono); cursor: pointer; }
.login { max-width: 420px; margin: 16vh auto; padding: 16px; }
.login .logo { height: 52px; margin-bottom: 24px; }