/* ============================================================
   styles.css — Raise Them Safe Training Platform
   ============================================================ */

:root {
  --navy:          #1e3a5f;
  --navy-light:    #2d5282;
  --navy-hover:    #163050;
  --gold:          #e8a020;
  --gold-hover:    #d4911a;
  --gold-light:    #fef3dc;
  --green:         #16a34a;
  --green-light:   #dcfce7;
  --red:           #dc2626;
  --red-hover:     #b91c1c;
  --red-light:     #fee2e2;
  --blue-light:    #dbeafe;
  --blue:          #2563eb;
  --bg:            #eef2f7;
  --white:         #ffffff;
  --text:          #1a202c;
  --text-muted:    #6b7280;
  --text-light:    #9ca3af;
  --border:        #e2e8f0;
  --border-dark:   #cbd5e1;
  --sidebar-w:     285px;
  --topbar-h:      62px;
  --radius:        10px;
  --radius-sm:     6px;
  --shadow:        0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md:     0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
  --shadow-lg:     0 10px 25px rgba(0,0,0,.15);
  --font:          -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font);
  font-size: 15px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  overflow: hidden;
  height: 100vh;
}

/* ── OVERLAY BASE ─────────────────────────────────────────── */
.overlay {
  position: fixed; inset: 0;
  background: rgba(15, 25, 45, 0.75);
  backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
}
.hidden { display: none !important; }

/* ── WELCOME MODAL ───────────────────────────────────────── */
#welcome-overlay {
  position: fixed; inset: 0;
  background: linear-gradient(135deg, #0f1d35 0%, #1e3a5f 50%, #163050 100%);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
}

#welcome-modal {
  background: var(--white);
  border-radius: 16px;
  width: 100%;
  max-width: 460px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.modal-header {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  padding: 32px 36px 28px;
  text-align: center;
}

.modal-logo {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin-bottom: 10px;
}
.logo-icon { font-size: 1.8rem; }
.logo-text { font-size: 1.4rem; font-weight: 700; color: var(--white); letter-spacing: -0.3px; }

.modal-tagline {
  color: rgba(255,255,255,0.72);
  font-size: 0.85rem;
  letter-spacing: 0.2px;
}

.modal-body { padding: 32px 36px 36px; }

.modal-body h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.modal-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 24px;
  line-height: 1.5;
}

.form-group { margin-bottom: 18px; }

.form-group label {
  display: block;
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.required { color: var(--red); margin-left: 2px; }

.form-group input[type="text"],
.form-group input[type="email"] {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border-dark);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.9rem;
  color: var(--text);
  background: var(--white);
  transition: border-color .2s, box-shadow .2s;
  outline: none;
}

.form-group input:focus {
  border-color: var(--navy-light);
  box-shadow: 0 0 0 3px rgba(45,82,130,0.12);
}

.form-group input.error { border-color: var(--red); }

.field-error {
  display: none;
  font-size: 0.78rem;
  color: var(--red);
  margin-top: 4px;
}
.field-error.visible { display: block; }

.form-check {
  display: flex; align-items: flex-start; gap: 10px;
  margin-bottom: 14px;
}

.form-check input[type="checkbox"] {
  width: 17px; height: 17px;
  margin-top: 2px;
  cursor: pointer;
  accent-color: var(--navy);
  flex-shrink: 0;
}

.form-check label {
  font-size: 0.875rem;
  color: var(--text);
  cursor: pointer;
  line-height: 1.45;
}

.form-check label a {
  color: var(--navy-light);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.form-check .field-error { margin-left: 27px; }

#begin-btn {
  width: 100%;
  margin-top: 10px;
  padding: 13px;
  background: var(--gold);
  color: var(--white);
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background .2s, transform .1s, opacity .2s;
  letter-spacing: 0.2px;
}
#begin-btn:hover:not(:disabled) { background: var(--gold-hover); }
#begin-btn:active:not(:disabled) { transform: scale(0.99); }
#begin-btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* ── TERMS MODAL ─────────────────────────────────────────── */
#terms-overlay { z-index: 1100; }

#terms-modal {
  background: var(--white);
  border-radius: var(--radius);
  width: 100%;
  max-width: 520px;
  max-height: 80vh;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg);
}

.terms-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}
.terms-header h3 { font-size: 1.05rem; font-weight: 700; }
.terms-header button {
  background: none; border: none; cursor: pointer;
  font-size: 1rem; color: var(--text-muted); padding: 4px 8px;
  border-radius: 4px; transition: background .15s;
}
.terms-header button:hover { background: var(--bg); }

.terms-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
  line-height: 1.7;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.terms-body p { margin-bottom: 14px; }

.terms-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end;
}
.terms-footer button {
  padding: 9px 22px;
  background: var(--navy);
  color: var(--white);
  border: none; border-radius: var(--radius-sm);
  font-family: var(--font); font-size: 0.875rem; font-weight: 600;
  cursor: pointer; transition: background .2s;
}
.terms-footer button:hover { background: var(--navy-hover); }

/* ── EXIT MODAL ──────────────────────────────────────────── */
#exit-overlay { z-index: 1100; }

