/* ===== Interactive Lesson — Fullscreen Layout ===== */
html.il-active, .il-active body {
  margin: 0; padding: 0; overflow: hidden;
  height: 100vh; height: 100dvh;
}
.il-active .header,
.il-active .footer { display: none !important; }

.il-fullscreen {
  display: flex;
  flex-direction: column;
  height: 100vh; height: 100dvh;
  background: #060e24;
  color: #f0f4ff;
  font-family: var(--font-sans, 'Outfit', sans-serif);
}

/* ── Top bar ── */
.il-topbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem 1.2rem;
  background: rgba(6,14,46,0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(122,216,255,0.15);
  flex-shrink: 0;
  z-index: 10;
}
.il-topbar-back {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: rgba(240,244,255,0.6);
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s;
  flex-shrink: 0;
}
.il-topbar-back:hover { color: #7ad8ff; }
.il-topbar-center {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
}
.il-topbar-logo {
  width: 36px; height: 36px;
  object-fit: contain;
  flex-shrink: 0;
}
.il-topbar-title {
  font-size: 1rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.il-topbar-progress {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}
.il-topbar-progress span {
  font-size: 0.9rem;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  color: #7ad8ff;
  min-width: 2.5em;
  text-align: right;
}
.il-topbar-progress-track {
  width: 120px;
  height: 6px;
  border-radius: 99px;
  background: rgba(255,255,255,0.1);
  overflow: hidden;
}
.il-topbar-progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 99px;
  background: linear-gradient(90deg, #7ad8ff, #27c46b);
  transition: width 0.5s ease;
}

/* ── Viewport ── */
.il-viewport {
  flex: 1;
  position: relative;
  overflow: hidden;
}

/* ── Individual slide ── */
.il-slide {
  position: absolute;
  inset: 0;
  display: none;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(122,216,255,0.3) transparent;
}
.il-slide::-webkit-scrollbar { width: 5px; }
.il-slide::-webkit-scrollbar-track { background: transparent; }
.il-slide::-webkit-scrollbar-thumb { background: rgba(122,216,255,0.25); border-radius: 99px; }
.il-slide.active {
  display: flex;
  animation: ilSlideIn 0.45s ease;
}
@keyframes ilSlideIn {
  from { opacity: 0; transform: translateX(30px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ── Slide layout: two-column ── */
.il-slide-inner {
  display: flex;
  width: 100%;
  min-height: 100%;
}
.il-slide-visual {
  flex: 0 0 42%;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.il-slide-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
}
.il-slide-visual-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
}
.il-slide-visual-content {
  position: relative;
  z-index: 2;
  padding: 2rem;
  text-align: center;
}
.il-slide-content {
  flex: 1;
  padding: 2.5rem 3rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1rem;
  overflow-y: auto;
}

/* ── Cover slide (centered) ── */
.il-slide-cover {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background-size: cover;
  background-position: center;
  position: relative;
}
.il-slide-cover::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(6,14,36,0.65);
}
.il-slide-cover > * { position: relative; z-index: 1; }

/* Cover intro modulo: overlay + ombre testo (sfondo ricco di linee / lucchetti) */
.il-slide-cover--module::before {
  background: linear-gradient(
    160deg,
    rgba(4, 10, 28, 0.82) 0%,
    rgba(6, 18, 46, 0.76) 45%,
    rgba(4, 12, 32, 0.88) 100%
  );
}
.il-slide-cover--module .il-title,
.il-slide-cover--module .il-text,
.il-slide-cover--module p {
  text-shadow: 0 2px 28px rgba(0, 0, 0, 0.9), 0 1px 10px rgba(0, 0, 0, 0.65);
}
.il-slide-cover--module img[alt="C.O.R.E."] {
  filter: drop-shadow(0 8px 28px rgba(0, 0, 0, 0.75));
}

/* ── Section divider slide ── */
.il-slide-divider {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  background-size: cover;
  background-position: center;
}
.il-slide-divider::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(6,14,36,0.6);
}
.il-slide-divider > * { position: relative; z-index: 1; }

/* ── Typography — BIGGER ── */
.il-section-label {
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #7ad8ff;
  margin-bottom: 0.25rem;
}
.il-title {
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  font-weight: 700;
  line-height: 1.15;
  margin: 0;
}
.il-text {
  font-size: 1.08rem;
  line-height: 1.75;
  color: rgba(240,244,255,0.82);
  margin: 0;
}
.il-text strong { color: #f0f4ff; }
.il-text .hl { color: #ffd700; font-weight: 600; }

/* ── Tooltip ── */
.il-term {
  color: #7ad8ff;
  font-weight: 600;
  border-bottom: 1px dashed rgba(122,216,255,0.5);
  cursor: help;
  position: relative;
  display: inline;
}
.il-tip {
  position: fixed;
  left: 0;
  top: 0;
  transform: scale(0.95);
  background: rgba(8,18,56,0.97);
  border: 1px solid rgba(122,216,255,0.5);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  font-size: 0.92rem;
  font-weight: 400;
  color: rgba(240,244,255,0.9);
  line-height: 1.5;
  width: max-content;
  max-width: 320px;
  z-index: 99999;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
}
.il-tip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: rgba(122,216,255,0.5);
}
.il-term:hover .il-tip,
.il-term:focus .il-tip {
  opacity: 1;
  transform: scale(1);
}

/* ── Expandable cards ── */
.il-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.7rem;
}
.il-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 0.85rem;
  cursor: pointer;
  transition: border-color 0.25s, background 0.25s, box-shadow 0.25s;
}
.il-card:hover {
  border-color: rgba(122,216,255,0.4);
  background: rgba(122,216,255,0.06);
}
.il-card.open {
  border-color: #7ad8ff;
  background: rgba(122,216,255,0.08);
  box-shadow: 0 0 0 1px rgba(122,216,255,0.2);
}
.il-card-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.il-card-ico {
  width: 34px; height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}
.il-card-name {
  font-size: 1rem;
  font-weight: 600;
  flex: 1;
}
.il-card-arrow {
  font-size: 0.7rem;
  color: rgba(240,244,255,0.4);
  transition: transform 0.3s;
}
.il-card.open .il-card-arrow { transform: rotate(180deg); }
.il-card-detail {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}
.il-card.open .il-card-detail {
  max-height: 300px;
}
.il-card-detail-inner {
  padding: 0.6rem 0 0;
  font-size: 0.95rem;
  line-height: 1.6;
  color: rgba(240,244,255,0.75);
}

/* Card icon colors */
.ico-blue   { background: rgba(122,216,255,0.15); color: #7ad8ff; }
.ico-green  { background: rgba(39,196,107,0.15); color: #27c46b; }
.ico-gold   { background: rgba(255,215,0,0.15); color: #ffd700; }
.ico-red    { background: rgba(255,100,100,0.15); color: #ff6464; }
.ico-purple { background: rgba(170,130,255,0.15); color: #aa82ff; }
.ico-orange { background: rgba(255,165,0,0.15); color: #ffa500; }
.ico-cyan   { background: rgba(0,210,255,0.15); color: #00d2ff; }

/* ── Callout ── */
.il-callout {
  padding: 0.85rem 1.1rem;
  border-radius: 8px;
  font-size: 1rem;
  line-height: 1.6;
  color: rgba(240,244,255,0.88);
}
.il-callout strong { color: #f0f4ff; }
.il-callout.c-info    { background: rgba(122,216,255,0.08); border-left: 3px solid #7ad8ff; }
.il-callout.c-warn    { background: rgba(255,165,0,0.08); border-left: 3px solid #ffa500; }
.il-callout.c-danger  { background: rgba(255,100,100,0.06); border-left: 3px solid #ff6464; }
.il-callout.c-success { background: rgba(39,196,107,0.08); border-left: 3px solid #27c46b; }

/* ── Stats row ── */
.il-stats {
  display: flex;
  gap: 0.7rem;
}
.il-stat {
  flex: 1;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 0.85rem;
  text-align: center;
}
.il-stat-val {
  font-size: 1.8rem;
  font-weight: 700;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  color: #ffd700;
  display: block;
}
.il-stat-lbl {
  font-size: 0.85rem;
  color: rgba(240,244,255,0.6);
  margin-top: 0.2rem;
  display: block;
}

/* ── Quiz ── */
.il-quiz {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(122,216,255,0.15);
  border-radius: 12px;
  padding: 1.2rem 1.5rem;
}
.il-quiz + .il-quiz { margin-top: 1rem; }
.il-quiz-label {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #ffd700;
  margin-bottom: 0.5rem;
}
.il-quiz-q {
  font-size: 1.08rem;
  font-weight: 500;
  color: #f0f4ff;
  margin-bottom: 0.75rem;
  line-height: 1.5;
}
.il-quiz-opts {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 0.75rem;
}
.il-opt {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 1rem;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  color: rgba(240,244,255,0.75);
  transition: border-color 0.2s, background 0.2s;
}
.il-opt:hover { border-color: rgba(122,216,255,0.3); background: rgba(122,216,255,0.04); }
.il-opt.sel { border-color: #7ad8ff; background: rgba(122,216,255,0.1); color: #f0f4ff; }
.il-opt.ok  { border-color: #27c46b; background: rgba(39,196,107,0.12); color: #5aeaa0; }
.il-opt.no  { border-color: #ff6464; background: rgba(255,100,100,0.08); color: #ff9090; }
.il-radio {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.2);
  flex-shrink: 0;
  position: relative;
}
.il-opt.sel .il-radio { border-color: #7ad8ff; }
.il-opt.sel .il-radio::after {
  content: '';
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #7ad8ff;
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
}
.il-opt.ok .il-radio { border-color: #27c46b; }
.il-opt.ok .il-radio::after { background: #27c46b; }
.il-quiz-btn {
  padding: 0.55rem 1.4rem;
  background: #7ad8ff;
  color: #071739;
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: opacity 0.2s;
}
.il-quiz-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.il-quiz-btn:not(:disabled):hover { background: #55c3ff; }
.il-quiz-fb {
  margin-top: 0.6rem;
  padding: 0.7rem 1rem;
  border-radius: 8px;
  font-size: 0.95rem;
  line-height: 1.5;
  display: none;
}
.il-quiz-fb.show { display: block; }
.il-quiz-fb.fb-ok  { background: rgba(39,196,107,0.1); border: 1px solid rgba(39,196,107,0.25); color: #5aeaa0; }
.il-quiz-fb.fb-no  { background: rgba(255,100,100,0.07); border: 1px solid rgba(255,100,100,0.2); color: #ff9090; }

/* ── Numbered list ── */
.il-numlist {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: ilnum;
}
.il-numlist li {
  counter-increment: ilnum;
  padding: 0.45rem 0 0.45rem 2.4rem;
  position: relative;
  font-size: 1.05rem;
  color: rgba(240,244,255,0.82);
  line-height: 1.55;
}
.il-numlist li::before {
  content: counter(ilnum);
  position: absolute;
  left: 0; top: 0.45rem;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: rgba(122,216,255,0.15);
  color: #7ad8ff;
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.il-numlist li strong { color: #f0f4ff; }

/* ── Checklist ── */
.il-checks {
  list-style: none;
  padding: 0;
  margin: 0;
}
.il-checks li {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.4rem 0;
  font-size: 1.05rem;
  color: rgba(240,244,255,0.82);
  line-height: 1.55;
}
.il-chk {
  flex-shrink: 0;
  width: 22px; height: 22px;
  border-radius: 5px;
  background: rgba(39,196,107,0.2);
  color: #27c46b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  margin-top: 2px;
}

/* ── Scenario ── */
.il-scenario {
  background: linear-gradient(135deg, rgba(255,165,0,0.06), rgba(255,80,80,0.04));
  border: 1px solid rgba(255,165,0,0.2);
  border-radius: 10px;
  padding: 1rem 1.2rem;
}
.il-scenario-tag {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #ffa500;
  margin-bottom: 0.4rem;
}
.il-scenario p {
  font-size: 1rem;
  line-height: 1.6;
  color: rgba(240,244,255,0.8);
  margin: 0 0 0.3rem;
}
.il-scenario strong { color: #f0f4ff; }

/* ── Bottom bar ── */
.il-bottombar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 1.5rem;
  background: rgba(6,14,46,0.9);
  backdrop-filter: blur(12px);
  border-top: 1px solid rgba(122,216,255,0.12);
  flex-shrink: 0;
  z-index: 10;
}
.il-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.4rem;
  border-radius: 8px;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s;
  border: none;
}
.il-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.il-btn-prev {
  background: rgba(255,255,255,0.06);
  color: rgba(240,244,255,0.7);
  border: 1px solid rgba(255,255,255,0.12);
}
.il-btn-prev:not(:disabled):hover { background: rgba(255,255,255,0.12); color: #f0f4ff; }
.il-btn-next {
  background: #7ad8ff;
  color: #071739;
}
.il-btn-next:not(:disabled):hover { background: #55c3ff; }
.il-page-counter {
  font-size: 0.95rem;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  color: rgba(240,244,255,0.5);
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .il-slide-inner { flex-direction: column; }
  .il-slide-visual { flex: 0 0 200px; }
  .il-slide-content { padding: 1.2rem 1.2rem; }
  .il-cards { grid-template-columns: 1fr; }
  .il-stats { flex-direction: column; }
  .il-topbar-title { display: none; }
  .il-title { font-size: clamp(1.5rem, 5vw, 2rem); }
  .il-text { font-size: 1rem; }
}
