/* ═══════════════════════════════════════════════════════════
   OraTek Sales Training — Shared Styles
   Matches existing portal CSS variables exactly
   ═══════════════════════════════════════════════════════════ */

/* ── CSS Variables (mirror portal) ── */
:root {
  --blue:   #3877D8;
  --cyan:   #55BFEC;
  --orange: #FF9851;
  --navy:   #0F2035;
  --bg:     #F2F6FB;
  --bg2:    #F9FBFE;
  --white:  #FFFFFF;
  --text:   #334155;
  --text2:  #455262;
  --muted:  #8899AA;
  --border: #DDE6F0;
  --green:  #22C55E;
  --yellow: #F59E0B;
  --red:    #EF4444;
  --purple: #8B5CF6;
  --surface:#FFFFFF;

  --ease-out: cubic-bezier(0.2,0,0,1);
  --shadow-sm: 0 1px 3px rgba(15,32,53,.06), 0 1px 2px rgba(15,32,53,.04);
  --shadow-md: 0 4px 16px rgba(15,32,53,.08), 0 2px 6px rgba(15,32,53,.05);
  --shadow-lg: 0 8px 32px rgba(15,32,53,.12);
}

/* ── Reset ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body {
  font-family: 'Poppins', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 13px;
  line-height: 1.6;
}

/* ── Typography ── */
h1 { font-size: 24px; font-weight: 700; color: var(--navy); line-height: 1.25; }
h2 { font-size: 18px; font-weight: 700; color: var(--navy); }
h3 { font-size: 15px; font-weight: 600; color: var(--text); }
h4 { font-size: 13px; font-weight: 600; color: var(--text); }
p  { color: var(--text2); line-height: 1.7; }
a  { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Header ── */
.tr-header {
  position: sticky;
  top: 0;
  z-index: 200;
  height: 54px;
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 20px;
  flex-shrink: 0;
}
.tr-header-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text2);
}
.tr-header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ── Back / Portal button (matches CRM portal nav button) ── */
.btn-portal {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 5px 14px;
  font-family: 'Poppins', sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: var(--text2);
  text-decoration: none;
  transition: all .15s;
  cursor: pointer;
}
.btn-portal:hover { border-color: var(--blue); color: var(--blue); text-decoration: none; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  border-radius: 8px;
  padding: 8px 18px;
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
  text-decoration: none;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: #2c65c5; color: #fff; text-decoration: none; }
.btn-secondary { background: var(--bg); border: 1.5px solid var(--border); color: var(--text2); }
.btn-secondary:hover { border-color: var(--blue); color: var(--blue); text-decoration: none; }
.btn-accent { background: var(--orange); color: #fff; }
.btn-accent:hover { background: #e8833e; color: #fff; text-decoration: none; }
.btn-purple { background: var(--purple); color: #fff; }
.btn-purple:hover { background: #7c3aed; color: #fff; text-decoration: none; }
.btn-green { background: var(--green); color: #fff; }
.btn-green:hover { background: #16a34a; color: #fff; text-decoration: none; }
.btn-danger { background: transparent; border: 1.5px solid var(--red); color: var(--red); }
.btn-danger:hover { background: rgba(239,68,68,.08); }
.btn-sm { padding: 5px 12px; font-size: 11px; }
.btn-lg { padding: 12px 28px; font-size: 14px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ── Cards ── */
.card {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

/* ── Badge ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: .3px;
}
.badge-blue   { background: rgba(56,119,216,.1); color: var(--blue); }
.badge-green  { background: rgba(34,197,94,.1);  color: var(--green); }
.badge-red    { background: rgba(239,68,68,.1);  color: var(--red); }
.badge-yellow { background: rgba(245,158,11,.1); color: var(--yellow); }
.badge-purple { background: rgba(139,92,246,.1); color: var(--purple); }
.badge-muted  { background: var(--bg2);          color: var(--muted); }

/* ── Progress Bar ── */
.progress-wrap {
  background: var(--border);
  border-radius: 10px;
  height: 8px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 10px;
  background: linear-gradient(90deg, var(--blue), var(--cyan));
  transition: width .4s var(--ease-out);
}
.progress-fill.green { background: linear-gradient(90deg, var(--green), #4ade80); }
.progress-fill.red   { background: var(--red); }

/* ── Toast ── */
.tr-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--navy);
  color: #fff;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  opacity: 0;
  transition: all .25s var(--ease-out);
  z-index: 9999;
  pointer-events: none;
  white-space: nowrap;
}
.tr-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,32,53,.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 800;
  display: none;
  align-items: center;
  justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  width: 480px;
  max-width: 94vw;
  max-height: 88vh;
  overflow-y: auto;
  padding: 28px;
}
.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
}
.modal-title { font-size: 16px; font-weight: 700; color: var(--navy); }
.modal-close {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--muted);
  cursor: pointer;
  line-height: 1;
  padding: 2px;
}
.modal-close:hover { color: var(--red); }

/* ── Form Elements ── */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text2);
  margin-bottom: 5px;
}
.form-input, .form-select, .form-textarea {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  color: var(--text);
  background: var(--bg2);
  outline: none;
  transition: all .2s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(56,119,216,.08);
  background: var(--white);
}
.form-textarea { resize: vertical; min-height: 80px; }
.form-select { cursor: pointer; }

/* ── Toggle / Switch ── */
.toggle-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}
.toggle-wrap input[type="checkbox"] { display: none; }
.toggle-slider {
  width: 36px; height: 20px;
  background: var(--border);
  border-radius: 10px;
  position: relative;
  transition: background .2s;
  flex-shrink: 0;
}
.toggle-slider::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 14px; height: 14px;
  background: #fff;
  border-radius: 50%;
  transition: transform .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
input:checked ~ .toggle-slider { background: var(--blue); }
input:checked ~ .toggle-slider::after { transform: translateX(16px); }

/* ── Divider Block ── */
.block-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0;
}
.block-divider::before, .block-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.block-divider-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  white-space: nowrap;
}

/* ── Callout Blocks ── */
.callout {
  border-radius: 10px;
  padding: 14px 16px;
  margin: 12px 0;
  border-left: 4px solid;
  font-size: 13px;
}
.callout-info   { background: rgba(56,119,216,.06);  border-color: var(--blue);   color: var(--text); }
.callout-tip    { background: rgba(34,197,94,.06);   border-color: var(--green);  color: var(--text); }
.callout-caution{ background: rgba(245,158,11,.06);  border-color: var(--yellow); color: var(--text); }
.callout-rule   { background: rgba(239,68,68,.06);   border-color: var(--red);    color: var(--text); }
.callout-label  { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 4px; }
.callout-info   .callout-label { color: var(--blue); }
.callout-tip    .callout-label { color: var(--green); }
.callout-caution .callout-label { color: var(--yellow); }
.callout-rule   .callout-label { color: var(--red); }

/* ══════════════════════════════════
   COURSE CATALOG (index.html)
   ══════════════════════════════════ */
.catalog-hero {
  background: linear-gradient(135deg, var(--navy) 0%, #1a3460 100%);
  color: #fff;
  padding: 48px 40px;
  border-radius: 16px;
  margin-bottom: 32px;
  position: relative;
  overflow: hidden;
}
.catalog-hero::after {
  content: '🎓';
  position: absolute;
  right: 40px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 80px;
  opacity: .15;
}
.catalog-hero h1 { color: #fff; font-size: 28px; margin-bottom: 6px; }
.catalog-hero p  { color: rgba(255,255,255,.7); font-size: 14px; max-width: 500px; }
.catalog-hero-meta {
  display: flex;
  gap: 24px;
  margin-top: 20px;
  flex-wrap: wrap;
}
.catalog-hero-stat {
  font-size: 12px;
  color: rgba(255,255,255,.8);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}
.catalog-hero-stat strong { color: #fff; font-size: 18px; }

.catalog-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 24px 60px;
}
.catalog-progress-bar {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  gap: 20px;
}
.catalog-progress-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text2);
  white-space: nowrap;
}
.catalog-progress-pct {
  font-size: 20px;
  font-weight: 800;
  color: var(--blue);
  min-width: 48px;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}
.module-card {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  cursor: pointer;
  text-decoration: none;
  display: block;
  transition: all .2s var(--ease-out);
  position: relative;
  overflow: hidden;
}
.module-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--blue);
  border-radius: 12px 12px 0 0;
  opacity: 0;
  transition: opacity .2s;
}
.module-card:hover { box-shadow: var(--shadow-md); border-color: rgba(56,119,216,.3); transform: translateY(-2px); text-decoration: none; }
.module-card:hover::before { opacity: 1; }
.module-card.locked { cursor: not-allowed; opacity: .6; }
.module-card.locked:hover { transform: none; box-shadow: none; border-color: var(--border); }
.module-card.passed::before  { background: var(--green); opacity: 1; }
.module-card.failed::before  { background: var(--red);   opacity: 1; }
.module-card-num {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  margin-bottom: 4px;
}
.module-card-title { font-size: 15px; font-weight: 700; color: var(--navy); margin-bottom: 4px; }
.module-card-sub   { font-size: 12px; color: var(--muted); margin-bottom: 14px; line-height: 1.5; }
.module-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.module-card-meta { font-size: 11px; color: var(--muted); display: flex; gap: 12px; align-items: center; }