#exit-modal {
  background: var(--white);
  border-radius: var(--radius);
  width: 100%;
  max-width: 380px;
  padding: 36px 32px;
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.exit-icon { font-size: 2.5rem; margin-bottom: 14px; }
#exit-modal h3 { font-size: 1.2rem; font-weight: 700; margin-bottom: 10px; }
#exit-modal p { color: var(--text-muted); font-size: 0.9rem; line-height: 1.55; margin-bottom: 26px; }

.exit-actions { display: flex; flex-direction: column; gap: 10px; }

.btn-secondary {
  padding: 12px;
  background: var(--bg);
  color: var(--text);
  border: 1.5px solid var(--border-dark);
  border-radius: var(--radius-sm);
  font-family: var(--font); font-size: 0.9rem; font-weight: 600;
  cursor: pointer; transition: background .2s;
}
.btn-secondary:hover { background: var(--border); }

.btn-danger {
  padding: 12px;
  background: var(--red);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font); font-size: 0.9rem; font-weight: 700;
  cursor: pointer; transition: background .2s;
}
.btn-danger:hover { background: var(--red-hover); }

/* ── TOP BAR ─────────────────────────────────────────────── */
#topbar {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  background: var(--navy);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px 0 0;
  z-index: 500;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
}

.topbar-left {
  display: flex; align-items: center;
  width: var(--sidebar-w);
  padding: 0 20px;
  border-right: 1px solid rgba(255,255,255,0.1);
  height: 100%;
}

.topbar-logo {
  color: var(--white);
  font-size: 1rem;
  white-space: nowrap;
}
.topbar-logo strong { font-weight: 700; }

.topbar-center {
  flex: 1;
  text-align: center;
}
#current-module-label {
  color: rgba(255,255,255,0.75);
  font-size: 0.82rem;
  letter-spacing: 0.3px;
}

.topbar-right {
  display: flex; align-items: center; gap: 14px;
}

.user-badge {
  color: rgba(255,255,255,0.7);
  font-size: 0.82rem;
  background: rgba(255,255,255,0.08);
  padding: 5px 12px;
  border-radius: 20px;
}

.btn-exit {
  padding: 7px 16px;
  background: transparent;
  color: rgba(255,255,255,0.8);
  border: 1.5px solid rgba(255,255,255,0.25);
  border-radius: var(--radius-sm);
  font-family: var(--font); font-size: 0.82rem; font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
}
.btn-exit:hover {
  background: var(--red);
  border-color: var(--red);
  color: var(--white);
}

/* ── MAIN LAYOUT ─────────────────────────────────────────── */
#main-layout {
  display: flex;
  height: 100vh;
  padding-top: var(--topbar-h);
}

/* ── SIDEBAR ─────────────────────────────────────────────── */
#sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--navy);
  height: 100%;
  overflow-y: auto;
  border-right: 1px solid rgba(255,255,255,0.07);
  display: flex; flex-direction: column;
}

#sidebar::-webkit-scrollbar { width: 4px; }
#sidebar::-webkit-scrollbar-track { background: transparent; }
#sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 4px; }

.sidebar-progress {
  padding: 16px 18px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.progress-label {
  display: flex; justify-content: space-between;
  font-size: 0.72rem; color: rgba(255,255,255,0.5);
  margin-bottom: 7px; text-transform: uppercase; letter-spacing: 0.5px;
}
.progress-bar-track {
  height: 4px; background: rgba(255,255,255,0.1); border-radius: 4px; overflow: hidden;
}
.progress-bar-fill {
  height: 100%; background: var(--gold); border-radius: 4px;
  transition: width .4s ease;
}

.sidebar-modules { padding: 8px 0 24px; flex: 1; }

.track-section { margin-bottom: 4px; }

.track-header {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 18px 6px;
  font-size: 0.68rem; font-weight: 700;
  color: rgba(255,255,255,0.38);
  text-transform: uppercase; letter-spacing: 1px;
}

.module-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 18px;
  cursor: pointer;
  transition: background .15s;
  border-left: 3px solid transparent;
}
.module-item:hover:not(.locked) { background: rgba(255,255,255,0.06); }

.module-item.active {
  background: rgba(232,160,32,0.12);
  border-left-color: var(--gold);
}

.module-item.locked { cursor: not-allowed; opacity: 0.45; }

.module-id-badge {
  flex-shrink: 0;
  width: 30px; height: 30px;
  background: rgba(255,255,255,0.07);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; font-weight: 700; color: rgba(255,255,255,0.6);
}
.module-item.active .module-id-badge {
  background: var(--gold);
  color: var(--white);
}

.module-item-text { flex: 1; min-width: 0; }
.module-item-title {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.75);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.module-item.active .module-item-title { color: var(--white); font-weight: 500; }

.module-lock-icon {
  font-size: 0.65rem; color: rgba(255,255,255,0.25); flex-shrink: 0;
}
.module-check-icon {
  font-size: 0.8rem; color: var(--green); flex-shrink: 0;
}

/* ── CONTENT AREA ────────────────────────────────────────── */
#content-area {
  flex: 1;
  overflow-y: auto;
  background: var(--bg);
}

