:root {
  --navy: #1e2761;
  --navy-2: #2a3570;
  --ice: #cadcfc;
  --accent: #f2a65a;
  --text-muted: #5b6480;
  --card-bg: #f4f6fc;
}

* { box-sizing: border-box; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
  background: var(--navy);
  color: #fff;
  padding: 12px 20px;
  border-radius: 0 0 8px 0;
  z-index: 1000;
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus {
  left: 0;
  top: 0;
  width: auto;
  height: auto;
  overflow: visible;
}

a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible,
select:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--navy);
  outline-offset: 2px;
}

body {
  font-family: -apple-system, "Calibri", "Segoe UI", Arial, sans-serif;
  margin: 0;
  background: #f7f8fc;
  color: #1e2761;
}

header.topbar {
  background: var(--navy);
  color: #fff;
  padding: 16px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

header.topbar a { color: #fff; text-decoration: none; }
header.topbar .brand { font-weight: 700; font-size: 18px; }
header.topbar nav a { margin-left: 18px; color: var(--ice); font-size: 14px; }

main { max-width: 960px; margin: 0 auto; padding: 32px 20px 60px; }
main.lms-page { max-width: 1120px; }

.lms-layout { display: flex; gap: 24px; align-items: flex-start; }
.lms-main { flex: 1; min-width: 0; }

.lms-nav {
  width: 300px;
  flex-shrink: 0;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
  padding: 20px;
  position: sticky;
  top: 20px;
}
.lms-course { margin-bottom: 22px; }
.lms-course:last-child { margin-bottom: 0; }
.lms-course-header { display: flex; justify-content: space-between; gap: 8px; font-weight: 700; color: var(--navy); font-size: 13px; margin-bottom: 6px; }
.lms-progress-count { color: var(--text-muted); font-weight: 600; font-size: 12px; white-space: nowrap; }
.lms-progress-bar { background: #e9ecf7; border-radius: 999px; height: 6px; overflow: hidden; margin-bottom: 10px; }
.lms-progress-fill { background: var(--navy); height: 100%; border-radius: 999px; }
.lms-module-list { list-style: none; margin: 0; padding: 0; }
.lms-module-item { margin-bottom: 2px; }
.lms-module-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--navy);
  text-decoration: none;
  line-height: 1.3;
}
a.lms-module-link:hover { background: var(--card-bg); }
.lms-module-item.active .lms-module-link { background: var(--navy); color: #fff; }
span.lms-module-link.state-locked { color: var(--text-muted); cursor: not-allowed; }
.lms-icon { width: 16px; text-align: center; flex-shrink: 0; }

.lms-lesson h3 { font-size: 16px; margin: 18px 0 6px; }
.lms-lesson h3:first-child { margin-top: 0; }
.lms-lesson p, .lms-lesson ul { font-size: 14px; line-height: 1.6; color: #2b2f4a; }
.lms-lesson ul { padding-left: 20px; }
.lms-lesson li { margin-bottom: 4px; }

.lms-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid #eef0f8; }
.lms-row:last-child { border-bottom: none; }

@media (max-width: 820px) {
  .lms-layout { flex-direction: column; }
  .lms-nav { width: 100%; position: static; }
}

.card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
  padding: 28px;
  margin-bottom: 20px;
}

.card.dark { background: var(--navy-2); color: #fff; }

fieldset.card { border: none; margin: 0 0 20px; min-width: 0; }
fieldset.card legend { font-weight: 700; color: var(--navy); padding: 0; margin-bottom: 10px; font-size: 16px; }

h1, h2, h3 { color: var(--navy); }
.card.dark h1, .card.dark h2, .card.dark h3 { color: var(--accent); }

.btn {
  display: inline-block;
  background: var(--navy);
  color: #fff;
  padding: 10px 20px;
  border-radius: 8px;
  border: none;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { background: var(--navy-2); }
.btn.secondary { background: #fff; color: var(--navy); border: 1px solid var(--navy); }

input[type=text], input[type=email], input[type=password], textarea, select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d3d8e8;
  border-radius: 8px;
  font-size: 14px;
  margin-top: 4px;
  margin-bottom: 14px;
}

label { font-weight: 600; font-size: 13px; color: var(--text-muted); }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid #e3e7f3; font-size: 14px; }
th { color: var(--text-muted); font-size: 12px; text-transform: uppercase; }

.badge { padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge.pass { background: #dcf5e3; color: #1c7a3d; }
.badge.fail { background: #fde3e3; color: #a02121; }

.flash { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 14px; }
.flash.error { background: #fde3e3; color: #a02121; }
.flash.success { background: #dcf5e3; color: #1c7a3d; }

.module-video { width: 100%; border-radius: 10px; background: #000; margin-bottom: 16px; }

.quiz-question { margin: 0 0 18px; padding: 0 0 14px; border: none; border-bottom: 1px solid #eef0f8; }
.quiz-question:last-child { border-bottom: none; }
.quiz-question legend { font: inherit; font-weight: 400; color: inherit; padding: 0; margin-bottom: 8px; white-space: normal; }
.quiz-question .choice { display: block; margin: 6px 0; font-weight: 400; }

.cert-page {
  background: #fff;
  border: 10px solid var(--navy);
  border-radius: 12px;
  padding: 60px;
  text-align: center;
  max-width: 800px;
  margin: 20px auto;
}
.cert-page .accent { color: var(--accent); font-weight: 700; }
.cert-code { font-family: monospace; font-size: 18px; letter-spacing: 2px; color: var(--text-muted); }

@media print {
  header.topbar, .no-print { display: none; }
  body { background: #fff; }
}