/* ══════════════════════════════════
   MODULE VIEWER (module.html)
   ══════════════════════════════════ */
.viewer-layout {
  display: flex;
  height: calc(100vh - 54px);
  overflow: hidden;
}

/* Sidebar */
.viewer-sidebar {
  width: 280px;
  flex-shrink: 0;
  background: var(--white);
  border-right: 1.5px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  transition: width .25s var(--ease-out);
}
.viewer-sidebar.collapsed { width: 0; overflow: hidden; }
.sidebar-module-title {
  padding: 16px 16px 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.sidebar-page-list { flex: 1; overflow-y: auto; padding: 8px; }
.sidebar-page-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: all .15s;
  font-size: 12px;
  color: var(--text2);
  font-weight: 500;
  margin-bottom: 2px;
}
.sidebar-page-item:hover { background: var(--bg); color: var(--text); }
.sidebar-page-item.active { background: rgba(56,119,216,.08); color: var(--blue); font-weight: 600; }
.sidebar-page-item.done   { color: var(--green); }
.sidebar-page-check {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px;
  flex-shrink: 0;
  transition: all .2s;
}
.sidebar-page-item.done   .sidebar-page-check { background: var(--green); border-color: var(--green); color: #fff; }
.sidebar-page-item.active .sidebar-page-check { border-color: var(--blue); }

/* Main viewer area */
.viewer-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}
.viewer-progress-bar {
  height: 3px;
  background: var(--border);
  flex-shrink: 0;
}
.viewer-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--blue), var(--cyan));
  transition: width .4s var(--ease-out);
}
.viewer-content {
  flex: 1;
  overflow-y: auto;
  padding: 36px 48px;
  max-width: 760px;
  margin: 0 auto;
  width: 100%;
}
.viewer-page-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1.5px solid var(--border);
}
.viewer-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 48px;
  border-top: 1px solid var(--border);
  background: var(--white);
  flex-shrink: 0;
}
.viewer-nav-center {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

/* ══════════════════════════════════
   CONTENT BLOCKS (rep-facing)
   ══════════════════════════════════ */
.block { margin-bottom: 24px; }

/* Text block */
.block-text { font-size: 13px; line-height: 1.8; color: var(--text2); }
.block-text h2 { font-size: 18px; color: var(--navy); margin: 20px 0 10px; }
.block-text h3 { font-size: 15px; color: var(--text); margin: 16px 0 8px; }
.block-text ul, .block-text ol { padding-left: 20px; margin: 8px 0; }
.block-text li { margin-bottom: 4px; }
.block-text strong { color: var(--text); }
.block-text blockquote {
  border-left: 3px solid var(--blue);
  padding: 8px 16px;
  color: var(--text2);
  font-style: italic;
  background: var(--bg);
  border-radius: 0 8px 8px 0;
  margin: 12px 0;
}

/* Image block */
.block-image img {
  max-width: 100%;
  border-radius: 10px;
  border: 1px solid var(--border);
}
.block-image.full img  { width: 100%; }
.block-image.center    { text-align: center; }
.block-image.float-left img  { float: left; margin: 0 20px 10px 0; max-width: 40%; }
.block-image.float-right img { float: right; margin: 0 0 10px 20px; max-width: 40%; }
.block-caption { font-size: 11px; color: var(--muted); margin-top: 6px; font-style: italic; }

/* Video block */
.block-video-wrap {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
}
.block-video-wrap iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: 0;
}
.block-video-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 200px;
  border: 1.5px dashed var(--border);
  border-radius: 10px;
  background: var(--bg2);
  color: var(--muted);
  font-size: 12px;
  gap: 8px;
}

