/* SimulateIT Year 1 essentials styling */

.essentials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.essentials-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  transition: border-color var(--t), transform var(--t), box-shadow var(--t);
  overflow: hidden;
}
.essentials-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--cyan);
}
.essentials-card-green::before  { background: var(--green); }
.essentials-card-amber::before  { background: var(--amber); }
.essentials-card:hover {
  border-color: var(--cyan);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px -10px rgba(52, 211, 153, 0.4);
}
.essentials-card-green:hover { border-color: var(--green); }
.essentials-card-amber:hover { border-color: var(--amber); }

.essentials-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}
.essentials-icon {
  width: 38px;
  height: 38px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: rgba(52, 211, 153, 0.15);
  color: var(--cyan);
  border: 1px solid rgba(52, 211, 153, 0.3);
}
.essentials-icon-green { background: rgba(74, 222, 128, 0.15); color: var(--green); border-color: rgba(74, 222, 128, 0.3); }
.essentials-icon-amber { background: rgba(251, 191, 36, 0.15); color: var(--amber); border-color: rgba(251, 191, 36, 0.3); }
.essentials-card h3 {
  margin: 0;
  font-size: 18px;
}
.essentials-card-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.06em;
  margin: 6px 0;
}
.essentials-card-meta strong { color: var(--text-muted); }

.essentials-track-meta {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}
.essentials-track-meta strong { color: var(--cyan); }

/* Growth banner */
.growth-banner {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 14px 18px;
  background: linear-gradient(90deg, rgba(74, 222, 128, 0.08), transparent 60%), var(--bg-panel);
  border: 1px solid rgba(74, 222, 128, 0.3);
  border-left: 4px solid var(--green);
  border-radius: var(--radius-sm);
  margin: 18px 0;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.55;
}
.growth-banner strong { color: var(--green); }
.growth-banner-icon {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  color: var(--green);
  background: rgba(74, 222, 128, 0.12);
  border: 1px solid rgba(74, 222, 128, 0.4);
  flex-shrink: 0;
}

/* Chapters */
.chapters-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 20px;
}
.chapter {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
}
.chapter-stretch {
  border-color: rgba(251, 191, 36, 0.4);
  background: linear-gradient(180deg, rgba(251, 191, 36, 0.03), transparent 30%), var(--bg-panel);
}
.chapter-head {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 14px;
}
.chapter-num {
  font-family: var(--font-mono);
  font-size: 36px;
  font-weight: 800;
  color: var(--cyan);
  line-height: 1;
  letter-spacing: -0.03em;
  opacity: 0.85;
}
.chapter-stretch .chapter-num { color: var(--amber); }
.chapter-head h2 {
  margin: 0 0 6px;
  font-size: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.stretch-pill {
  display: inline-block;
  padding: 2px 8px;
  background: rgba(251, 191, 36, 0.15);
  color: var(--amber);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  font-weight: 700;
  border-radius: 999px;
  border: 1px solid rgba(251, 191, 36, 0.4);
}
.chapter-intro {
  margin: 0;
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.55;
}
.chapter-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.chapter-reflect {
  grid-column: 1 / -1;
}
@media (max-width: 720px) {
  .chapter-body { grid-template-columns: 1fr; }
}
.chapter-block h3 {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cyan);
  margin: 0 0 8px;
}
.chapter-stretch .chapter-block h3 { color: var(--amber); }
.chapter-block ul {
  margin: 0;
  padding-left: 20px;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}
.chapter-labs {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.chapter-lab {
  display: grid;
  grid-template-columns: 70px 1fr 24px;
  gap: 12px;
  align-items: center;
  padding: 10px 14px;
  background: var(--bg-panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text);
  font-size: 13px;
  transition: border-color var(--t), background var(--t);
}
.chapter-lab-live {
  border-left: 3px solid var(--green);
}
.chapter-lab-live:hover {
  background: var(--bg-elev);
  border-color: var(--green);
}
.chapter-lab-planned {
  border-left: 3px solid var(--text-dim);
  opacity: 0.6;
  cursor: not-allowed;
}
.chapter-lab-status {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  padding: 2px 6px;
  border-radius: 4px;
  text-align: center;
}
.chapter-lab-live .chapter-lab-status {
  background: rgba(74, 222, 128, 0.15);
  color: var(--green);
}
.chapter-lab-planned .chapter-lab-status {
  background: var(--bg-input);
  color: var(--text-dim);
}
.chapter-lab-arrow {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text-dim);
  text-align: center;
}
.chapter-reflect ul {
  list-style: none;
  padding-left: 0;
}
.chapter-reflect li {
  padding: 6px 12px 6px 24px;
  background: var(--bg-panel-2);
  border-left: 3px solid var(--amber);
  border-radius: 4px;
  margin-bottom: 6px;
  position: relative;
  font-style: italic;
}
.chapter-reflect li::before {
  content: '?';
  position: absolute;
  left: 8px;
  color: var(--amber);
  font-style: normal;
  font-weight: 700;
}