#content-area::-webkit-scrollbar { width: 6px; }
#content-area::-webkit-scrollbar-track { background: transparent; }
#content-area::-webkit-scrollbar-thumb { background: var(--border-dark); border-radius: 4px; }

#module-container {
  max-width: 820px;
  margin: 0 auto;
  padding: 28px 28px 60px;
}

/* ── MODULE HEADER ───────────────────────────────────────── */
.module-header {
  margin-bottom: 24px;
}

.module-meta {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 10px;
}

.module-id-tag {
  background: var(--navy);
  color: var(--white);
  font-size: 0.72rem; font-weight: 700;
  padding: 3px 10px; border-radius: 20px;
  letter-spacing: 0.5px;
}
.track-tag {
  background: var(--gold-light);
  color: var(--gold-hover);
  font-size: 0.72rem; font-weight: 600;
  padding: 3px 10px; border-radius: 20px;
}
.duration-tag {
  color: var(--text-muted);
  font-size: 0.78rem;
  margin-left: 4px;
}

.module-title-main {
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.25;
  letter-spacing: -0.4px;
  margin-bottom: 20px;
}

/* ── BLOCK STEPPER ───────────────────────────────────────── */
.block-stepper {
  display: flex; align-items: center;
  gap: 0;
  background: var(--white);
  border-radius: var(--radius);
  padding: 12px 16px;
  box-shadow: var(--shadow);
  overflow-x: auto;
  scrollbar-width: none;
}
.block-stepper::-webkit-scrollbar { display: none; }

.step-item {
  display: flex; align-items: center; gap: 8px;
  flex-shrink: 0;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background .15s;
}
.step-item:hover.step-done { background: var(--bg); }
.step-item:not(.step-done):not(.step-active) { cursor: default; }

.step-circle {
  width: 26px; height: 26px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.72rem; font-weight: 700;
  flex-shrink: 0;
}
.step-item.step-active .step-circle {
  background: var(--navy); color: var(--white);
}
.step-item.step-done .step-circle {
  background: var(--green); color: var(--white);
  font-size: 0.8rem;
}
.step-item.step-upcoming .step-circle {
  background: var(--border); color: var(--text-muted);
}

.step-label {
  font-size: 0.78rem; font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
}
.step-item.step-active .step-label { color: var(--text); font-weight: 600; }
.step-item.step-done .step-label { color: var(--green); }

.step-connector {
  flex: 1; min-width: 16px; max-width: 32px;
  height: 1px; background: var(--border-dark);
  flex-shrink: 0;
}

/* ── BLOCK CARD ──────────────────────────────────────────── */
.block-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-top: 18px;
  overflow: hidden;
}

.block-card-header {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
}

.block-type-icon { font-size: 1.1rem; }

.block-type-label {
  font-size: 0.7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.8px;
  color: var(--text-muted);
}

.block-title {
  font-size: 1rem; font-weight: 700;
  color: var(--text);
  margin-left: 4px;
}

.block-card-body { padding: 22px 22px; }

/* ── SCENARIO BLOCK ──────────────────────────────────────── */
.scenario-body {
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--text);
}
.scenario-body p { margin-bottom: 14px; }
.scenario-body p:last-child { margin-bottom: 0; }

/* ── CALLOUT BOXES ───────────────────────────────────────── */
.callout {
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  margin: 18px 0;
  font-size: 0.88rem;
  line-height: 1.65;
  border-left: 4px solid;
}
.callout-blue { background: var(--blue-light); border-color: var(--blue); color: #1e3a6e; }
.callout-gold { background: var(--gold-light); border-color: var(--gold); color: #7a4e0a; }
.callout-green { background: var(--green-light); border-color: var(--green); color: #14532d; }
.callout-red { background: var(--red-light); border-color: var(--red); color: #7f1d1d; }

/* ── PLYR THEME ──────────────────────────────────────────── */
:root {
  --plyr-color-main:                    #1e3a5f;
  --plyr-video-control-color:           #fff;
  --plyr-video-control-color-hover:     #fff;
  --plyr-video-control-background-hover:#e8a020;
  --plyr-range-fill-background:         #e8a020;
  --plyr-video-progress-buffered-background: rgba(255,255,255,0.2);
  --plyr-font-size-base:                14px;
  --plyr-control-spacing:               10px;
  --plyr-control-radius:                6px;
}
.plyr { border-radius: var(--radius-sm); overflow: hidden; }
.plyr--video .plyr__controls { padding: 10px 14px; }

/* ── VIDEO BLOCK ─────────────────────────────────────────── */
.video-wrapper {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 */
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #0a1628;
}

.video-inner {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, #0a1628 0%, #1a3550 60%, #0d2040 100%);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px;
}

.video-badge {
  position: absolute; top: 14px; left: 14px;
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.7);
  font-size: 0.72rem; padding: 4px 10px; border-radius: 20px;
  letter-spacing: 0.3px;
}

.play-btn-circle {
  width: 64px; height: 64px;
  background: rgba(255,255,255,0.15);
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: default;
}
.play-btn-circle span { font-size: 1.3rem; margin-left: 4px; }

.video-label {
  color: var(--white);
  font-size: 0.9rem; font-weight: 600;
}
.video-sublabel {
  color: rgba(255,255,255,0.5);
  font-size: 0.78rem; max-width: 360px; text-align: center; line-height: 1.5;
}

.coming-soon-pill {
  background: rgba(232,160,32,0.2);
  color: var(--gold);
  font-size: 0.7rem; font-weight: 700;
  padding: 3px 10px; border-radius: 20px; letter-spacing: 0.5px;
  text-transform: uppercase;
}

.video-expand-btn {
  position: absolute; top: 12px; right: 12px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.8);
  border-radius: 6px;
  padding: 6px 10px; font-size: 0.78rem;
  cursor: pointer; transition: background .15s;
  display: flex; align-items: center; gap: 5px;
}
.video-expand-btn:hover { background: rgba(255,255,255,0.2); }

/* ── VIDEO FULLSCREEN MODAL ──────────────────────────────── */
#video-fullscreen {
  z-index: 1200;
}
#video-fullscreen .video-wrapper {
  width: 90vw; max-width: 1100px;
  padding-top: 0;
  height: calc(90vw * 0.5625);
  max-height: 80vh;
}

