:root {
  --navy: #0B2545; --navy-2: #13315C; --blue: #1D6FB8; --blue-2: #2E86DE; --sky: #E8F2FB; --sky-2: #D3E6F8;
  --ink: #12202F; --muted: #4A5B6E; --line: #D5DEE8; --bg: #F5F8FB; --white: #fff;
  --ok: #0F7B4E; --ok-bg: #E4F6EC; --warn: #8A5A00; --warn-bg: #FFF4DC; --bad: #B42318; --bad-bg: #FDE8E6;
  --radius: 12px; --shadow: 0 1px 2px rgba(11,37,69,.06), 0 6px 20px rgba(11,37,69,.08);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--bg); line-height: 1.6; font-size: 1.0625rem; min-height: 100vh; display: flex; flex-direction: column; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; animation: none !important; } }
main { flex: 1; width: 100%; max-width: 1120px; margin: 0 auto; padding: 24px 16px 56px; outline: none; }
h1, h2, h3 { color: var(--navy); line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); } h2 { font-size: 1.45rem; } h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; } a { color: var(--blue); }
:focus-visible { outline: 3px solid #FFB020; outline-offset: 2px; border-radius: 4px; }
.skip { position: absolute; left: -999px; top: 0; background: #fff; padding: 10px 14px; z-index: 100; }
.skip:focus { left: 8px; top: 8px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* header */
.site-header { background: var(--navy); color: #fff; position: sticky; top: 0; z-index: 20; box-shadow: 0 2px 8px rgba(0,0,0,.2); }
.site-header .bar { max-width: 1120px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 700; font-size: 1.1rem; }
.brand small { display: block; font-weight: 400; font-size: .72rem; color: #BBD7F2; letter-spacing: .02em; }
.brand svg { width: 36px; height: 36px; flex: none; }
nav.main-nav { margin-left: auto; display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
nav.main-nav a, nav.main-nav button { color: #E6F0FA; background: none; border: 0; font: inherit; font-size: .95rem; padding: 8px 12px; border-radius: 8px; text-decoration: none; cursor: pointer; }
nav.main-nav a:hover, nav.main-nav button:hover, nav.main-nav a[aria-current="page"] { background: rgba(255,255,255,.14); color: #fff; }

/* buttons & forms */
.btn { display: inline-flex; align-items: center; gap: 8px; border: 2px solid var(--blue); background: var(--blue); color: #fff; font: inherit; font-weight: 600; padding: 10px 20px; border-radius: 10px; cursor: pointer; text-decoration: none; min-height: 44px; }
.btn:hover { background: #17598F; border-color: #17598F; }
.btn.secondary { background: #fff; color: var(--blue); } .btn.secondary:hover { background: var(--sky); }
.btn.danger { background: var(--bad); border-color: var(--bad); } .btn.danger:hover { background: #8E1B12; }
.btn.small { padding: 5px 12px; min-height: 34px; font-size: .9rem; }
.btn.big { padding: 14px 28px; font-size: 1.15rem; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
label { display: block; font-weight: 600; margin: 0 0 4px; }
input[type=text], input[type=email], input[type=password], input[type=number], select, textarea { width: 100%; font: inherit; padding: 10px 12px; border: 1.5px solid #8CA0B5; border-radius: 8px; background: #fff; color: var(--ink); min-height: 44px; }
select { max-width: 100%; text-overflow: ellipsis; }
textarea { min-height: 120px; font-family: ui-monospace, Consolas, monospace; font-size: .9rem; }
.field { margin-bottom: 16px; } .hint { font-size: .875rem; color: var(--muted); margin-top: 4px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; } .grow { flex: 1; }
.error-msg { background: var(--bad-bg); color: var(--bad); border: 1px solid #F3B7B1; padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; }

/* cards & layout */
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin-bottom: 20px; }
.grid { display: grid; gap: 16px; } .grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); } .grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); } .grid.cols-4 { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.hero { background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 55%, #1B5C9E 100%); color: #fff; border-radius: 18px; padding: clamp(24px, 5vw, 56px); display: grid; gap: 28px; grid-template-columns: 1.4fr 1fr; align-items: center; box-shadow: var(--shadow); }
.hero h1 { color: #fff; } .hero p { color: #DCEBFA; font-size: 1.15rem; }
.hero .badge { display: inline-block; background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.35); border-radius: 999px; padding: 4px 14px; font-size: .9rem; margin-bottom: 14px; }
.hero svg.art { width: 100%; max-width: 340px; justify-self: center; }
@media (max-width: 760px) { .hero { grid-template-columns: 1fr; } .hero svg.art { max-width: 200px; } }
.icon { width: 1.25em; height: 1.25em; flex: none; vertical-align: -0.2em; }
.feature { display: flex; gap: 12px; } .feature .ic { background: var(--sky); color: var(--blue); width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.feature .ic .icon { width: 24px; height: 24px; }
.stat { text-align: center; } .stat .n { font-size: 2rem; font-weight: 800; color: var(--navy); line-height: 1.1; } .stat .l { color: var(--muted); font-size: .9rem; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .8rem; font-weight: 700; background: var(--sky); color: var(--navy); }
.pill.ok { background: var(--ok-bg); color: var(--ok); } .pill.bad { background: var(--bad-bg); color: var(--bad); } .pill.warn { background: var(--warn-bg); color: var(--warn); }

/* progress */
.progress { background: var(--sky-2); border-radius: 999px; height: 12px; overflow: hidden; } .progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--blue-2), var(--blue)); transition: width .3s; }

/* modules */
.module-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.module { display: flex; gap: 14px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.module .num { width: 40px; height: 40px; border-radius: 50%; background: var(--sky); color: var(--navy); display: grid; place-items: center; font-weight: 800; flex: none; }
.module.done .num { background: var(--ok); color: #fff; }
.module h3 { margin: 0; font-size: 1.05rem; } .module p { margin: 0; color: var(--muted); font-size: .92rem; }

/* lesson content */
.lesson { max-width: 820px; }
.lesson table { width: 100%; border-collapse: collapse; margin: 0 0 1.2em; font-size: .97rem; display: block; overflow-x: auto; }
.lesson th, .lesson td { text-align: left; padding: 10px 12px; border: 1px solid var(--line); vertical-align: top; }
.lesson th { background: var(--sky); color: var(--navy); }
.callout { border-left: 5px solid var(--blue); background: var(--sky); border-radius: 8px; padding: 12px 16px; margin: 0 0 1.2em; }
.callout.warn { border-color: #D98A00; background: var(--warn-bg); } .callout.tip { border-color: var(--ok); background: var(--ok-bg); }
.callout.mgmt { border-color: #7A4EC9; background: #F1EBFB; border-style: dashed; border-left-style: solid; }
.callout strong.t { display: block; margin-bottom: 2px; color: var(--navy); }
details.expand { border: 1px solid var(--line); border-radius: 10px; margin: 0 0 12px; background: #fff; }
details.expand summary { cursor: pointer; padding: 12px 16px; font-weight: 700; color: var(--navy); }
details.expand .body { padding: 0 16px 12px; }
.scenario { border: 2px solid var(--sky-2); border-radius: var(--radius); padding: 16px; margin: 0 0 1.4em; background: #fff; }
.scenario .tag { font-size: .78rem; font-weight: 800; letter-spacing: .06em; color: var(--blue); text-transform: uppercase; }
.opt { display: block; width: 100%; text-align: left; font: inherit; background: #fff; border: 1.5px solid #8CA0B5; border-radius: 10px; padding: 10px 14px; margin: 8px 0; cursor: pointer; color: var(--ink); }
.opt:hover:not([disabled]) { background: var(--sky); } .opt[disabled] { cursor: default; }
.opt.right { background: var(--ok-bg); border-color: var(--ok); } .opt.wrong { background: var(--bad-bg); border-color: var(--bad); }
.feedback { margin-top: 8px; padding: 10px 14px; border-radius: 8px; background: var(--sky); }
.mail { border: 1px solid #9DB0C4; border-radius: 8px; background: #fff; margin: 10px 0; font-size: .95rem; }
.mail .hd { background: #F0F4F8; padding: 8px 12px; border-bottom: 1px solid var(--line); } .mail .hd div { margin: 1px 0; } .mail .bd { padding: 12px; white-space: pre-wrap; }
.lesson-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 24px; flex-wrap: wrap; }
.steps { counter-reset: s; list-style: none; padding: 0; } .steps li { counter-increment: s; position: relative; padding: 0 0 12px 46px; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 32px; height: 32px; border-radius: 50%; background: var(--blue); color: #fff; font-weight: 800; display: grid; place-items: center; }
.crumbs { font-size: .92rem; margin-bottom: 8px; }
.stepper { display: flex; gap: 6px; margin: 8px 0 20px; flex-wrap: wrap; } .stepper span { height: 8px; flex: 1; min-width: 20px; border-radius: 4px; background: var(--sky-2); } .stepper span.on { background: var(--blue); }

/* exam */
.exam-bar { position: sticky; top: 62px; z-index: 10; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 16px; display: flex; gap: 16px; align-items: center; flex-wrap: wrap; box-shadow: var(--shadow); margin-bottom: 16px; }
.timer { font-variant-numeric: tabular-nums; font-weight: 800; font-size: 1.4rem; color: var(--navy); } .timer.low { color: var(--bad); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .55; } }
.choice { display: flex; gap: 12px; align-items: flex-start; border: 1.5px solid #8CA0B5; border-radius: 10px; padding: 12px 14px; margin: 10px 0; cursor: pointer; background: #fff; }
.choice:hover { background: var(--sky); } .choice input { margin-top: 5px; width: 20px; height: 20px; flex: none; } .choice:has(input:checked) { border-color: var(--blue); background: var(--sky); box-shadow: inset 0 0 0 1px var(--blue); }
.qgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: 6px; }
.qgrid button { min-height: 42px; border-radius: 8px; border: 1.5px solid #8CA0B5; background: #fff; font: inherit; font-weight: 700; cursor: pointer; color: var(--ink); }
.qgrid button.answered { background: var(--sky-2); border-color: var(--blue); } .qgrid button.current { background: var(--navy); color: #fff; border-color: var(--navy); }
.result-hero { text-align: center; padding: 28px 16px; border-radius: 16px; } .result-hero.pass { background: var(--ok-bg); border: 2px solid var(--ok); } .result-hero.fail { background: var(--bad-bg); border: 2px solid var(--bad); }
.result-hero .score { font-size: 3.2rem; font-weight: 900; color: var(--navy); line-height: 1; }

/* tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
table.data { width: 100%; border-collapse: collapse; font-size: .92rem; } table.data th, table.data td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.data th { background: var(--sky); color: var(--navy); position: sticky; top: 0; white-space: nowrap; } table.data tr:hover td { background: #F8FBFE; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 2px solid var(--line); margin-bottom: 20px; }
.tabs a { padding: 10px 16px; text-decoration: none; color: var(--muted); font-weight: 600; border-radius: 8px 8px 0 0; } .tabs a[aria-current="page"] { color: var(--navy); background: #fff; border: 1px solid var(--line); border-bottom-color: #fff; margin-bottom: -2px; }
dialog { border: 0; border-radius: 14px; padding: 24px; max-width: min(680px, 94vw); width: 100%; box-shadow: 0 20px 60px rgba(0,0,0,.35); } dialog::backdrop { background: rgba(11,37,69,.55); }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(100px); background: var(--navy); color: #fff; padding: 12px 20px; border-radius: 10px; opacity: 0; transition: .25s; z-index: 50; max-width: 92vw; } .toast.show { opacity: 1; transform: translateX(-50%); } .toast.bad { background: var(--bad); }
.site-footer { background: #fff; border-top: 1px solid var(--line); padding: 16px; text-align: center; color: var(--muted); font-size: .85rem; } .site-footer p { margin: 0; }
.noscript { padding: 20px; background: var(--bad-bg); }

/* printable certificate */
.cert { background: #fff; border: 6px double var(--navy); padding: 32px 24px; text-align: center; max-width: 960px; margin: 0 auto; aspect-ratio: 11 / 8.5; display: flex; flex-direction: column; justify-content: center; gap: 8px; }
.cert .org { color: var(--blue); font-weight: 800; letter-spacing: .2em; text-transform: uppercase; }
.cert h1 { letter-spacing: .12em; margin: 0; } .cert .nm { font-size: clamp(1.8rem, 5vw, 3rem); font-weight: 800; color: var(--blue); border-bottom: 2px solid var(--blue); display: inline-block; padding: 0 24px; margin: 4px auto; }
.cert .meta { display: flex; justify-content: space-around; background: var(--sky); padding: 10px; border-radius: 6px; flex-wrap: wrap; gap: 8px; font-size: .95rem; }
.cert .sig { margin: 20px auto 0; border-top: 1px solid var(--navy); width: 260px; padding-top: 4px; font-weight: 700; }
@media print {
  @page { size: landscape; margin: 0.4in; }
  body { background: #fff; } .site-header, .site-footer, .no-print, .skip, .toast { display: none !important; }
  main { padding: 0; max-width: none; } .cert { border-width: 6px; aspect-ratio: auto; height: 7.2in; }
}

.figure { margin: 0 0 1.4em; text-align: center; }
.figure img { max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.figure figcaption { font-size: .9rem; color: var(--muted); margin-top: 6px; }

.brand img.logo { height: 42px; width: auto; border-radius: 6px; flex: none; }
.cert-logo { height: 72px; width: auto; margin: 0 auto; border-radius: 6px; }
