:root {
  --paper: #f3efe6;
  --card: #fffdf8;
  --ink: #1d1a16;
  --muted: #6e675f;
  --line: #e3dacd;
  --orange: #f27316;
  --navy: #16284a;
  --clay: #c45c26;
  --danger: #8d2f1b;
  --shadow: 0 16px 40px rgba(40, 28, 14, 0.06);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.45;
}

button, input, select, textarea { font: inherit; color: inherit; }

:focus-visible {
  outline: 2px solid var(--clay);
  outline-offset: 2px;
}

a { color: var(--navy); }

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
}

.login-story {
  padding: 40px 64px 72px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  color: var(--navy);
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 255, 255, 0.34), transparent 28%),
    radial-gradient(circle at 90% 88%, rgba(22, 40, 74, 0.12), transparent 30%),
    var(--orange);
}

.mark {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 28px;
  font-family: Palatino Linotype, Palatino, Georgia, serif;
  font-size: 32px;
}

.logo {
  display: block;
  width: min(140px, 100%);
  height: auto;
  background: transparent;
}

.login-story h1 {
  margin: 0;
  max-width: 12ch;
  font-family: Palatino Linotype, Palatino, Georgia, serif;
  font-size: 54px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.02;
}

.login-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
  overflow: auto;
  background: var(--navy);
}

.login-stack { width: min(440px, 100%); }
.login-stack .card { width: 100%; }

.founder-link {
  margin: 14px 0 0;
  text-align: center;
}

.founder-link a { color: #f7f4ee; font-size: 14px; }

.card {
  width: min(440px, 100%);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 22px;
  box-shadow: var(--shadow);
}

.register-block {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.register-block h2 {
  margin: 0 0 12px;
  font-family: Palatino Linotype, Palatino, Georgia, serif;
  font-size: 22px;
  font-weight: 600;
}

.stack-form { display: flex; flex-direction: column; gap: 12px; }

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}

input, select, textarea {
  width: 100%;
  background: white;
  border: 1px solid #d9d0c3;
  border-radius: 11px;
  padding: 11px 12px;
}

textarea { min-height: 84px; resize: vertical; }

.hint { margin: 0; color: var(--muted); font-size: 13px; }

.form-error {
  min-height: 1.2em;
  margin: 0;
  color: var(--danger);
  font-size: 14px;
}

.btn {
  border: 0;
  background: var(--orange);
  color: var(--navy);
  border-radius: 999px;
  padding: 11px 16px;
  font-weight: 650;
  cursor: pointer;
}

.btn:disabled { opacity: 0.6; cursor: wait; }

.btn.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}

.btn.danger {
  background: transparent;
  color: var(--danger);
  padding-inline: 10px;
}

.btn.wide { width: 100%; }

.btn.navy {
  background: var(--navy);
  color: #f7f4ee;
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 240px 1fr;
}

.side {
  background: var(--orange);
  color: var(--navy);
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
  font-family: Palatino Linotype, Palatino, Georgia, serif;
  font-size: 30px;
}

.brand .logo,
.topbar .logo {
  width: 84px;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 28px;
}

.nav-btn {
  text-align: left;
  background: transparent;
  color: var(--navy);
  border: 0;
  border-radius: 11px;
  padding: 11px 12px;
  cursor: pointer;
}

.nav-btn.active,
.nav-btn:hover { background: rgba(22, 40, 74, 0.12); color: var(--navy); }

.side-foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.who { margin: 0; font-weight: 650; }

.side .btn.ghost,
.topbar .btn.ghost {
  color: var(--navy);
  border-color: rgba(22, 40, 74, 0.35);
}

.main {
  padding: 32px 36px 72px;
  max-width: 1120px;
}

.page-head h1,
.student-main h1,
.piece h3,
.card-title {
  font-family: Palatino Linotype, Palatino, Georgia, serif;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.page-head h1,
.student-main h1 {
  margin: 0;
  font-size: 36px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--clay);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.stats, .steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 18px 0;
}

.stat, .step, .piece, .panel, .callout, .banner, .pick, .content-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
}