/* ── CONTENT BLOCK ───────────────────────────────────────── */
.content-body { font-size: 0.9rem; line-height: 1.75; color: var(--text); }
.content-body h3 { font-size: 1.05rem; font-weight: 700; margin: 22px 0 12px; color: var(--text); }
.content-body p { margin-bottom: 14px; }
.content-body ul { margin: 10px 0 14px 22px; }
.content-body li { margin-bottom: 7px; }

.platform-summary { margin: 16px 0; display: flex; flex-direction: column; gap: 14px; }
.platform-row {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 14px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  font-size: 0.875rem; line-height: 1.55;
}
.logo-circle {
  width: 42px; height: 42px; flex-shrink: 0;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  margin-top: 1px;
}
.platform-logo-img { width: 22px; height: 22px; display: block; }
.platform-visit-link {
  font-size: 0.72rem; font-weight: 600; color: var(--navy-light);
  text-decoration: none; margin-left: 8px;
  border-bottom: 1px solid rgba(45,82,130,0.3);
  padding-bottom: 1px;
}
.platform-visit-link:hover { color: var(--navy); border-bottom-color: var(--navy); }
.safety-link {
  display: inline-block; margin-top: 5px;
  font-size: 0.72rem; color: var(--green); font-weight: 600;
  text-decoration: none; border-bottom: 1px solid rgba(22,163,74,0.3);
}
.safety-link:hover { border-bottom-color: var(--green); }
.age-tag {
  display: inline-block;
  background: var(--border);
  color: var(--text-muted);
  font-size: 0.68rem; font-weight: 600;
  padding: 1px 7px; border-radius: 10px;
  vertical-align: middle; margin-left: 5px;
}

/* ── ACTIVITY BLOCK ──────────────────────────────────────── */
.activity-instruction {
  font-size: 0.87rem; color: var(--text-muted);
  margin-bottom: 18px; line-height: 1.55;
}

.platform-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.platform-card {
  background: var(--bg);
  border: 1.5px solid var(--border-dark);
  border-radius: var(--radius);
  padding: 16px 12px;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
  position: relative;
}
.platform-card:hover:not(.reviewed) { border-color: var(--navy-light); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.platform-card.reviewed { border-color: var(--green); background: var(--green-light); }
.platform-card.expanded { border-color: var(--navy); background: var(--white); box-shadow: var(--shadow-md); }

.pc-logo-circle {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 8px;
}
.pc-logo-img { width: 26px; height: 26px; display: block; }
.pc-logo-text {
  font-size: 0.7rem; font-weight: 800; letter-spacing: 0.5px;
  line-height: 1;
}
.platform-logo-text {
  font-size: 0.7rem; font-weight: 800; letter-spacing: 0.5px;
}
.pc-name { font-size: 0.8rem; font-weight: 700; color: var(--text); }
.pc-reviewed-badge {
  position: absolute; top: -6px; right: -6px;
  width: 20px; height: 20px;
  background: var(--green); color: var(--white);
  border-radius: 50%; font-size: 0.65rem;
  display: flex; align-items: center; justify-content: center;
  display: none;
}
.platform-card.reviewed .pc-reviewed-badge { display: flex; }

.platform-detail {
  display: none;
  margin-top: 10px;
  text-align: left;
  font-size: 0.78rem; line-height: 1.55;
}
.platform-card.expanded .platform-detail { display: block; }

.pd-row { margin-bottom: 7px; }
.pd-label {
  font-size: 0.68rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--text-muted); display: block; margin-bottom: 2px;
}

.platform-detail-btn {
  display: block; width: 100%;
  margin-top: 10px;
  padding: 6px;
  background: var(--navy);
  color: var(--white);
  border: none; border-radius: 5px;
  font-family: var(--font); font-size: 0.75rem; font-weight: 600;
  cursor: pointer; transition: background .15s;
}
.platform-detail-btn:hover { background: var(--navy-light); }

.activity-progress {
  text-align: center;
  font-size: 0.82rem; color: var(--text-muted);
  padding: 10px;
  background: var(--bg);
  border-radius: var(--radius-sm);
}
.activity-progress strong { color: var(--text); }

