/* The look of an organisation's site. Its own colour is --accent, set by
   lms.js from the organisation's settings; everything tinted is mixed from
   it, so a school's colour carries through the bar, the buttons, the tags
   and the course cards. The rest is a calm light page: one typeface, one
   scale of greys, one radius for controls and one for cards. */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Noto+Sans+Devanagari:wght@400;600;700&display=swap");
:root {
  --accent: #4f46e5;
  --accent-soft: color-mix(in srgb, var(--accent) 9%, #fff);
  --accent-line: color-mix(in srgb, var(--accent) 28%, #fff);
  --accent-deep: color-mix(in srgb, var(--accent) 82%, #000);
  --t1: #0f172a; --t2: #1e293b; --t3: #64748b; --t4: #94a3b8; --t5: #cbd5e1;
  --surface: #ffffff; --surface2: #f1f5f9; --border: #e2e8f0; --border2: #cbd5e1;
  --radius-sm: 8px; --radius-md: 14px; --physics: #2563eb; --chemistry: #b91c1c;
  --page: #f6f8fb;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow-md: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px -12px rgba(15, 23, 42, .18);
  --font: "Inter", "Noto Sans Devanagari", system-ui, -apple-system, "Segoe UI", sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--page); color: var(--t2); font: 15.5px/1.6 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--accent-deep); text-underline-offset: 2px; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }

/* ── the bar ─────────────────────────────────────────────────────────── */
.top { position: sticky; top: 0; z-index: 20; background: rgba(255, 255, 255, .92); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--border); }
.top .in { width: min(1120px, calc(100% - 40px)); margin: 0 auto; min-height: 62px; padding: 8px 0; display: flex; gap: 8px 22px; align-items: center; flex-wrap: wrap; }
.school { display: flex; gap: 11px; align-items: center; text-decoration: none; color: var(--t1); font-weight: 700; font-size: 1.04rem; letter-spacing: -.01em; min-width: 0; }
.school img { height: 34px; width: auto; max-width: 120px; border-radius: 8px; }
.school .mark { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--accent); color: #fff; font-weight: 700; font-size: 1rem; }
.school span { overflow-wrap: anywhere; }
.menu { display: flex; gap: 2px; align-items: center; flex-wrap: wrap; }
.menu a { text-decoration: none; color: var(--t3); font-weight: 600; font-size: .92rem; padding: 7px 12px; border-radius: 8px; white-space: nowrap; }
.menu a:hover { color: var(--t1); background: var(--surface2); }
.menu a[aria-current] { color: var(--accent-deep); background: var(--accent-soft); }
.who { margin-left: auto; display: flex; gap: 10px; align-items: center; font-size: .9rem; color: var(--t3); flex-wrap: wrap; }
.who .person { display: flex; gap: 8px; align-items: center; color: var(--t2); font-weight: 600; }
.who .face { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-deep); border: 1px solid var(--accent-line); font-size: .78rem; font-weight: 700; }
.btn.wallet { font-variant-numeric: tabular-nums; white-space: nowrap; gap: .35em; color: var(--t3); }
.btn.wallet span { font-weight: 700; color: var(--t1); }