.stat, .step { padding: 16px; }

.stat b {
  display: block;
  font-family: Palatino Linotype, Palatino, Georgia, serif;
  font-size: 34px;
  font-weight: 600;
}

.stat span, .muted { color: var(--muted); }

.step {
  text-align: left;
  cursor: pointer;
}

.step em {
  display: block;
  margin-bottom: 6px;
  font-style: normal;
  color: var(--clay);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.callout, .banner, .panel { padding: 16px; }

.callout { background: #fff1e6; }

.callout ul { margin: 8px 0; padding-left: 18px; }

.banner { background: #f8efd8; border-color: #e4d0a1; margin-bottom: 16px; }

.banner p { margin: 6px 0; }

code {
  font-family: Consolas, "Courier New", monospace;
  background: white;
  border-radius: 6px;
  padding: 2px 6px;
}

.row-form, .inline {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
}

.row-form { margin-bottom: 16px; }

.row-form label, .inline label { flex: 1; min-width: 160px; }

.split {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 16px;
  align-items: start;
}

.list { display: flex; flex-direction: column; gap: 8px; }

.pick {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 12px 14px;
  text-align: left;
  cursor: pointer;
}

.pick.on {
  border-color: var(--orange);
  background: #fff1e6;
}

.section-head, .class-tools, .piece-top, .content-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }

th {
  text-align: left;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 650;
  padding: 8px;
}

td {
  border-top: 1px solid var(--line);
  padding: 10px 8px;
  vertical-align: middle;
}

td input, td select { padding: 8px 10px; }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}

.content-card, .piece { padding: 14px; }

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 700;
}

.badge.video { background: #fff1e6; color: #c2410c; }
.badge.pdf { background: #f8e8dc; color: #8a3e16; }

.links { display: flex; gap: 12px; align-items: center; margin-top: 10px; }

.text-link, .jump {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  font: inherit;
}

.text-link { color: var(--danger); text-decoration: underline; }

.jump { color: inherit; text-align: left; }
.jump:hover { text-decoration: underline; }

.empty {
  padding: 28px 16px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.45);
}

.class-block { margin-top: 16px; }

.class-block h3 { margin: 0; font-size: 16px; }

.student-check {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 9px 2px;
  border-top: 1px solid var(--line);
}

.student-check input { width: auto; }

.progress {
  height: 8px;
  background: #efe8dc;
  border-radius: 99px;
  overflow: hidden;
}

.progress div {
  height: 100%;
  width: 0;
  background: var(--orange);
}

.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 22px;
  background: var(--orange);
  color: var(--navy);
}

.topbar .brand { font-size: 26px; text-decoration: none; color: inherit; }
.topbar .who { margin: 0 0 0 auto; text-align: right; }
.topbar .who span { display: block; color: rgba(22, 40, 74, 0.72); font-weight: 400; font-size: 13px; }

.student-main { max-width: 980px; margin: 0 auto; padding: 28px 22px 72px; }

.pieces { display: flex; flex-direction: column; gap: 14px; margin-top: 12px; }

.video {
  width: 100%;
  max-height: 520px;
  background: #111;
  border-radius: 14px;
}

.pdf-frame {
  width: 100%;
  height: 72vh;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
}

.toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  max-width: min(360px, calc(100vw - 32px));
  background: var(--navy);
  color: white;
  padding: 12px 14px;
  border-radius: 12px;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: 0.2s ease;
}

.toast.show { opacity: 1; transform: none; }
.toast.bad { background: var(--danger); }

@media (max-width: 980px) {
  .login-shell, .shell, .stats, .steps, .split { grid-template-columns: 1fr; }
  .login-story { padding: 16px 24px 28px; }
  .login-story h1 { font-size: 40px; }
  .side {
    position: sticky;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
  }
  .nav { flex-direction: row; flex-wrap: wrap; margin-top: 0; }
  .side-foot { margin-top: 0; margin-left: auto; flex-direction: row; align-items: center; }
  .main { padding: 22px 16px 64px; }
  .page-head h1, .student-main h1 { font-size: 30px; }
}
