/* ============================================================================
   APP LAYER — components used by the Training Assessment templates, styled with
   the kit tokens (loaded from style.css first). Keeps existing pages
   looking native under the kit's brand system.
   ============================================================================ */

.container { max-width: 680px; margin: 0 auto; padding: 28px 18px 80px; }
.container-wide { max-width: 1120px; margin: 0 auto; padding: 28px 18px 80px; }

/* Brand bar (dark charcoal) */
.brandbar {
  background: var(--secondary-color); color: #fff; padding: 14px 22px;
  display: flex; align-items: center; gap: 14px; box-shadow: var(--shadow-sm);
  position: sticky; top: 0; z-index: 100;
}
.brandbar .brand-logo { height: 34px; width: auto; display: block; }
.brandbar strong { font-weight: 500; font-size: 1.02rem; color: #eaecef; }
.brandbar .spacer { flex: 1; }
.brandbar a { color: #eaecef; font-weight: 600; text-decoration: none; }
.brandbar a:hover { color: #fff; }

/* Cards */
.card {
  background: var(--bg-primary); border: 1px solid var(--border-light);
  border-radius: var(--border-radius); padding: 26px; margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}
.card.accent { border-top: 3px solid var(--primary-color); }
.card.tight { padding: 20px; }

h1 { font-size: 1.55rem; margin: 0 0 6px; font-weight: 700; color: var(--text-secondary); }
h2 { font-size: 1.18rem; margin: 0 0 14px; font-weight: 700; color: var(--text-secondary); }
h3 { font-size: 1rem; margin: 0 0 8px; font-weight: 700; color: var(--text-secondary); }
.muted { color: var(--text-muted); }
.small { font-size: 0.88rem; }
.center { text-align: center; }
.row { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; }
.stack > * + * { margin-top: 12px; }
.hero-icon { font-size: 2.6rem; line-height: 1; margin-bottom: 6px; }
img { max-width: 100%; height: auto; }
.brand-logo-lg { height: 64px; width: auto; display: inline-block; margin-bottom: 14px; }

/* Buttons: .btn / .btn.cta / .btn.ghost / .btn.sm / .btn.block / .btn.link / .btn.danger */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--secondary-color); color: #fff; border: none;
  border-radius: var(--border-radius-sm); padding: 13px 22px;
  font-size: 0.95rem; font-weight: 600; cursor: pointer;
  transition: var(--transition-fast); box-shadow: 0 4px 12px rgba(60,81,91,0.20);
  text-decoration: none; font-family: inherit;
}
.btn:hover { background: var(--secondary-dark); transform: translateY(-1px); color: #fff; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; box-shadow: none; transform: none; }
.btn.cta { background: var(--primary-color); box-shadow: 0 4px 12px rgba(255,102,0,0.25); }
.btn.cta:hover { background: var(--primary-dark); }
.btn.ghost { background: #fff; color: var(--secondary-color); border: 1.5px solid var(--border-color); box-shadow: none; }
.btn.ghost:hover { background: var(--bg-secondary); border-color: var(--secondary-color); color: var(--secondary-color); }
.btn.block { display: flex; width: 100%; }
.btn.sm { padding: 8px 14px; font-size: 0.85rem; }
.btn.danger { background: #fff; color: var(--danger-color); border: 1.5px solid var(--border-color); box-shadow: none; }
.btn.danger:hover { background: var(--danger-color); color: #fff; border-color: var(--danger-color); }
.btn.link { background: none; box-shadow: none; color: var(--text-muted); padding: 8px 10px; }
.btn.link:hover { color: var(--danger-color); background: none; transform: none; }

/* Forms */
label { display: block; font-weight: 600; margin: 14px 0 6px; font-size: 0.9rem; color: var(--text-secondary); }
input:not([type=radio]):not([type=checkbox]), select, textarea {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--border-color);
  border-radius: var(--border-radius-sm); font-size: 1rem;
  background: var(--bg-secondary); color: var(--text-primary);
  transition: var(--transition-fast); font-family: inherit;
}
input:focus, select:focus, textarea:focus {
  outline: none; background: #fff; border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(255,102,0,0.15);
}

/* Flash / errors */
.flash { padding: 12px 16px; border-radius: var(--border-radius-sm); margin: 0 0 14px; font-weight: 600; font-size: 0.92rem; }
.flash.error { background: #fdecec; color: var(--danger-color); border: 1px solid #f7cccd; }
.flash.success { background: #e7f6ec; color: var(--success-color); border: 1px solid #bfe6cd; }
.error { background: #fdecec; color: var(--danger-color); padding: 12px 14px; border-radius: var(--border-radius-sm); margin: 12px 0; font-size: 0.9rem; border: 1px solid #f7cccd; }

/* Tables */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 13px 10px; border-bottom: 1px solid var(--border-light); }
.table th { color: var(--text-secondary); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 700; background: var(--bg-secondary); }
.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--bg-secondary); }
.table-scroll { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-scroll .table { min-width: 460px; }

/* Badges */
.badge { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: 0.75rem; font-weight: 600; border: 1px solid transparent; }
.badge.state { background: var(--bg-secondary); color: var(--secondary-color); border-color: var(--border-light); }
.badge.live, .badge.pass { background: #e7f6ec; color: var(--success-color); }
.badge.fail { background: #fdecec; color: var(--danger-color); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--success-color); margin-right: 6px; animation: pulse 1.6s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }

/* KPI grid */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; margin-bottom: 20px; }
.kpi { background: var(--bg-primary); border: 1px solid var(--border-light); border-radius: var(--border-radius); padding: 20px; box-shadow: var(--shadow-sm); border-left: 3px solid var(--border-color); }
.kpi.accent { border-left-color: var(--primary-color); }
.kpi.good { border-left-color: var(--success-color); }
.kpi-value { font-size: 2rem; font-weight: 700; color: var(--text-secondary); line-height: 1.1; }
.kpi.accent .kpi-value { color: var(--primary-color); }
.kpi-label { color: var(--text-muted); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.4px; font-weight: 600; margin-top: 4px; }

/* Assessment */
.progress { height: 8px; background: var(--border-light); border-radius: 999px; overflow: hidden; margin: 4px 0 20px; }
.progress > span { display: block; height: 100%; background: var(--primary-color); border-radius: 999px; transition: width 0.3s ease; }
.question { padding: 20px 0; border-bottom: 1px solid var(--border-light); }
.question:first-child { padding-top: 6px; }
.question:last-child { border-bottom: none; }
.qtext { font-weight: 600; margin-bottom: 14px; font-size: 1.02rem; color: var(--text-secondary); }
.qtext .qnum { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; background: var(--secondary-color); color: #fff; border-radius: var(--border-radius-xs); font-size: 0.82rem; margin-right: 10px; }
.option { display: flex; align-items: center; gap: 12px; padding: 13px 15px; border: 1.5px solid var(--border-light); border-radius: var(--border-radius-sm); margin-bottom: 9px; cursor: pointer; background: #fff; transition: var(--transition-fast); }
.option:hover { border-color: var(--primary-color); background: var(--bg-secondary); }
.option.selected { border-color: var(--primary-color); background: #fff7f0; box-shadow: inset 0 0 0 1px var(--primary-color); }
.option input { width: auto; accent-color: var(--primary-color); }
.word-answer { max-width: 360px; margin-top: 4px; }

/* Anti-copy */
.no-copy, .no-copy * { -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; -webkit-touch-callout: none; }
.no-copy input { pointer-events: auto; }
.no-copy .word-answer { -webkit-user-select: text; -moz-user-select: text; user-select: text; }

/* Step list */
.steps { list-style: none; padding: 0; margin: 18px 0 0; counter-reset: step; }
.steps li { position: relative; padding: 10px 0 10px 40px; color: var(--text-muted); counter-increment: step; font-size: 0.9rem; }
.steps li::before { content: counter(step); position: absolute; left: 0; top: 8px; width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; background: var(--border-light); color: var(--secondary-color); border-radius: 50%; font-weight: 700; font-size: 0.8rem; }
.steps li.active::before { background: var(--primary-color); color: #fff; }
.steps li.done { color: var(--text-primary); }
.steps li.done::before { background: var(--success-color); color: #fff; content: "\2713"; }

/* Back link */
.backlink { display: inline-flex; align-items: center; gap: 6px; background: transparent; border: none; color: var(--text-muted); font-size: 0.92rem; font-weight: 600; cursor: pointer; padding: 6px 0; margin-bottom: 12px; text-decoration: none; }
.backlink:hover { color: var(--primary-color); }
.backlink span { font-size: 1.15rem; }

/* Results / review */
.mark { font-weight: 700; }
.mark .pct { color: var(--text-muted); font-weight: 500; font-size: 0.85rem; }
.up { color: var(--success-color); font-weight: 700; }
.down { color: var(--danger-color); font-weight: 700; }
.na { color: var(--text-muted); }
.danger-zone { border-top: 1px solid var(--border-light); margin-top: 18px; padding-top: 16px; }
.clickable-row { cursor: pointer; }
.clickable-row:hover { background: var(--bg-secondary); }
.clickable-row td .btn { pointer-events: none; }
.qrow-correct td { background: rgba(87, 199, 133, 0.06); }
.qrow-wrong td { background: rgba(245, 38, 46, 0.05); }
.tick { color: var(--success-color); font-weight: 700; }
.cross { color: var(--danger-color); font-weight: 700; }

/* Course builder */
.paper-box { width: 100%; margin-top: 8px; padding: 12px 14px; border: 1.5px solid var(--border-color); border-radius: var(--border-radius-sm); background: var(--bg-secondary); font-family: 'Roboto Mono', ui-monospace, Menlo, Consolas, monospace; font-size: 0.88rem; line-height: 1.5; resize: vertical; }
.paper-box:focus { outline: none; background: #fff; border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(255,102,0,0.15); }
pre.sample { background: var(--bg-secondary); border: 1px solid var(--border-light); border-radius: var(--border-radius-sm); padding: 12px 14px; font-size: 0.82rem; color: var(--text-primary); overflow-x: auto; margin: 0; }
code { background: var(--bg-secondary); padding: 1px 5px; border-radius: 4px; font-size: 0.85em; color: var(--primary-darkest); }

/* QR + expand */
.qr-wrap { display: inline-block; padding: 16px; background: #fff; border: 1px solid var(--border-light); border-radius: var(--border-radius); box-shadow: var(--shadow-sm); }
.qr-img { width: 220px; height: 220px; max-width: 100%; image-rendering: pixelated; display: block; }
.qr-expandable { position: relative; cursor: pointer; border: 1px solid var(--border-light); transition: var(--transition-fast); }
.qr-expandable:hover { border-color: var(--primary-color); box-shadow: var(--shadow-md); }
.qr-expand-icon { position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; background: var(--secondary-color); color: #fff; border-radius: var(--border-radius-xs); font-size: 1rem; line-height: 1; box-shadow: var(--shadow-sm); }
.qr-expandable:hover .qr-expand-icon { background: var(--primary-color); }
.qr-overlay { position: fixed; inset: 0; background: rgba(31,37,48,0.88); display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 1000; padding: 24px; }
.qr-overlay-inner { background: #fff; border-radius: var(--border-radius); padding: 28px; text-align: center; max-width: 92vw; }
.qr-overlay-img { width: min(70vh, 70vw); height: min(70vh, 70vw); image-rendering: pixelated; display: block; margin: 0 auto 14px; }
.qr-overlay-url { color: var(--text-primary); font-weight: 600; word-break: break-all; margin: 0 0 6px; }
.qr-overlay-close { position: absolute; top: 18px; right: 22px; background: transparent; border: none; color: #fff; font-size: 2.4rem; line-height: 1; cursor: pointer; opacity: 0.8; }
.qr-overlay-close:hover { opacity: 1; }

@media (max-width: 560px) {
  .brandbar { flex-wrap: wrap; row-gap: 8px; padding: 10px 14px; }
  .brandbar .spacer { flex-basis: 100%; height: 0; }
  .card { padding: 16px; }
}

/* ============================================================================
   NAVBAR composition + mobile hamburger drawer (from the kit's base-layout)
   ============================================================================ */
.nav-logo {
  display: inline-flex !important; align-items: center; gap: 0.75rem;
  background: none !important; -webkit-text-fill-color: initial !important;
  color: var(--secondary-color) !important; font-size: 1.4rem !important;
  font-weight: 700 !important; letter-spacing: 0 !important; text-decoration: none;
}
.nav-logo:hover { color: var(--primary-color) !important; transform: none !important; }
.nav-logo-img { height: 46px; width: auto; display: block; margin-right: -10px; }
.nav-logo-text { display: inline-block; line-height: 1.1; }
@media (max-width: 600px) { .nav-logo-text { display: none; } }

.nav-container-full { width: 100%; padding: 0 2rem; display: flex; justify-content: space-between; align-items: center; }
.nav-menu { display: flex; align-items: center; gap: 0.5rem; list-style: none; margin: 0; padding: 0; }
.nav-link { display: flex; align-items: center; gap: 0.5rem; }
.nav-link i { font-size: 0.875rem; }
.main-content { min-height: calc(100vh - 70px); }

/* Hamburger button */
.hamburger { display: none; flex-direction: column; gap: 5px; cursor: pointer; padding: 8px; z-index: 1001; background: none; border: none; }
.hamburger span { display: block; width: 24px; height: 2.5px; background: var(--text-primary); border-radius: 2px; transition: all 0.3s ease; }
.hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

.nav-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 10999; }
.nav-overlay.active { display: block; }

@media (max-width: 992px) {
  .hamburger { display: flex; }
  .nav-menu {
    position: fixed; top: 0; right: -300px; width: 280px; height: 100vh; background: white;
    flex-direction: column; align-items: stretch; padding: 1rem; gap: 0;
    box-shadow: -4px 0 20px rgba(0,0,0,0.15); z-index: 11000; transition: right 0.3s ease; overflow-y: auto;
  }
  .nav-menu.active { right: 0; }
  .nav-menu li { width: 100%; }
  .nav-menu .nav-link { padding: 12px 16px; border-radius: var(--border-radius-sm); width: 100%; }
  .nav-menu .nav-link:hover { background: var(--bg-secondary); transform: none; box-shadow: none; }
}

/* ============================================================================
   Participant review — question cards styled like the test, with
   correct=green and the participant's wrong pick=red.
   ============================================================================ */
.review-q { padding: 16px 0; border-bottom: 1px solid var(--border-light); }
.review-q:last-child { border-bottom: none; }
.review-option { cursor: default; }
.review-option .review-mark { min-width: 18px; text-align: center; font-weight: 700; }
.review-option.opt-correct { border-color: var(--success-color); background: #eefaf1; box-shadow: inset 0 0 0 1px var(--success-color); }
.review-option.opt-wrong { border-color: var(--danger-color); background: #fdecec; box-shadow: inset 0 0 0 1px var(--danger-color); }
.review-tag { margin-left: auto; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; }
.review-word { display: flex; align-items: center; gap: 8px; padding: 12px 15px; border: 1.5px solid var(--border-light); border-radius: var(--border-radius-sm); margin-bottom: 6px; }
.review-word.opt-correct { border-color: var(--success-color); background: #eefaf1; }
.review-word.opt-wrong { border-color: var(--danger-color); background: #fdecec; }
.review-accepted { font-size: 0.85rem; color: var(--text-primary); padding-left: 4px; }