/* ── the page ────────────────────────────────────────────────────────── */
main { flex: 1 0 auto; width: min(1120px, calc(100% - 40px)); margin: 34px auto 72px; }
main.narrow { width: min(800px, calc(100% - 40px)); }
h1 { font-size: clamp(1.55rem, 3.6vw, 2rem); line-height: 1.2; letter-spacing: -.02em; font-weight: 700; color: var(--t1); margin: 0 0 6px; overflow-wrap: anywhere; }
h2 { font-size: 1.12rem; letter-spacing: -.01em; font-weight: 700; color: var(--t1); margin: 38px 0 12px; scroll-margin-top: 130px; }
.lead { color: var(--t3); font-size: 1.02rem; margin: 0 0 24px; max-width: 68ch; }
main > p:not(.lead):not(.note) > a:only-child { text-decoration: none; font-weight: 600; font-size: .9rem; color: var(--t3); }
main > p:not(.lead):not(.note) > a:only-child:hover { color: var(--accent-deep); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); padding: 20px 22px; margin-bottom: 14px; min-width: 0; overflow-wrap: anywhere; }
.card > strong:first-child { display: block; color: var(--t1); font-size: 1rem; margin-bottom: 4px; }
.card[id^="no-"] { text-align: center; color: var(--t3); background: transparent; border-style: dashed; border-color: var(--border2); box-shadow: none; padding: 26px 22px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4em; border: 1px solid var(--border2); background: var(--surface); border-radius: var(--radius-sm); padding: 8px 15px; cursor: pointer; text-decoration: none; color: var(--t1); font-weight: 600; font-size: .93rem; line-height: 1.4; box-shadow: var(--shadow-sm); transition: background .12s, border-color .12s, box-shadow .12s; }
.btn:hover { border-color: var(--t4); background: #fbfcfe; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-deep); border-color: var(--accent-deep); }
.btn.big { padding: 11px 22px; font-size: 1rem; border-radius: 10px; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.small { padding: 5px 11px; font-size: .84rem; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

input[type=text], input[type=email], input[type=url], input[type=number], input[type=datetime-local], select, textarea { border: 1px solid var(--border2); border-radius: var(--radius-sm); padding: 8px 11px; background: var(--surface); color: var(--t1); transition: border-color .12s, box-shadow .12s; }
input[type=text]:focus, input[type=email]:focus, input[type=url]:focus, input[type=number]:focus, input[type=datetime-local]:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent) !important; box-shadow: 0 0 0 3px var(--accent-soft); }
input[type=checkbox] { accent-color: var(--accent); }
input[type=color] { border: 1px solid var(--border2); border-radius: var(--radius-sm); background: var(--surface); padding: 3px; height: 38px; width: 64px !important; cursor: pointer; }
::placeholder { color: var(--t4); }
.field { display: grid; gap: 5px; margin-bottom: 14px; font-size: .86rem; font-weight: 600; color: var(--t2); }
.field input, .field select { font-weight: 400; font-size: .97rem; width: 100%; }
.note { font-size: .88rem; color: var(--t3); }
.note[data-kind=error] { color: #b91c1c; }
.note[data-kind=ok] { color: #15803d; }

.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.list li { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-sm); padding: 13px 18px; display: flex; gap: 8px 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; transition: border-color .12s, box-shadow .12s; }
.list li:hover { border-color: var(--accent-line); box-shadow: var(--shadow-md); }
.list .name { color: var(--t1); font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
.list a.name:hover { color: var(--accent-deep); }
.tag { font-size: .76rem; font-weight: 600; border-radius: 999px; padding: 3px 10px; background: var(--surface2); color: var(--t3); white-space: nowrap; }
.tag.done { background: #dcfce7; color: #166534; }
.tag.now { background: #fef3c7; color: #92400e; }
.code { font: 700 1.7rem/1.1 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .16em; color: var(--accent-deep); margin-top: 4px; }

table.plain { display: table; width: 100%; border-collapse: separate; border-spacing: 0; font-size: .9rem; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-sm); }
table.plain th { background: #f8fafc; color: var(--t3); font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
table.plain th, table.plain td { border-bottom: 1px solid var(--border); padding: 10px 14px; text-align: left; white-space: nowrap; }
table.plain th:first-child { border-top-left-radius: 12px; }
table.plain th:last-child { border-top-right-radius: 12px; }
table.plain tbody tr:last-child td { border-bottom: 0; }
table.plain tbody tr:hover td { background: #fafbfd; }

/* ── a member's front page: courses as cards ─────────────────────────── */
#home h1 { font-size: 1.3rem; margin-bottom: 12px; }
#home #courses { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
#home #courses li { position: relative; flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 10px; padding: 0 18px 16px; overflow: hidden; }
#home #courses li::before { content: ""; align-self: stretch; height: 68px; margin: 0 -18px 4px; background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #fff)); }
#home #courses li:nth-child(3n+2)::before { background: linear-gradient(135deg, var(--accent-deep), var(--accent)); }
#home #courses li:nth-child(3n)::before { background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 70%, #0f172a), color-mix(in srgb, var(--accent) 70%, #fff)); }
#home #courses .name { font-size: 1.04rem; line-height: 1.35; }
#home #courses .name::after { content: ""; position: absolute; inset: 0; }

/* ── someone at the door ─────────────────────────────────────────────── */
#door { text-align: center; padding-top: 4vh; }
#door .lead { margin-inline: auto; }
#door .card { text-align: left; max-width: 440px; margin-inline: auto; padding: 26px; box-shadow: var(--shadow-md); }

/* ── apaslms.com itself ──────────────────────────────────────────────── */
main:has(#front:not([hidden])) { width: min(1120px, calc(100% - 40px)); margin-top: 0; }
.hero { text-align: center; padding: clamp(40px, 8vw, 84px) 0 clamp(28px, 5vw, 48px); }
.hero .eyebrow { display: inline-block; font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-deep); background: var(--accent-soft); border: 1px solid var(--accent-line); border-radius: 999px; padding: 4px 12px; margin: 0 0 18px; }
.hero h1 { font-size: clamp(2rem, 5.4vw, 3.3rem); line-height: 1.08; letter-spacing: -.035em; max-width: 17ch; margin: 0 auto 16px; }
.hero .lead { font-size: clamp(1rem, 2vw, 1.16rem); margin: 0 auto 26px; max-width: 58ch; }
.hero .card { display: inline-flex; gap: 14px; align-items: center; margin: 0; padding: 10px 10px 10px 20px; border-radius: 14px; box-shadow: var(--shadow-md); }
.hero .card p { margin: 0; color: var(--t3); }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin: 8px 0 16px; }
.feature { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); padding: 22px; }
.feature .icon { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-deep); border: 1px solid var(--accent-line); margin-bottom: 14px; }
.feature .icon svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.feature h3 { margin: 0 0 6px; font-size: 1.02rem; color: var(--t1); letter-spacing: -.01em; }
.feature p { margin: 0; color: var(--t3); font-size: .93rem; }
.steps { counter-reset: step; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px 26px; list-style: none; margin: 0 0 8px; padding: 22px 24px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); }
.steps li { counter-increment: step; display: grid; grid-template-columns: auto 1fr; gap: 0 12px; align-items: start; color: var(--t3); font-size: .93rem; }
.steps li::before { content: counter(step); width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; font-weight: 700; font-size: .85rem; }
.steps b { display: block; color: var(--t1); }
.yours { width: min(560px, 100%); margin: 0 auto; }
.yours h2 { margin-top: 30px; }
#create { padding: 26px; box-shadow: var(--shadow-md); }
#create > strong { font-size: 1.1rem; }

/* ── Manage ──────────────────────────────────────────────────────────── */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 0 0 6px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); padding: 16px 18px; text-decoration: none; color: inherit; display: block; }
a.stat:hover { border-color: var(--accent-line); box-shadow: var(--shadow-md); }
.stat b { display: block; font-size: 1.7rem; line-height: 1.15; letter-spacing: -.02em; color: var(--t1); font-variant-numeric: tabular-nums; }
.stat span { font-size: .76rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--t3); }
.sections { position: sticky; top: 62px; z-index: 10; display: flex; gap: 4px; overflow-x: auto; margin: 18px -4px 0; padding: 8px 4px; background: color-mix(in srgb, var(--page) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); scrollbar-width: none; }
.sections a { flex: none; text-decoration: none; color: var(--t3); font-weight: 600; font-size: .88rem; padding: 6px 12px; border-radius: 999px; }
.sections a:hover { color: var(--accent-deep); background: var(--accent-soft); }
#bank label { padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: #fbfcfe; }
#bank label:has(input:checked) { border-color: var(--accent-line); background: var(--accent-soft); }