/* Quiz block */
.quiz-block {
  background: var(--bg2);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 20px;
}
.quiz-block-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--blue);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.quiz-question {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.quiz-question:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.quiz-q-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 8px;
  line-height: 1.5;
}
.quiz-scenario {
  background: var(--bg);
  border-left: 3px solid var(--blue);
  padding: 10px 14px;
  border-radius: 0 8px 8px 0;
  font-size: 12px;
  color: var(--text2);
  margin-bottom: 12px;
  font-style: italic;
}
.quiz-options { display: flex; flex-direction: column; gap: 8px; }
.quiz-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: var(--white);
  cursor: pointer;
  transition: all .15s;
  font-size: 12px;
  color: var(--text2);
  text-align: left;
  width: 100%;
  font-family: 'Poppins', sans-serif;
}
.quiz-option:hover:not(.locked) { border-color: var(--blue); background: rgba(56,119,216,.04); color: var(--text); }
.quiz-option.selected  { border-color: var(--blue);  background: rgba(56,119,216,.06);  color: var(--blue);  font-weight: 600; }
.quiz-option.correct   { border-color: var(--green); background: rgba(34,197,94,.06);   color: var(--green); font-weight: 600; }
.quiz-option.incorrect { border-color: var(--red);   background: rgba(239,68,68,.06);   color: var(--red);   font-weight: 600; }
.quiz-option.locked    { cursor: default; }
.quiz-option-letter {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
  transition: all .15s;
}
.quiz-option.selected  .quiz-option-letter { background: var(--blue);  color: #fff; }
.quiz-option.correct   .quiz-option-letter { background: var(--green); color: #fff; }
.quiz-option.incorrect .quiz-option-letter { background: var(--red);   color: #fff; }
.quiz-explanation {
  margin-top: 10px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.6;
  display: none;
}
.quiz-explanation.show { display: block; }
.quiz-explanation.correct-exp  { background: rgba(34,197,94,.08);  color: #166534; border-left: 3px solid var(--green); }
.quiz-explanation.incorrect-exp { background: rgba(239,68,68,.08);  color: #991b1b; border-left: 3px solid var(--red); }
.quiz-submit-btn {
  margin-top: 14px;
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 9px 22px;
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.quiz-submit-btn:hover { background: #2c65c5; }
.quiz-result {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  display: none;
}
.quiz-result.show { display: block; }
.quiz-result.pass { background: rgba(34,197,94,.1); color: #166534; }
.quiz-result.fail { background: rgba(239,68,68,.1);  color: #991b1b; }

/* Comparison table */
.block-table { overflow-x: auto; }
.block-table table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  font-size: 12px;
}
.block-table th {
  background: var(--navy);
  color: #fff;
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
}
.block-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text2);
  vertical-align: top;
}
.block-table tbody tr:last-child td { border-bottom: none; }
.block-table tbody tr:nth-child(even) td { background: var(--bg2); }
.block-table.bold-first-col td:first-child { font-weight: 600; color: var(--text); }

/* Flashcards */
.flashcard-deck { display: flex; flex-direction: column; gap: 12px; }
.flashcard {
  perspective: 600px;
  height: 80px;
  cursor: pointer;
}
.flashcard-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform .45s var(--ease-out);
  border-radius: 10px;
}
.flashcard.flipped .flashcard-inner { transform: rotateY(180deg); }
.flashcard-front, .flashcard-back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  padding: 14px 18px;
  font-size: 13px;
  font-weight: 600;
}
.flashcard-front {
  background: var(--white);
  color: var(--navy);
}
.flashcard-back {
  background: var(--navy);
  color: #fff;
  transform: rotateY(180deg);
  font-weight: 400;
  font-size: 12px;
  line-height: 1.5;
}
.flashcard-hint {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--muted);
  margin-bottom: 12px;
}

/* Download block */
.download-block {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  background: var(--bg2);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  text-decoration: none;
  transition: all .15s;
}
.download-block:hover {
  border-color: var(--blue);
  background: rgba(56,119,216,.04);
  text-decoration: none;
}
.download-icon {
  width: 40px; height: 40px;
  border-radius: 8px;
  background: rgba(239,68,68,.1);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.download-label { font-size: 13px; font-weight: 600; color: var(--navy); }
.download-desc  { font-size: 11px; color: var(--muted); margin-top: 1px; }

/* Module complete screen */
.module-complete {
  text-align: center;
  padding: 48px 24px;
  max-width: 480px;
  margin: 0 auto;
}
.module-complete-icon { font-size: 56px; margin-bottom: 16px; }
.module-complete h2  { font-size: 24px; color: var(--navy); margin-bottom: 8px; }
.module-complete p   { color: var(--muted); font-size: 14px; margin-bottom: 28px; }
.module-score {
  display: flex;
  gap: 24px;
  justify-content: center;
  margin-bottom: 28px;
}
.module-score-item { text-align: center; }
.module-score-val { font-size: 28px; font-weight: 800; color: var(--navy); }
.module-score-label { font-size: 11px; color: var(--muted); font-weight: 600; margin-top: 2px; }

/* ══════════════════════════════════
   CERTIFICATE (certificate.html)
   ══════════════════════════════════ */
.cert-wrap {
  max-width: 800px;
  margin: 40px auto;
  padding: 20px;
}
.certificate {
  background: var(--white);
  border: 3px solid var(--navy);
  border-radius: 16px;
  padding: 60px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.certificate::before {
  content: '';
  position: absolute;
  inset: 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  pointer-events: none;
}
.cert-top-accent {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 6px;
  background: linear-gradient(90deg, var(--navy), var(--blue), var(--cyan));
}
.cert-logo { margin-bottom: 20px; }
.cert-logo img { height: 36px; }
.cert-issued-to { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 2px; margin-bottom: 8px; }
.cert-name { font-size: 36px; font-weight: 800; color: var(--navy); margin-bottom: 12px; font-family: 'Oswald', sans-serif; }
.cert-body { font-size: 14px; color: var(--text2); margin-bottom: 24px; line-height: 1.7; }
.cert-body strong { color: var(--navy); }
.cert-details {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.cert-detail-item { text-align: center; }
.cert-detail-label { font-size: 10px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.cert-detail-val { font-size: 14px; font-weight: 700; color: var(--navy); margin-top: 2px; }

@media print {
  .cert-actions, .tr-header { display: none !important; }
  body { background: #fff; }
  .cert-wrap { margin: 0; padding: 0; max-width: 100%; }
  .certificate { border-color: #000; box-shadow: none; }
}

/* ══════════════════════════════════
   ADMIN EDITOR (admin.html)
   ══════════════════════════════════ */
.admin-layout {
  display: flex;
  height: calc(100vh - 54px);
  overflow: hidden;
}

/* Admin left tree panel */
.admin-tree {
  width: 280px;
  flex-shrink: 0;
  background: var(--white);
  border-right: 1.5px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.admin-tree-header {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.admin-tree-scroll { flex: 1; overflow-y: auto; padding: 8px; }

/* Course / Module items */
.tree-course { margin-bottom: 8px; }
.tree-course-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--bg2);
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  color: var(--navy);
  user-select: none;
}
.tree-course-header:hover { background: var(--bg); }
.tree-course-expand { font-size: 10px; color: var(--muted); transition: transform .2s; }
.tree-course-expand.open { transform: rotate(90deg); }

.tree-modules { padding-left: 12px; }
.tree-module { margin-bottom: 2px; }
.tree-module-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  color: var(--text2);
  font-weight: 500;
  user-select: none;
  position: relative;
}
.tree-module-header:hover { background: var(--bg); }
.tree-module-header.active { background: rgba(56,119,216,.08); color: var(--blue); font-weight: 600; }
.tree-module-menu {
  margin-left: auto;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  font-size: 16px;
  padding: 0 2px;
  line-height: 1;
  opacity: 0;
  transition: opacity .15s;
}
.tree-module-header:hover .tree-module-menu { opacity: 1; }
.tree-module-menu:hover { color: var(--text); }

.tree-pages { padding-left: 14px; }
.tree-page-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 11px;
  color: var(--text2);
  margin-bottom: 1px;
}
.tree-page-item:hover { background: var(--bg); }
.tree-page-item.active { background: rgba(56,119,216,.06); color: var(--blue); font-weight: 600; }
.tree-page-menu { margin-left: auto; opacity: 0; }
.tree-page-item:hover .tree-page-menu { opacity: 1; }

.tree-add-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  color: var(--blue);
  border: none;
  background: none;
  font-family: 'Poppins', sans-serif;
  width: 100%;
  text-align: left;
  transition: background .15s;
}
.tree-add-btn:hover { background: rgba(56,119,216,.06); }

/* Context menu */
.ctx-menu {
  position: absolute;
  right: 0;
  top: 100%;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow-md);
  z-index: 500;
  min-width: 130px;
  overflow: hidden;
}
.ctx-menu-item {
  display: block;
  width: 100%;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text2);
  cursor: pointer;
  background: none;
  border: none;
  text-align: left;
  font-family: 'Poppins', sans-serif;
  transition: background .1s;
}
.ctx-menu-item:hover { background: var(--bg); color: var(--text); }
.ctx-menu-item.danger { color: var(--red); }
.ctx-menu-item.danger:hover { background: rgba(239,68,68,.06); }

/* Admin center (editor) */
.admin-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}
.admin-editor-top {
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  background: var(--white);
}
.admin-page-title-input {
  flex: 1;
  border: none;
  font-family: 'Poppins', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--navy);
  outline: none;
  background: transparent;
}
.admin-page-title-input::placeholder { color: var(--muted); }

.admin-blocks-scroll { flex: 1; overflow-y: auto; padding: 20px; }
.admin-block-wrap {
  position: relative;
  margin-bottom: 16px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--white);
  transition: border-color .15s;
}
.admin-block-wrap:hover { border-color: rgba(56,119,216,.3); }
.admin-block-wrap.drag-over { border-color: var(--blue); background: rgba(56,119,216,.02); }
.admin-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg2);
  border-radius: 8px 8px 0 0;
  border-bottom: 1px solid var(--border);
}
.admin-block-type-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.admin-block-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}
.admin-block-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 5px;
  font-size: 13px;
  color: var(--muted);
  transition: all .15s;
  font-family: 'Poppins', sans-serif;
}
.admin-block-btn:hover { background: var(--bg); color: var(--text); }
.admin-block-btn.danger:hover { color: var(--red); }
.admin-block-body { padding: 14px; }

