:root {
  color-scheme: light;
  --paper: #f6f5ef;
  --surface: #fffefa;
  --ink: #16190f;
  --muted: #585d54;
  --line: #dcded4;
  --deep: #1e2721;
  --accent: #e2fa6a;
  --radius: 18px;
  font-family: "Avenir Next", "Segoe UI", system-ui, sans-serif;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
a { color: inherit; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .55; }
:focus-visible { outline: 3px solid #5d7300; outline-offset: 4px; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin-top: 0; }
h1, h2 { line-height: 1.08; letter-spacing: -.045em; }
h1 { font-size: clamp(2.35rem, 6vw, 4.5rem); margin-bottom: 0; }
h2 { font-size: clamp(1.55rem, 3vw, 2.3rem); }
p { max-width: 72ch; }

.brand {
  display: flex;
  width: fit-content;
  align-items: center;
  gap: 12px;
  font-weight: 760;
  line-height: 1.12;
  text-decoration: none;
  letter-spacing: -.015em;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: var(--accent);
  color: var(--deep);
  font-weight: 850;
  letter-spacing: -.04em;
}
.public-shell { min-height: 100dvh; padding: 0 clamp(24px, 6vw, 96px); }
.public-header { padding: 32px 0; border-bottom: 1px solid var(--line); }
.public-shell .main { padding-inline: 0; }
.welcome {
  min-height: min(640px, calc(100dvh - 105px));
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: clamp(32px, 7vw, 112px);
  align-items: center;
  margin-inline: auto;
}
.welcome h1 {
  font-size: clamp(3rem, 9vw, 8rem);
  line-height: .91;
  letter-spacing: -.085em;
}
.welcome h1 em { color: #466238; font: inherit; }
.welcome-copy > p { margin-top: 26px; margin-bottom: 0; color: var(--muted); font-size: clamp(1rem, 2vw, 1.3rem); }
.login-panel {
  background: var(--deep);
  color: #f6f7ee;
  padding: clamp(24px, 4vw, 44px);
  border-radius: 26px;
}
.login-panel p { color: #cbd3c5; }
.login-actions { display: grid; gap: 12px; margin-top: 32px; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 10px 14px;
  background: transparent;
  color: inherit;
  font-weight: 690;
  line-height: 1.25;
  text-decoration: none;
  white-space: normal;
}
.login-actions .button { justify-content: space-between; }
.button.primary { background: var(--accent); color: #222a09; }
.button.primary:hover { background: #d3ee52; }
.button.secondary { border-color: var(--line); }
.button.secondary:hover { background: #edf0e5; color: var(--deep); }
.login-panel .button.secondary { border-color: #748172; }
.login-panel :focus-visible, .sidebar :focus-visible { outline-color: var(--accent); }
.app {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 253px minmax(0, 1fr);
}
.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 30px 18px 20px;
  gap: 48px;
  background: var(--deep);
  color: #f4f6ec;
}
.sidebar .brand { padding-left: 10px; }
.sidebar nav { display: grid; gap: 5px; }
.sidebar nav a, .sidebar-account {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 9px;
  font-weight: 640;
  text-decoration: none;
}
.sidebar nav a:hover, .sidebar-account:hover { background: #344438; }
.sidebar a[aria-current="page"] { background: #39493c; color: var(--accent); }
.sidebar-account { margin-top: auto; }
.main { width: min(100%, 1080px); padding: clamp(24px, 5vw, 70px); }
.page-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; margin-bottom: 30px; }
.status, .empty { color: var(--muted); }
.status { padding: 18px 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.module-card {
  margin-bottom: 18px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.module-card h2 { margin-bottom: 16px; }
.lesson-list { list-style: none; margin: 0; padding: 0; }
.lesson-list li + li { border-top: 1px solid var(--line); }
.lesson-list a { display: flex; justify-content: space-between; gap: 20px; padding: 14px 0; text-decoration: none; }
.lesson-list a:hover { text-decoration: underline; }
.lesson-list .empty { padding: 12px 0; }
.lesson-player, .video-frame, #lesson-player { max-width: 100%; width: 100%; }
.lesson-player iframe, .video-frame iframe { display: block; width: 100%; height: 100%; border: 0; }
.lesson-description { white-space: pre-wrap; overflow-wrap: anywhere; }
.account-card { max-width: 540px; }
.account-card label { display: grid; gap: 5px; }
.account-card input:not([type="hidden"]) { width: 100%; border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 10px; color: var(--ink); }

@media (max-width: 760px) {
  .app { display: block; }
  .sidebar { position: static; min-height: 0; gap: 15px; padding: 16px; }
  .sidebar .brand { padding-left: 0; }
  .sidebar nav { display: flex; gap: 4px; flex-wrap: wrap; }
  .sidebar nav a, .sidebar-account { padding: 6px 8px; min-height: 38px; font-size: .88rem; }
  .sidebar-account { position: absolute; top: 18px; right: 16px; }
  .welcome { grid-template-columns: 1fr; align-items: start; }
  .welcome h1 { font-size: clamp(3.1rem, 14vw, 5.5rem); }
  .public-header { padding-block: 20px; }
}

@media (max-width: 420px) {
  .module-card { padding: 14px; }
  .main { padding-inline: 14px; }
}

.player-frame {
  aspect-ratio: 16 / 9;
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  background: #141a15;
}
.player-frame iframe { display: block; width: 100%; height: 100%; border: 0; }
