/* Standing on Purpose Movement Academy */
:root {
  --purple: #5b2a86;
  --purple-dark: #48206b;
  --plum: #3b1f3f;
  --lilac: #efe7f6;
  --lilac-2: #f7f2fb;
  --bg: #faf7fc;
  --surface: #ffffff;
  --ink: #241629;
  --muted: #6c5d73;
  --line: #e7dcef;
  --green: #1f8a4c;
  --red: #b3261e;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(59, 31, 63, .06), 0 6px 20px rgba(59, 31, 63, .06);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background: var(--bg); color: var(--ink);
  font-family: "Inter", system-ui, sans-serif; font-size: 16px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--purple); }
img { display: block; max-width: 100%; }
h1, h2, h3 { font-family: "Bricolage Grotesque", sans-serif; letter-spacing: -.02em; line-height: 1.15; color: var(--plum); }
h1 { font-size: clamp(26px, 4vw, 36px); }
h2 { font-size: 22px; }
h3 { font-size: 17px; }
.boot { padding: 80px 20px; text-align: center; color: var(--muted); }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.hidden { display: none !important; }

/* Buttons and forms */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--purple); color: #fff; border: 0; border-radius: 999px;
  padding: 12px 22px; font: 600 15px "Inter", sans-serif; cursor: pointer; text-decoration: none;
}
.btn:hover { background: var(--purple-dark); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--purple); border: 1.5px solid var(--purple); }
.btn.ghost:hover { background: var(--lilac); }
.btn.small { padding: 7px 14px; font-size: 14px; }
.btn.done { background: var(--green); }
.btn.danger { background: transparent; color: var(--red); border: 1.5px solid #e8c4c1; }
.linkbtn { background: none; border: 0; color: var(--purple); font: inherit; cursor: pointer; text-decoration: underline; padding: 0; }
label { display: block; font-weight: 600; font-size: 14px; margin: 14px 0 6px; color: var(--plum); }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=search], textarea, select {
  width: 100%; padding: 11px 14px; border: 1.5px solid var(--line); border-radius: 12px;
  font: 15px "Inter", sans-serif; background: #fff; color: var(--ink);
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--purple); outline-offset: 1px; border-color: transparent; }
textarea { min-height: 140px; resize: vertical; line-height: 1.5; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.error { background: #fdecea; color: var(--red); border-radius: 12px; padding: 10px 14px; margin-top: 14px; font-size: 14px; }
.notice { background: var(--lilac); color: var(--plum); border-radius: 12px; padding: 12px 16px; font-size: 14px; }
.testbar { background: #fff6d6; color: #5c4400; text-align: center; font-size: 13px; padding: 6px 16px; }

/* Top bar */
.top { position: sticky; top: 0; z-index: 20; background: var(--plum); color: #fff; }
.top .wrap { display: flex; align-items: center; gap: 14px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; min-width: 0; }
.brand img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: #fff; }
.brand span { font: 700 15px "Bricolage Grotesque", sans-serif; line-height: 1.1; max-width: 190px; }
.search { flex: 1; max-width: 420px; margin-left: auto; position: relative; }
.search input { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2); color: #fff; padding: 9px 14px 9px 38px; border-radius: 999px; }
.search input::placeholder { color: rgba(255,255,255,.7); }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); opacity: .8; }
.iconbtn { position: relative; background: none; border: 0; color: #fff; cursor: pointer; padding: 8px; border-radius: 50%; display: flex; }
.iconbtn:hover { background: rgba(255,255,255,.12); }
.badge { position: absolute; top: 2px; right: 2px; background: #e2457f; color: #fff; font-size: 11px; font-weight: 700; min-width: 18px; height: 18px; border-radius: 9px; display: flex; align-items: center; justify-content: center; padding: 0 4px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: var(--lilac); color: var(--purple); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; flex-shrink: 0; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.big { width: 96px; height: 96px; font-size: 32px; }
.menu { position: absolute; right: 0; top: 52px; background: #fff; color: var(--ink); border-radius: 14px; box-shadow: 0 12px 40px rgba(0,0,0,.18); width: 300px; overflow: hidden; z-index: 30; }
.menu a, .menu button.item { display: block; width: 100%; text-align: left; padding: 11px 16px; color: var(--ink); text-decoration: none; background: none; border: 0; font: 15px "Inter", sans-serif; cursor: pointer; }
.menu a:hover, .menu button.item:hover { background: var(--lilac-2); }
.menu .head { padding: 12px 16px; border-bottom: 1px solid var(--line); font-weight: 700; color: var(--plum); }
.note { padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: 14px; }
.note.unread { background: var(--lilac-2); }
.note b { display: block; color: var(--plum); }
.note time { color: var(--muted); font-size: 12px; }
.menu .note a { display: inline; padding: 0; color: var(--purple); font-weight: 600; margin-right: 8px; }
.menu .note a:hover { background: none; text-decoration: underline; }
.anchor { position: relative; }
@media (max-width: 720px) {
  .top .wrap { flex-wrap: wrap; height: auto; padding-top: 10px; padding-bottom: 10px; }
  .brand span { display: none; }
  .search { order: 5; flex-basis: 100%; max-width: none; }
  .menu { position: fixed; left: 16px; right: 16px; top: 112px; width: auto; }
}

/* Layout */
main { padding: 32px 0 80px; }
.hero { background: linear-gradient(135deg, var(--purple), var(--plum)); color: #fff; border-radius: 22px; padding: 32px; margin-bottom: 32px; }
.hero h1 { color: #fff; }
.hero p { opacity: .9; margin-top: 8px; max-width: 640px; }
.hero .btn { background: #fff; color: var(--purple); margin-top: 18px; }
.section { margin-bottom: 36px; }
.section > h2 { margin-bottom: 14px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); text-decoration: none; color: inherit; display: flex; flex-direction: column; gap: 8px; }
a.card:hover { border-color: var(--purple); }
.card .tag { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--purple); }
.card p { color: var(--muted); font-size: 14px; flex: 1; }
.bar { height: 8px; background: var(--lilac); border-radius: 4px; overflow: hidden; }
.bar > div { height: 100%; background: var(--purple); border-radius: 4px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.narrow { max-width: 460px; margin: 0 auto; }
.center { text-align: center; }
.stack > * + * { margin-top: 12px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.crumbs { font-size: 14px; color: var(--muted); margin-bottom: 12px; }
.crumbs a { color: var(--muted); }

/* Course and lesson */
.lessons { list-style: none; margin-top: 18px; }
.lessons li a { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; background: #fff; color: var(--ink); text-decoration: none; }
.lessons li a:hover { border-color: var(--purple); }
.tick { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.tick.on { background: var(--green); border-color: var(--green); color: #fff; }
.lesson-layout { display: grid; grid-template-columns: 1fr 300px; gap: 24px; align-items: start; }
@media (max-width: 900px) { .lesson-layout { grid-template-columns: 1fr; } }
.video { position: relative; padding-top: 56.25%; background: #120a14; border-radius: var(--radius); overflow: hidden; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-link { background: var(--plum); color: #fff; border-radius: var(--radius); padding: 32px; text-align: center; }
.video-link .btn { background: #fff; color: var(--purple); margin-top: 14px; }
.notes { margin-top: 22px; }
.notes h2, .notes h3 { margin: 22px 0 8px; }
.notes p { margin: 10px 0; }
.notes ul, .notes ol { margin: 10px 0 10px 22px; }
.notes li { margin: 4px 0; }
.notes h4 { font: 700 16px "Inter", sans-serif; color: var(--plum); margin: 16px 0 6px; }
.notes ul.checklist { list-style: none; margin-left: 2px; }
.notes .box { display: inline-block; width: 16px; height: 16px; border: 2px solid var(--purple); border-radius: 4px; margin-right: 10px; vertical-align: -3px; }
.notes .box.on { background: var(--purple); }
.notes figure { margin: 18px 0; }
.notes figure img { border: 1px solid var(--line); border-radius: 12px; cursor: zoom-in; box-shadow: var(--shadow); }
.notes figcaption::after { content: " Click the picture to see it bigger."; }
.lightbox { position: fixed; inset: 0; z-index: 60; background: rgba(20, 10, 24, .92); display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 24px 16px; cursor: zoom-out; overflow: auto; }
.lightbox img { width: min(96vw, 1100px); height: auto; margin: auto 0 0; background: #fff; border-radius: 10px; flex-shrink: 0; }
.lightbox .btn { margin-bottom: auto; }
.lightbox p { color: #fff; font-size: 14px; text-align: center; max-width: 700px; }
.lightbox .btn { background: #fff; color: var(--purple); }
.notes figcaption { font-size: 13px; color: var(--muted); margin-top: 6px; }
.notes code { background: var(--lilac); padding: 1px 6px; border-radius: 6px; font-size: 14px; }
.notes .callout { background: var(--lilac-2); border-left: 4px solid var(--purple); border-radius: 10px; padding: 4px 16px; margin: 16px 0; }
.notes table { margin: 12px 0; background: #fff; }
.notes th { background: var(--lilac-2); }
.side-list a { display: flex; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 10px; text-decoration: none; color: var(--ink); font-size: 14px; }
.side-list a.current { background: var(--lilac); font-weight: 600; }
.side-list a:hover { background: var(--lilac-2); }
.side-list .tick { width: 20px; height: 20px; }

/* Admin */
.tree .sec { border: 1px solid var(--line); border-radius: 14px; background: #fff; margin-bottom: 14px; }
.tree .sec-head { display: flex; gap: 8px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--lilac-2); border-radius: 14px 14px 0 0; flex-wrap: wrap; }
.tree .sec-head input { flex: 1; min-width: 160px; font-weight: 700; }
.tree .item { display: flex; gap: 8px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tree .item:last-child { border-bottom: 0; }
.tree .item .grow { flex: 1; min-width: 160px; }
.pill { font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 999px; background: var(--lilac); color: var(--purple); }
.pill.off { background: #eee; color: #666; }
.pill.ok { background: #e3f4ea; color: var(--green); }
.res-row { display: grid; grid-template-columns: 1fr 1.4fr auto; gap: 8px; margin-bottom: 8px; }
@media (max-width: 600px) { .res-row { grid-template-columns: 1fr; } }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); }
.table-wrap { overflow-x: auto; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--plum); color: #fff; padding: 12px 20px; border-radius: 999px; font-size: 14px; z-index: 50; box-shadow: var(--shadow); }