/* ── TAKEAWAY BLOCK ──────────────────────────────────────── */
.takeaway-desc {
  font-size: 0.87rem; color: var(--text-muted); margin-bottom: 20px; line-height: 1.55;
}

.takeaway-table {
  width: 100%; border-collapse: collapse; font-size: 0.85rem;
}
.takeaway-table th {
  background: var(--navy);
  color: var(--white);
  padding: 10px 14px;
  text-align: left;
  font-size: 0.78rem; font-weight: 600;
  letter-spacing: 0.3px;
}
.takeaway-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  line-height: 1.5;
  vertical-align: top;
}
.takeaway-table tr:nth-child(even) td { background: var(--bg); }


/* ── QUIZ BLOCK ──────────────────────────────────────────── */
.quiz-progress-bar {
  display: flex; gap: 6px; margin-bottom: 22px;
}
.qpb-dot {
  flex: 1; height: 4px; border-radius: 4px;
  background: var(--border-dark); transition: background .3s;
}
.qpb-dot.answered { background: var(--navy); }
.qpb-dot.correct { background: var(--green); }
.qpb-dot.wrong { background: var(--red); }

.quiz-q-count {
  font-size: 0.78rem; color: var(--text-muted);
  margin-bottom: 10px;
}

.quiz-question {
  font-size: 1rem; font-weight: 600;
  color: var(--text); line-height: 1.5;
  margin-bottom: 18px;
}

.quiz-options { display: flex; flex-direction: column; gap: 9px; margin-bottom: 16px; }

.quiz-option {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  border: 1.5px solid var(--border-dark);
  border-radius: var(--radius-sm);
  cursor: pointer; transition: all .15s;
  font-size: 0.9rem;
}
.quiz-option:hover:not(.disabled) { border-color: var(--navy-light); background: #f0f5ff; }
.quiz-option.correct { border-color: var(--green); background: var(--green-light); }
.quiz-option.wrong { border-color: var(--red); background: var(--red-light); }
.quiz-option.disabled { cursor: default; }

.option-letter {
  width: 26px; height: 26px; flex-shrink: 0;
  background: var(--bg);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 700; color: var(--text-muted);
}
.quiz-option.correct .option-letter { background: var(--green); color: var(--white); }
.quiz-option.wrong .option-letter { background: var(--red); color: var(--white); }

.quiz-explanation {
  display: none;
  padding: 14px 16px;
  background: var(--blue-light);
  border-left: 4px solid var(--blue);
  border-radius: var(--radius-sm);
  font-size: 0.86rem; line-height: 1.65;
  color: #1e3a6e;
  margin-bottom: 14px;
}
.quiz-explanation.visible { display: block; }

.quiz-next-btn {
  padding: 10px 24px;
  background: var(--navy);
  color: var(--white);
  border: none; border-radius: var(--radius-sm);
  font-family: var(--font); font-size: 0.875rem; font-weight: 600;
  cursor: pointer; transition: background .2s;
  display: none;
}
.quiz-next-btn.visible { display: inline-block; }
.quiz-next-btn:hover { background: var(--navy-light); }

/* ── QUIZ RESULTS ────────────────────────────────────────── */
.quiz-results {
  text-align: center; padding: 20px 0;
}
.quiz-result-emoji { font-size: 3rem; margin-bottom: 14px; }
.quiz-result-title { font-size: 1.25rem; font-weight: 800; margin-bottom: 8px; }
.quiz-result-score {
  font-size: 2.5rem; font-weight: 800;
  color: var(--navy); margin-bottom: 6px;
}
.quiz-result-desc { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 24px; }

/* ── BLOCK NAV ───────────────────────────────────────────── */
.block-nav {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 20px;
  padding: 16px 22px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.nav-btn {
  display: flex; align-items: center; gap: 7px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-family: var(--font); font-size: 0.875rem; font-weight: 600;
  cursor: pointer; transition: all .2s; border: none;
}

.nav-btn-prev {
  background: var(--bg);
  color: var(--text);
  border: 1.5px solid var(--border-dark);
}
.nav-btn-prev:hover { background: var(--border); }
.nav-btn-prev:disabled { opacity: 0.35; cursor: not-allowed; }

.nav-btn-next {
  background: var(--gold);
  color: var(--white);
}
.nav-btn-next:hover { background: var(--gold-hover); }
.nav-btn-next:disabled { opacity: 0.35; cursor: not-allowed; }

.block-indicator { font-size: 0.8rem; color: var(--text-muted); }

/* ── MODULE COMPLETE ─────────────────────────────────────── */
.module-complete {
  text-align: center; padding: 48px 24px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-top: 18px;
}
.mc-icon { font-size: 3.5rem; margin-bottom: 16px; }
.mc-title { font-size: 1.5rem; font-weight: 800; margin-bottom: 8px; color: var(--text); }
.mc-subtitle { color: var(--text-muted); font-size: 0.92rem; margin-bottom: 24px; line-height: 1.6; }
.mc-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--green-light); color: var(--green);
  font-size: 0.85rem; font-weight: 700;
  padding: 8px 18px; border-radius: 20px; margin-bottom: 24px;
}
.mc-next-info {
  background: var(--bg); border-radius: var(--radius-sm);
  padding: 14px 18px; font-size: 0.85rem;
  color: var(--text-muted); margin-bottom: 0;
}

