/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #1a3a5c;
  --primary-light: #2563a8;
  --accent: #e8a020;
  --accent-dark: #c47f10;
  --success: #16a34a;
  --danger: #dc2626;
  --bg: #f5f7fa;
  --card-bg: #ffffff;
  --sidebar-bg: #0f2540;
  --sidebar-width: 280px;
  --text: #1e2a3a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --progress-h: 56px;
  --header-h: 64px;
  --radius: 12px;
  --shadow: 0 4px 20px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.15);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ===== LAYOUT ===== */
#app { display: flex; flex-direction: column; min-height: 100vh; }

.main-layout {
  display: flex;
  flex: 1;
  padding-bottom: var(--progress-h);
  padding-top: var(--header-h);
}

/* ===== HEADER ===== */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  height: var(--header-h);
  background: var(--primary);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}

.site-header .logo {
  display: flex; align-items: center; gap: 12px;
}

.logo-badge {
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  font-size: 13px;
  padding: 4px 10px;
  border-radius: 6px;
  letter-spacing: 0.5px;
}

.site-header h1 {
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.header-right {
  display: flex; align-items: center; gap: 16px;
}

.user-badge {
  background: rgba(255,255,255,0.15);
  color: #fff;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid rgba(255,255,255,0.2);
}

/* ===== SIDEBAR ===== */
.sidebar {
  position: fixed;
  top: var(--header-h);
  left: 0;
  bottom: var(--progress-h);
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  overflow-y: auto;
  z-index: 100;
  border-right: 1px solid rgba(255,255,255,0.05);
  transition: transform 0.3s ease;
}

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

.sidebar-inner { padding: 20px 0 30px; }

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

.sidebar-stage-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255,255,255,0.4);
  cursor: pointer;
  user-select: none;
}

.stage-status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  flex-shrink: 0;
}

.stage-status-dot.completed { background: var(--success); }
.stage-status-dot.active { background: var(--accent); }
.stage-status-dot.locked { background: rgba(255,255,255,0.15); }

.sidebar-lesson {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 20px 10px 28px;
  color: rgba(255,255,255,0.55);
  font-size: 13px;
  font-weight: 400;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
  border-left: 3px solid transparent;
  position: relative;
}

.sidebar-lesson:hover:not(.locked) {
  color: rgba(255,255,255,0.9);
  background: rgba(255,255,255,0.05);
}

.sidebar-lesson.active {
  color: #fff;
  background: rgba(37,99,168,0.4);
  border-left-color: var(--accent);
  font-weight: 600;
}

.sidebar-lesson.completed {
  color: rgba(255,255,255,0.7);
}

.sidebar-lesson.locked {
  color: rgba(255,255,255,0.25);
  cursor: not-allowed;
}

.lesson-icon {
  width: 18px; height: 18px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
}

.sidebar-lesson.completed .lesson-icon::before { content: "✓"; color: var(--success); font-weight: 700; }
.sidebar-lesson.active .lesson-icon::before { content: "▶"; color: var(--accent); font-size: 9px; }
.sidebar-lesson.locked .lesson-icon::before { content: "🔒"; font-size: 10px; }
.sidebar-lesson:not(.completed):not(.active):not(.locked) .lesson-icon::before { content: "○"; color: rgba(255,255,255,0.3); }

.sidebar-quiz-link, .sidebar-cert-link {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 20px;
  color: rgba(255,255,255,0.4);
  font-size: 13px; font-weight: 600;
  cursor: not-allowed;
  border-left: 3px solid transparent;
  text-transform: uppercase; letter-spacing: 0.5px;
}

.sidebar-quiz-link.unlocked {
  color: var(--accent);
  cursor: pointer;
  background: rgba(232,160,32,0.1);
  border-left-color: var(--accent);
}

.sidebar-quiz-link.unlocked:hover { background: rgba(232,160,32,0.2); }

/* ===== MAIN CONTENT ===== */
.content-area {
  margin-left: var(--sidebar-width);
  flex: 1;
  padding: 40px 48px;
  max-width: calc(100% - var(--sidebar-width));
  min-height: calc(100vh - var(--header-h) - var(--progress-h));
}