/* ============================================================
   CHAPTER VIEWER: theorie + checkpoints + lab-gate
   ============================================================ */
.chapter-meta-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  margin-top: 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}
.chapter-meta-bar strong { color: var(--cyan); }
.chapter-objectives {
  margin-bottom: 18px;
}
.chapter-objectives-list {
  margin: 0;
  padding-left: 22px;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.7;
}

.theory-section {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 26px;
  margin-bottom: 16px;
}
.theory-section-head {
  display: flex;
  gap: 14px;
  align-items: baseline;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
  margin-bottom: 14px;
}
.theory-section-num {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 800;
  color: var(--cyan);
  letter-spacing: -0.02em;
  opacity: 0.7;
}
.theory-section-head h2 {
  margin: 0;
  font-size: 18px;
}
.theory-section-body {
  font-size: 14px;
  color: var(--text);
  line-height: 1.7;
}
.theory-section-body p {
  margin: 0 0 12px;
}
.theory-section-body ul {
  margin: 0 0 12px;
  padding-left: 22px;
}
.theory-section-body li {
  margin-bottom: 6px;
}
.theory-section-body code {
  background: var(--bg-input);
  padding: 1px 6px;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--cyan);
}
.theory-code {
  background: #050a14;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--cyan);
  line-height: 1.55;
  overflow-x: auto;
  margin: 10px 0;
}
.theory-code code { background: transparent; padding: 0; color: inherit; }
.theory-callout {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 14px 0;
  padding: 12px 16px;
  border-left: 3px solid var(--cyan);
  border-radius: 4px;
  background: rgba(52, 211, 153, 0.06);
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}
.theory-callout-green { border-left-color: var(--green); background: rgba(74, 222, 128, 0.06); }
.theory-callout-amber { border-left-color: var(--amber); background: rgba(251, 191, 36, 0.06); }
.theory-callout-red   { border-left-color: var(--red);   background: rgba(251, 113, 133, 0.06); }
.theory-callout strong { color: var(--text); font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; }

.checkpoint-block {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-left: 4px solid var(--amber);
  border-radius: var(--radius);
  padding: 18px 22px;
  margin-bottom: 16px;
}
.checkpoint-block.cp-correct { border-left-color: var(--green); }
.checkpoint-block.cp-wrong   { border-left-color: var(--red); }
.checkpoint-head {
  margin-bottom: 12px;
}
.checkpoint-num {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--amber);
  font-weight: 700;
}
.checkpoint-head h3 {
  margin: 4px 0 0;
  font-size: 16px;
  color: var(--text);
}
.checkpoint-options {
  display: grid;
  gap: 6px;
}
.checkpoint-option {
  text-align: left;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.5;
  cursor: pointer;
  transition: border-color var(--t), color var(--t), background var(--t);
}
.checkpoint-option:hover:not(:disabled) { color: var(--text); border-color: var(--cyan); }
.checkpoint-option.selected.correct {
  color: var(--green);
  border-color: var(--green);
  background: rgba(74, 222, 128, 0.1);
}
.checkpoint-option.selected.incorrect {
  color: var(--red);
  border-color: var(--red);
  background: rgba(251, 113, 133, 0.1);
}
.checkpoint-option.correct-answer {
  color: var(--green);
  border-color: var(--green);
  box-shadow: inset 0 0 0 1px var(--green);
}
.checkpoint-option.tried-wrong {
  color: var(--text-dim);
  border-color: rgba(251, 113, 133, 0.3);
  background: rgba(251, 113, 133, 0.04);
  text-decoration: line-through;
  opacity: 0.7;
}
.checkpoint-option:disabled { cursor: default; }
.checkpoint-fb {
  margin-top: 10px;
  padding: 10px 14px;
  border-radius: 4px;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}
.checkpoint-fb.right { background: rgba(74, 222, 128, 0.06); border-left: 3px solid var(--green); }
.checkpoint-fb.wrong { background: rgba(251, 191, 36, 0.06); border-left: 3px solid var(--amber); }

.chapter-lab-gate {
  border-left: 4px solid var(--green);
  margin-top: 18px;
}
.chapter-lab-gate.locked {
  border-left-color: var(--amber);
  opacity: 0.92;
}
.chapter-lab-gate p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
}
.chapter-reflect-list {
  margin: 8px 0 0;
  padding-left: 22px;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.7;
}

/* ============================================================
   LICENSE GATE + MODAL
   ============================================================ */