/* ── LOCKED MODULE PLACEHOLDER ───────────────────────────── */
.locked-placeholder {
  text-align: center; padding: 60px 24px;
  background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow);
}
.locked-placeholder .lock-icon { font-size: 3rem; margin-bottom: 14px; opacity: 0.4; }
.locked-placeholder h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 8px; }
.locked-placeholder p { color: var(--text-muted); font-size: 0.88rem; }

/* ── WELCOME MODAL LOGO ──────────────────────────────────── */
.modal-logo-img {
  height: 38px; width: auto; display: block; margin: 0 auto 10px;
  filter: brightness(0) invert(1); /* white on navy background */
}
.modal-course-title {
  font-size: 1.6rem; font-weight: 800; color: var(--white);
  letter-spacing: -0.5px; margin-bottom: 4px;
}

/* ── TOPBAR LOGO IMG ─────────────────────────────────────── */
.topbar-logo-img {
  height: 22px; width: auto; vertical-align: middle;
  margin-right: 6px; filter: brightness(0) invert(1);
}
.mobile-menu-btn {
  display: none;
  background: none; border: none; color: var(--white);
  font-size: 1.3rem; cursor: pointer; padding: 8px 12px 8px 0;
  line-height: 1;
}

/* ── TRACK PICKER ────────────────────────────────────────── */
#track-picker-overlay { z-index: 1050; }

#track-picker-modal {
  background: var(--white);
  border-radius: 16px;
  width: 100%; max-width: 640px;
  padding: 40px 36px 36px;
  box-shadow: var(--shadow-lg);
  max-height: 90vh; overflow-y: auto;
}

.picker-header {
  text-align: center; margin-bottom: 32px;
}
.picker-logo {
  height: 36px; width: auto; margin: 0 auto 14px; display: block;
}
.picker-header h2 {
  font-size: 1.5rem; font-weight: 800; color: var(--text);
  margin-bottom: 6px; letter-spacing: -0.3px;
}
.picker-header p {
  color: var(--text-muted); font-size: 0.9rem;
}

.track-cards {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
  margin-bottom: 20px;
}

.track-card {
  border: 2px solid var(--border-dark);
  border-radius: var(--radius);
  padding: 24px 20px;
  cursor: pointer;
  transition: all .2s;
  text-align: center;
  background: var(--bg);
}
.track-card:hover {
  border-color: var(--navy-light);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  background: var(--white);
}
.track-card.selected {
  border-color: var(--gold);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(232,160,32,0.2);
}

.tc-icon { font-size: 2.5rem; margin-bottom: 10px; }
.tc-title { font-size: 1.1rem; font-weight: 800; color: var(--text); margin-bottom: 4px; }
.tc-age  {
  display: inline-block;
  background: var(--navy); color: var(--white);
  font-size: 0.7rem; font-weight: 700;
  padding: 2px 10px; border-radius: 20px;
  margin-bottom: 12px;
}
.tc-desc  { font-size: 0.82rem; color: var(--text-muted); line-height: 1.55; margin-bottom: 12px; }
.tc-modules { font-size: 0.75rem; font-weight: 700; color: var(--navy-light); }

.picker-both-note {
  background: var(--blue-light);
  border-left: 4px solid var(--blue);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 0.82rem; color: #1e3a6e; line-height: 1.55;
  margin-bottom: 22px;
}

#picker-begin-btn {
  width: 100%;
  padding: 14px;
  background: var(--gold);
  color: var(--white);
  border: none; border-radius: var(--radius-sm);
  font-family: var(--font); font-size: 0.95rem; font-weight: 700;
  cursor: pointer; transition: background .2s, opacity .2s;
}
#picker-begin-btn:hover:not(:disabled) { background: var(--gold-hover); }
#picker-begin-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── TERMS MODAL UPDATES ─────────────────────────────────── */
.terms-body h4 {
  font-size: 0.88rem; font-weight: 700; color: var(--text);
  margin: 20px 0 6px;
}
.terms-body ul { margin: 6px 0 12px 20px; }
.terms-body li { margin-bottom: 4px; }

/* ── TRACK TOGGLE PILL ───────────────────────────────────── */
.track-toggle {
  display: flex;
  margin: 10px 12px 6px;
  background: rgba(255,255,255,0.07);
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}
.track-toggle-btn {
  flex: 1;
  padding: 6px 8px;
  border: none; border-radius: 6px;
  font-family: var(--font); font-size: 0.75rem; font-weight: 600;
  cursor: pointer;
  background: transparent;
  color: rgba(255,255,255,0.5);
  transition: all .2s;
}
.track-toggle-btn.active {
  background: var(--gold);
  color: var(--white);
}
.track-toggle-btn:hover:not(.active) {
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.8);
}

