:root {
  --ink: #0f1b2d;
  --navy: #12284c;
  --navy-2: #1c3a6b;
  --gold: #b8912a;
  --gold-soft: #f4ead0;
  --bg: #f5f6f8;
  --card: #ffffff;
  --muted: #5b6676;
  --line: #e2e6ed;
  --ok: #1d7f56;
  --ok-soft: #e3f4ec;
  --warn: #a16207;
  --warn-soft: #fdf3dc;
  --err: #b42323;
  --err-soft: #fbe6e6;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(15, 27, 45, .06), 0 6px 20px rgba(15, 27, 45, .06);
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; font-family: var(--sans); color: var(--ink); background: var(--bg); line-height: 1.55; font-size: 16px; }
a { color: var(--navy-2); }
img, video { max-width: 100%; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-family: var(--serif); font-weight: 600; font-size: clamp(1.7rem, 3.4vw, 2.4rem); letter-spacing: -.01em; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
small, .muted { color: var(--muted); }
code { background: #eef1f5; padding: .1em .35em; border-radius: 4px; font-size: .9em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }

.wrap { max-width: 1140px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 460px; }
.mid { max-width: 780px; }
main { flex: 1; padding: 32px 0 56px; }

/* ---- Header ---- */
.top { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
.top .wrap { display: flex; align-items: center; gap: 16px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 800; font-size: 1.08rem; letter-spacing: -.01em; }
.brand-mark { width: 34px; height: 34px; border-radius: 9px; background: var(--navy); color: #f1d98a; display: grid; place-items: center; font-family: var(--serif); font-size: .8rem; font-weight: 700; letter-spacing: .04em; }
.brand small { display: block; font-weight: 600; font-size: .68rem; color: var(--muted); letter-spacing: .02em; margin-top: -2px; }
.nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.nav a, .nav button.linklike { text-decoration: none; color: var(--ink); font-weight: 600; font-size: .93rem; padding: 8px 12px; border-radius: 8px; }
.nav a:hover, .nav button.linklike:hover { background: var(--bg); }
.nav a.on { color: var(--navy-2); background: #eef2f9; }
.nav form { margin: 0; }
.menu-btn { display: none; margin-left: auto; background: none; border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; font: inherit; cursor: pointer; }
@media (max-width: 760px) {
  .menu-btn { display: block; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 64px; background: #fff; border-bottom: 1px solid var(--line); flex-direction: column; align-items: stretch; padding: 8px 16px 14px; }
  .nav.open { display: flex; }
  .nav a, .nav button.linklike { padding: 11px 10px; text-align: left; }
}

/* ---- Buttons & forms ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 9px; padding: 10px 18px; font: inherit; font-weight: 700; font-size: .95rem; cursor: pointer; text-decoration: none; line-height: 1.2; transition: background .15s, border-color .15s, opacity .15s; }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-2); }
.btn-gold { background: var(--gold); color: #fff; }
.btn-gold:hover { background: #a37f22; }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: #c5ccd8; }
.btn-danger { background: #fff; color: var(--err); border-color: #efc4c4; }
.btn-danger:hover { background: var(--err-soft); }
.btn-sm { padding: 6px 11px; font-size: .84rem; border-radius: 7px; }
.btn-lg { padding: 14px 24px; font-size: 1.02rem; }
.btn[disabled], .btn.disabled { opacity: .45; cursor: not-allowed; }
button.linklike { background: none; border: 0; font: inherit; cursor: pointer; color: var(--navy-2); padding: 0; }

label { display: block; font-weight: 700; font-size: .9rem; margin: 0 0 6px; }
.field { margin-bottom: 16px; }
.hint { font-weight: 400; color: var(--muted); font-size: .84rem; margin-top: 5px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=search], input[type=tel], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: #fff; border: 1px solid #cfd6e1; border-radius: 9px; padding: 10px 12px;
}
textarea { min-height: 120px; resize: vertical; }
textarea.code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .85rem; min-height: 320px; }
input:focus, select:focus, textarea:focus { outline: 2px solid #9fb6dd; outline-offset: 0; border-color: #7d99c8; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; margin-bottom: 12px; }
.check input { margin-top: 4px; width: 17px; height: 17px; flex: none; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.inline { display: inline; margin: 0; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* ---- Cards, panels ---- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; }
.card + .card { margin-top: 18px; }
.card h2 { margin-bottom: 14px; }
.panel-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.panel-title h2 { margin: 0; }

.flash { border-radius: 10px; padding: 12px 16px; margin-bottom: 20px; font-weight: 600; border: 1px solid; }
.flash-ok { background: var(--ok-soft); color: var(--ok); border-color: #bfe4d2; }
.flash-warn { background: var(--warn-soft); color: var(--warn); border-color: #f0dca8; }
.flash-error { background: var(--err-soft); color: var(--err); border-color: #f0c2c2; }

.badge { display: inline-block; font-size: .74rem; font-weight: 800; letter-spacing: .02em; padding: 3px 8px; border-radius: 999px; background: #eef1f5; color: var(--muted); white-space: nowrap; }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-err { background: var(--err-soft); color: var(--err); }
.badge-navy { background: #e6ecf7; color: var(--navy-2); }

.bar { height: 8px; background: #e7ebf1; border-radius: 99px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--navy-2), var(--gold)); border-radius: 99px; }

/* ---- Tables ---- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: #fafbfc; font-weight: 800; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; white-space: nowrap; }
td .muted { font-size: .84rem; }

/* ---- Home ---- */
.hero { background: radial-gradient(1200px 400px at 85% -10%, rgba(184, 145, 42, .35), transparent 60%), linear-gradient(135deg, #0d1f3d, #1c3a6b); color: #fff; margin-top: -32px; padding: 72px 0 80px; }
.hero h1 { color: #fff; font-size: clamp(2rem, 5vw, 3.2rem); max-width: 720px; }
.hero p { color: #d7deea; font-size: 1.12rem; max-width: 600px; }
.hero .eyebrow { color: #f1d98a; }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: .76rem; font-weight: 800; color: var(--gold); margin-bottom: 12px; }
.steps4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 40px 0 8px; }
.steps4 div { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.steps4 b { display: block; font-family: var(--serif); font-size: 1.6rem; color: var(--gold); line-height: 1; margin-bottom: 8px; }
@media (max-width: 860px) { .steps4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .steps4 { grid-template-columns: 1fr; } }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.course-card { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; text-decoration: none; color: inherit; transition: transform .15s, box-shadow .15s; }
.course-card:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(15, 27, 45, .12); }
.cover { aspect-ratio: 16 / 9; background: linear-gradient(135deg, #12284c, #2b4f8a); display: grid; place-items: center; color: #f1d98a; font-family: var(--serif); font-size: 1.4rem; padding: 18px; text-align: center; overflow: hidden; }
.cover img { width: 100%; height: 100%; object-fit: cover; }
.course-card .body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.course-card h3 { font-size: 1.12rem; margin: 0; }
.course-card .foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; padding-top: 10px; }
.price { font-weight: 800; font-size: 1.15rem; color: var(--navy); }

/* ---- Course page ---- */
.course-layout { display: grid; grid-template-columns: 1fr 340px; gap: 28px; align-items: start; }
.buy-box { position: sticky; top: 84px; }
.buy-box .price { font-size: 1.8rem; display: block; margin-bottom: 10px; }
@media (max-width: 900px) { .course-layout { grid-template-columns: 1fr; } .buy-box { position: static; } }
.outline { list-style: none; padding: 0; margin: 0; }
.outline li { display: flex; gap: 12px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line); }
.outline li:last-child { border-bottom: 0; }
.outline .n { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: #eef1f5; font-size: .8rem; font-weight: 800; color: var(--muted); }
.outline .done .n { background: var(--ok); color: #fff; }
.outline .current .n { background: var(--gold); color: #fff; }
.rich { overflow-wrap: anywhere; }
.rich p:last-child { margin-bottom: 0; }

/* ---- Learn ---- */
.learn { display: grid; grid-template-columns: 300px 1fr; gap: 26px; align-items: start; }
.learn aside { position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow: auto; }
.side-list { list-style: none; margin: 0; padding: 0; }
.side-list a, .side-list span.locked { display: flex; gap: 10px; align-items: flex-start; padding: 9px 10px; border-radius: 8px; text-decoration: none; color: var(--ink); font-size: .9rem; line-height: 1.35; }
.side-list a:hover { background: var(--bg); }
.side-list .on a { background: #eef2f9; font-weight: 700; }
.side-list span.locked { color: #9aa3b1; cursor: not-allowed; }
.side-list .ico { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: .7rem; font-weight: 800; background: #eef1f5; color: var(--muted); margin-top: -1px; }
.side-list .is-done .ico { background: var(--ok); color: #fff; }
.side-list .is-current .ico { background: var(--gold); color: #fff; }
.learn-main { min-width: 0; }
.step-head { display: flex; justify-content: space-between; gap: 14px; align-items: baseline; flex-wrap: wrap; margin-bottom: 14px; }
.step-head h1 { margin: 0; font-size: clamp(1.4rem, 2.6vw, 1.95rem); }
.player { position: relative; background: #000; border-radius: var(--radius); overflow: hidden; margin-bottom: 20px; }
.player video { display: block; width: 100%; max-height: 78vh; background: #000; }
.player:fullscreen video { max-height: 100vh; height: 100%; }
.wm { position: absolute; pointer-events: none; color: rgba(255, 255, 255, .33); font-size: 13px; font-weight: 700; text-shadow: 0 1px 2px rgba(0, 0, 0, .5); transition: top 1.5s, left 1.5s; white-space: nowrap; user-select: none; }
.fs-btn { position: absolute; top: 10px; right: 10px; background: rgba(0, 0, 0, .55); color: #fff; border: 0; border-radius: 7px; padding: 6px 10px; font: inherit; font-size: .8rem; font-weight: 700; cursor: pointer; opacity: .85; }
.doc { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(20px, 4vw, 40px); font-size: 1.02rem; line-height: 1.7; overflow-wrap: anywhere; }
.doc h1 { font-size: 1.6rem; } .doc h2 { font-size: 1.3rem; margin-top: 1.4em; } .doc h3 { margin-top: 1.2em; }
.doc img { height: auto; border-radius: 6px; margin: 8px 0; }
.doc table { margin: 14px 0; border: 1px solid var(--line); display: block; overflow-x: auto; }
.doc td, .doc th { border: 1px solid var(--line); }
.doc ul, .doc ol { padding-left: 1.4em; }
.pdf-frame { width: 100%; height: 80vh; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.protect { -webkit-user-select: none; user-select: none; }
.complete-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 22px; padding: 16px 18px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.complete-bar .note { color: var(--muted); font-size: .9rem; }
.side-toggle { display: none; }
@media (max-width: 900px) {
  .learn { grid-template-columns: 1fr; }
  .learn aside { position: static; max-height: none; }
  .side-toggle { display: block; }
  .learn aside .side-body { display: none; }
  .learn aside.open .side-body { display: block; }
}
@media print { .doc, .player, .pdf-frame { display: none !important; } }

/* ---- Certificate / done ---- */
.done-hero { text-align: center; padding: 40px 24px; }
.done-hero .seal { width: 84px; height: 84px; border-radius: 50%; background: var(--navy); color: #f1d98a; display: grid; place-items: center; margin: 0 auto 18px; font-family: var(--serif); font-size: 1.8rem; box-shadow: 0 0 0 6px var(--gold-soft); }
.cert-view { border: 6px solid var(--navy); outline: 1px solid var(--gold); outline-offset: -14px; background: #fbf8f1; padding: 40px 28px; text-align: center; border-radius: 4px; }
.cert-view .name { font-family: var(--serif); font-style: italic; font-size: clamp(1.6rem, 4vw, 2.4rem); margin: 6px 0 12px; }

/* ---- Admin ---- */
.admin-nav { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 24px; border-bottom: 1px solid var(--line); }
.admin-nav a { text-decoration: none; color: var(--muted); font-weight: 700; font-size: .92rem; padding: 10px 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.admin-nav a.on { color: var(--navy); border-color: var(--gold); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.stat b { display: block; font-size: 1.6rem; font-weight: 800; letter-spacing: -.01em; }
.stat span { color: var(--muted); font-size: .85rem; font-weight: 600; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.two > .card + .card { margin-top: 0; }
@media (max-width: 900px) { .two { grid-template-columns: 1fr; } }
.dropzone { border: 2px dashed #b9c4d6; border-radius: var(--radius); background: #fafcff; padding: 40px 20px; text-align: center; cursor: pointer; transition: background .15s, border-color .15s; }
.dropzone.over { background: #eef4ff; border-color: var(--navy-2); }
.dropzone b { font-size: 1.1rem; }
.queue { list-style: none; padding: 0; margin: 16px 0 0; }
.queue li { padding: 10px 0; border-bottom: 1px solid var(--line); font-size: .92rem; }
.queue .prog { height: 6px; background: #e7ebf1; border-radius: 9px; overflow: hidden; margin-top: 6px; }
.queue .prog span { display: block; height: 100%; width: 0; background: var(--navy-2); transition: width .2s; }
.queue .res { margin-top: 4px; color: var(--muted); font-size: .86rem; }
.queue .res.err { color: var(--err); }
.kv { display: grid; grid-template-columns: 160px 1fr; gap: 8px 14px; font-size: .93rem; }
.kv dt { color: var(--muted); font-weight: 700; }
.kv dd { margin: 0; overflow-wrap: anywhere; }
details.box { border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; background: #fff; }
details.box + details.box { margin-top: 10px; }
details.box summary { cursor: pointer; font-weight: 700; }
.preview-banner { background: var(--warn-soft); color: var(--warn); border: 1px solid #f0dca8; border-radius: 10px; padding: 10px 14px; font-weight: 700; margin-bottom: 16px; font-size: .9rem; }

/* ---- Footer ---- */
.foot-site { background: var(--navy); color: #c7d1e1; padding: 32px 0; font-size: .9rem; }
.foot-site .wrap { display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.foot-site a { color: #fff; text-decoration: none; margin-right: 16px; }
.foot-site strong { color: #fff; }

.center { text-align: center; }
.mt0 { margin-top: 0; } .mt { margin-top: 18px; } .mb0 { margin-bottom: 0; } .mb { margin-bottom: 18px; }
.split { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.empty { text-align: center; color: var(--muted); padding: 40px 20px; }
.pre { white-space: pre-wrap; }