.license-gate {
  text-align: center;
  padding: 50px 40px;
  border-color: rgba(251, 191, 36, 0.4);
  background: linear-gradient(180deg, rgba(251, 191, 36, 0.04), transparent 60%), var(--bg-panel);
}
.license-gate h2 {
  margin: 14px 0 12px;
  font-size: 22px;
}
.license-gate p {
  margin: 0 auto 12px;
}
.license-gate-icon {
  display: inline-block;
  padding: 8px 14px;
  background: var(--bg-input);
  border: 1px solid var(--amber);
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--amber);
  letter-spacing: 0.16em;
}
.license-gate-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 22px;
}
.license-modal {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 17, 0.85);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.license-modal-body {
  position: relative;
  background: var(--bg-panel);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 30px 32px 24px;
  width: min(480px, 100%);
}
.license-modal h3 {
  margin: 0;
  font-size: 18px;
}
.essentials-card.locked::after {
  content: 'LICENTIE';
  position: absolute;
  top: 14px;
  right: 14px;
  padding: 2px 10px;
  background: var(--amber);
  color: #1a1500;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.16em;
  border-radius: 999px;
}

/* Chapter-viewer panel-title (matches simulator.css, scoped for chapter page) */
[data-page="chapter"] .panel-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text);
  margin: 28px 0 14px;
}
[data-page="chapter"] .panel-title-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 26px;
  padding: 0 6px;
  background: rgba(0, 224, 255, 0.08);
  border: 1px solid rgba(0, 224, 255, 0.3);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--cyan);
  flex-shrink: 0;
}
[data-page="chapter"] .panel-title-icon.green {
  color: var(--green);
  background: rgba(74, 222, 128, 0.08);
  border-color: rgba(74, 222, 128, 0.3);
}
[data-page="chapter"] .panel-title-icon.amber {
  color: var(--amber);
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.3);
}
[data-page="chapter"] .panel-title-icon.red {
  color: var(--red);
  background: rgba(251, 113, 133, 0.08);
  border-color: rgba(251, 113, 133, 0.3);
}
[data-page="chapter"] .panel-title-icon.purple {
  color: var(--purple);
  background: rgba(168, 85, 247, 0.08);
  border-color: rgba(168, 85, 247, 0.3);
}

/* ============================================================
   Theorie als inklapbare kaarten (progressive disclosure)
   ============================================================ */
.theory-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 22px 0 6px; }
.theory-controls-label { font-size: 12px; color: var(--text-dim); }
.theory-seg { display: inline-flex; background: var(--bg-input); border: 1px solid var(--border); border-radius: 999px; padding: 3px; gap: 2px; }
.theory-seg .seg-btn { border: 0; background: transparent; color: var(--text-muted); font-size: 12.5px; padding: 6px 14px; border-radius: 999px; cursor: pointer; font-family: inherit; min-height: 34px; }
.theory-seg .seg-btn.on { background: var(--cyan); color: #04222b; font-weight: 600; }

.theory-card { background: var(--bg-panel-2); border: 1px solid var(--border); border-radius: 10px; margin: 10px 0; overflow: hidden; }
.theory-card-head { display: flex; align-items: flex-start; gap: 12px; width: 100%; text-align: left; background: transparent; border: 0; padding: 14px 16px; cursor: pointer; font-family: inherit; color: var(--text); min-height: 56px; transition: background var(--t-fast); }
.theory-card-head:hover { background: var(--bg-elev); }
.theory-card-num { font-family: var(--font-mono); font-size: 11px; color: var(--cyan); background: var(--cyan-dim); border-radius: 6px; padding: 4px 7px; flex: none; margin-top: 1px; }
.theory-card-tx { flex: 1; min-width: 0; }
.theory-card-title { display: block; font-size: 15px; font-weight: 600; color: var(--text); line-height: 1.35; }
.theory-card-sum { display: block; font-size: 12.5px; color: var(--text-muted); margin-top: 3px; line-height: 1.45; }
.theory-card.open .theory-card-sum { display: none; }
.theory-card-chev { margin-left: auto; color: var(--text-dim); display: flex; align-items: center; flex: none; margin-top: 2px; transition: transform var(--t); }
.theory-card.open .theory-card-chev { transform: rotate(180deg); }
.theory-card-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows var(--t); }
.theory-card.open .theory-card-body { grid-template-rows: 1fr; }
.theory-card-body-clip { overflow: hidden; min-height: 0; }
.theory-card-body-inner { padding: 2px 16px 16px 16px; }
.theory-card-body-inner > :first-child { margin-top: 0; }

@media (prefers-reduced-motion: reduce) {
  .theory-card-body { transition: none; }
  .theory-card-chev { transition: none; }
}
@media (max-width: 600px) {
  .theory-card-head { padding: 13px 14px; }
  .theory-card-body-inner { padding: 2px 14px 14px 14px; }
  .theory-seg .seg-btn { padding: 8px 16px; min-height: 40px; }
}
