/* NEAITECH — NIS2 Academy · tema chiaro security / cyber */
:root {
  --navy: #0b1f3a;
  --navy-soft: #143056;
  --blue: #1565c0;
  --blue-bright: #1e88e5;
  --cyan: #0891b2;
  --cyan-soft: #e0f7fa;
  --accent: #b8860b;
  --accent-2: #d4a017;
  --green: #15803d;
  --red: #dc2626;
  --orange: #d97706;
  --white: #ffffff;
  --bg: #f0f5fb;
  --bg-2: #e8f0fa;
  --cream: #f7f9fc;
  --muted: #5a6f88;
  --text: #0f2744;
  --text-soft: #334e6b;
  --card: #ffffff;
  --card-alt: #f5f9ff;
  --border: rgba(21, 101, 192, 0.14);
  --border-strong: rgba(21, 101, 192, 0.28);
  --shadow: 0 12px 40px rgba(15, 39, 68, 0.08);
  --shadow-lg: 0 22px 55px rgba(15, 39, 68, 0.12);
  --radius: 16px;
  --radius-sm: 10px;
  --font: "DM Sans", system-ui, sans-serif;
  --serif: "Instrument Serif", Georgia, serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --max: 1180px;
  --header-h: 70px;
  --ok: #15803d;
  --warn: #d97706;
  --bad: #dc2626;
  --shield: #0d47a1;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  min-height: 100vh;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
ul, ol { list-style: none; }

/* —— Sfondo cyber chiaro: griglia + scudi + hex —— */
.bg-grid {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 90% 55% at 0% -5%, rgba(30, 136, 229, 0.16), transparent 55%),
    radial-gradient(ellipse 70% 45% at 100% 0%, rgba(8, 145, 178, 0.12), transparent 50%),
    radial-gradient(ellipse 60% 40% at 50% 100%, rgba(13, 71, 161, 0.08), transparent 55%),
    linear-gradient(180deg, #eef4fb 0%, #f4f8fc 40%, #eef3f9 100%);
}
.bg-grid::before {
  content: "";
  position: absolute; inset: 0;
  opacity: 0.45;
  background-image:
    linear-gradient(rgba(21, 101, 192, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(21, 101, 192, 0.06) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse 90% 80% at 50% 30%, black 10%, transparent 75%);
}
.bg-grid::after {
  content: "";
  position: absolute; inset: 0;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='100' viewBox='0 0 28 50'%3E%3Cpath fill='%231565c0' d='M13 0l13 7.5v15L13 30 0 22.5v-15z'/%3E%3C/svg%3E");
  background-size: 56px 100px;
}

/* Shield watermark */
.app-shell::before {
  content: "";
  position: fixed;
  right: -4%;
  top: 12%;
  width: min(420px, 55vw);
  height: min(480px, 70vh);
  z-index: 0;
  pointer-events: none;
  opacity: 0.06;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 140'%3E%3Cpath fill='%230d47a1' d='M60 4L10 24v36c0 32 22 58 50 72 28-14 50-40 50-72V24L60 4z'/%3E%3Ccircle cx='60' cy='62' r='22' fill='none' stroke='%231565c0' stroke-width='3'/%3E%3Ccircle cx='60' cy='62' r='8' fill='none' stroke='%231565c0' stroke-width='2.5'/%3E%3Ccircle cx='60' cy='62' r='3' fill='%231565c0'/%3E%3Cpath fill='none' stroke='%231565c0' stroke-width='3' stroke-linecap='round' d='M60 34v12M60 78v12M32 62h12M76 62h12'/%3E%3C/svg%3E") center/contain no-repeat;
}

.app-shell { position: relative; z-index: 1; min-height: 100vh; display: flex; flex-direction: column; }
.container { width: min(var(--max), calc(100% - 1.75rem)); margin-inline: auto; }

/* Banner NIS dedicata */
.nis-banner {
  background: linear-gradient(105deg, #0d47a1 0%, #1565c0 45%, #0277bd 100%);
  color: #fff;
  border-bottom: 3px solid var(--accent-2);
  box-shadow: 0 8px 28px rgba(13, 71, 161, 0.22);
  position: relative;
  overflow: hidden;
}
.nis-banner::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.06) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: 0.5;
}
.nis-banner::after {
  content: "NIS2";
  position: absolute;
  right: 4%;
  top: 50%;
  transform: translateY(-50%);
  font-size: clamp(3rem, 10vw, 5.5rem);
  font-weight: 800;
  letter-spacing: 0.08em;
  opacity: 0.1;
  pointer-events: none;
}
.nis-banner-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1rem 0;
  flex-wrap: wrap;
}
.nis-shield {
  width: 56px; height: 64px;
  flex-shrink: 0;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.2));
}
.nis-banner h1 {
  font-size: clamp(1.15rem, 2.4vw, 1.45rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.25;
}
.nis-banner h1 span {
  display: block;
  font-weight: 500;
  font-size: 0.82rem;
  opacity: 0.88;
  margin-top: 0.2rem;
  letter-spacing: 0.04em;
}
.nis-pills {
  display: flex; flex-wrap: wrap; gap: 0.4rem;
  margin-left: auto;
}
.nis-pills span {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  backdrop-filter: blur(6px);
}

/* Header */
.header {
  position: sticky; top: 0; z-index: 50;
  height: var(--header-h);
  backdrop-filter: blur(16px) saturate(1.2);
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 rgba(255,255,255,0.8), 0 8px 24px rgba(15, 39, 68, 0.04);
}
.header-inner {
  height: var(--header-h);
  display: flex; align-items: center; gap: 1rem;
}
.logo {
  display: flex; align-items: center; gap: 0.55rem;
  font-weight: 700; letter-spacing: 0.08em; font-size: 0.9rem;
  color: var(--navy);
}
.logo-badge {
  font-size: 0.62rem; letter-spacing: 0.12em; font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #0d47a1, #1565c0);
  padding: 0.28rem 0.5rem; border-radius: 6px;
  box-shadow: 0 2px 8px rgba(13, 71, 161, 0.3);
}
.nav { display: flex; gap: 0.1rem; margin-left: auto; flex-wrap: wrap; justify-content: flex-end; }
.nav a, .nav button.nav-link {
  font-size: 0.8rem; font-weight: 600; color: var(--muted);
  padding: 0.4rem 0.65rem; border-radius: 8px; transition: 0.2s;
}
.nav a:hover, .nav button.nav-link:hover,
.nav a.active, .nav button.nav-link.active {
  color: var(--blue);
  background: rgba(21, 101, 192, 0.08);
}
.nav .nav-home { color: var(--cyan); }
.menu-btn {
  display: none; width: 42px; height: 42px; border-radius: 10px;
  border: 1px solid var(--border); color: var(--navy); font-size: 1.2rem;
  background: var(--white);
}
.progress-pill {
  display: flex; align-items: center; gap: 0.45rem;
  font-size: 0.75rem; color: var(--muted);
  padding: 0.35rem 0.7rem; border-radius: 999px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, #fff, var(--card-alt));
  white-space: nowrap;
  box-shadow: var(--shadow);
}
.progress-pill strong { color: var(--blue); font-variant-numeric: tabular-nums; }
.progress-ring {
  width: 18px; height: 18px; border-radius: 50%;
  background: conic-gradient(var(--blue) var(--p, 0%), #dbe7f5 0);
  position: relative;
}
.progress-ring::after {
  content: ""; position: absolute; inset: 3px; border-radius: 50%; background: #fff;
}

/* Main */
main { flex: 1; padding: 1.5rem 0 3.5rem; }
.view { display: none; animation: fadeIn 0.35s ease; }
.view.active { display: block; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* Hero dashboard */
.hero {
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 1.25rem; margin-bottom: 1.75rem;
}
.hero-card, .panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.hero-card {
  padding: 1.75rem;
  position: relative; overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.97) 0%, rgba(232, 242, 255, 0.95) 100%);
  border-color: var(--border-strong);
}
.hero-card::before {
  content: "";
  position: absolute; top: -30%; right: -8%;
  width: 240px; height: 240px; border-radius: 50%;
  background: radial-gradient(circle, rgba(21,101,192,0.12), transparent 70%);
}
.hero-card::after {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0; width: 4px;
  background: linear-gradient(180deg, #0d47a1, #0891b2, #c9a227);
  border-radius: 16px 0 0 16px;
}
.kicker {
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.08em;
  color: var(--blue); text-transform: uppercase; margin-bottom: 0.7rem; font-weight: 600;
}
.hero-card h1 {
  font-family: var(--serif); font-weight: 400; font-size: clamp(1.75rem, 3.4vw, 2.45rem);
  line-height: 1.15; margin-bottom: 0.8rem; max-width: 18ch; color: var(--navy);
}
.hero-card h1 em { font-style: italic; color: var(--blue); }
.hero-card p.lead { color: var(--text-soft); max-width: 52ch; margin-bottom: 1.25rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.65rem; position: relative; z-index: 1; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  padding: 0.72rem 1.15rem; border-radius: 12px; font-weight: 700; font-size: 0.9rem;
  transition: 0.2s transform, 0.2s box-shadow, 0.2s background;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: linear-gradient(135deg, #0d47a1, #1565c0);
  color: #fff;
  box-shadow: 0 8px 22px rgba(13, 71, 161, 0.28);
}
.btn-primary:hover { box-shadow: 0 12px 28px rgba(13, 71, 161, 0.35); }
.btn-secondary {
  background: #fff;
  border: 1px solid var(--border-strong);
  color: var(--navy);
  box-shadow: 0 2px 8px rgba(15,39,68,0.05);
}
.btn-ghost {
  color: var(--cyan);
  border: 1px solid rgba(8, 145, 178, 0.35);
  background: rgba(8, 145, 178, 0.06);
}
.btn-danger {
  background: rgba(220, 38, 38, 0.08);
  color: #b91c1c;
  border: 1px solid rgba(220, 38, 38, 0.25);
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.stats-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; padding: 1.15rem;
  background:
    linear-gradient(160deg, #fff 0%, #f0f7ff 100%);
}
.stat {
  background: #fff;
  border-radius: var(--radius-sm);
  padding: 0.95rem;
  border: 1px solid var(--border);
  box-shadow: 0 2px 10px rgba(15,39,68,0.04);
}
.stat strong {
  display: block; font-size: 1.55rem; color: var(--blue);
  font-variant-numeric: tabular-nums; line-height: 1.1;
}
.stat span { font-size: 0.78rem; color: var(--muted); font-weight: 500; }

/* Section heads */
.section-head {
  display: flex; align-items: end; justify-content: space-between;
  gap: 1rem; margin: 0 0 1rem; flex-wrap: wrap;
}
.section-head h2 {
  font-family: var(--serif); font-weight: 400; font-size: 1.65rem; color: var(--navy);
}
.section-head p { color: var(--muted); font-size: 0.92rem; max-width: 48ch; }

/* Cards grid */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.mod-card, .tool-card, .news-card, .lesson-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem;
  transition: 0.2s border, 0.2s transform, 0.2s box-shadow;
  cursor: pointer; text-align: left; width: 100%;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.mod-card::before, .tool-card::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, #0d47a1, #0891b2);
  opacity: 0;
  transition: 0.2s;
}
.mod-card:hover, .tool-card:hover, .lesson-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}
.mod-card:hover::before, .tool-card:hover::before { opacity: 1; }
.mod-card .ico, .tool-card .ico { font-size: 1.5rem; margin-bottom: 0.55rem; display: block; }
.mod-card h3, .tool-card h3, .lesson-card h3 { font-size: 1.05rem; margin-bottom: 0.35rem; color: var(--navy); }
.mod-card p, .tool-card p, .lesson-card p, .news-card p { color: var(--muted); font-size: 0.88rem; }
.mod-meta { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.85rem; }
.tag {
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.04em;
  padding: 0.22rem 0.5rem; border-radius: 999px;
  background: #eef3f9; color: var(--muted);
}
.tag.done { background: #dcfce7; color: #166534; }
.tag.progress { background: #fef3c7; color: #92400e; }
.tag.todo { background: #eef3f9; color: var(--muted); }
.tag.hard { background: #fee2e2; color: #991b1b; }
.bar {
  height: 6px; border-radius: 999px; background: #e2eaf4;
  overflow: hidden; margin-top: 0.85rem;
}
.bar > i {
  display: block; height: 100%; border-radius: inherit;
  background: linear-gradient(90deg, #0d47a1, #0891b2);
  width: var(--w, 0%); transition: width 0.4s ease;
}

/* Lesson reader */
.reader-layout { display: grid; grid-template-columns: 260px 1fr; gap: 1.25rem; }
.toc {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem; height: fit-content;
  position: sticky; top: calc(var(--header-h) + 1rem);
  box-shadow: var(--shadow);
}
.toc h3 {
  font-size: 0.75rem; color: var(--blue); letter-spacing: 0.08em;
  text-transform: uppercase; margin-bottom: 0.7rem; font-weight: 700;
}
.toc button {
  display: block; width: 100%; text-align: left; padding: 0.55rem 0.65rem;
  border-radius: 8px; color: var(--text-soft); font-size: 0.86rem; margin-bottom: 0.2rem;
  font-weight: 500;
}
.toc button:hover, .toc button.active {
  background: rgba(21, 101, 192, 0.08); color: var(--navy);
}
.toc button .st { float: right; font-size: 0.72rem; opacity: 0.8; color: var(--green); }
.lesson-body {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem 1.6rem 2rem;
  box-shadow: var(--shadow);
}
.lesson-body h2 {
  font-family: var(--serif); font-weight: 400; font-size: 1.85rem;
  margin-bottom: 0.35rem; color: var(--navy);
}
.lesson-body .meta { color: var(--muted); font-size: 0.85rem; margin-bottom: 1.25rem; }
.lesson-body h3 {
  margin: 1.4rem 0 0.55rem; font-size: 1.1rem; color: var(--blue);
}
.lesson-body p, .lesson-body li { color: var(--text-soft); margin-bottom: 0.75rem; }
.lesson-body a { color: var(--blue); text-decoration: underline; text-underline-offset: 2px; font-weight: 600; }
.lesson-body a:hover { color: var(--cyan); }
.lesson-body ul, .lesson-body ol { margin: 0.4rem 0 1rem 0.2rem; }
.lesson-body li { padding-left: 1.1rem; position: relative; }
.lesson-body ul li::before {
  content: "◆"; position: absolute; left: 0; color: var(--blue); font-size: 0.55rem; top: 0.45rem;
}
.lesson-body ol { counter-reset: n; }
.lesson-body ol li { counter-increment: n; }
.lesson-body ol li::before {
  content: counter(n) "."; position: absolute; left: 0; color: var(--cyan); font-weight: 700; font-size: 0.85rem;
}
.callout {
  border-left: 4px solid var(--blue);
  background: linear-gradient(90deg, rgba(21,101,192,0.08), rgba(8,145,178,0.04));
  padding: 0.95rem 1.05rem; border-radius: 0 12px 12px 0;
  margin: 1rem 0; color: var(--text-soft); font-size: 0.92rem;
  border: 1px solid var(--border);
  border-left-width: 4px;
}
.callout strong { color: var(--navy); }
.table-wrap { overflow-x: auto; margin: 1rem 0; border-radius: 12px; border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
th, td {
  border-bottom: 1px solid var(--border); padding: 0.7rem 0.85rem; text-align: left;
}
th {
  background: linear-gradient(180deg, #e8f1fb, #dfeaf8);
  color: var(--navy); font-weight: 700;
}
td { color: var(--text-soft); background: #fff; }
tr:last-child td { border-bottom: none; }
.lesson-actions {
  display: flex; flex-wrap: wrap; gap: 0.65rem; margin-top: 1.5rem;
  padding-top: 1.25rem; border-top: 1px solid var(--border);
}

/* News / timeline */
.timeline { display: grid; gap: 0.85rem; }
.news-card {
  cursor: default; display: grid; grid-template-columns: 110px 1fr; gap: 1rem; align-items: start;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.news-date {
  font-family: var(--mono); font-size: 0.75rem; color: var(--blue); font-weight: 600;
  padding-top: 0.15rem;
}
.news-card h3 { font-size: 1rem; margin-bottom: 0.3rem; color: var(--navy); }
.badge {
  display: inline-block; font-size: 0.68rem; font-weight: 700;
  padding: 0.15rem 0.45rem; border-radius: 6px; margin-right: 0.35rem;
}
.badge.law { background: #dbeafe; color: #1e40af; }
.badge.acn { background: #fef3c7; color: #92400e; }
.badge.tip { background: #cffafe; color: #0e7490; }
.badge.clusit { background: #e0e7ff; color: #3730a3; }

/* Policies */
.policy-list { display: grid; gap: 0.85rem; }
.policy-item {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.15rem 1.25rem;
  box-shadow: var(--shadow);
}
.policy-item h3 { font-size: 1.05rem; margin-bottom: 0.35rem; color: var(--navy); }
.policy-item p { color: var(--muted); font-size: 0.9rem; margin-bottom: 0.7rem; }
.checklist { display: grid; gap: 0.4rem; }
.checklist label {
  display: flex; gap: 0.55rem; align-items: flex-start;
  font-size: 0.88rem; color: var(--text-soft); cursor: pointer;
  padding: 0.4rem 0.5rem; border-radius: 8px;
}
.checklist label:hover { background: var(--card-alt); }
.checklist input { margin-top: 0.25rem; accent-color: var(--blue); }

/* Quiz */
.quiz-shell {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.4rem;
  box-shadow: var(--shadow-lg);
}
.quiz-top {
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  margin-bottom: 1.1rem; align-items: center;
}
.quiz-top h2 { font-family: var(--serif); font-weight: 400; font-size: 1.45rem; color: var(--navy); }
.q-progress { font-family: var(--mono); font-size: 0.8rem; color: var(--muted); font-weight: 600; }
.q-card {
  background: linear-gradient(180deg, #f8fbff, #fff);
  border-radius: var(--radius-sm);
  padding: 1.2rem; border: 1px solid var(--border);
}
.q-card h3 { font-size: 1.08rem; margin-bottom: 1rem; line-height: 1.45; color: var(--navy); }
.options { display: grid; gap: 0.55rem; }
.opt {
  text-align: left; padding: 0.85rem 1rem; border-radius: 12px;
  border: 1px solid var(--border); background: #fff;
  transition: 0.15s; color: var(--text); font-weight: 500;
}
.opt:hover:not(:disabled) {
  border-color: var(--blue); background: rgba(21, 101, 192, 0.05);
}
.opt.selected { border-color: var(--blue); background: rgba(21, 101, 192, 0.08); }
.opt.correct { border-color: var(--ok); background: #dcfce7; color: #14532d; }
.opt.wrong { border-color: var(--bad); background: #fee2e2; color: #7f1d1d; }
.feedback {
  margin-top: 1rem; padding: 0.85rem 1rem; border-radius: 10px; font-size: 0.9rem;
}
.feedback.ok { background: #dcfce7; color: #14532d; }
.feedback.ko { background: #fee2e2; color: #7f1d1d; }
.quiz-actions { display: flex; gap: 0.65rem; margin-top: 1.1rem; flex-wrap: wrap; }

/* Crossword */
.xword-layout { display: grid; grid-template-columns: 1fr 320px; gap: 1.25rem; align-items: start; }
.xword-board-wrap {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem; overflow: auto;
  box-shadow: var(--shadow);
}
.xword-grid {
  display: grid; gap: 2px; margin: 0 auto; width: fit-content;
  background: #c5d4e8; padding: 3px; border-radius: 8px;
}
.xcell {
  width: 34px; height: 34px; position: relative;
  background: transparent;
}
.xcell.block { background: transparent; }
.xcell input {
  width: 100%; height: 100%; border: none; background: #fff; color: var(--navy);
  text-align: center; text-transform: uppercase; font-weight: 700; font-size: 0.95rem;
  border-radius: 3px; padding: 0;
  box-shadow: inset 0 0 0 1px #b8c9de;
}
.xcell input:focus { outline: 2px solid var(--blue); background: #eef6ff; }
.xcell input.ok { background: #dcfce7; box-shadow: inset 0 0 0 1px #86efac; }
.xcell input.ko { background: #fee2e2; box-shadow: inset 0 0 0 1px #fca5a5; }
.xcell .num {
  position: absolute; top: 1px; left: 2px; font-size: 0.55rem; color: #475569; font-weight: 700;
  pointer-events: none; z-index: 1;
}
.clues {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.1rem; max-height: 70vh; overflow: auto;
  box-shadow: var(--shadow);
}
.clues h3 { font-size: 0.95rem; color: var(--blue); margin: 0.8rem 0 0.45rem; font-weight: 700; }
.clues h3:first-child { margin-top: 0; }
.clue {
  font-size: 0.84rem; color: var(--text-soft); padding: 0.35rem 0.4rem; border-radius: 6px;
  cursor: pointer; margin-bottom: 0.15rem;
}
.clue:hover, .clue.active { background: rgba(21, 101, 192, 0.08); }
.clue.done { color: var(--green); }
.clue strong { color: var(--blue); margin-right: 0.3rem; font-family: var(--mono); font-size: 0.78rem; }

/* Assessment / results */
.score-hero {
  text-align: center; padding: 2rem 1.25rem;
  background: linear-gradient(160deg, #fff 0%, #e8f1fb 100%);
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  margin-bottom: 1.25rem; box-shadow: var(--shadow-lg);
  position: relative; overflow: hidden;
}
.score-hero::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(21,101,192,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(21,101,192,0.04) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
}
.score-hero .big {
  font-family: var(--serif); font-size: clamp(3rem, 8vw, 4.5rem);
  line-height: 1; color: var(--blue); position: relative;
}
.score-hero .level {
  display: inline-block; margin-top: 0.6rem; padding: 0.35rem 0.85rem;
  border-radius: 999px; font-weight: 700; font-size: 0.85rem;
}
.level.pro { background: #dcfce7; color: #166534; }
.level.mid { background: #fef3c7; color: #92400e; }
.level.low { background: #fee2e2; color: #991b1b; }
.domain-bars { display: grid; gap: 0.75rem; }
.domain-row {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 0.9rem 1rem;
  box-shadow: var(--shadow);
}
.domain-row header {
  display: flex; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.45rem;
  font-size: 0.9rem; color: var(--navy);
}
.domain-row header span { color: var(--muted); font-family: var(--mono); font-size: 0.8rem; }
.plan-list { display: grid; gap: 0.75rem; }
.plan-item {
  display: grid; grid-template-columns: auto 1fr auto; gap: 0.9rem; align-items: center;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem 1.1rem;
  box-shadow: var(--shadow);
}
.plan-item .prio {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
  font-weight: 800; font-size: 0.85rem;
}
.prio.high { background: #fee2e2; color: #991b1b; }
.prio.med { background: #fef3c7; color: #92400e; }
.prio.low { background: #dcfce7; color: #166534; }
.plan-item h4 { font-size: 0.98rem; margin-bottom: 0.2rem; color: var(--navy); }
.plan-item p { font-size: 0.84rem; color: var(--muted); }

/* Glossary */
.glossary-search {
  width: 100%; max-width: 420px; padding: 0.75rem 1rem; border-radius: 12px;
  border: 1px solid var(--border); background: #fff;
  margin-bottom: 1rem; box-shadow: var(--shadow);
  color: var(--text);
}
.glossary-search:focus { outline: 2px solid rgba(21,101,192,0.35); border-color: var(--blue); }
.glossary-list { display: grid; gap: 0.65rem; }
.g-item {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 0.95rem 1.05rem;
  box-shadow: var(--shadow);
}
.g-item h3 { font-size: 1rem; color: var(--blue); margin-bottom: 0.3rem; }
.g-item p { color: var(--muted); font-size: 0.9rem; }

/* Flashcards */
.flash { min-height: 180px; perspective: 1000px; cursor: pointer; }
.flash-inner {
  position: relative; width: 100%; min-height: 180px; transition: transform 0.5s;
  transform-style: preserve-3d;
}
.flash.flipped .flash-inner { transform: rotateY(180deg); }
.flash-face {
  position: absolute; inset: 0; backface-visibility: hidden;
  background: #fff; border: 1px solid var(--border-strong); border-radius: var(--radius);
  display: grid; place-items: center; padding: 1.25rem; text-align: center;
  box-shadow: var(--shadow-lg);
  color: var(--navy);
}
.flash-face.back {
  transform: rotateY(180deg);
  background: linear-gradient(145deg, #e8f1fb, #fff);
  border-color: var(--blue);
}
.flash-face p { font-size: 1.05rem; }

.muted { color: var(--muted); }
.center { text-align: center; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 1rem; }
.flex-row { display: flex; gap: 0.65rem; flex-wrap: wrap; align-items: center; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); border: 0;
}

.picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0.85rem; }

footer.site-foot {
  border-top: 1px solid var(--border);
  padding: 1.35rem 0 1.85rem;
  color: var(--muted);
  font-size: 0.82rem;
  background: linear-gradient(180deg, transparent, rgba(21,101,192,0.04));
}
footer.site-foot .container {
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}
footer.site-foot strong { color: var(--navy); }
footer.site-foot a { color: var(--blue); font-weight: 600; }

/* Toast light */
#toast {
  background: #fff !important;
  color: var(--navy) !important;
  border: 1px solid var(--border-strong) !important;
  box-shadow: var(--shadow-lg) !important;
}

/* Responsive */
@media (max-width: 960px) {
  .hero, .reader-layout, .xword-layout, .news-card { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .toc { position: static; }
  .nav { display: none; }
  .nav.open {
    display: flex; flex-direction: column; position: absolute; top: var(--header-h);
    left: 0; right: 0; background: rgba(255,255,255,0.98); padding: 1rem;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
  }
  .menu-btn { display: grid; place-items: center; margin-left: auto; }
  .progress-pill { display: none; }
  .nis-pills { margin-left: 0; width: 100%; }
  .app-shell::before { opacity: 0.04; }
}
@media (max-width: 640px) {
  .grid-3, .grid-2, .stats-grid, .plan-item { grid-template-columns: 1fr; }
  .xcell, .xcell input { width: 28px; height: 28px; font-size: 0.8rem; }
  .hero-card { padding: 1.25rem; }
  .nis-banner-inner { padding: 0.85rem 0; }
}

/* ═══════════════════════════════════════════
   NEWS TICKER (scorrimento + emoticon)
   ═══════════════════════════════════════════ */
.news-ticker {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  align-items: stretch;
  height: 40px;
  background: linear-gradient(90deg, #0d47a1 0%, #1565c0 40%, #0277bd 100%);
  color: #fff;
  border-bottom: 2px solid #c9a227;
  box-shadow: 0 4px 16px rgba(13, 71, 161, 0.2);
  overflow: hidden;
}
.news-ticker-label {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0 0.85rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  background: rgba(0, 0, 0, 0.18);
  border-right: 1px solid rgba(255, 255, 255, 0.15);
  z-index: 2;
}
.news-ticker-live {
  width: 8px; height: 8px; border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.55);
  animation: ticker-live 1.5s ease-out infinite;
}
@keyframes ticker-live {
  0% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.55); }
  70% { box-shadow: 0 0 0 7px rgba(74, 222, 128, 0); }
  100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}
.news-ticker-viewport {
  flex: 1;
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 3%, #000 97%, transparent);
}
.news-ticker-track {
  display: flex;
  align-items: center;
  gap: 0;
  width: max-content;
  height: 100%;
  animation: ticker-scroll 55s linear infinite;
  will-change: transform;
}
.news-ticker:hover .news-ticker-track { animation-play-state: paused; }
@keyframes ticker-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.2rem 0.5rem;
  white-space: nowrap;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: help;
  border-radius: 8px;
  transition: background 0.15s;
}
.ticker-item:hover,
.ticker-item:focus {
  background: rgba(255, 255, 255, 0.14);
  outline: none;
}
.ticker-emoji { font-size: 1rem; line-height: 1; }
.ticker-tag {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 0.15rem 0.4rem;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.25);
}
.ticker-text { opacity: 0.95; }
.ticker-sep {
  display: inline-flex;
  align-items: center;
  padding: 0 0.85rem;
  color: rgba(255, 255, 255, 0.35);
  font-size: 0.55rem;
}

/* ═══════════════════════════════════════════
   BARRA FISSA DESTRA — conferenze / agenda
   ═══════════════════════════════════════════ */
:root { --events-rail-w: 300px; }

body.has-events-rail.events-rail-open .app-shell {
  margin-right: var(--events-rail-w);
  transition: margin-right 0.25s ease;
}
body.has-events-rail .app-shell {
  transition: margin-right 0.25s ease;
}

.events-rail {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: var(--events-rail-w);
  z-index: 80;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #ffffff 0%, #f3f8ff 100%);
  border-left: 1px solid rgba(21, 101, 192, 0.18);
  box-shadow: -12px 0 40px rgba(15, 39, 68, 0.1);
  transform: translateX(105%);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
.events-rail.open { transform: translateX(0); }

.events-rail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.9rem 0.95rem 0.55rem;
  border-bottom: 1px solid rgba(21, 101, 192, 0.12);
  background: linear-gradient(135deg, #0d47a1, #1565c0);
  color: #fff;
}
.events-rail-kicker {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  opacity: 0.9;
  margin-bottom: 0.15rem;
}
.events-rail-head strong {
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.25;
}
.events-rail-close {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 1.25rem;
  line-height: 1;
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.events-rail-close:hover { background: rgba(255, 255, 255, 0.28); }
.events-rail-note {
  padding: 0.55rem 0.95rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  background: rgba(21, 101, 192, 0.05);
  border-bottom: 1px solid rgba(21, 101, 192, 0.08);
}
.events-rail-list {
  flex: 1;
  overflow: auto;
  padding: 0.65rem 0.7rem 1rem;
  display: grid;
  gap: 0.55rem;
  align-content: start;
}
.event-card {
  display: block;
  padding: 0.75rem 0.8rem;
  border-radius: 12px;
  background: #fff;
  border: 1px solid rgba(21, 101, 192, 0.12);
  box-shadow: 0 4px 14px rgba(15, 39, 68, 0.05);
  transition: 0.18s transform, 0.18s border-color, 0.18s box-shadow;
  border-left: 3px solid #1565c0;
}
.event-card:hover {
  transform: translateY(-2px);
  border-color: rgba(21, 101, 192, 0.35);
  box-shadow: 0 8px 22px rgba(15, 39, 68, 0.1);
}
.event-card.org-clusit { border-left-color: #5c6bc0; }
.event-card.org-acn { border-left-color: #0d47a1; }
.event-card.org-csirt { border-left-color: #c62828; }
.event-card.org-enisa { border-left-color: #0277bd; }
.event-card.org-idc { border-left-color: #00897b; }
.event-card-top {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.35rem;
  flex-wrap: wrap;
}
.event-emoji { font-size: 1rem; }
.event-org {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #0d47a1;
  background: rgba(21, 101, 192, 0.08);
  padding: 0.12rem 0.4rem;
  border-radius: 5px;
}
.event-status {
  margin-left: auto;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6b7f96;
  background: #f0f4f8;
  padding: 0.12rem 0.35rem;
  border-radius: 5px;
}
.event-title {
  display: block;
  font-size: 0.86rem;
  color: #0b1f3a;
  line-height: 1.35;
  margin-bottom: 0.4rem;
  font-weight: 700;
}
.event-meta {
  display: grid;
  gap: 0.15rem;
  font-size: 0.72rem;
  color: #5a6f88;
  font-weight: 500;
}
.events-rail-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.65rem;
  padding: 0.7rem 0.9rem 0.85rem;
  border-top: 1px solid rgba(21, 101, 192, 0.12);
  background: #fff;
  font-size: 0.72rem;
  font-weight: 700;
}
.events-rail-foot a { color: #1565c0; }

.events-fab {
  position: fixed;
  right: 1rem;
  bottom: 1.1rem;
  z-index: 85;
  display: none;
  align-items: center;
  gap: 0.4rem;
  padding: 0.7rem 1rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #0d47a1, #1565c0);
  color: #fff;
  font-weight: 800;
  font-size: 0.85rem;
  box-shadow: 0 12px 30px rgba(13, 71, 161, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.events-fab span { letter-spacing: 0.02em; }

/* header sticky sotto ticker */
body.has-events-rail .header { top: 40px; }
body.has-events-rail .toc { top: calc(var(--header-h) + 40px + 1rem); }

@media (max-width: 1099px) {
  body.has-events-rail.events-rail-open .app-shell { margin-right: 0; }
  .events-rail {
    width: min(340px, 92vw);
    box-shadow: -16px 0 50px rgba(15, 39, 68, 0.2);
  }
  .events-fab { display: inline-flex; }
  body.events-rail-open .events-fab { right: calc(min(340px, 92vw) + 0.5rem); }
}
@media (min-width: 1100px) {
  .events-fab { display: none; }
  body.has-events-rail.events-rail-open .events-fab { display: none; }
}
@media (max-width: 640px) {
  .news-ticker-label { padding: 0 0.55rem; font-size: 0.65rem; }
  .ticker-item { font-size: 0.78rem; }
}

/* ═══════════════════════════════════════════
   AUTH + GDPR
   ═══════════════════════════════════════════ */
.auth-slot { display: flex; align-items: center; gap: 0.4rem; margin-left: 0.35rem; }
.btn-auth-nav {
  padding: 0.45rem 0.85rem !important;
  font-size: 0.82rem !important;
  border-radius: 10px !important;
}
.btn-logout {
  font-size: 0.78rem;
  font-weight: 700;
  color: #0d47a1;
  padding: 0.35rem 0.65rem;
  border-radius: 8px;
  border: 1px solid rgba(21,101,192,0.2);
  background: #fff;
}
.btn-logout:hover { background: #e3f2fd; }
.auth-user-btn { font-weight: 700 !important; color: #0d47a1 !important; }
.gdpr-header-link { display: flex; align-items: center; margin-left: 0.25rem; }
.gdpr-mini-badge {
  display: inline-flex; align-items: center; gap: 0.3rem;
  font-size: 0.68rem; font-weight: 800; letter-spacing: 0.06em;
  color: #1b5e20; background: #e8f5e9; border: 1px solid rgba(46,125,50,0.25);
  padding: 0.2rem 0.45rem; border-radius: 999px;
}
.gdpr-inline {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.65rem;
  margin-bottom: 1rem; position: relative; z-index: 1;
}
.gdpr-badge-lg { filter: drop-shadow(0 8px 20px rgba(21,101,192,0.2)); }

.auth-layout {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 1.25rem;
  align-items: stretch;
  margin-bottom: 1rem;
}
.auth-hero-panel {
  background: linear-gradient(155deg, #0d47a1 0%, #1565c0 45%, #0277bd 100%);
  color: #fff;
  border-radius: 20px;
  padding: 1.75rem 1.8rem;
  box-shadow: 0 20px 50px rgba(13,71,161,0.25);
  position: relative;
  overflow: hidden;
}
.auth-hero-panel::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.06) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: 0.5;
  pointer-events: none;
}
.auth-hero-panel > * { position: relative; z-index: 1; }
.auth-hero-panel .kicker { color: #bbdefb; }
.auth-hero-panel h1 {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(1.6rem, 3vw, 2.2rem); line-height: 1.2;
  margin: 0.5rem 0 0.75rem; max-width: 16ch;
}
.auth-hero-panel h1 em { font-style: italic; color: #ffe082; }
.auth-hero-panel .lead { color: rgba(255,255,255,0.9); margin-bottom: 1rem; max-width: 40ch; }
.auth-trust { list-style: none; margin: 0 0 1rem; padding: 0; }
.auth-trust li {
  font-size: 0.9rem; padding: 0.35rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.95);
}
.auth-hero-panel .auth-trust li { border-color: rgba(255,255,255,0.12); }
.policy-item .auth-trust li { color: var(--text-soft); border-color: var(--border); }
.auth-trust-badges { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.pill-secure {
  font-size: 0.68rem; font-weight: 800; letter-spacing: 0.04em;
  padding: 0.3rem 0.55rem; border-radius: 999px;
  background: rgba(255,255,255,0.14); border: 1px solid rgba(255,255,255,0.25);
}

.auth-card {
  background: #fff;
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  padding: 1.35rem 1.4rem 1.2rem;
  box-shadow: var(--shadow-lg);
}
.auth-tabs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.35rem;
  background: #eef4fb; padding: 0.3rem; border-radius: 12px; margin-bottom: 1.1rem;
}
.auth-tab {
  padding: 0.65rem; border-radius: 10px; font-weight: 700; font-size: 0.9rem;
  color: var(--muted); transition: 0.15s;
}
.auth-tab.active {
  background: #fff; color: #0d47a1;
  box-shadow: 0 4px 12px rgba(15,39,68,0.08);
}
.auth-form { display: grid; gap: 0.75rem; }
.auth-form label {
  display: grid; gap: 0.3rem;
  font-size: 0.82rem; font-weight: 700; color: var(--navy);
}
.auth-form input[type="text"],
.auth-form input[type="email"],
.auth-form input[type="password"] {
  width: 100%;
  padding: 0.75rem 0.85rem;
  border-radius: 11px;
  border: 1px solid var(--border-strong);
  background: #fbfdff;
  font-weight: 500;
  color: var(--text);
}
.auth-form input:focus {
  outline: 2px solid rgba(21,101,192,0.3);
  border-color: var(--blue);
  background: #fff;
}
.auth-form .check-line {
  display: flex; gap: 0.55rem; align-items: flex-start;
  font-weight: 500; font-size: 0.82rem; color: var(--text-soft);
  padding: 0.35rem 0;
}
.auth-form .check-line input { margin-top: 0.2rem; accent-color: var(--blue); flex-shrink: 0; }
.auth-form .check-line a { color: var(--blue); font-weight: 700; text-decoration: underline; }
.auth-form .optional { opacity: 0.9; }
.auth-error {
  background: #fee2e2; color: #991b1b; border: 1px solid #fecaca;
  padding: 0.65rem 0.8rem; border-radius: 10px; font-size: 0.85rem; font-weight: 600;
}
.auth-hint { font-size: 0.8rem; color: var(--muted); margin: 0; line-height: 1.45; }
.btn-block { width: 100%; }
.auth-legal {
  margin-top: 1rem; text-align: center;
  font-size: 0.75rem; color: var(--muted);
}
.auth-legal a { color: var(--blue); font-weight: 700; }

body.auth-locked .events-rail,
body.auth-locked .events-fab,
body.auth-locked .news-ticker { display: none !important; }
body.auth-locked .header { top: 0; }
body.auth-locked .app-shell { margin-right: 0 !important; }
body.auth-locked .nis-banner { display: none; }
body.auth-locked {
  background: #e8f1fb;
}
body.auth-locked .bg-grid {
  background:
    radial-gradient(ellipse 90% 60% at 10% 0%, rgba(30, 136, 229, 0.18), transparent 55%),
    radial-gradient(ellipse 70% 50% at 95% 15%, rgba(8, 145, 178, 0.12), transparent 50%),
    radial-gradient(ellipse 60% 40% at 50% 100%, rgba(13, 71, 161, 0.1), transparent 55%),
    linear-gradient(180deg, #e3eef9 0%, #f0f6fc 45%, #eaf2fa 100%);
}
body.auth-locked .bg-grid::before {
  opacity: 0.55;
  animation: auth-grid-drift 18s linear infinite;
}
body.auth-locked .bg-grid::after {
  opacity: 0.09;
  animation: auth-hex-drift 28s linear infinite;
}
@keyframes auth-grid-drift {
  from { transform: translateY(0); }
  to { transform: translateY(40px); }
}
@keyframes auth-hex-drift {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-28px, 50px, 0); }
}

/* Sfondo cyber animato pagina login */
.auth-stage {
  position: relative;
  min-height: calc(100vh - var(--header-h) - 3rem);
  padding: 0.5rem 0 1.5rem;
}
.auth-cyber-bg {
  position: absolute;
  inset: -0.5rem -0.25rem 0;
  z-index: 0;
  pointer-events: none;
  border-radius: 24px;
  overflow: hidden;
}
.auth-cyber-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.55;
  animation: auth-glow-float 10s ease-in-out infinite alternate;
}
.auth-cyber-glow-a {
  width: min(420px, 70vw); height: min(420px, 70vw);
  left: -8%; top: 5%;
  background: radial-gradient(circle, rgba(66, 165, 245, 0.45), transparent 70%);
}
.auth-cyber-glow-b {
  width: min(360px, 60vw); height: min(360px, 60vw);
  right: -6%; bottom: 8%;
  background: radial-gradient(circle, rgba(3, 169, 244, 0.28), transparent 70%);
  animation-delay: -4s;
}
@keyframes auth-glow-float {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(18px, -14px, 0) scale(1.08); }
}
.auth-cyber-hex {
  position: absolute; inset: 0;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='100' viewBox='0 0 28 50'%3E%3Cpath fill='none' stroke='%231565c0' stroke-width='1' d='M14 1l12 7v14l-12 7L2 22V8z'/%3E%3C/svg%3E");
  background-size: 48px 86px;
  animation: auth-hex-drift 22s linear infinite;
}
#auth-cyber-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0.95;
}
.auth-cyber-vignette {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 80% 70% at 50% 40%, transparent 30%, rgba(232, 241, 251, 0.55) 100%);
}
.auth-stage .auth-layout {
  position: relative;
  z-index: 1;
}

.footer-gdpr-row { align-items: center; }

/* ═══ Livelli (lista ordinata 1-2-3, bottoni azioni sempre visibili) ═══ */
#view-levels.active {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  min-height: 70vh;
}
.levels-page {
  max-width: 780px;
  margin: 0 auto;
  padding: 0.5rem 0 3rem;
  position: relative;
  z-index: 2;
}
.lv-header .kicker {
  margin: 0 0 0.35rem;
}
.lv-header h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  color: var(--navy);
  margin: 0 0 0.5rem;
}
.lv-header > p {
  color: var(--muted);
  font-size: 1rem;
  margin: 0 0 0.85rem;
  line-height: 1.55;
}
.lv-status {
  display: block;
  padding: 0.85rem 1.1rem;
  border-radius: 12px;
  background: #fff3e0;
  border: 2px solid #ffb74d;
  color: #5d4037;
  font-weight: 700;
  font-size: 0.98rem;
  margin: 0 0 1rem !important;
}
.lv-status.ok {
  background: #e8f5e9;
  border-color: #66bb6a;
  color: #1b5e20;
}
.lv-list {
  list-style: none;
  margin: 1.25rem 0 1.5rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.lv-list > li { margin: 0; padding: 0; }
.lv-btn {
  width: 100%;
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 1.15rem;
  align-items: start;
  text-align: left;
  padding: 1.4rem 1.45rem;
  min-height: 120px;
  border-radius: 16px;
  border: 2px solid #c5d4e8;
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 39, 68, 0.07);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s, transform 0.12s;
  -webkit-tap-highlight-color: rgba(21, 101, 192, 0.2);
  touch-action: manipulation;
  user-select: none;
  position: relative;
  z-index: 3;
  pointer-events: auto !important;
}
.lv-btn:hover {
  border-color: #1565c0;
  box-shadow: 0 12px 28px rgba(21, 101, 192, 0.14);
  transform: translateY(-1px);
}
.lv-btn:active {
  transform: translateY(0);
}
.lv-btn.is-selected {
  border-color: #0d47a1;
  background: #e3f2fd;
  box-shadow: 0 0 0 3px rgba(13, 71, 161, 0.18);
}
.lv-num {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 1.4rem;
  font-weight: 800;
  color: #fff;
  background: #1565c0;
  flex-shrink: 0;
  pointer-events: none;
}
#lv-btn-1 .lv-num { background: #2e7d32; }
#lv-btn-2 .lv-num { background: #ef6c00; }
#lv-btn-3 .lv-num { background: #6a1b9a; }
.lv-btn.is-selected#lv-btn-1 { border-color: #2e7d32; background: #e8f5e9; box-shadow: 0 0 0 3px rgba(46,125,50,0.18); }
.lv-btn.is-selected#lv-btn-2 { border-color: #ef6c00; background: #fff3e0; box-shadow: 0 0 0 3px rgba(239,108,0,0.18); }
.lv-btn.is-selected#lv-btn-3 { border-color: #6a1b9a; background: #f3e5f5; box-shadow: 0 0 0 3px rgba(106,27,154,0.18); }
.lv-body {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
  pointer-events: none; /* click passa al button */
}
.lv-body strong {
  font-size: 1.08rem;
  color: var(--navy);
  font-weight: 700;
  line-height: 1.3;
}
.lv-body em {
  font-style: normal;
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.45;
}
.lv-facts {
  margin: 0.45rem 0 0;
  padding: 0 0 0 1.1rem;
  list-style: disc;
  color: #37474f;
  font-size: 0.86rem;
  line-height: 1.45;
}
.lv-facts li {
  margin: 0.2rem 0;
}
.lv-action {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #1565c0;
  white-space: nowrap;
  padding: 0.55rem 0.8rem;
  border-radius: 10px;
  background: #e3f2fd;
  align-self: center;
  pointer-events: none;
}
.lv-btn.is-selected .lv-action {
  background: #0d47a1;
  color: #fff;
}
#lv-btn-1.is-selected .lv-action { background: #2e7d32; }
#lv-btn-2.is-selected .lv-action { background: #ef6c00; }
#lv-btn-3.is-selected .lv-action { background: #6a1b9a; }

.lv-next {
  margin: 0 0 0.25rem;
  padding: 1.25rem 1.35rem;
  border-radius: 16px;
  background: #e8f5e9;
  border: 2px solid #66bb6a;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  position: relative;
  z-index: 4;
}
.lv-next-top {
  margin-bottom: 0.25rem;
  box-shadow: 0 8px 22px rgba(46, 125, 50, 0.12);
}
.lv-next.is-ready {
  background: #c8e6c9;
  border-color: #43a047;
}
.lv-next-bottom {
  margin-top: 0.5rem;
  background: #e3f2fd;
  border-color: #64b5f6;
}
.lv-next-bottom p {
  color: #0d47a1 !important;
}
.lv-next p {
  margin: 0 0 0.9rem;
  color: #1b5e20;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.45;
}
.lv-next-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}
.lv-next .btn,
.btn-lv-action {
  margin: 0 !important;
  min-width: 132px;
  min-height: 48px;
  padding: 0.9rem 1.2rem !important;
  font-size: 0.95rem !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  pointer-events: auto !important;
  position: relative;
  z-index: 5;
  -webkit-tap-highlight-color: rgba(21, 101, 192, 0.25);
  touch-action: manipulation;
}

/* legacy badges usati altrove */
.diff-inline-banner {
  padding: 0.75rem 1rem; border-radius: 12px; margin-bottom: 1rem;
  background: #e3f2fd; border: 1px solid rgba(21,101,192,0.2); font-size: 0.9rem;
}
.diff-inline-banner.L2 { background: #fff3e0; border-color: rgba(245,124,0,0.3); }
.diff-inline-banner.L3 { background: #f3e5f5; border-color: rgba(123,31,162,0.3); }
.diff-home-pill {
  display: inline-block; margin-top: 0.75rem; padding: 0.4rem 0.75rem;
  border-radius: 999px; background: #e3f2fd; font-size: 0.85rem; font-weight: 600;
}
.diff-home-pill.L2 { background: #ffe0b2; }
.diff-home-pill.L3 { background: #e1bee7; }
.linkish {
  background: none; border: none; color: var(--blue); font-weight: 700;
  text-decoration: underline; cursor: pointer; font-size: inherit;
}
@media (max-width: 640px) {
  .lv-btn {
    grid-template-columns: 44px 1fr;
    gap: 0.85rem;
    padding: 1.15rem 1.1rem;
  }
  .lv-action {
    grid-column: 1 / -1;
    justify-self: stretch;
    text-align: center;
    padding: 0.7rem;
  }
  .lv-num { width: 40px; height: 40px; font-size: 1.15rem; }
  .lv-next .btn,
  .btn-lv-action {
    flex: 1 1 calc(50% - 0.5rem);
    min-width: 0;
  }
}

/* ═══ FX interattivi ═══ */
.fx-confetti {
  pointer-events: none; position: absolute; inset: 0; overflow: hidden; z-index: 20;
}
.fx-confetti i {
  position: absolute; top: -12px; width: 8px; height: 12px; border-radius: 2px;
  animation: confetti-fall linear forwards;
}
@keyframes confetti-fall {
  to { transform: translateY(110vh) rotate(720deg); opacity: 0.2; }
}
.fx-float {
  position: absolute; left: 50%; top: 30%; transform: translate(-50%, 0);
  font-weight: 800; font-size: 1.1rem; pointer-events: none; z-index: 15;
  animation: fx-float-up 0.85s ease-out forwards;
}
.fx-float.ok { color: #15803d; text-shadow: 0 2px 8px rgba(21,128,61,0.25); }
.fx-float.ko { color: #b91c1c; }
@keyframes fx-float-up {
  from { opacity: 1; transform: translate(-50%, 10px); }
  to { opacity: 0; transform: translate(-50%, -40px); }
}
.fx-shake { animation: fx-shake 0.4s ease; }
@keyframes fx-shake {
  0%,100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
}
.fx-pulse { animation: fx-pulse 0.45s ease; }
@keyframes fx-pulse {
  0% { box-shadow: 0 0 0 0 rgba(34,197,94,0.45); }
  100% { box-shadow: 0 0 0 18px rgba(34,197,94,0); }
}

/* Live HUD / cards */
.live-hud {
  display: flex; flex-wrap: wrap; gap: 0.45rem; margin-bottom: 0.65rem;
}
.live-hud-item {
  display: flex; flex-direction: column; min-width: 64px;
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  padding: 0.4rem 0.65rem; box-shadow: 0 4px 12px rgba(15,39,68,0.05);
}
.live-hud-item span { font-size: 0.65rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.live-hud-item strong { font-size: 1.05rem; color: var(--navy); font-variant-numeric: tabular-nums; }
.live-hud-item.combo.hot strong { color: #e65100; }
.live-hud-item.xp strong { color: #1565c0; }
.live-hud-item.timer.danger strong { color: #c62828; animation: pulse-timer 0.6s infinite alternate; }
@keyframes pulse-timer { from { transform: scale(1); } to { transform: scale(1.08); } }
.live-bar, .live-quiz .live-bar {
  height: 8px; border-radius: 999px; background: #e2eaf4; overflow: hidden; margin-bottom: 0.85rem;
}
.live-bar > i, .live-quiz .live-bar > i {
  display: block; height: 100%; width: var(--w, 0%);
  background: linear-gradient(90deg, #0d47a1, #29b6f6, #66bb6a);
  transition: width 0.35s ease; border-radius: inherit;
}
.live-card {
  position: relative;
  background: linear-gradient(165deg, #fff 0%, #f3f8ff 100%);
  border: 1px solid var(--border-strong);
  border-radius: 18px; padding: 1.25rem 1.3rem 1.15rem;
  box-shadow: var(--shadow-lg);
}
.live-card.enter { animation: card-in 0.28s ease; }
@keyframes card-in {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
.live-badge {
  display: inline-block; font-size: 0.7rem; font-weight: 800; letter-spacing: 0.06em;
  color: #0d47a1; background: #e3f2fd; border-radius: 999px; padding: 0.25rem 0.65rem; margin-bottom: 0.75rem;
}
.live-q { font-size: 1.2rem; line-height: 1.4; color: var(--navy); margin: 0 0 1rem; }
.live-story {
  background: #e8f4ff; border-left: 4px solid #1565c0; border-radius: 0 12px 12px 0;
  padding: 0.85rem 1rem; margin-bottom: 0.85rem; color: var(--text-soft); font-size: 0.95rem;
}
.live-tf { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.live-tf-btn {
  padding: 1.1rem 1rem; border-radius: 16px; font-weight: 800; font-size: 1.05rem;
  border: 2px solid transparent; transition: 0.15s transform, 0.15s box-shadow;
  display: flex; flex-direction: column; align-items: center; gap: 0.35rem;
}
.live-tf-btn kbd {
  font-size: 0.7rem; background: rgba(0,0,0,0.08); padding: 0.15rem 0.4rem; border-radius: 6px;
}
.live-tf-btn.yes { background: linear-gradient(145deg, #e8f5e9, #c8e6c9); color: #1b5e20; }
.live-tf-btn.no { background: linear-gradient(145deg, #ffebee, #ffcdd2); color: #b71c1c; }
.live-tf-btn:hover:not(:disabled) { transform: translateY(-2px) scale(1.02); box-shadow: 0 10px 24px rgba(15,39,68,0.12); }
.live-tf-btn.hit-ok, .live-opt.hit-ok { box-shadow: 0 0 0 3px #66bb6a; }
.live-tf-btn.hit-ko, .live-opt.hit-ko { box-shadow: 0 0 0 3px #ef5350; }
.live-options { display: grid; gap: 0.55rem; }
.live-opt {
  display: flex; align-items: flex-start; gap: 0.75rem; text-align: left;
  padding: 0.85rem 1rem; border-radius: 14px; border: 1px solid var(--border);
  background: #fff; font-weight: 600; color: var(--text); font-size: 0.95rem;
  transition: 0.15s transform, 0.15s border-color, 0.15s background;
}
.live-opt:hover:not(:disabled) {
  border-color: var(--blue); background: #f5f9ff; transform: translateX(4px);
}
.live-key {
  flex-shrink: 0; width: 28px; height: 28px; border-radius: 8px;
  display: grid; place-items: center; font-size: 0.78rem; font-weight: 800;
  background: #e3f2fd; color: #0d47a1;
}
.live-feed {
  margin-top: 0.9rem; padding: 0.8rem 0.95rem; border-radius: 12px; font-size: 0.9rem;
  animation: card-in 0.2s ease;
}
.live-feed.ok { background: #dcfce7; color: #14532d; }
.live-feed.ko { background: #fee2e2; color: #7f1d1d; }
.live-hint { margin-top: 0.85rem; font-size: 0.8rem; color: var(--muted); }
.live-hint kbd, .live-tf-btn kbd {
  font-family: var(--mono); font-size: 0.72rem; background: #eef2f7;
  border: 1px solid #d0d7e2; border-radius: 5px; padding: 0.1rem 0.35rem;
}
.live-arena { position: relative; overflow: hidden; }
.live-result { position: relative; }
.live-result.win .play-result-score { color: #2e7d32; }
.result-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem;
  margin: 1rem 0; max-width: 480px; margin-inline: auto;
}
.result-stats div {
  background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 0.55rem;
}
.result-stats strong { display: block; font-size: 1.15rem; color: var(--blue); }
.result-stats span { font-size: 0.7rem; color: var(--muted); font-weight: 600; }
.xp-track { max-width: 420px; margin: 0.75rem auto 0; text-align: left; }
.xp-track span { font-size: 0.75rem; color: var(--muted); font-weight: 600; }
.xp-track-bar {
  height: 10px; border-radius: 999px; background: #e3eaf3; overflow: hidden; margin-bottom: 0.35rem;
}
.xp-track-bar i {
  display: block; height: 100%; border-radius: inherit;
  background: linear-gradient(90deg, #fbc02d, #1565c0, #43a047);
  transition: width 0.5s ease;
}
.xp-track.light .xp-track-bar { background: rgba(255,255,255,0.25); }
.xp-track.light .xp-track-bar i { background: linear-gradient(90deg, #ffe082, #fff); }
.hot-mode { border-color: rgba(230, 81, 0, 0.35) !important; }
.hot-flag {
  position: absolute; top: 10px; right: 10px; font-size: 0.62rem; font-weight: 800;
  background: #ff6d00; color: #fff; padding: 0.15rem 0.4rem; border-radius: 6px;
}
.btn-lg { padding: 0.85rem 1.4rem !important; font-size: 1rem !important; }
.live-mem .mem-card { cursor: pointer; transition: transform 0.15s; }
.live-mem .mem-card:hover:not(:disabled) { transform: scale(1.04); }
.live-spot:hover:not(:disabled) { transform: scale(1.01); }

@media (max-width: 640px) {
  .live-tf { grid-template-columns: 1fr; }
  .result-stats { grid-template-columns: 1fr 1fr; }
  .live-q { font-size: 1.05rem; }
}

/* ═══ Percorso intuitivo: Lezioni → Palestra → Quiz → Esame ═══ */
.path-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.85rem;
  margin-bottom: 0.5rem;
}
.path-step {
  text-align: left;
  background: #fff;
  border: 2px solid #d5e0ef;
  border-radius: 16px;
  padding: 1.1rem 1rem 1rem;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  box-shadow: 0 8px 22px rgba(15, 39, 68, 0.06);
}
.path-step:hover {
  transform: translateY(-3px);
  border-color: #1565c0;
  box-shadow: 0 14px 32px rgba(13, 71, 161, 0.14);
}
.path-n {
  display: inline-grid;
  place-items: center;
  width: 32px; height: 32px;
  border-radius: 50%;
  font-weight: 800; font-size: 0.95rem;
  color: #fff;
  background: #1565c0;
  margin-bottom: 0.55rem;
}
.path-step-1 .path-n { background: #2e7d32; }
.path-step-2 .path-n { background: #ef6c00; }
.path-step-3 .path-n { background: #1565c0; }
.path-step-4 .path-n { background: #6a1b9a; }
.path-step strong {
  display: block;
  font-size: 1.05rem;
  color: var(--navy);
  margin-bottom: 0.2rem;
}
.path-step em {
  display: block;
  font-style: normal;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.65rem;
}
.path-cta {
  font-size: 0.82rem;
  font-weight: 800;
  color: #1565c0;
}

.path-banner {
  background: linear-gradient(120deg, #e8f5e9, #e3f2fd 55%, #f3e5f5);
  border: 1px solid rgba(21, 101, 192, 0.15);
  border-radius: 16px;
  padding: 1rem 1.15rem;
  margin-bottom: 1rem;
}
.path-banner-compact { padding: 0.65rem 1rem; margin-bottom: 0.85rem; }
.path-banner-track {
  display: flex; flex-wrap: wrap; gap: 0.45rem; margin-bottom: 0.55rem;
}
.path-banner-track span {
  font-size: 0.75rem; font-weight: 800;
  padding: 0.3rem 0.65rem; border-radius: 999px;
  background: rgba(255,255,255,0.75);
  color: #5a6f88;
  border: 1px solid rgba(15,39,68,0.08);
}
.path-banner-track span.on {
  background: #2e7d32; color: #fff; border-color: #2e7d32;
}
.path-banner-txt {
  margin: 0; font-size: 0.92rem; color: #37474f; font-weight: 600;
}
.path-next-row {
  display: flex; flex-wrap: wrap; gap: 0.55rem; margin-bottom: 1.15rem;
}

.lesson-path-list {
  display: grid; gap: 0.85rem;
}
.lesson-path-card {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 1rem;
  align-items: center;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1rem 1.1rem;
  box-shadow: 0 8px 22px rgba(15,39,68,0.05);
}
.lesson-path-card.is-done {
  border-color: rgba(46, 125, 50, 0.35);
  background: linear-gradient(90deg, #f1f8f2, #fff 40%);
}
.lesson-path-num {
  width: 42px; height: 42px; border-radius: 12px;
  display: grid; place-items: center;
  font-weight: 800; font-size: 1.1rem;
  color: #fff; background: #1565c0;
}
.lesson-path-card.is-done .lesson-path-num { background: #2e7d32; }
.lesson-path-main h3 {
  margin: 0 0 0.25rem; font-size: 1.05rem; color: var(--navy);
}
.lesson-path-main p {
  margin: 0 0 0.45rem; font-size: 0.88rem; color: var(--muted); line-height: 1.4;
}
.lesson-path-actions {
  display: flex; flex-direction: column; gap: 0.4rem; min-width: 150px;
}
.lesson-path-actions .btn {
  width: 100%;
  padding: 0.55rem 0.75rem !important;
  font-size: 0.85rem !important;
  justify-content: center;
}
.lesson-next-box {
  margin-top: 1.5rem;
  padding: 1.15rem 1.2rem;
  border-radius: 16px;
  background: #e8f5e9;
  border: 2px solid #81c784;
}
.lesson-next-box h3 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  color: #1b5e20;
}
.lesson-next-box ol {
  margin: 0 0 0.5rem;
  padding-left: 1.2rem;
  color: #2e4a32;
  font-size: 0.92rem;
}
.nav-link.nav-path {
  font-weight: 700;
  color: #0d47a1;
}
@media (max-width: 900px) {
  .path-steps { grid-template-columns: 1fr 1fr; }
  .lesson-path-card {
    grid-template-columns: 40px 1fr;
  }
  .lesson-path-actions {
    grid-column: 1 / -1;
    flex-direction: row;
    flex-wrap: wrap;
    min-width: 0;
  }
  .lesson-path-actions .btn { width: auto; flex: 1 1 auto; }
}
@media (max-width: 560px) {
  .path-steps { grid-template-columns: 1fr; }
}

/* ═══ Palestra / mini-giochi ═══ */
.play-hero {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem;
  align-items: center;
  background: linear-gradient(120deg, #0d47a1, #1565c0 50%, #0288d1);
  color: #fff; border-radius: 16px; padding: 1.1rem 1.25rem; margin-bottom: 1.1rem;
  box-shadow: 0 12px 32px rgba(13,71,161,0.22);
}
.play-hero p { margin: 0.25rem 0 0; opacity: 0.9; font-size: 0.9rem; max-width: 48ch; }
.play-hero-pills { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.play-hero-pills span {
  font-size: 0.72rem; font-weight: 700;
  background: rgba(255,255,255,0.14); border: 1px solid rgba(255,255,255,0.22);
  padding: 0.3rem 0.55rem; border-radius: 999px;
}
.play-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0.95rem;
}
.play-card {
  text-align: left; background: #0c1f3d; border: 1px solid rgba(255,255,255,0.14);
  border-radius: 16px; padding: 0; box-shadow: var(--shadow);
  transition: 0.22s transform, 0.22s border-color, 0.22s box-shadow;
  position: relative; overflow: hidden;
  min-height: 180px;
  cursor: pointer;
  isolation: isolate;
}
/* Colori di fallback se l'immagine non carica */
.play-card.play-tf { background: linear-gradient(145deg, #0d47a1, #1565c0); }
.play-card.play-sc { background: linear-gradient(145deg, #1a237e, #3949ab); }
.play-card.play-mt { background: linear-gradient(145deg, #004d40, #00897b); }
.play-card.play-or { background: linear-gradient(145deg, #e65100, #fb8c00); }
.play-card.play-cl { background: linear-gradient(145deg, #4a148c, #7b1fa2); }
.play-card.play-sp { background: linear-gradient(145deg, #b71c1c, #e53935); }
.play-card.play-mm { background: linear-gradient(145deg, #00695c, #26a69a); }
.play-card.play-sp2 { background: linear-gradient(145deg, #37474f, #607d8b); }
.play-card.play-hs { background: linear-gradient(145deg, #6a1b9a, #ab47bc); }
.play-card.play-du { background: linear-gradient(145deg, #bf360c, #ff5722); }
.play-card.play-fl { background: linear-gradient(145deg, #1565c0, #42a5f5); }
.play-card.play-xw { background: linear-gradient(145deg, #455a64, #90a4ae); }
.play-card.play-qz { background: linear-gradient(145deg, #0d47a1, #0288d1); }

.play-card-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: 0;
  pointer-events: none;
  transform: scale(1.04);
  transition: transform 0.35s ease;
}
.play-card:hover .play-card-img { transform: scale(1.1); }

.play-card-veil {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    linear-gradient(165deg, rgba(8, 20, 40, 0.25) 0%, rgba(8, 20, 40, 0.55) 40%, rgba(8, 20, 40, 0.88) 100%);
  transition: background 0.25s ease;
}
.play-card-body {
  position: relative; z-index: 2;
  display: flex; flex-direction: column; justify-content: flex-end;
  min-height: 180px; padding: 1.1rem 1.15rem 1.05rem;
  text-align: left;
}
.play-card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; z-index: 3;
  background: linear-gradient(90deg, #64b5f6, #fff);
  opacity: 0; transition: 0.2s;
}
.play-card:hover {
  transform: translateY(-4px) scale(1.01);
  border-color: rgba(100, 181, 246, 0.45);
  box-shadow: 0 18px 40px rgba(8, 20, 40, 0.28);
}
.play-card:hover::before { opacity: 1; }
.play-card:hover .play-card-veil {
  background:
    linear-gradient(165deg, rgba(8, 20, 40, 0.18) 0%, rgba(8, 20, 40, 0.48) 42%, rgba(8, 20, 40, 0.84) 100%);
}
.play-ico { display: none !important; }
.play-card h3 {
  font-size: 1.05rem; color: #fff; margin: 0 0 0.35rem;
  font-weight: 800; line-height: 1.25;
  text-shadow: 0 2px 10px rgba(0,0,0,0.35);
}
.play-card p {
  font-size: 0.84rem; color: rgba(255,255,255,0.88); margin: 0 0 0.65rem;
  line-height: 1.4; text-shadow: 0 1px 6px rgba(0,0,0,0.3);
}
.play-card .mod-meta { gap: 0.35rem; }
.play-card .tag {
  background: rgba(255,255,255,0.16) !important;
  border: 1px solid rgba(255,255,255,0.28) !important;
  color: #fff !important;
}
.play-card .tag.progress {
  background: rgba(67, 160, 71, 0.35) !important;
  border-color: rgba(165, 214, 167, 0.5) !important;
}
.play-card .tag.todo {
  background: rgba(255, 255, 255, 0.12) !important;
}
.play-card.hot-mode { border-color: rgba(255, 152, 0, 0.55) !important; }
.play-card .hot-flag {
  z-index: 3;
  box-shadow: 0 4px 12px rgba(255, 109, 0, 0.4);
}
.play-arena {
  margin-top: 1.25rem; background: #fff; border: 1px solid var(--border-strong);
  border-radius: 18px; padding: 1.2rem 1.25rem; box-shadow: var(--shadow-lg);
}
.play-head {
  display: flex; justify-content: space-between; gap: 0.75rem;
  font-size: 0.82rem; font-weight: 700; color: var(--blue); margin-bottom: 0.75rem;
}
.play-q-card h3 { font-size: 1.1rem; color: var(--navy); margin: 0.5rem 0 0.9rem; line-height: 1.4; }
.play-story {
  background: #f0f7ff; border: 1px solid var(--border); border-radius: 12px;
  padding: 0.85rem 1rem; color: var(--text-soft); font-size: 0.92rem; margin-bottom: 0.5rem;
}
.tf-btns { display: flex; flex-wrap: wrap; gap: 0.65rem; }
.play-feed {
  margin-top: 0.9rem; padding: 0.75rem 0.9rem; border-radius: 10px; font-size: 0.88rem;
}
.play-feed.ok { background: #dcfce7; color: #14532d; }
.play-feed.ko { background: #fee2e2; color: #7f1d1d; }
.play-result { text-align: center; padding: 1.25rem 0.5rem; }
.play-result-score {
  font-family: var(--serif); font-size: 3.2rem; color: var(--blue); line-height: 1;
}
.play-actions { display: flex; flex-wrap: wrap; gap: 0.55rem; justify-content: center; margin-top: 1rem; }
.match-board { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.match-col { display: grid; gap: 0.45rem; align-content: start; }
.match-chip {
  text-align: left; padding: 0.7rem 0.85rem; border-radius: 12px;
  border: 1px solid var(--border); background: #f8fbff; font-weight: 600; font-size: 0.88rem;
  color: var(--navy); transition: 0.15s;
}
.match-chip:hover:not(:disabled) { border-color: var(--blue); }
.match-chip.sel { border-color: var(--blue); background: #e3f2fd; box-shadow: 0 0 0 2px rgba(21,101,192,0.15); }
.match-chip.done { opacity: 0.45; background: #e8f5e9; }
.order-list { display: grid; gap: 0.45rem; margin: 0.75rem 0; }
.order-row {
  display: grid; grid-template-columns: auto 1fr auto; gap: 0.65rem; align-items: center;
  padding: 0.65rem 0.75rem; border-radius: 12px; border: 1px solid var(--border); background: #fff;
}
.order-num {
  width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center;
  background: #e3f2fd; color: #0d47a1; font-weight: 800; font-size: 0.8rem;
}
.order-label { font-size: 0.9rem; color: var(--text); font-weight: 500; }
.order-btns { display: flex; gap: 0.25rem; }
.order-btns button {
  width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--border);
  background: #f5f9ff; font-weight: 700; color: var(--blue);
}
.cloze-text .blank { color: var(--blue); font-style: normal; font-weight: 800; letter-spacing: 0.08em; }
.speed-timer {
  font-family: var(--mono); color: #c62828; background: #ffebee;
  padding: 0.2rem 0.5rem; border-radius: 8px;
}
.memory-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.55rem;
}
.mem-card {
  aspect-ratio: 1.15; border-radius: 12px; border: 1px solid var(--border);
  background: linear-gradient(145deg, #1565c0, #0d47a1); color: #fff;
  font-weight: 700; font-size: 0.85rem; transition: 0.15s;
}
.mem-card.open, .mem-card.matched {
  background: #fff; color: var(--navy); border-color: var(--border-strong);
}
.mem-card.matched { background: #e8f5e9; border-color: #a5d6a7; }
.mem-inner { padding: 0.4rem; line-height: 1.25; }
.spot-list { display: grid; gap: 0.45rem; }
.spot-line {
  text-align: left; padding: 0.75rem 0.9rem; border-radius: 12px;
  border: 1px solid var(--border); background: #fff; font-size: 0.9rem; color: var(--text-soft);
}
.spot-line:hover:not(:disabled) { border-color: var(--blue); background: #f5f9ff; }
.spot-line.is-error { background: #fff3e0; border-color: #ffb74d; color: #e65100; font-weight: 600; }
.spot-line.wrong { background: #fee2e2; border-color: #ef9a9a; }
.hotseat-form { display: flex; flex-wrap: wrap; gap: 0.55rem; margin-top: 0.5rem; }
.hotseat-form input {
  flex: 1; min-width: 180px; padding: 0.75rem 0.9rem; border-radius: 12px;
  border: 1px solid var(--border-strong); font-size: 1rem;
}
@media (max-width: 640px) {
  .match-board { grid-template-columns: 1fr; }
  .memory-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Andamento istruzione NIS2 (area privata) */
.learn-stats {
  background: linear-gradient(165deg, #ffffff 0%, #f0f6ff 100%);
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  padding: 1.35rem 1.4rem 1.25rem;
  box-shadow: var(--shadow-lg);
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
}
.learn-stats::before {
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: linear-gradient(180deg, #0d47a1, #0891b2, #43a047);
}
.learn-stats-head {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.85rem;
  align-items: flex-start; margin-bottom: 1.1rem;
}
.learn-stats-head h2 {
  font-family: var(--serif); font-weight: 400; font-size: 1.55rem; color: var(--navy);
}
.learn-stats-head p { color: var(--muted); font-size: 0.9rem; max-width: 48ch; }
.learn-stats-level { display: flex; flex-direction: column; align-items: flex-end; gap: 0.35rem; }
.trend { font-size: 0.78rem; font-weight: 700; }
.trend.up { color: #15803d; }
.trend.down { color: #b91c1c; }
.trend.flat { color: var(--muted); }

.learn-kpis {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.75rem;
  margin-bottom: 1.1rem;
}
.learn-kpi {
  background: #fff; border: 1px solid var(--border); border-radius: 14px;
  padding: 0.85rem 0.9rem; box-shadow: 0 4px 14px rgba(15,39,68,0.04);
}
.learn-kpi strong {
  display: block; font-size: 1.45rem; color: var(--blue); line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.learn-kpi span { font-size: 0.75rem; color: var(--muted); font-weight: 600; display: block; margin: 0.25rem 0 0.5rem; }
.learn-kpi .bar { margin-top: 0.35rem; }

.learn-stats-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.9rem; margin-bottom: 1rem;
}
.learn-panel {
  background: #fff; border: 1px solid var(--border); border-radius: 14px;
  padding: 1rem 1.05rem;
}
.learn-panel h3 { font-size: 0.95rem; color: var(--navy); margin-bottom: 0.7rem; }
.spark-chart {
  display: flex; align-items: flex-end; gap: 0.45rem; min-height: 88px;
  padding: 0.35rem 0.15rem;
}
.spark-col {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 0.25rem;
  min-width: 0;
}
.spark-col i {
  display: block; width: 100%; max-width: 36px;
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, #42a5f5, #0d47a1);
  box-shadow: 0 4px 10px rgba(13,71,161,0.2);
}
.spark-col span {
  font-size: 0.65rem; font-weight: 700; color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.domain-row.compact { padding: 0.55rem 0.65rem; margin-bottom: 0.4rem; }
.domain-row.compact:last-child { margin-bottom: 0; }
.compact-list { display: grid; gap: 0.35rem; max-height: 220px; overflow: auto; }
.learn-actions {
  display: flex; flex-wrap: wrap; gap: 0.55rem; align-items: center;
  padding-top: 0.35rem; border-top: 1px solid var(--border);
}
.btn-reset-private { margin-left: auto; }
.learn-reset-note { font-size: 0.78rem; margin-top: 0.55rem; }

@media (max-width: 900px) {
  .learn-kpis { grid-template-columns: 1fr 1fr; }
  .learn-stats-grid { grid-template-columns: 1fr; }
  .btn-reset-private { margin-left: 0; width: 100%; }
}
@media (max-width: 520px) {
  .learn-kpis { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .auth-layout { grid-template-columns: 1fr; }
  .gdpr-header-link { display: none; }
  .auth-cyber-bg { border-radius: 16px; }
  #auth-cyber-canvas { opacity: 0.75; }
}
@media (prefers-reduced-motion: reduce) {
  .auth-cyber-glow,
  .auth-cyber-hex,
  body.auth-locked .bg-grid::before,
  body.auth-locked .bg-grid::after { animation: none !important; }
}

/* ═══════════════════════════════════════════
   TOOLTIP PROFESSIONALE (news + eventi)
   ═══════════════════════════════════════════ */
.pro-tooltip {
  position: fixed;
  z-index: 200;
  width: min(340px, calc(100vw - 24px));
  padding: 0.85rem 0.95rem 0.75rem;
  border-radius: 14px;
  background: linear-gradient(165deg, #ffffff 0%, #f4f8ff 100%);
  color: #0f2744;
  border: 1px solid rgba(21, 101, 192, 0.22);
  box-shadow:
    0 18px 48px rgba(15, 39, 68, 0.18),
    0 0 0 1px rgba(255, 255, 255, 0.8) inset;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s;
}
.pro-tooltip.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.pro-tooltip.above {
  transform: translateY(-4px);
}
.pro-tooltip.above.visible {
  transform: translateY(0);
}
.pro-tooltip::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  border-radius: 14px 0 0 14px;
  background: linear-gradient(180deg, #0d47a1, #0288d1, #c9a227);
}
.pro-tooltip-head {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.4rem;
}
.pro-tooltip-emoji { font-size: 1.15rem; line-height: 1; }
.pro-tooltip-tag {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #0d47a1;
  background: rgba(21, 101, 192, 0.1);
  border: 1px solid rgba(21, 101, 192, 0.16);
  padding: 0.18rem 0.45rem;
  border-radius: 6px;
}
.pro-tooltip-title {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.35;
  color: #0b1f3a;
  margin-bottom: 0.45rem;
}
.pro-tooltip-body {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.55;
  color: #3d4f66;
}
.pro-tooltip-foot {
  margin-top: 0.65rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(21, 101, 192, 0.1);
  font-size: 0.68rem;
  font-weight: 600;
  color: #6b7f96;
  letter-spacing: 0.02em;
}