/* ── FEEDBACK FAB ────────────────────────────────────────── */
#feedback-fab {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 400;
  display: flex; align-items: center; gap: 7px;
  padding: 10px 18px 10px 14px;
  background: var(--navy);
  color: var(--white);
  border: none; border-radius: 30px;
  font-family: var(--font); font-size: 0.85rem; font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(30,58,95,0.35);
  transition: all .2s;
  z-index: 485; /* above bottom-nav (480) but below modals (1000+) */
}
#feedback-fab:hover { background: var(--navy-light); transform: translateY(-1px); box-shadow: 0 6px 18px rgba(30,58,95,0.4); }
.fab-icon { font-size: 1rem; }
.fab-label { font-size: 0.82rem; }

/* ── FEEDBACK MODAL ──────────────────────────────────────── */
#feedback-modal-overlay { z-index: 1100; }

#feedback-modal {
  background: var(--white);
  border-radius: var(--radius);
  width: 100%; max-width: 400px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.feedback-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  background: var(--navy);
}
.feedback-header h3 { font-size: 1rem; font-weight: 700; color: var(--white); }
.feedback-header button {
  background: none; border: none; color: rgba(255,255,255,0.6);
  font-size: 1rem; cursor: pointer; padding: 4px 6px; border-radius: 4px;
  transition: color .15s;
}
.feedback-header button:hover { color: var(--white); }

#feedback-form-wrap { padding: 22px; }

.star-row {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 18px; flex-wrap: wrap;
}
.star-label { font-size: 0.85rem; color: var(--text-muted); white-space: nowrap; }
.stars { display: flex; gap: 4px; }
.star-btn {
  background: none; border: none;
  font-size: 1.6rem; color: var(--border-dark);
  cursor: pointer; padding: 2px;
  transition: color .15s, transform .1s;
  line-height: 1;
}
.star-btn:hover, .star-btn.active { color: var(--gold); transform: scale(1.1); }

#feedback-modal .form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border-dark);
  border-radius: var(--radius-sm);
  font-family: var(--font); font-size: 0.875rem;
  color: var(--text); resize: vertical;
  outline: none; transition: border-color .2s;
}
#feedback-modal .form-group textarea:focus { border-color: var(--navy-light); }
#feedback-modal .form-group label {
  display: block; font-size: 0.82rem; font-weight: 600;
  margin-bottom: 6px;
}

.feedback-submit-btn {
  width: 100%; padding: 11px;
  background: var(--gold); color: var(--white);
  border: none; border-radius: var(--radius-sm);
  font-family: var(--font); font-size: 0.9rem; font-weight: 700;
  cursor: pointer; transition: background .2s; margin-top: 6px;
}
.feedback-submit-btn:hover { background: var(--gold-hover); }

#feedback-thanks {
  padding: 40px 22px;
  text-align: center;
}
.feedback-thanks-icon {
  width: 52px; height: 52px;
  background: var(--green); color: var(--white);
  border-radius: 50%; font-size: 1.5rem;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px;
}
.feedback-thanks-msg { font-size: 0.95rem; font-weight: 600; color: var(--text); }

/* ── CERTIFICATE MODAL ───────────────────────────────────── */
#cert-overlay { z-index: 1200; }

#cert-modal {
  background: var(--white);
  border-radius: var(--radius);
  width: 100%; max-width: 640px;
  padding: 0;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.cert-preview { padding: 28px 28px 0; }

.cert-border {
  border: 3px solid var(--navy);
  border-radius: var(--radius-sm);
  padding: 32px 28px 28px;
  text-align: center;
  position: relative;
  background: #fbfcfe;
}
.cert-border::before {
  content: '';
  position: absolute; top: 6px; left: 6px; right: 6px; bottom: 6px;
  border: 1px solid rgba(30,58,95,0.15);
  border-radius: 6px; pointer-events: none;
}
/* Gold top accent */
.cert-border::after {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 5px; background: var(--gold);
  border-radius: 4px 4px 0 0;
}

.cert-logo {
  height: 32px; width: auto; display: block; margin: 0 auto 16px;
}
.cert-headline {
  font-size: 1.35rem; font-weight: 800; color: var(--navy);
  letter-spacing: -0.3px; margin-bottom: 4px;
}
.cert-subhead {
  font-size: 0.78rem; color: var(--text-muted); margin-bottom: 14px;
}
.cert-rule {
  height: 2px;
  background: linear-gradient(to right, transparent, var(--gold), transparent);
  margin: 12px 24px;
}
.cert-certifies { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 8px; }
.cert-name {
  font-size: 1.8rem; font-weight: 800; color: var(--navy);
  letter-spacing: -0.5px; margin-bottom: 10px; font-style: italic;
}
.cert-completed { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 8px; }
.cert-track {
  font-size: 1rem; font-weight: 700; color: var(--text);
  margin-bottom: 4px;
}
.cert-date { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 6px; margin-top: 6px; }
.cert-issuer { font-size: 0.72rem; color: var(--text-light); }

