:root {
  color-scheme: dark;
  --bg: #030712;
  --panel: rgba(8, 24, 32, 0.88);
  --panel-strong: rgba(7, 17, 31, 0.96);
  --line: rgba(52, 245, 255, 0.22);
  --text: #f8fbff;
  --muted: #9aa8bd;
  --cyan: #34f5ff;
  --green: #4ade80;
  --danger: #fb7185;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 12%, rgba(52, 245, 255, 0.14), transparent 28%),
    radial-gradient(circle at 78% 8%, rgba(74, 222, 128, 0.12), transparent 24%),
    linear-gradient(180deg, #020617 0%, #04111d 48%, #020617 100%);
}

button,
input,
textarea,
select {
  font: inherit;
}

a {
  color: inherit;
}

.lms-topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 76px;
  padding: 12px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid var(--line);
  background: rgba(3, 7, 18, 0.9);
  backdrop-filter: blur(18px);
}

.lms-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  text-decoration: none;
}

.lms-brand img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.lms-topbar nav {
  display: flex;
  align-items: center;
  gap: 14px;
}

.lms-topbar nav a,
.ghost-button {
  border: 1px solid rgba(52, 245, 255, 0.2);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--muted);
  background: rgba(8, 24, 32, 0.5);
  text-decoration: none;
}

.ghost-button {
  cursor: pointer;
}

.lms-shell,
.admin-shell {
  width: min(1440px, calc(100% - 32px));
  margin: 0 auto;
  padding: 36px 0 56px;
}

.login-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 440px);
  gap: 32px;
  align-items: center;
  min-height: calc(100vh - 160px);
}

.login-copy h1,
.empty-state h1,
.lesson-header h1 {
  margin: 10px 0 12px;
  font-size: clamp(2rem, 5vw, 4.4rem);
  line-height: 1.02;
}

.login-copy p,
.empty-state p,
.lesson-header p {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.7;
}

.eyebrow {
  color: var(--cyan);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.auth-card,
.admin-panel,
.course-sidebar,
.lesson-area {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.auth-card {
  display: grid;
  gap: 18px;
  padding: 28px;
}

label {
  display: grid;
  gap: 8px;
  color: #dbe8f8;
  font-weight: 700;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid rgba(154, 168, 189, 0.22);
  border-radius: 8px;
  padding: 13px 14px;
  color: var(--text);
  background: rgba(2, 6, 23, 0.72);
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(52, 245, 255, 0.12);
}

button {
  border: 0;
  border-radius: 8px;
  padding: 13px 18px;
  color: #031016;
  background: linear-gradient(135deg, var(--cyan), var(--green));
  font-weight: 900;
  cursor: pointer;
}

.form-message {
  min-height: 22px;
  margin: 0;
  color: var(--muted);
}

.form-message.error {
  color: var(--danger);
}

.form-message.success {
  color: var(--green);
}

.workspace {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.course-sidebar {
  position: sticky;
  top: 100px;
  display: grid;
  gap: 22px;
  max-height: calc(100vh - 124px);
  padding: 22px;
  overflow: auto;
}

.course-sidebar h2,
.panel-heading h2 {
  margin: 8px 0 0;
}

.course-list {
  display: grid;
  gap: 14px;
}

.course-card {
  border: 1px solid rgba(52, 245, 255, 0.16);
  border-radius: 8px;
  padding: 14px;
  background: rgba(2, 6, 23, 0.42);
}

.course-card h3 {
  margin: 0 0 8px;
}

.course-card p {
  margin: 0 0 12px;
  color: var(--muted);
  line-height: 1.5;
}

.lesson-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  margin-top: 8px;
  border: 1px solid rgba(154, 168, 189, 0.16);
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--text);
  background: rgba(7, 17, 31, 0.72);
  text-align: left;
}

.lesson-button.completed {
  border-color: rgba(74, 222, 128, 0.34);
}

.lesson-area {
  min-height: calc(100vh - 124px);
  padding: clamp(22px, 4vw, 42px);
}

.empty-state {
  display: grid;
  place-content: center;
  min-height: 520px;
}

.lesson-view {
  display: grid;
  gap: 22px;
}

.lesson-video {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #020617;
  aspect-ratio: 16 / 9;
}

.lesson-video iframe,
.lesson-video video {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.lesson-video.empty {
  display: grid;
  place-items: center;
  color: var(--muted);
}

.lesson-body {
  margin: 0;
  white-space: pre-wrap;
  border: 1px solid rgba(154, 168, 189, 0.16);
  border-radius: 8px;
  padding: 22px;
  color: #dbe8f8;
  background: rgba(2, 6, 23, 0.56);
  line-height: 1.75;
}

.resource-link {
  justify-self: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--cyan);
  text-decoration: none;
}

.complete-button {
  justify-self: start;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.admin-panel {
  padding: 22px;
}

.stack-form {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.check-row input {
  width: 18px;
  height: 18px;
}

.course-map {
  grid-column: 1 / -1;
}

.admin-course {
  border-top: 1px solid rgba(154, 168, 189, 0.14);
  padding: 16px 0;
}

.admin-course h3 {
  margin: 0 0 8px;
}

.admin-course ul {
  margin: 10px 0 0;
  padding-left: 22px;
  color: var(--muted);
}

@media (max-width: 980px) {
  .login-panel,
  .workspace,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .course-sidebar {
    position: static;
    max-height: none;
  }
}

@media (max-width: 620px) {
  .lms-topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .lms-topbar nav {
    width: 100%;
    flex-wrap: wrap;
  }

  .lms-topbar nav a,
  .ghost-button {
    flex: 1 1 auto;
    text-align: center;
  }
}
