:root {
  --navy: #082a60;
  --navy-dark: #061d42;
  --blue: #0d6ea8;
  --orange: #ff7a21;
  --paper: #f4f7fb;
  --line: #d9e3ef;
  --ink: #17233a;
  --muted: #66748a;
  --white: #fff;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

a { color: inherit; }

.course-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 86px;
  padding: 12px clamp(18px, 4vw, 56px);
  background: rgba(255,255,255,.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.course-header img { width: min(230px, 50vw); height: auto; display: block; }

.course-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.course-nav a,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 6px;
  color: var(--navy);
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
}

.button {
  color: var(--white);
  background: var(--orange);
  border: 0;
  cursor: pointer;
}

.button.secondary {
  color: var(--navy);
  background: var(--white);
  border: 1px solid var(--line);
}

.button.ghost {
  color: var(--white);
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2);
}

.shell { width: min(1220px, calc(100% - 32px)); margin: 0 auto; padding: 26px 0 46px; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr);
  gap: 28px;
  align-items: center;
  padding: clamp(26px, 5vw, 54px);
  color: var(--white);
  background: linear-gradient(135deg, var(--navy), var(--navy-dark));
  border-radius: 8px;
  overflow: hidden;
}

.kicker {
  margin: 0 0 10px;
  color: var(--orange);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

h1 {
  margin: 0 0 14px;
  font-size: clamp(34px, 5vw, 62px);
  line-height: 1.02;
}

.hero p { color: #dbe9f7; font-size: 18px; line-height: 1.55; }

.hero-card,
.panel,
.module-card,
.login-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(8,42,96,.1);
}

.hero-card { padding: 24px; color: var(--ink); }
.hero-card strong { display: block; color: var(--navy); font-size: 34px; }
.hero-card span { display: block; margin-top: 4px; color: var(--muted); }

.grid { display: grid; gap: 18px; }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.section { margin-top: 24px; }
.section-title { margin: 0 0 14px; color: var(--navy); font-size: 28px; }

.panel,
.module-card,
.login-card { padding: 20px; }

.module-card h3 { margin: 6px 0 8px; color: var(--navy); }
.module-card p { margin: 0; color: var(--muted); line-height: 1.45; }

.app-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 18px;
}

.sidebar {
  position: sticky;
  top: 104px;
  align-self: start;
}

.progress-bar {
  height: 10px;
  overflow: hidden;
  background: #e8eef6;
  border-radius: 999px;
}

.progress-bar span {
  display: block;
  height: 100%;
  background: var(--orange);
  width: 0%;
}

.module-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.module-list button {
  width: 100%;
  padding: 12px;
  color: var(--ink);
  background: #f8fbff;
  border: 1px solid var(--line);
  border-radius: 6px;
  text-align: left;
  cursor: pointer;
}

.module-list button.active { border-color: var(--orange); box-shadow: inset 4px 0 0 var(--orange); }
.module-list small { display: block; margin-top: 4px; color: var(--muted); }

.reader {
  min-height: 620px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.reader-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.reader-body {
  padding: clamp(18px, 4vw, 34px);
  line-height: 1.65;
}

.reader-body h1,
.reader-body h2,
.reader-body h3 { color: var(--navy); }
.reader-body blockquote {
  margin: 18px 0;
  padding: 14px 16px;
  background: #f4f8fc;
  border-left: 4px solid var(--orange);
}

.video-box {
  margin-bottom: 18px;
  aspect-ratio: 16 / 9;
  background: #061d42;
  border-radius: 8px;
  overflow: hidden;
}
.video-box iframe { width: 100%; height: 100%; border: 0; }

input, select {
  width: 100%;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
}

textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
  resize: vertical;
}

label { display: grid; gap: 7px; color: var(--navy); font-weight: 800; font-size: 13px; }
form { display: grid; gap: 12px; }

.login-wrap { display: grid; place-items: center; min-height: calc(100vh - 120px); }
.login-card { width: min(460px, 100%); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 11px 10px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { color: var(--navy); font-size: 12px; text-transform: uppercase; }

.notice {
  padding: 12px 14px;
  margin: 12px 0;
  color: var(--navy);
  background: #fff8ed;
  border: 1px solid #ffd2a3;
  border-radius: 6px;
}

.lesson-shell {
  max-width: 920px;
  margin: 0 auto;
}

.lesson-meta {
  margin-top: -8px;
  color: var(--muted);
  font-weight: 700;
}

.lesson-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}

.lesson-steps button {
  width: 38px;
  height: 38px;
  color: var(--navy);
  background: #f4f8fc;
  border: 1px solid var(--line);
  border-radius: 50%;
  font-weight: 900;
  cursor: pointer;
}

.lesson-steps button.active {
  color: var(--white);
  background: var(--orange);
  border-color: var(--orange);
}

.lesson-block {
  margin: 18px 0;
  padding: 18px;
  background: #fbfdff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.lesson-block h2 {
  margin-top: 0;
}

.choice-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.choice {
  width: 100%;
  padding: 13px 14px;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 6px;
  text-align: left;
  cursor: pointer;
}

.choice:hover,
.choice.selected {
  border-color: var(--orange);
  box-shadow: inset 4px 0 0 var(--orange);
}

.feedback {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 6px;
  font-weight: 700;
}

.feedback.ok {
  color: #14532d;
  background: #dcfce7;
  border: 1px solid #86efac;
}

.feedback.bad {
  color: #7f1d1d;
  background: #fee2e2;
  border: 1px solid #fca5a5;
}

.reader-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.reader-actions button:disabled,
.button:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.score-card {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 16px 0;
  padding: 14px;
  background: #f4f8fc;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.score-card strong {
  color: var(--orange);
  font-size: 34px;
}

.score-card span {
  color: var(--muted);
  font-weight: 800;
}

.course-toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 60;
  padding: 12px 16px;
  color: var(--white);
  background: var(--navy);
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(8,42,96,.22);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: .2s ease;
}

.course-toast.show {
  opacity: 1;
  transform: translateY(0);
}

.hidden { display: none !important; }

@media (max-width: 920px) {
  .hero,
  .app-layout,
  .grid.two,
  .grid.three { grid-template-columns: 1fr; }
  .sidebar { position: static; }
}

@media (max-width: 680px) {
  .course-header { display: block; }
  .course-nav { margin-top: 10px; }
  .shell { width: min(100% - 20px, 1220px); }
  .reader-toolbar { display: grid; }
}