/* Add block bar */
.add-block-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 8px 0;
  position: relative;
}
.add-block-bar::before {
  content: '';
  position: absolute;
  left: 0; right: 0;
  height: 1px;
  background: var(--border);
}
.add-block-btn {
  position: relative;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 20px;
  padding: 4px 14px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  font-family: 'Poppins', sans-serif;
  transition: all .15s;
  z-index: 1;
}
.add-block-btn:hover { border-color: var(--blue); color: var(--blue); }

/* Block type picker dropdown */
.block-type-picker {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-md);
  padding: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  position: absolute;
  z-index: 200;
  top: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  width: 320px;
}
.block-type-option {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  color: var(--text2);
  background: none;
  font-family: 'Poppins', sans-serif;
  transition: all .15s;
  flex: 1;
  min-width: calc(50% - 4px);
}
.block-type-option:hover { border-color: var(--blue); color: var(--blue); background: rgba(56,119,216,.04); }

/* Admin right panel */
.admin-right {
  width: 260px;
  flex-shrink: 0;
  background: var(--white);
  border-left: 1.5px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.admin-right-section {
  padding: 16px;
  border-bottom: 1px solid var(--border);
}
.admin-right-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
}

/* Admin top bar */
.admin-topbar {
  height: 54px;
  background: var(--white);
  border-bottom: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  flex-shrink: 0;
  z-index: 100;
}
.admin-topbar-left { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.admin-topbar-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* Quiz editor */
.quiz-q-editor {
  border: 1.5px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 10px;
  background: var(--bg2);
}
.quiz-q-editor-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
  font-size: 12px;
  font-weight: 600;
  color: var(--text2);
}
.quiz-q-editor-body { padding: 12px; }
.quiz-option-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.quiz-option-row input[type="text"] {
  flex: 1;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  color: var(--text);
  outline: none;
  background: var(--white);
}
.quiz-option-row input[type="text"]:focus { border-color: var(--blue); }