/* ===== PAGE PANELS ===== */
.page { display: none; }
.page.active { display: block; animation: fadeIn 0.3s ease; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ===== WELCOME PAGE ===== */
.welcome-hero {
  background: linear-gradient(135deg, var(--primary) 0%, #1e4d7b 50%, #2563a8 100%);
  border-radius: 20px;
  padding: 56px 48px;
  color: #fff;
  margin-bottom: 40px;
  position: relative;
  overflow: hidden;
}

.welcome-hero::before {
  content: "";
  position: absolute; top: -60px; right: -60px;
  width: 250px; height: 250px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
}

.welcome-hero::after {
  content: "";
  position: absolute; bottom: -40px; right: 80px;
  width: 150px; height: 150px;
  border-radius: 50%;
  background: rgba(255,255,255,0.04);
}

.hero-tag {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: 11px; font-weight: 700;
  padding: 4px 12px; border-radius: 12px;
  text-transform: uppercase; letter-spacing: 1px;
  margin-bottom: 16px;
}

.welcome-hero h2 {
  font-size: 32px; font-weight: 800;
  line-height: 1.2; margin-bottom: 14px;
}

.welcome-hero p { font-size: 16px; opacity: 0.85; max-width: 580px; line-height: 1.6; }

.welcome-meta {
  display: flex; gap: 24px; margin-top: 28px; flex-wrap: wrap;
}

.meta-chip {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 13px; font-weight: 500;
}

.stages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.stage-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 24px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}

.stage-card:hover:not(.locked) {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-light);
}

.stage-card.locked { opacity: 0.55; cursor: not-allowed; }
.stage-card.completed { border-color: var(--success); }

.stage-card-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  margin-bottom: 14px;
}

.stage-card h3 { font-size: 14px; font-weight: 700; margin-bottom: 6px; }
.stage-card p { font-size: 13px; color: var(--text-muted); line-height: 1.5; }

.stage-badge {
  position: absolute; top: 14px; right: 14px;
  font-size: 10px; font-weight: 700;
  padding: 3px 8px; border-radius: 8px;
  text-transform: uppercase; letter-spacing: 0.5px;
}

.badge-locked { background: #e2e8f0; color: #94a3b8; }
.badge-active { background: #dbeafe; color: var(--primary-light); }
.badge-completed { background: #dcfce7; color: var(--success); }

.start-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--primary);
  color: #fff;
  font-size: 15px; font-weight: 600;
  padding: 14px 32px;
  border-radius: 10px;
  border: none; cursor: pointer;
  transition: all 0.2s;
  margin-top: 12px;
}

.start-btn:hover { background: var(--primary-light); transform: translateY(-1px); }

/* ===== LESSON PAGE ===== */
.lesson-header {
  margin-bottom: 32px;
}

.breadcrumb {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text-muted);
  margin-bottom: 16px;
}

.breadcrumb a { color: var(--primary-light); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb span { color: var(--text-muted); }

.lesson-stage-tag {
  display: inline-block;
  font-size: 11px; font-weight: 700;
  padding: 4px 10px; border-radius: 8px;
  background: #dbeafe; color: var(--primary);
  text-transform: uppercase; letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.lesson-title {
  font-size: 26px; font-weight: 800;
  color: var(--primary); margin-bottom: 8px;
}

.lesson-subtitle { font-size: 15px; color: var(--text-muted); }

.lesson-divider {
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent), transparent);
  border-radius: 2px;
  margin: 24px 0;
}

.lesson-body {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 36px 40px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  margin-bottom: 32px;
  line-height: 1.8;
  font-size: 15px;
}

.lesson-body h3 {
  font-size: 17px; font-weight: 700;
  color: var(--primary); margin: 24px 0 12px;
}

.lesson-body h3:first-child { margin-top: 0; }

.lesson-body p { margin-bottom: 14px; }

.lesson-body ul, .lesson-body ol {
  padding-left: 24px; margin-bottom: 16px;
}

.lesson-body li { margin-bottom: 8px; }

.lesson-body strong { color: var(--primary); }

.callout {
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  border-left: 4px solid var(--primary-light);
  border-radius: 0 8px 8px 0;
  padding: 16px 20px;
  margin: 20px 0;
  font-size: 14px;
  font-style: italic;
}