/* ── a lesson ────────────────────────────────────────────────────────── */
.paper { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); padding: clamp(18px, 4vw, 40px); overflow-x: auto; }
.lesson-body img { max-width: 100%; height: auto; display: block; margin: 12px auto; }
.lesson-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.apc-question-check { margin-top: .8rem; border: 1px solid var(--accent); background: var(--accent); color: #fff; border-radius: 8px; padding: 6px 14px; cursor: pointer; font-weight: 600; }
.apc-question-check:disabled { opacity: .6; }
.apc-question-feedback { margin-top: .6rem; font-weight: 600; }
.apc-question-feedback[data-correct=true] { color: #15803d; }
.apc-question-feedback[data-correct=false] { color: #b91c1c; }
.apc-question-key { margin-top: .6rem; color: var(--t1); }
.apc-question-key > span { color: var(--t3); font-size: .85rem; margin-right: .4rem; text-transform: uppercase; letter-spacing: .04em; }

.foot { flex: none; text-align: center; font-size: .8rem; color: var(--t4); margin: 0; padding: 22px 16px 26px; border-top: 1px solid var(--border); }
.foot a { color: var(--t3); font-weight: 600; text-decoration: none; }

@media (max-width: 720px) {
  table.plain { display: block; overflow-x: auto; }
}
@media (max-width: 640px) {
  .top .in, main, main.narrow, main:has(#front:not([hidden])) { width: calc(100% - 28px); }
  .top .in { gap: 6px 12px; }
  .who .person span:not(.face) { display: none; }
  .menu { order: 3; width: 100%; overflow-x: auto; flex-wrap: nowrap; }
  main { margin-top: 22px; }
  .hero .card { flex-direction: column; padding: 16px; }
  .sections { position: static; }
  .top { position: static; }
}

.list + .card, .list + form.card { margin-top: 12px; }
.list:empty { display: none; }

/* ── what one can make: tiles on a writer's front page ───────────────── */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin: 0 0 34px; }
.tile { display: grid; gap: 4px; align-content: start; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); padding: 18px; text-decoration: none; color: var(--t3); font-size: .9rem; transition: border-color .12s, box-shadow .12s, transform .12s; }
.tile:hover { border-color: var(--accent-line); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.tile b { color: var(--t1); font-size: 1.02rem; }
.tile .icon { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-deep); border: 1px solid var(--accent-line); margin-bottom: 8px; }
.tile .icon svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
main.narrow:has(#make-part:not([hidden])) { width: min(1000px, calc(100% - 40px)); }