/* Flashcard editor */
.fc-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 6px;
}
.fc-row input {
  border: 1.5px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  color: var(--text);
  outline: none;
  width: 100%;
  background: var(--white);
}
.fc-row input:focus { border-color: var(--blue); }

/* Table editor */
.table-editor-grid { width: 100%; border-collapse: collapse; }
.table-editor-grid td {
  padding: 0;
  border: 1px solid var(--border);
}
.table-editor-cell {
  width: 100%;
  border: none;
  padding: 7px 10px;
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  color: var(--text);
  outline: none;
  background: transparent;
}
.table-editor-cell:focus { background: rgba(56,119,216,.04); }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--muted);
}
.empty-state-icon { font-size: 40px; margin-bottom: 12px; }
.empty-state h3 { font-size: 15px; font-weight: 600; color: var(--text2); margin-bottom: 6px; }
.empty-state p  { font-size: 12px; color: var(--muted); max-width: 300px; margin: 0 auto 20px; }

/* Responsive */
@media (max-width: 768px) {
  .viewer-sidebar { display: none; }
  .viewer-content { padding: 24px 20px; }
  .admin-right { display: none; }
  .admin-tree { width: 240px; }
  .module-grid { grid-template-columns: 1fr; }
  .catalog-hero { padding: 32px 24px; }
  .certificate { padding: 36px 24px; }
  .cert-name { font-size: 26px; }
}