.callout.warning {
  background: linear-gradient(135deg, #fff7ed, #fed7aa);
  border-left-color: var(--accent);
}

.callout.success {
  background: linear-gradient(135deg, #f0fdf4, #dcfce7);
  border-left-color: var(--success);
}

.scenario-box {
  background: linear-gradient(135deg, #f8fafc, #f1f5f9);
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 20px 24px;
  margin: 20px 0;
}

.scenario-box .scenario-label {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px;
  color: var(--text-muted); margin-bottom: 8px;
}

.scripts-box {
  background: #1e2a3a;
  border-radius: 10px;
  padding: 20px 24px;
  margin: 20px 0;
}

.scripts-box p {
  color: rgba(255,255,255,0.85);
  font-size: 14px;
  font-style: italic;
  margin-bottom: 10px;
}

.scripts-box p:last-child { margin-bottom: 0; }

.lesson-nav {
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px;
  padding-top: 8px;
}

.nav-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 14px; font-weight: 600;
  border: none; cursor: pointer;
  transition: all 0.2s;
}

.nav-btn.prev {
  background: #f1f5f9; color: var(--text);
}

.nav-btn.prev:hover { background: #e2e8f0; }

.nav-btn.next {
  background: var(--primary); color: #fff;
}

.nav-btn.next:hover { background: var(--primary-light); }

.nav-btn.complete {
  background: var(--success); color: #fff;
}

.nav-btn.complete:hover { background: #15803d; }

.nav-btn.quiz {
  background: var(--accent); color: #fff;
}

.nav-btn.quiz:hover { background: var(--accent-dark); }

/* ===== QUIZ PAGE ===== */
.quiz-header {
  background: linear-gradient(135deg, #1e3a5f, var(--primary-light));
  border-radius: 16px;
  padding: 36px 40px;
  color: #fff; margin-bottom: 36px;
}

.quiz-header h2 { font-size: 26px; font-weight: 800; margin-bottom: 8px; }
.quiz-header p { opacity: 0.85; font-size: 15px; }

.quiz-meta-bar {
  display: flex; gap: 24px; margin-top: 20px; flex-wrap: wrap;
}

.quiz-meta-item {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.12);
  padding: 6px 14px; border-radius: 20px;
  font-size: 13px; font-weight: 500;
}

.question-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 32px 36px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  margin-bottom: 28px;
}

.question-number {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px;
  color: var(--primary-light); margin-bottom: 12px;
}

.question-text {
  font-size: 17px; font-weight: 600;
  line-height: 1.6; color: var(--text);
  margin-bottom: 24px;
}

.options-grid { display: flex; flex-direction: column; gap: 10px; }

.option-label {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 14px 18px;
  border-radius: 10px;
  border: 2px solid var(--border);
  cursor: pointer;
  transition: all 0.2s;
  background: var(--card-bg);
  font-size: 14px; line-height: 1.5;
}

.option-label:hover { border-color: var(--primary-light); background: #f0f7ff; }
.option-label input[type="radio"] { display: none; }

.option-label.selected { border-color: var(--primary); background: #eff6ff; }
.option-label.correct { border-color: var(--success); background: #f0fdf4; }
.option-label.incorrect { border-color: var(--danger); background: #fef2f2; }

.option-key {
  min-width: 28px; height: 28px;
  border-radius: 50%;
  background: #e2e8f0;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  color: var(--text-muted);
  flex-shrink: 0;
}

.option-label.selected .option-key { background: var(--primary); color: #fff; }
.option-label.correct .option-key { background: var(--success); color: #fff; }
.option-label.incorrect .option-key { background: var(--danger); color: #fff; }

.quiz-submit-area {
  display: flex; justify-content: center; padding: 12px 0 40px;
}

.submit-btn {
  background: var(--primary);
  color: #fff;
  font-size: 16px; font-weight: 700;
  padding: 16px 48px;
  border-radius: 12px;
  border: none; cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 16px rgba(26,58,92,0.3);
}

.submit-btn:hover { background: var(--primary-light); transform: translateY(-1px); }
.submit-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ===== RESULTS ===== */
.result-panel {
  background: var(--card-bg);
  border-radius: 20px;
  padding: 48px;
  text-align: center;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  margin-bottom: 32px;
}

.result-score-ring {
  width: 140px; height: 140px;
  border-radius: 50%;
  margin: 0 auto 24px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  font-size: 36px; font-weight: 800;
  border: 8px solid;
}

.result-score-ring.pass { border-color: var(--success); color: var(--success); }
.result-score-ring.fail { border-color: var(--danger); color: var(--danger); }

.result-score-ring small { font-size: 12px; font-weight: 500; color: var(--text-muted); margin-top: 2px; }

.result-title { font-size: 24px; font-weight: 800; margin-bottom: 10px; }
.result-sub { font-size: 15px; color: var(--text-muted); max-width: 460px; margin: 0 auto 28px; line-height: 1.6; }

.result-actions { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; }

.cert-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--accent);
  color: #fff; font-size: 15px; font-weight: 700;
  padding: 14px 32px; border-radius: 12px;
  border: none; cursor: pointer;
  transition: all 0.2s;
}

.cert-btn:hover { background: var(--accent-dark); transform: translateY(-1px); }

.retry-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: #f1f5f9; color: var(--text);
  font-size: 15px; font-weight: 600;
  padding: 14px 32px; border-radius: 12px;
  border: none; cursor: pointer;
  transition: all 0.2s;
}

.retry-btn:hover { background: #e2e8f0; }

/* ===== CERTIFICATION PAGE ===== */
.cert-page {
  display: flex; flex-direction: column; align-items: center;
  padding: 40px 20px;
  overflow-x: auto;
}

.certificate {
  border-radius: 4px;
  max-width: none;
  width: fit-content;
  padding: 0;
  position: relative;
  overflow: visible;
}

/* ── Outer navy card — A4 landscape (297×210 mm at 96 dpi ≈ 1122×794 px) ── */
    .cert-outer {
        background: #1b2a6b;
        border-radius: 6px;
        padding: 18px;
        position: relative;
        box-shadow: 0 24px 64px rgba(0, 0, 0, 0.32);
        width: 1010px;
        height: auto;
        box-sizing: border-box;
        }

    /* corner gold pins */
    .cert-outer::before,
    .cert-outer::after,
    .cert-outer .c-bl,
    .cert-outer .c-br {
        content: "";
        position: absolute;
        width: 11px;
        height: 11px;
        border-radius: 50%;
        background: #c9a84c;
        z-index: 2;
    }

    .cert-outer::before {
        top: 13px;
        left: 13px;
    }

    .cert-outer::after {
        top: 13px;
        right: 13px;
    }

    .cert-outer .c-bl {
        bottom: 13px;
        left: 13px;
    }

    .cert-outer .c-br {
        bottom: 13px;
        right: 13px;
    }

    /* ── Gold frame ── */
    .cert-frame {
        border: 2px solid #c9a84c;
        border-radius: 3px;
        position: relative;
        height: calc(100% - 36px);
        display: flex;
        flex-direction: column;
    }

    .cert-frame::before,
    .cert-frame::after,
    .cert-frame .f-bl,
    .cert-frame .f-br {
        content: "";
        position: absolute;
        width: 34px;
        height: 34px;
        border-color: #c9a84c;
        border-style: solid;
        z-index: 1;
    }

    .cert-frame::before {
        top: -2px;
        left: -2px;
        border-width: 3px 0 0 3px;
        border-radius: 2px 0 0 0;
    }

    .cert-frame::after {
        top: -2px;
        right: -2px;
        border-width: 3px 3px 0 0;
        border-radius: 0 2px 0 0;
    }

    .cert-frame .f-bl {
        bottom: -2px;
        left: -2px;
        border-width: 0 0 3px 3px;
        border-radius: 0 0 0 2px;
    }

    .cert-frame .f-br {
        bottom: -2px;
        right: -2px;
        border-width: 0 3px 3px 0;
        border-radius: 0 0 2px 0;
    }

    /* ── White inner body ── */
    .cert-inner {
        background: #fff;
        padding: 42px 64px 34px;
        text-align: center;
        position: relative;
        overflow: hidden;
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }

    /* ── Watermark ── */
    .watermark {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 460px;
        height: 460px;
        background-size: contain;
        background-repeat: no-repeat;
        background-position: center;
        opacity: 0.10;
        pointer-events: none;
        z-index: 0;
    }

    .cert-inner>*:not(.watermark) {
        position: relative;
        z-index: 1;
    }

    /* ── Header: logo + org name ── */
    .org-header {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 14px;
/*        margin-bottom: 18px;*/
        padding-bottom: 16px;
        /*      border-bottom: 1px solid #e8e3d8;*/
    }

    .org-logo {
        width: 95px;
        height: 95px;
        object-fit: contain;
        flex-shrink: 0;
    }

    .org-text {
        text-align: left;
    }

    .org-name-main {
        font-family: "Lato", sans-serif;
        font-size: 22px;
        font-weight: 900;
        color: #1b2a6b;
        letter-spacing: 0.04em;
        line-height: 1.3;
    }

    .org-name-abbr {
        font-family: "Lato", sans-serif;
        font-size: 15px;
        font-weight: 400;
        color: #7a6000;
        letter-spacing: 0.06em;
        margin-top: 1px;
    }

    .org-tagline {
        font-family: "Lato", sans-serif;
        font-size: 10px;
        font-weight: 400;
        color: #e05a10;
        letter-spacing: 0.1em;
        text-transform: uppercase;
        margin-top: 3px;
    }

    /* ── Certificate title ── */
    .cert-title {
        font-family: "Playfair Display", serif;
        font-size: 13px;
        font-weight: 600;
        color: #1b2a6b;
        line-height: 1.2;
        margin-bottom: 10px;
    }

    /* ── "THIS IS TO CERTIFY THAT" ── */
    .cert-eyebrow {
        font-size: 10px;
        font-weight: 700;
        letter-spacing: 0.2em;
        color: #c9a84c;
/*        text-transform: uppercase;*/
        margin-bottom: 26px;
    }

    /* ── Recipient ── */
    .recipient {
        font-family: "Dancing Script", cursive;
        font-size: 36px;
        color: #1b2a6b;
        line-height: 1.1;
        margin-bottom: 12px;
    }

    /* ── Divider ── */
    .divider {
        width: 340px;
        height: 1px;
        background: linear-gradient(90deg, transparent, #c9a84c 20%, #c9a84c 80%, transparent);
        margin: 0 auto 16px;
    }

    /* ── Body text ── */
    .cert-body {
        font-size: 13px;
        font-weight: 500;
        color: #333;
        line-height: 1.8;
        max-width: 630px;
        margin: 0 auto 20px;
    }


    /* ── Body text ── */
    .cert-accent {
        font-size: 10px;
        font-weight: 300;
        color: #333;
        line-height: 1.3;
        max-width: 530px;
        margin: 0 auto 14px;
    }

    /* ── Signatures ── */
    .signatures {
        display: flex;
        align-items: flex-end;
        justify-content: space-between;
        gap: 20px;
        margin-bottom: 26px;
    }

    .sig-block {
        flex: 1;
        text-align: center;
    }

    .sig-art {
        height: 48px;
        display: flex;
        align-items: flex-end;
        justify-content: center;
        margin-bottom: 5px;
    }

    .sig-rule {
        width: 130px;
        height: 1px;
        background: #1b2a6b;
        margin: 0 auto 5px;
    }

    .sig-name {
        font-size: 11px;
        font-weight: 700;
        color: #1b2a6b;
        letter-spacing: 0.08em;
        text-transform: uppercase;
    }

    .sig-role {
        font-size: 11px;
        font-weight: 300;
        color: #666;
        margin-top: 2px;
    }

    /* ── Stamp ── */
    .stamp-wrap {
        flex: 0 0 auto;
        display: flex;
        align-items: center;
        justify-content: center;
        padding-bottom: 6px;
    }

    /* ── Orange YAC banner accent (echoes logo) ── */
    .yac-accent {
        display: inline-block;
        background: #e05a10;
        color: #fff;
        font-size: 9px;
        font-weight: 700;
        letter-spacing: 0.18em;
        text-transform: uppercase;
        padding: 3px 12px;
        border-radius: 2px;
        margin-bottom: 8px;
    }

    /* ── Footer meta ── */
    .cert-meta {
        border-top: 1px solid #ececec;
        padding-top: 13px;
        display: flex;
        justify-content: center;
        gap: 44px;
    }

    .meta-pair {
        font-size: 12px;
        color: #333;
    }

    .meta-label {
        font-weight: 700;
        margin-right: 5px;
    }

    /* ── Buttons ── */
    .actions {
        margin-top: 22px;
        display: flex;
        gap: 12px;
        justify-content: center;
    }

    .btn {
        padding: 10px 28px;
        border-radius: 4px;
        font-family: "Lato", sans-serif;
        font-size: 13px;
        font-weight: 700;
        letter-spacing: 0.06em;
        cursor: pointer;
        border: none;
        transition: opacity .2s;
    }

    .btn:hover {
        opacity: .82;
    }

    .btn-primary {
        background: #1b2a6b;
        color: #fff;
    }

    .btn-orange {
        background: #e05a10;
        color: #fff;
    }

    @media print {
        body {
            background: none;
            padding: 0;
        }

        .actions {
            display: none;
        }

        .cert-outer {
            box-shadow: none;
        }
    }


/*    @media (max-width: 640px) {
        .cert-inner {
            padding: 28px 22px 22px;
        }

        .cert-title {
            font-size: 26px;
        }

        .recipient {
            font-size: 38px;
        }

        .org-logo {
            width: 52px;
            height: 52px;
        }

        .signatures {
            flex-direction: column;
            align-items: center;
            gap: 20px;
        }

        .cert-meta {
            flex-direction: column;
            gap: 8px;
        }
    }*/

/* ===== PROGRESS BAR ===== */
.progress-bar-fixed {
  position: fixed; bottom: 0; left: 0; right: 0;
  height: var(--progress-h);
  background: #fff;
  border-top: 1px solid var(--border);
  z-index: 300;
  display: flex; align-items: center;
  padding: 0 24px 0 calc(var(--sidebar-width) + 24px);
  gap: 20px;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.06);
}

.progress-label { font-size: 12px; font-weight: 700; color: var(--text-muted); white-space: nowrap; min-width: 140px; }
.progress-label span { color: var(--primary-light); }

.progress-track {
  flex: 1;
  height: 10px;
  background: #e2e8f0;
  border-radius: 6px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 6px;
  transition: width 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.progress-percent {
  font-size: 13px; font-weight: 700;
  color: var(--primary); min-width: 40px; text-align: right;
}

/* ===== NAME MODAL ===== */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 500;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
}

.modal-box {
  background: #fff;
  border-radius: 20px;
  padding: 48px;
  max-width: 440px; width: 90%;
  text-align: center;
  box-shadow: var(--shadow-lg);
  animation: fadeIn 0.3s ease;
}

.modal-icon { font-size: 48px; margin-bottom: 16px; }
.modal-box h2 { font-size: 22px; font-weight: 800; color: var(--primary); margin-bottom: 8px; }
.modal-box p { font-size: 14px; color: var(--text-muted); margin-bottom: 24px; line-height: 1.6; }

.name-input {
  width: 100%;
  padding: 14px 18px;
  border: 2px solid var(--border);
  border-radius: 10px;
  font-size: 16px;
  outline: none;
  transition: border-color 0.2s;
  font-family: inherit;
}

.name-input:focus { border-color: var(--primary); }

.modal-btn {
  width: 100%; margin-top: 16px;
  background: var(--primary); color: #fff;
  font-size: 15px; font-weight: 700;
  padding: 14px;
  border-radius: 10px;
  border: none; cursor: pointer;
  transition: all 0.2s;
}

.modal-btn:hover { background: var(--primary-light); }

.cert-display2 {display: none;}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  :root { --sidebar-width: 0px; }
  .sidebar { transform: translateX(-280px); width: 280px; }
  .sidebar.open { transform: translateX(0); }
  .content-area { margin-left: 0; padding: 24px 20px; max-width: 100%; }
  .progress-bar-fixed { padding-left: 24px; }
  .welcome-hero { padding: 32px 24px; }
  .welcome-hero h2 { font-size: 22px; }
  .lesson-body { padding: 24px 20px; }
  .cert-inner { padding: 32px 24px; }
  .cert-name { font-size: 26px; }
  .cert-display1 {display: none;}
  .cert-display2 {display: block;}
}