.cert-actions {
  display: flex; gap: 10px; justify-content: center;
  padding: 20px 28px 24px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.cert-download-btn {
  padding: 11px 24px;
  background: var(--gold); color: var(--white);
  border: none; border-radius: var(--radius-sm);
  font-family: var(--font); font-size: 0.9rem; font-weight: 700;
  cursor: pointer; transition: background .2s;
}
.cert-download-btn:hover { background: var(--gold-hover); }

.cert-trigger-btn {
  display: inline-block; margin-top: 18px;
  padding: 12px 28px;
  background: var(--gold); color: var(--white);
  border: none; border-radius: var(--radius-sm);
  font-family: var(--font); font-size: 0.95rem; font-weight: 700;
  cursor: pointer; transition: background .2s;
}
.cert-trigger-btn:hover { background: var(--gold-hover); }

/* ── SIDEBAR OVERLAY (mobile) ────────────────────────────── */
#sidebar-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 490;
}

/* ── BOTTOM NAV (mobile only — hidden on desktop) ───────── */
#bottom-nav {
  display: none; /* shown only inside @media (max-width: 768px) */
  position: fixed; bottom: 0; left: 0; right: 0;
  height: 56px;
  background: var(--navy);
  border-top: 1px solid rgba(255,255,255,0.1);
  align-items: stretch;
  z-index: 480;
}
#bottom-nav button {
  flex: 1; border: none; background: none;
  color: rgba(255,255,255,0.7);
  font-family: var(--font); font-size: 0.72rem; font-weight: 600;
  cursor: pointer; padding: 8px 4px;
  border-right: 1px solid rgba(255,255,255,0.08);
  transition: background .15s, color .15s;
}
#bottom-nav button:last-child { border-right: none; }
#bottom-nav button:hover { background: rgba(255,255,255,0.07); color: var(--white); }

/* ── RESPONSIVE — TABLET ─────────────────────────────────── */
@media (max-width: 1024px) {
  :root { --sidebar-w: 260px; }

  .platform-grid { grid-template-columns: repeat(3, 1fr); }

  #module-container { padding: 22px 22px 60px; }

  .track-cards { grid-template-columns: 1fr 1fr; gap: 12px; }
}

/* ── RESPONSIVE — MOBILE ─────────────────────────────────── */
@media (max-width: 768px) {
  body { overflow: auto; }

  /* Topbar */
  #topbar { padding: 0 14px; }
  .topbar-left { width: auto; border-right: none; padding: 0; gap: 8px; }
  .topbar-logo strong { display: none; } /* hide text, keep logo image */
  .topbar-logo-img { height: 20px; }
  .topbar-center { display: none; }
  .user-badge { display: none; }
  .btn-exit { font-size: 0.75rem; padding: 6px 10px; }
  .mobile-menu-btn { display: block; }

  /* Main layout */
  #main-layout {
    padding-top: var(--topbar-h);
    flex-direction: column;
    height: auto;
    min-height: 100vh;
  }

  /* Sidebar becomes a fixed drawer */
  #sidebar {
    position: fixed;
    top: var(--topbar-h); left: 0; bottom: 0;
    width: min(var(--sidebar-w), 85vw);
    transform: translateX(-110%);
    transition: transform .3s ease;
    z-index: 495;
    height: auto;
  }
  #sidebar.open { transform: translateX(0); }

  /* Content area fills screen, leaves room for bottom nav */
  #content-area {
    flex: 1;
    width: 100%;
    height: auto;
    overflow-y: visible;
    padding-bottom: 72px;
  }

  #module-container { padding: 16px 16px 24px; }

  /* Block stepper — hide labels on small screens */
  .step-label { display: none; }
  .step-connector { min-width: 10px; }

  /* Platform grid — 2 cols on mobile */
  .platform-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }

  /* Takeaway table — horizontal scroll */
  .takeaway-table { font-size: 0.78rem; }
  .block-card-body { overflow-x: auto; }

  /* Module complete */
  #module-container .module-complete { padding: 32px 16px; }
  .mc-title { font-size: 1.2rem; }

  /* Track cards in picker — stacked on mobile */
  .track-cards { grid-template-columns: 1fr; }

  /* Welcome modal */
  #welcome-modal { margin: 16px; border-radius: 12px; }
  .modal-header { padding: 24px 24px 20px; }
  .modal-body { padding: 24px; }

  /* Track picker */
  #track-picker-modal { margin: 16px; border-radius: 12px; padding: 28px 20px 24px; }

  /* Bottom nav visible */
  #bottom-nav { display: flex; }

  /* Feedback FAB — keep above bottom nav */
  #feedback-fab { bottom: 72px; right: 16px; padding: 9px 14px; }
  .fab-label { display: none; }

  /* Certificate modal */
  #cert-modal { margin: 12px; }
  .cert-border { padding: 20px 16px; }
  .cert-name { font-size: 1.3rem; }
  .cert-headline { font-size: 1.1rem; }

  /* Modules header */
  .module-title-main { font-size: 1.25rem; }

  /* Quiz options text size */
  .quiz-option { font-size: 0.85rem; }
}

@media (max-width: 420px) {
  .platform-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .pc-logo-circle { width: 40px; height: 40px; }
  .pc-logo-img { width: 22px; height: 22px; }
  .block-stepper { padding: 10px 12px; gap: 0; }
}

/* ── PROGRESS TOAST ─────────────────────────────────────────── */
.progress-toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--navy);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 10px 20px;
  border-radius: 24px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 600;
  pointer-events: none;
  white-space: nowrap;
}
.progress-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