/* Password gate */
.pw-gate {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
}
.pw-gate.hidden { display: none; }
.pw-box {
  background: var(--white);
  border-radius: 16px;
  padding: 40px 36px;
  width: 360px;
  max-width: 92vw;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.pw-title { font-size: 20px; font-weight: 700; color: var(--navy); margin-bottom: 4px; }
.pw-sub   { font-size: 12px; color: var(--muted); margin-bottom: 24px; }
.pw-input {
  width: 100%;
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  color: var(--navy);
  outline: none;
  text-align: center;
  letter-spacing: 1px;
  transition: border-color .2s;
  margin-bottom: 14px;
}
.pw-input:focus { border-color: var(--blue); }
.pw-input.error { border-color: var(--red); animation: shake .4s; }
@keyframes shake { 0%,100%{transform:translateX(0)} 20%,60%{transform:translateX(-8px)} 40%,80%{transform:translateX(8px)} }
.pw-error { font-size: 12px; color: var(--red); font-weight: 600; min-height: 18px; margin-bottom: 8px; }

/* ═══════════════════════════════════════════════════════════
   New block types — Script, Memorize, Walkthrough, Callout,
   Inline markdown ({{memorize}}), Compare tables
   All tokens map to the ocean theme (theme.css) via var(--aqua),
   var(--cyan), var(--purple), var(--navy).
   ═══════════════════════════════════════════════════════════ */

/* Inline {{memorize}} highlight */
.tr-mem {
  color: #E5D5FF;
  font-weight: 600;
  background: linear-gradient(transparent 62%, rgba(139,92,246,.32) 62%, rgba(139,92,246,.32) 94%, transparent 94%);
  padding: 0 3px;
  border-radius: 2px;
}

/* Callout block (new data-driven variant) */
.tr-callout {
  position: relative;
  border-radius: 14px;
  padding: 18px 22px 20px 22px;
  margin: 8px 0;
  background: linear-gradient(135deg, rgba(255,152,81,.10), rgba(255,152,81,.03));
  border: 1px solid rgba(255,152,81,.26);
  display: flex; gap: 14px; align-items: flex-start;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  overflow: hidden;
}
.tr-callout::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(80% 80% at 0% 0%, rgba(255,152,81,.18), transparent 55%);
}
.tr-callout-icon {
  position: relative; z-index: 1;
  flex-shrink: 0; width: 28px; height: 28px; border-radius: 9px;
  background: linear-gradient(135deg, #FF9851, #C76A2C);
  color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: 14px;
  box-shadow: 0 4px 14px rgba(255,152,81,.4);
  font-family: 'Oswald', serif;
}
.tr-callout-body { flex: 1; min-width: 0; position: relative; z-index: 1; }
.tr-callout-title { font-weight: 600; color: #fff; margin: 0 0 5px; font-size: 15px; letter-spacing: -0.005em; }
.tr-callout-text  { color: rgba(232,244,251,.82); font-size: 14.5px; line-height: 1.62; text-wrap: pretty; }
.tr-callout.warn {
  background: linear-gradient(135deg, rgba(239,68,68,.12), rgba(239,68,68,.03));
  border-color: rgba(239,68,68,.34);
}
.tr-callout.warn::before { background: radial-gradient(80% 80% at 0% 0%, rgba(239,68,68,.22), transparent 55%); }
.tr-callout.warn .tr-callout-icon { background: linear-gradient(135deg, #EF4444, #B42727); }

/* Script block (blue glass) */
.tr-script {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(126,255,221,.14);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  margin: 4px 0 8px;
}
.tr-script-header {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 18px;
  background: rgba(85,191,236,.08);
  border-bottom: 1px solid rgba(126,255,221,.12);
  font-size: 13px; color: rgba(232,244,251,.82);
}
.tr-script-pill {
  font-family: 'Space Grotesk', ui-monospace, monospace;
  font-size: 10px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: #041020;
  padding: 4px 9px; border-radius: 5px;
  background: linear-gradient(135deg, #55BFEC, #3877D8);
  box-shadow: 0 2px 10px rgba(85,191,236,.3);
}
.tr-script-label { color: #fff; font-weight: 500; }
.tr-script-body {
  padding: 20px 22px;
  font-family: 'Oswald', 'Georgia', serif;
  font-weight: 400;
  font-size: 18px; line-height: 1.58;
  color: #fff;
  white-space: pre-wrap;
  letter-spacing: 0.2px;
}

/* Script · Memorize — purple variant */
.tr-script.memorize {
  background:
    linear-gradient(135deg, rgba(139,92,246,.14), rgba(139,92,246,.04)),
    rgba(255,255,255,.02);
  border: 1px solid rgba(164,120,250,.35);
  box-shadow: 0 12px 40px rgba(107,47,201,.18), inset 0 1px 0 rgba(255,255,255,.04);
}
.tr-script.memorize::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: linear-gradient(180deg, #A478FA, #6B2FC9);
  box-shadow: 0 0 20px rgba(139,92,246,.6);
  pointer-events: none;
}
.tr-script.memorize::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(60% 60% at 100% 0%, rgba(139,92,246,.18), transparent 55%);
}
.tr-script.memorize .tr-script-header {
  background: rgba(139,92,246,.14);
  border-bottom-color: rgba(164,120,250,.22);
  position: relative; z-index: 1;
}
.tr-script.memorize .tr-script-pill {
  color: #fff;
  background: linear-gradient(135deg, #A478FA, #6B2FC9);
  box-shadow: 0 2px 14px rgba(139,92,246,.45);
}
.tr-script.memorize .tr-script-label { color: #E5D5FF; }
.tr-script.memorize .tr-script-body {
  color: #F3EBFF;
  position: relative; z-index: 1;
}
.tr-script-corner {
  position: absolute; top: 12px; right: 16px; z-index: 2;
  font-family: 'Space Grotesk', ui-monospace, monospace;
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: #A478FA;
  display: flex; align-items: center; gap: 6px;
}
.tr-script-corner::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%; background: #A478FA;
  box-shadow: 0 0 8px #8B5CF6;
}

/* Walkthrough — timeline */
.tr-walkthrough { position: relative; padding: 4px 0; }
.tr-wt-step {
  display: grid; grid-template-columns: 80px 1fr; gap: 20px;
  padding: 16px 0; position: relative;
}
.tr-wt-step::before {
  content: ''; position: absolute; left: 94px; top: 42px; bottom: -16px;
  width: 1px;
  background: linear-gradient(180deg, rgba(85,191,236,.55), rgba(139,92,246,.35));
}
.tr-wt-step:last-child::before { display: none; }
.tr-wt-time {
  font-family: 'Space Grotesk', ui-monospace, monospace;
  font-size: 12px; color: #55BFEC; font-weight: 700;
  padding-top: 4px; letter-spacing: 0.02em;
}
.tr-wt-content { position: relative; }
.tr-wt-content::before {
  content: ''; position: absolute; left: -28px; top: 8px;
  width: 12px; height: 12px; border-radius: 50%;
  background: radial-gradient(circle, #55BFEC 0%, #3877D8 100%);
  box-shadow: 0 0 0 3px var(--navy, #0F2035), 0 0 14px rgba(85,191,236,.7);
}
.tr-wt-title { font-weight: 600; color: #fff; margin: 0 0 4px; font-size: 15px; }
.tr-wt-body  { color: rgba(232,244,251,.82); font-size: 14.5px; line-height: 1.6; margin: 0; }

/* Compare table coloring — green on col 2, red-ish on col 3 */
.block-table.compare td:nth-child(2) { color: #C8F0D8; }
.block-table.compare td:nth-child(3) { color: #F5C7BB; }
.block-table.compare tr:hover td { background: rgba(255,255,255,.03); }

/* Inline markdown inside text/callout blocks */
.block-text strong { color: #fff; font-weight: 600; }
.block-text em { color: #D6E7F5; font-style: italic; }
.block-text p { margin: 0 0 12px; }
.block-text p:last-child { margin-bottom: 0; }
.block-text ol, .block-text ul { margin: 8px 0 12px; padding: 0 0 0 22px; }
.block-text li { margin: 4px 0; line-height: 1.55; }
