/* Bio-philic: login, classroom and admin screens (loads after site.css) */
.app-body { background: var(--ground); min-height: 100%; }
.app-bar { background: var(--deep); color: #FFFFFF; position: sticky; top: 0; z-index: 20; }
.app-bar .wrap { position: static; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 8px; }
.app-bar .brand img { height: 50px; }
.app-bar .who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.app-bar .who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 46vw; font-weight: 600; }
.btn-small { min-height: 40px; padding: 6px 16px; font-size: 15px; border-radius: 10px; }
.btn-line { background: transparent; border-color: #6B46A8; color: #FFFFFF; }
.btn-line:hover { background: #FFFFFF; color: var(--deep); }
.btn-line-dark { background: #FFFFFF; border-color: var(--accent); color: var(--accent); }
.btn-line-dark:hover { background: var(--accent); color: #FFFFFF; }
.btn-danger { background: #FFFFFF; border-color: #B91C1C; color: #B91C1C; }
.btn-danger:hover { background: #B91C1C; color: #FFFFFF; }
.btn[disabled] { opacity: 0.6; cursor: default; }

.app-main { padding-block: 24px 64px; display: flex; flex-direction: column; gap: 20px; }
.app-main h1 { font-size: clamp(24px, 4vw, 32px); line-height: 1.2; color: var(--deep); }
.app-main h2 { font-size: 21px; line-height: 1.3; color: var(--deep); }
.panel { background: #FFFFFF; border: 1px solid var(--line); border-radius: 18px; padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.muted { color: var(--muted); }

.tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.tabs button { min-height: 44px; padding: 8px 20px; border-radius: 999px; border: 1px solid var(--line); background: #FFFFFF; color: var(--ink); font: 600 16px/1.2 var(--font-body); cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--accent); border-color: var(--accent); color: #FFFFFF; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pills button { min-height: 40px; padding: 6px 16px; border-radius: 10px; border: 1px solid var(--line); background: #FFFFFF; color: var(--ink); font: 600 15px/1.2 var(--font-body); cursor: pointer; }
.pills button[aria-pressed="true"] { background: var(--deep); border-color: var(--deep); color: #FFFFFF; }

/* forms */
.form { display: grid; gap: 12px 14px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); align-items: end; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field label, .field .label { font-weight: 600; font-size: 15px; }
.field input, .field select { min-height: 46px; padding: 8px 12px; border-radius: 10px; border: 1px solid #B9A9D6; background: #FFFFFF; color: var(--ink); font: 400 16px/1.3 var(--font-body); width: 100%; }
.field input:focus, .field select:focus { outline: 3px solid #C9A6FF; border-color: var(--accent); }
.checks { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.checks label { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; font-weight: 500; }
.checks input { width: 20px; height: 20px; accent-color: var(--accent); }
.wide { grid-column: 1 / -1; }
.msg { display: none; border-radius: 10px; padding: 10px 14px; font-weight: 500; }
.msg.show { display: block; }
.msg.info { background: var(--tint); color: #3B1A7A; }
.msg.ok { background: #DCFCE7; color: #14532D; }
.msg.error { background: #FEE2E2; color: #7F1D1D; }

/* tables */
.table-box { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
table.data th, table.data td { text-align: left; padding: 10px 12px; border-bottom: 1px solid #ECE6F5; vertical-align: top; }
table.data th { font-size: 14px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.badge { display: inline-block; background: #EFE5FF; color: #4A1D96; border-radius: 999px; padding: 1px 10px; font-size: 13.5px; font-weight: 600; margin: 1px 4px 1px 0; }
.badge.free { background: #DCFCE7; color: #14532D; }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; }

/* login card */
.login-card { max-width: 440px; margin: 0 auto; width: 100%; background: rgba(255, 255, 255, 0.72); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); border: 1px solid rgba(255, 255, 255, 0.9); border-radius: 20px; padding: 24px; display: flex; flex-direction: column; gap: 14px; box-shadow: 0 8px 26px rgba(42, 15, 92, 0.12); }
.login-card h2 { font-size: 24px; color: var(--deep); }
.login-card .btn { width: 100%; }

/* classroom */
.class-layout { display: grid; gap: 18px; grid-template-columns: minmax(0, 1.7fr) minmax(260px, 1fr); align-items: start; }
@media (max-width: 860px) { .class-layout { grid-template-columns: minmax(0, 1fr); } }
.player { position: relative; background: #000000; border-radius: 16px; overflow: hidden; aspect-ratio: 16 / 9; }
.player .frame, .player .frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
/* the shield sits over YouTube's own title, share and logo so they cannot be clicked */
.player .shield { position: absolute; inset: 0; background: transparent; border: 0; padding: 0; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.player .shield span { width: 76px; height: 76px; border-radius: 50%; background: rgba(109, 40, 217, 0.92); display: flex; align-items: center; justify-content: center; }
.player.playing .shield span { display: none; }
.player .empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; color: #E3D4FA; padding: 20px; }
.controls { position: absolute; left: 0; right: 0; bottom: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 26px 10px 8px; background: linear-gradient(180deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.82)); color: #FFFFFF; }
.controls button, .controls select { min-width: 42px; height: 42px; border-radius: 10px; border: 0; background: rgba(255, 255, 255, 0.14); color: #FFFFFF; font: 600 14px/1 var(--font-body); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; padding: 0 8px; }
.controls select option { color: #000000; }
.controls input[type="range"] { flex: 1 1 100%; order: -1; accent-color: #C9A6FF; height: 22px; margin: 0; }
.controls .time { font-size: 14px; font-variant-numeric: tabular-nums; margin-right: auto; padding-left: 4px; }
.player:fullscreen { border-radius: 0; aspect-ratio: auto; }
.now-title { font-weight: 700; font-size: 19px; line-height: 1.35; }
.chapters { display: flex; flex-direction: column; gap: 8px; }
.chapters details { background: #FFFFFF; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.chapters summary { cursor: pointer; padding: 12px 14px; font-weight: 700; list-style-position: inside; }
.chapters button.lesson { width: 100%; text-align: left; display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 14px; border: 0; border-top: 1px solid #ECE6F5; background: transparent; color: var(--ink); font: 500 16px/1.35 var(--font-body); cursor: pointer; }
.chapters button.lesson:hover { background: var(--tint); }
.chapters button.lesson[aria-current="true"] { background: #EFE5FF; color: #4A1D96; font-weight: 700; }
.chapters button.lesson svg { flex: none; color: var(--accent); }
.score { display: flex; flex-wrap: wrap; gap: 12px 32px; }
.score div { display: flex; flex-direction: column; }
.score strong { font: 800 28px/1.2 var(--font-display); color: var(--deep); font-variant-numeric: tabular-nums; }

/* narrow screens: tables scroll sideways inside their box, player controls stay on one row */
table.data { min-width: 520px; }
table.data td.nowrap, table.data th.nowrap { white-space: nowrap; }
table.data.kv { min-width: 0; }
@media (max-width: 600px) {
  .controls { gap: 4px; padding: 22px 6px 6px; }
  .controls button, .controls select { min-width: 36px; height: 36px; font-size: 13px; padding: 0 5px; border-radius: 8px; }
  .controls .time { font-size: 12.5px; padding-left: 2px; }
  .player .shield span { width: 60px; height: 60px; }
  .panel { padding: 14px; }
}

/* free demo classes on the public course page */
.demo { display: flex; flex-direction: column; gap: 6px; }
.demo-btn { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 6px 12px; border-radius: 10px; border: 1px solid #B9A9D6; background: rgba(255, 255, 255, 0.7); color: var(--ink); font: 600 15px/1.35 var(--font-body); text-align: left; cursor: pointer; }
.demo-btn svg { flex: none; color: var(--accent); }
.demo-btn:hover { background: var(--accent); border-color: var(--accent); color: #FFFFFF; }
.demo-btn:hover svg { color: #FFFFFF; }
.modal { position: fixed; inset: 0; z-index: 60; background: rgba(10, 1, 30, 0.9); display: flex; align-items: center; justify-content: center; padding: 14px; }
.modal-box { width: min(100%, 880px); display: flex; flex-direction: column; gap: 10px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: #FFFFFF; }
.modal-title { font-size: 18px; line-height: 1.35; }

/* BioConfu band and public video tiles */
.confu { background: linear-gradient(135deg, #34127A 0%, #1B0845 55%, #12022E 100%); color: #FFFFFF; border-radius: 24px; padding: 26px; display: flex; flex-direction: column; gap: 18px; border: 1px solid #4A2A86; }
.confu-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px 20px; }
.confu-head h2 { font-size: clamp(30px, 5vw, 44px); line-height: 1.1; font-weight: 800; }
.confu-head p { color: var(--lilac-soft); font-size: 18px; font-weight: 500; }
.confu-empty { color: var(--lilac-soft); grid-column: 1 / -1; }
.confu .lecture, .confu .lecture strong { color: #FFFFFF; }
.confu .lecture:hover strong { color: var(--lilac); }
.lecture { position: relative; }
.lecture .kind { align-self: flex-start; border-radius: 999px; padding: 1px 12px; font-size: 13px; font-weight: 600; }
.lecture .kind.free { background: #DCFCE7; color: #14532D; }
.lecture .kind.demo { background: #EFE5FF; color: #4A1D96; }
.page-head h1 .rainbow { display: inline-block; }
@media (max-width: 600px) { .confu { padding: 18px 14px; border-radius: 20px; } .confu-head p { font-size: 16px; } }

/* admission form */
.enroll-form { max-width: 760px; margin: 0 auto; width: 100%; }
.choices { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.choice { position: relative; display: block; cursor: pointer; }
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choice span { display: flex; flex-direction: column; gap: 2px; min-height: 64px; padding: 10px 14px; border-radius: 12px; border: 2px solid #D8CCEE; background: #FFFFFF; }
.choice b { font-size: 17px; }
.choice small { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.choice input:checked + span { border-color: var(--accent); background: #F3ECFF; box-shadow: 0 0 0 3px rgba(109, 40, 217, 0.15); }
.choice input:focus-visible + span { outline: 3px solid #F59E0B; outline-offset: 2px; }
.pay-steps { background: var(--tint); border-radius: 12px; padding: 12px 16px; }
.pay-steps ol { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.pay-steps p { margin-top: 6px; }
.offer.closed { background: #7F1D1D; }
.field textarea { min-height: 96px; padding: 8px 12px; border-radius: 10px; border: 1px solid #B9A9D6; background: #FFFFFF; color: var(--ink); font: 400 16px/1.5 var(--font-body); width: 100%; resize: vertical; }
.field textarea:focus { outline: 3px solid #C9A6FF; border-color: var(--accent); }
.field .hint { font-size: 13.5px; color: var(--muted); }

/* admin: courses and admission requests */
.tabs .count { display: inline-block; min-width: 22px; padding: 0 6px; margin-left: 4px; border-radius: 999px; background: #DC2626; color: #FFFFFF; font-size: 13px; line-height: 22px; text-align: center; }
.tabs .count:empty { display: none; }
.course-edit { display: grid; gap: 18px; grid-template-columns: minmax(0, 1.6fr) minmax(260px, 1fr); align-items: start; }
@media (max-width: 860px) { .course-edit { grid-template-columns: minmax(0, 1fr); } .preview { order: -1; position: static; } }
.preview { position: sticky; top: 80px; display: flex; flex-direction: column; gap: 6px; }
.preview .label { font-weight: 600; font-size: 15px; }
.preview .card { max-width: 340px; }
.thumb-sm { width: 112px; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; flex: none; }
.thumb-sm .cover { width: 112px; }
.course-cell { display: flex; align-items: center; gap: 10px; min-width: 220px; }
.badge.off { background: #FEE2E2; color: #7F1D1D; }
.req-list { display: flex; flex-direction: column; gap: 10px; }
.req { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: grid; gap: 6px 18px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); background: #FFFFFF; }
.req .who b { display: block; font-size: 17px; }
.req .k { color: var(--muted); font-size: 13.5px; display: block; }
.req .v { font-weight: 600; font-variant-numeric: tabular-nums; word-break: break-all; }
.req .warn { color: #B91C1C; font-weight: 600; }
.req .row-actions { grid-column: 1 / -1; }
.cred { background: #DCFCE7; color: #14532D; border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.cred .row-actions a { text-decoration: none; }
.course-row .course-cell { min-width: 0; }
.course-row .badge { margin-bottom: 4px; }

/* online MCQ */
.q-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; }
.q-view { display: flex; flex-direction: column; gap: 14px; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-weight: 600; }
.crumbs button { border: 0; background: transparent; color: var(--accent); font: 600 15.5px/1.4 var(--font-body); padding: 6px 2px; cursor: pointer; text-align: left; }
.crumbs button:last-child { color: var(--ink); }
.crumbs span { color: var(--muted); }
.q-nodes { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.q-node { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-height: 76px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: #FFFFFF; color: var(--ink); text-align: left; cursor: pointer; font: 400 15px/1.4 var(--font-body); }
.q-node b { font-size: 16.5px; }
.q-node:hover { border-color: var(--accent); box-shadow: 0 6px 18px rgba(42, 15, 92, 0.12); }
.q-node .bar { width: 100%; height: 5px; border-radius: 3px; background: #ECE6F5; overflow: hidden; margin-top: 2px; }
.q-node .bar i { display: block; height: 100%; background: var(--accent); }
.exam-bar { position: sticky; top: 66px; z-index: 10; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 10px 14px; border-radius: 14px; background: var(--deep); color: #FFFFFF; box-shadow: 0 8px 20px rgba(18, 2, 46, 0.25); }
.exam-bar b { display: block; }
.exam-bar .muted { color: var(--lilac-soft); font-size: 14px; }
.exam-meta { display: flex; align-items: center; gap: 14px; font-weight: 600; }
.timer { font: 800 26px/1 var(--font-display); font-variant-numeric: tabular-nums; color: var(--lilac); min-width: 76px; text-align: right; }
.timer.low { color: #FCA5A5; }
.q-list { display: flex; flex-direction: column; gap: 12px; }
.qitem { margin: 0; border: 1px solid var(--line); border-radius: 14px; background: #FFFFFF; padding: 14px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.qitem legend, .qitem .qtext { float: left; width: 100%; padding: 0; font-weight: 600; font-size: 17px; line-height: 1.55; margin: 0; }
.qitem legend + * { clear: both; }
.qn { color: var(--accent); }
.qimg { max-height: 280px; width: auto; max-width: 100%; border-radius: 10px; border: 1px solid var(--line); }
.opts { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); clear: both; }
.opt { position: relative; display: flex; align-items: flex-start; gap: 10px; min-height: 48px; padding: 10px 12px; border-radius: 10px; border: 1.5px solid #D8CCEE; cursor: pointer; line-height: 1.45; }
.opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.opt .ol { flex: none; width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid #B9A9D6; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; }
.opt:has(input:checked) { border-color: var(--accent); background: #F3ECFF; }
.opt:has(input:checked) .ol { background: var(--accent); border-color: var(--accent); color: #FFFFFF; }
.opt:has(input:focus-visible) { outline: 3px solid #F59E0B; outline-offset: 2px; }
.qitem.done .opt { cursor: default; flex-wrap: wrap; }
.opt em { margin-left: auto; font-style: normal; font-size: 13px; font-weight: 700; }
.opt.correct { border-color: #16A34A; background: #DCFCE7; }
.opt.correct .ol { background: #16A34A; border-color: #16A34A; color: #FFFFFF; }
.opt.correct em { color: #14532D; }
.opt.chosen { border-color: #DC2626; background: #FEE2E2; }
.opt.chosen .ol { background: #DC2626; border-color: #DC2626; color: #FFFFFF; }
.opt.chosen em { color: #7F1D1D; }
.qitem.right { border-left: 5px solid #16A34A; }
.qitem.wrong { border-left: 5px solid #DC2626; }
.qitem.skip { border-left: 5px solid #A8A2B8; }
.exp { background: var(--tint); border-radius: 10px; padding: 8px 12px; }
.score strong.ok { color: #15803D; }
.score strong.bad { color: #B91C1C; }
.board tr.me td { background: #F3ECFF; font-weight: 600; }
.medal { display: inline-flex; width: 30px; height: 30px; border-radius: 50%; align-items: center; justify-content: center; font-weight: 800; color: #1C1230; }
.medal.m1 { background: #FCD34D; } .medal.m2 { background: #D1D5DB; } .medal.m3 { background: #F0B37E; }
.my-rank { font-weight: 700; color: var(--deep); }
@media (max-width: 600px) { .exam-bar { top: 62px; } .timer { font-size: 22px; } .qitem legend, .qitem .qtext { font-size: 16px; } }

/* admin: MCQ tree and questions */
.m-node { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; background: #FFFFFF; }
.m-node.editing { display: block; }
.m-open { flex: 1 1 220px; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 44px; border: 0; background: transparent; text-align: left; cursor: pointer; color: var(--ink); font: 400 15px/1.4 var(--font-body); padding: 4px; }
.m-open b { font-size: 16.5px; color: var(--accent); }
.m-q { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: #FFFFFF; display: flex; flex-direction: column; gap: 6px; }
.m-q .ans { color: #15803D; }
.row-actions.wide { grid-column: 1 / -1; }
