/* Aricxpoint Labs LMS: Labs palette (graphite / electric cyan) */
:root {
  --navy: #060a13; --navy-2: #0c1424; --navy-3: #14223a;
  --cyan: #22d3ee; --cyan-soft: #a5f3fc; --accent: #0e7490; --accent-2: #0891b2;
  --ink: #0b1220; --muted: #5b6577; --line: #e3e8ef; --bg: #f5f8fb; --card: #fff;
  --ok: #15803d; --ok-bg: #dcfce7; --warn-bg: #fef3c7; --warn: #92400e; --danger: #b91c1c;
  --radius: 18px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: Outfit, system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--ink); background: var(--bg); line-height: 1.55; }
a { color: var(--accent); }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

/* Header */
.top { background: var(--navy); color: #fff; }
.top-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 88px; }
.top-brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; }
.top-brand img { height: 48px; width: auto; filter: invert(1); }
.top-brand span { font-size: 15px; letter-spacing: .08em; text-transform: uppercase; color: var(--cyan-soft); border-left: 1px solid rgba(255,255,255,.18); padding-left: 12px; }
.top-nav { display: flex; align-items: center; gap: 18px; font-size: 15px; }
.top-nav a { color: rgba(255,255,255,.75); text-decoration: none; }
.top-nav a:hover, .top-nav a.on { color: #fff; }
.top-nav a.top-user { color: rgba(255,255,255,.55); font-size: 14px; }
@media (max-width: 640px) { .top-user { display: none; } .top-brand span { display: none; } }

/* Hero band */
.hero { background: linear-gradient(180deg, var(--navy) 0%, var(--navy-2) 100%); color: #fff; padding: 34px 0 86px; }
.eyebrow { font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--cyan); font-weight: 600; margin: 0 0 8px; }
.hero h1 { font-size: clamp(28px, 4.2vw, 42px); line-height: 1.15; margin: 0 0 10px; font-weight: 600; }
.hero p { margin: 0; color: rgba(255,255,255,.72); max-width: 640px; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: -56px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; box-shadow: 0 10px 30px rgba(6,10,19,.06); }
.stat b { display: block; font-size: 26px; font-weight: 600; }
.stat small { color: var(--muted); font-size: 14px; }
.bar { height: 8px; border-radius: 99px; background: #e6edf3; overflow: hidden; margin-top: 12px; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent-2), var(--cyan)); border-radius: 99px; }
@media (max-width: 760px) { .stats { grid-template-columns: 1fr; } }

/* Module grid */
.section { padding: 40px 0 64px; }
.section h2 { font-size: 22px; font-weight: 600; margin: 0 0 18px; }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 960px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .grid { grid-template-columns: 1fr; } }
.mod { position: relative; display: flex; flex-direction: column; gap: 8px; min-height: 178px; padding: 20px 22px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: inherit; transition: transform .15s, box-shadow .15s, border-color .15s; }
a.mod:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(6,10,19,.08); border-color: #c7d6e2; }
.mod-n { font-size: 13px; font-weight: 600; color: var(--accent); letter-spacing: .06em; }
.mod h3 { margin: 0; font-size: 18px; font-weight: 600; line-height: 1.3; }
.mod p { margin: 0; color: var(--muted); font-size: 14.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mod-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13.5px; color: var(--muted); }
.mod.locked { background: #f0f3f7; }
.mod.locked h3, .mod.locked p { color: #8792a3; }
.mod.next { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(34,211,238,.18); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: 12.5px; font-weight: 500; background: #e0f2fe; color: #075985; white-space: nowrap; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.lock { background: #e5e9ef; color: #556070; }
.pill.warn { background: var(--warn-bg); color: var(--warn); }

/* Module page */
.back { display: inline-block; color: var(--cyan-soft); text-decoration: none; font-size: 14px; margin-bottom: 14px; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
@media (max-width: 900px) { .layout { grid-template-columns: 1fr; } }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.panel + .panel { margin-top: 16px; }
.panel h2 { font-size: 19px; margin: 0 0 14px; font-weight: 600; }
.mats { list-style: none; margin: 0; padding: 0; }
.mat { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-top: 1px solid var(--line); }
.mat:first-child { border-top: 0; padding-top: 0; }
.mat-ic { flex: none; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: #ecfeff; color: var(--accent); font-size: 12px; font-weight: 700; letter-spacing: .04em; }
.mat-body { flex: 1; min-width: 0; }
.mat-body b { display: block; font-weight: 600; overflow-wrap: anywhere; }
.mat-body small { color: var(--muted); }
.mat-act { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.outcomes { margin: 0; padding: 0; list-style: none; }
.outcomes li { position: relative; padding: 6px 0 6px 28px; }
.outcomes li::before { content: "✓"; position: absolute; left: 0; top: 6px; width: 20px; height: 20px; border-radius: 50%; background: #ecfeff; color: var(--accent); font-size: 12px; display: grid; place-items: center; }
.empty { color: var(--muted); margin: 0; }
.sticky { position: sticky; top: 20px; }

/* Buttons + forms */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px; border-radius: 12px; border: 1px solid var(--line); background: #fff; color: var(--ink); text-decoration: none; font-size: 14.5px; font-weight: 500; cursor: pointer; }
.btn:hover { border-color: #b8c6d3; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: #155e75; }
.btn.done { background: var(--ok-bg); border-color: #bbf7d0; color: var(--ok); }
.btn.danger { color: var(--danger); }
.btn.sm { padding: 6px 12px; font-size: 13.5px; border-radius: 10px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .6; cursor: default; }
label { display: block; font-size: 14px; font-weight: 500; margin: 12px 0 6px; }
input[type=text], input[type=email], input[type=date], input[type=number], input[type=url], select, textarea { width: 100%; padding: 10px 12px; border: 1px solid #cfd8e3; border-radius: 10px; background: #fff; color: var(--ink); }
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus, .btn:focus-visible { outline: 2px solid var(--cyan); outline-offset: 1px; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.hint { color: var(--muted); font-size: 13.5px; margin: 6px 0 0; }
.msg { margin-top: 12px; font-size: 14px; }
.msg.err { color: var(--danger); }
.msg.ok { color: var(--ok); }

/* Admin tables */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.tabs button { border: 1px solid var(--line); background: #fff; padding: 8px 16px; border-radius: 99px; cursor: pointer; font-weight: 500; }
.tabs button.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.table th { text-align: left; font-weight: 500; color: var(--muted); font-size: 13px; padding: 0 10px 10px; border-bottom: 1px solid var(--line); }
.table td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr.off td { color: #98a2b3; }
.scroll { overflow-x: auto; }
.mini-bar { width: 90px; height: 6px; background: #e6edf3; border-radius: 99px; overflow: hidden; display: inline-block; vertical-align: middle; margin-right: 8px; }
.mini-bar i { display: block; height: 100%; background: var(--accent-2); }
.dates { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-top: 14px; }
.dates div { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font-size: 13.5px; }
.dates b { color: var(--accent); font-weight: 600; margin-right: 6px; }

/* Notices */
.notice { max-width: 560px; margin: 80px auto; text-align: center; padding: 0 20px; }
.notice h1 { font-size: 28px; font-weight: 600; margin: 0 0 10px; }
.notice p { color: var(--muted); }
.foot { color: var(--muted); font-size: 13.5px; padding: 24px 0 40px; border-top: 1px solid var(--line); }
.foot .wrap { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.skeleton { color: var(--muted); padding: 40px 0; }

/* ---------- Stage 2: quiz + assignment ---------- */
.ph { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.ph h2 { margin: 0; }
fieldset.q { border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px 12px; margin: 0 0 14px; }
fieldset.q legend { padding: 0; font-weight: 600; float: left; width: 100%; margin-bottom: 10px; }
fieldset.q legend span { color: var(--accent); margin-right: 4px; }
fieldset.q.right { border-color: #86efac; background: #f6fef9; }
fieldset.q.wrong { border-color: #fca5a5; background: #fff8f8; }
.opt { display: flex; align-items: flex-start; gap: 10px; margin: 0; padding: 9px 12px; border-radius: 10px; font-weight: 400; cursor: pointer; clear: both; }
.opt:hover { background: #f1f5f9; }
.opt input { margin-top: 4px; accent-color: var(--accent); }
.opt.is-answer { background: var(--ok-bg); color: var(--ok); font-weight: 500; }
.opt.is-answer::after { content: "✓ correct"; margin-left: auto; font-size: 12.5px; white-space: nowrap; }
.opt.is-wrong { background: #fee2e2; color: var(--danger); }
.opt.is-wrong::after { content: "your answer"; margin-left: auto; font-size: 12.5px; white-space: nowrap; }
.explain { margin: 8px 0 4px; font-size: 14px; color: var(--muted); padding-left: 12px; border-left: 3px solid var(--line); }
.score { display: flex; align-items: center; gap: 16px; padding: 16px 18px; border-radius: 14px; margin-bottom: 16px; }
.score.ok { background: var(--ok-bg); color: #14532d; }
.score.warn { background: var(--warn-bg); color: var(--warn); }
.score b { font-size: 30px; line-height: 1; }
.asg-title { margin: 0 0 10px; font-size: 17px; font-weight: 600; }
.steps { margin: 0 0 16px; padding-left: 22px; }
.steps li { padding: 3px 0; }
.sub { border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; margin-bottom: 16px; background: #fbfcfe; }
.sub .ph { margin-bottom: 8px; }
.sub p { margin: 4px 0; overflow-wrap: anywhere; }
.feedback { margin-top: 12px; padding: 12px 14px; border-radius: 10px; background: #ecfeff; border-left: 3px solid var(--accent-2); }
.feedback p { margin: 4px 0 0; }
.handin { border-top: 1px solid var(--line); padding-top: 14px; }
.handin h3 { margin: 0; font-size: 16px; font-weight: 600; }
input[type=file] { width: 100%; padding: 8px; border: 1px dashed #cfd8e3; border-radius: 10px; background: #fff; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag { font-size: 12px; color: var(--muted); background: #f1f5f9; border-radius: 6px; padding: 2px 8px; white-space: nowrap; }
.tag.ok { background: var(--ok-bg); color: var(--ok); }
.tag.warn { background: var(--warn-bg); color: var(--warn); }
/* admin grading */
.grade-row { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; padding: 16px 0; border-top: 1px solid var(--line); }
.grade-row:first-of-type { border-top: 0; }
@media (max-width: 820px) { .grade-row { grid-template-columns: 1fr; } }
.grade-row textarea { min-height: 70px; }
.grade-row .who b { display: block; }
.grade-row .who p { margin: 4px 0; overflow-wrap: anywhere; font-size: 14.5px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips label { margin: 0; font-weight: 400; font-size: 13.5px; border: 1px solid var(--line); border-radius: 99px; padding: 5px 12px; cursor: pointer; }
.chips input { position: absolute; opacity: 0; pointer-events: none; }
.chips label:has(input:checked) { background: var(--navy); color: #fff; border-color: var(--navy); }
textarea.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; min-height: 260px; }

.mod-n i { font-style: normal; color: var(--muted); font-weight: 500; letter-spacing: 0; }
.tools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.tools span { font-size: 13px; padding: 4px 10px; border-radius: 99px; background: rgba(34,211,238,.12); color: var(--cyan-soft); border: 1px solid rgba(34,211,238,.25); }
.outcomes li { font-size: 14.5px; }
.weeks { list-style: none; margin: 0; padding: 0; }
.wk { display: grid; grid-template-columns: 54px 150px minmax(0,1fr) auto; gap: 12px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line); font-size: 14.5px; }
.wk:first-child { border-top: 0; }
.wk b { color: var(--accent); }
.wk.off { color: #98a2b3; }
.wk.off span.what { font-style: italic; }
.wk .btn { padding: 4px 10px; font-size: 12.5px; }
@media (max-width: 640px) { .wk { grid-template-columns: 44px 1fr auto; } .wk .what { grid-column: 1 / -1; } }
.acc { list-style: none; margin: 0; padding: 0; }
.acc-row { display: grid; grid-template-columns: 30px minmax(0,1fr) auto auto; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14.5px; }
.acc-row:first-child { border-top: 0; }
.acc-row > b { color: var(--accent); }
.acc-t { min-width: 0; font-weight: 500; }
.acc-t small { display: block; color: var(--muted); font-weight: 400; font-size: 12.5px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.seg button { border: 0; background: none; padding: 6px 10px; font-size: 12.5px; cursor: pointer; color: var(--muted); border-left: 1px solid var(--line); }
.seg button:first-child { border-left: 0; }
.seg button:hover { background: #f1f5f9; color: var(--ink); }
.seg button.on { color: #fff; font-weight: 600; }
.seg button.on.auto { background: #475569; }
.seg button.on.open { background: #16a34a; }
.seg button.on.locked { background: #b91c1c; }
.seg button[disabled] { cursor: default; opacity: .7; }
@media (max-width: 760px) { .acc-row { grid-template-columns: 30px minmax(0,1fr); } .acc-row .tag, .acc-row .seg { grid-column: 2; justify-self: start; } }
.score-in { width: 90px !important; display: inline-block; margin: 8px 8px 8px 0; }

/* ---------- Sign-in / account ---------- */
body.auth { background: radial-gradient(1200px 600px at 50% -10%, #14223a 0%, var(--navy) 60%); min-height: 100vh; }
.auth-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 16px; }
.auth-brand img { height: 72px; width: auto; filter: invert(1); margin-bottom: 30px; }
.auth-card { width: 100%; max-width: 400px; background: #fff; border-radius: 22px; padding: 30px 28px 24px; box-shadow: 0 30px 80px rgba(0,0,0,.35); }
.auth-card h1 { margin: 0 0 8px; font-size: 26px; font-weight: 600; }
.auth-card .eyebrow { color: var(--accent); }
.pw { position: relative; }
.pw input { padding-right: 64px; }
.pw-show { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--accent); font-size: 13px; font-weight: 500; cursor: pointer; padding: 6px 8px; }
input[type=password] { width: 100%; padding: 10px 12px; border: 1px solid #cfd8e3; border-radius: 10px; background: #fff; color: var(--ink); }
.cred { margin-top: 14px; padding: 14px 16px; border-radius: 12px; background: #ecfeff; border: 1px solid #a5f3fc; font-size: 14.5px; }
.cred code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; background: #fff; padding: 2px 6px; border-radius: 6px; }
.cred pre { white-space: pre-wrap; font-family: inherit; margin: 8px 0 10px; }

/* ---------- Profile ---------- */
.avatar { display: inline-grid; place-items: center; border-radius: 50%; object-fit: cover; background: linear-gradient(135deg, var(--accent-2), var(--cyan)); color: #fff; font-weight: 600; flex: none; vertical-align: middle; }
.top-nav a.top-me { display: inline-flex; align-items: center; gap: 8px; color: rgba(255,255,255,.85); padding: 3px 10px 3px 3px; border-radius: 99px; border: 1px solid rgba(255,255,255,.14); }
.top-nav a.top-me:hover, .top-nav a.top-me.on { background: rgba(255,255,255,.08); color: #fff; }
.avatar-big { display: flex; justify-content: center; margin: 6px 0 16px; }
.avatar-big .avatar { box-shadow: 0 0 0 4px #ecfeff, 0 8px 24px rgba(6,10,19,.15); }
@media (max-width: 640px) { .top-nav a.top-me span { display: none; } .top-nav a.top-me { padding: 3px; } }

@media (max-width: 640px) { .top-bar { height: 72px; } .top-brand img { height: 38px; } .auth-brand img { height: 56px; } }

body.auth[data-portal="admin"] { background: radial-gradient(1200px 600px at 50% -10%, #2a1f5c 0%, #0b0a1f 60%); }
body.auth[data-portal="admin"] .auth-card .eyebrow { color: #6d5ce8; }
body.auth[data-portal="admin"] .btn.primary { background: #5546e0; border-color: #5546e0; }
body.auth[data-portal="admin"] input:focus { outline-color: #8f82ff; }
body.auth[data-portal="admin"] .pw-show, body.auth[data-portal="admin"] .hint a { color: #5546e0; }

label.check { display: flex; align-items: center; gap: 8px; font-weight: 400; font-size: 14px; margin-top: 12px; cursor: pointer; }
label.check input { width: 16px; height: 16px; accent-color: var(--accent); }

/* ---------- Moving sign-in pages ---------- */
.auth-bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
body.auth .auth-wrap { position: relative; z-index: 1; }
body.auth[data-portal="student"]::after, body.auth[data-portal="admin"]::after {   /* soft vignette so the card stays readable */
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(760px 620px at 50% 50%, rgba(6,10,19,.94) 0%, rgba(6,10,19,.75) 45%, rgba(6,10,19,.25) 80%, rgba(6,10,19,.1) 100%);
}
body.auth[data-portal="admin"]::after { background: radial-gradient(520px 420px at 50% 52%, rgba(11,10,31,.8), rgba(11,10,31,0) 75%); }
body.auth[data-portal="admin"]::before {   /* slow purple aurora */
  content: ""; position: fixed; inset: -20%; z-index: 0; pointer-events: none;
  background: radial-gradient(40% 35% at 30% 30%, rgba(85,70,224,.35), transparent 70%), radial-gradient(35% 30% at 72% 70%, rgba(143,130,255,.22), transparent 70%);
  animation: aurora 18s ease-in-out infinite alternate;
}
@keyframes aurora { from { transform: translate(-4%, -3%) rotate(0deg); } to { transform: translate(4%, 3%) rotate(8deg); } }

/* animated logo (same moves as aricxpoint.co) */
.auth-brand { display: block; margin-bottom: 30px; }
.auth-brand .lm { position: relative; display: block; width: 260px; aspect-ratio: 1118 / 339; }
.auth-brand .lm img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; margin: 0; filter: invert(1); }
.lm-ring, .lm-dot { transform-origin: 24.46% 11.95%; }
.lm-ax    { transform-origin: 13.3% 75%; }
.lm-smile { transform-origin: 13.2% 89%; }
.lm-word  { transform-origin: 34% 50%; }
@media (prefers-reduced-motion: no-preference) {
  .lm-ax    { animation: lm-pop .6s cubic-bezier(.34,1.56,.64,1) both; }
  .lm-smile { animation: lm-draw .7s .35s cubic-bezier(.65,0,.35,1) both, lm-smile 7s 2.4s ease-in-out infinite; }
  .lm-ring  { animation: lm-drop .8s .6s cubic-bezier(.34,1.56,.64,1) both, lm-bob 7s 2.4s ease-in-out infinite; }
  .lm-dot   { animation: lm-drop .8s .6s cubic-bezier(.34,1.56,.64,1) both, lm-pulse 3.5s 2s ease-in-out infinite; }
  .lm-word  { animation: lm-slide .7s .25s cubic-bezier(.22,1,.36,1) both; }
  .auth-brand:hover .lm-ring, .auth-brand:hover .lm-dot { animation: lm-hop .6s cubic-bezier(.34,1.56,.64,1); }
  .auth-brand:hover .lm-smile { animation: lm-grin .6s ease-in-out; }
  .auth-card { animation: card-in .7s .2s cubic-bezier(.22,1,.36,1) both; }
}
@keyframes lm-pop   { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: none; } }
@keyframes lm-draw  { from { clip-path: inset(0 98% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes lm-drop  { from { opacity: 0; transform: translateY(-40%) scale(.4); } to { opacity: 1; transform: none; } }
@keyframes lm-slide { from { opacity: 0; transform: translateX(-3%); } to { opacity: 1; transform: none; } }
@keyframes lm-pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.35); } }
@keyframes lm-bob   { 0%,88%,100% { transform: none; } 92% { transform: translateY(-6%); } 96% { transform: translateY(1%); } }
@keyframes lm-smile { 0%,88%,100% { transform: none; } 93% { transform: scaleX(1.06) scaleY(1.25); } }
@keyframes lm-hop   { 0%,100% { transform: none; } 40% { transform: translateY(-10%) rotate(-12deg); } 70% { transform: translateY(2%); } }
@keyframes lm-grin  { 0%,100% { transform: none; } 50% { transform: scaleX(1.08) scaleY(1.35); } }
@keyframes card-in  { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@media (max-width: 640px) { .auth-brand .lm { width: 200px; } }

/* ---------- Admin sign-in: robot photo ---------- */
body.auth[data-portal="admin"], body.auth[data-portal="student"] { background: #050818; }
body.auth[data-portal="admin"]::before { display: none; }
.robot-bg { position: fixed; inset: 0; overflow: hidden; z-index: 0; pointer-events: none; }
.robot-stage { position: absolute; right: 0; top: 50%; width: max(100vw, calc(100vh * 16 / 9)); aspect-ratio: 16 / 9; transform: translateY(-50%); transform-origin: 72% 35%; }
.robot-stage img { display: block; width: 100%; height: 100%; object-fit: cover; }
.robot-eye { position: absolute; left: 74.8%; top: 24.8%; width: 6.5%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%;
  background: radial-gradient(circle, rgba(224,250,255,.95) 0%, rgba(103,232,249,.55) 22%, rgba(34,211,238,.18) 45%, rgba(34,211,238,0) 70%); mix-blend-mode: screen; opacity: .35; }
.robot-eye-2 { left: 94.2%; top: 76.5%; width: 4.5%; }   /* shoulder light */
body.auth[data-portal="admin"]::after, body.auth[data-portal="student"]::after {
  background: linear-gradient(90deg, rgba(5,8,24,.92) 0%, rgba(5,8,24,.78) 30%, rgba(5,8,24,.35) 55%, rgba(5,8,24,.05) 75%, rgba(5,8,24,0) 100%),
              linear-gradient(0deg, rgba(5,8,24,.55) 0%, rgba(5,8,24,0) 35%);
}
@media (prefers-reduced-motion: no-preference) {
  .robot-stage { animation: kenburns 28s ease-in-out infinite alternate; }
  .robot-eye { animation: eye-glow 3.4s ease-in-out infinite; }
  .robot-eye-2 { animation-delay: 1.2s; animation-duration: 4.2s; }
}
@keyframes kenburns { from { transform: translateY(-50%) scale(1); } to { transform: translateY(-50%) scale(1.07) translateX(-1.2%); } }
@keyframes eye-glow { 0%, 100% { opacity: .25; transform: translate(-50%, -50%) scale(.9); } 50% { opacity: .9; transform: translate(-50%, -50%) scale(1.15); } }
@media (min-width: 1000px) {
  body.auth .auth-wrap { align-items: flex-start; padding-left: max(7vw, 40px); }
}
@media (max-width: 999px) {
  body.auth[data-portal="admin"]::after, body.auth[data-portal="student"]::after { background: rgba(5,8,24,.7); }
}

/* ---------- Student sign-in: black & white flavour ---------- */
body.auth[data-portal="student"]{ background: #000; }
body.auth[data-portal="student"] .robot-stage img{ filter: grayscale(1) contrast(1.12) brightness(.82); }
body.auth[data-portal="student"]::after{
  background: linear-gradient(90deg, rgba(0,0,0,.94) 0%, rgba(0,0,0,.8) 30%, rgba(0,0,0,.4) 55%, rgba(0,0,0,.08) 75%, rgba(0,0,0,0) 100%),
              linear-gradient(0deg, rgba(0,0,0,.6) 0%, rgba(0,0,0,0) 35%);
}
body.auth[data-portal="student"] .robot-eye{ background: radial-gradient(circle, rgba(255,255,255,.95) 0%, rgba(255,255,255,.5) 22%, rgba(255,255,255,.15) 45%, rgba(255,255,255,0) 70%); }
body.auth[data-portal="student"] .auth-card .eyebrow{ color: #111; }
body.auth[data-portal="student"] .btn.primary{ background: #0a0a0a; border-color: #0a0a0a; color: #fff; }
body.auth[data-portal="student"] .btn.primary:hover{ background: #262626; }
body.auth[data-portal="student"] .pw-show, body.auth[data-portal="admin"] .pw-show, body.auth[data-portal="student"] .hint a{ color: #111; }
body.auth[data-portal="student"] input:focus{ outline-color: #737373; }
@media (max-width: 999px) { body.auth[data-portal="student"]::after{ background: rgba(0,0,0,.72); } }

/* module page: material sections */
.mat-sec { font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 22px 0 10px; }
.mat-sec:first-child { margin-top: 0; }
.mat-lab .mat-ic { background: #0a0a0a; color: #fff; }

/* ---------- Admin sign-in: full colour ---------- */
body.auth[data-portal="admin"] { background: #0b0726; }
body.auth[data-portal="admin"] .robot-stage img { filter: saturate(1.3) contrast(1.06) brightness(.98); }
.robot-tint { position: absolute; inset: 0; mix-blend-mode: soft-light; opacity: .85; pointer-events: none;
  background: linear-gradient(120deg, #7c3aed 0%, #06b6d4 30%, #ec4899 55%, #6366f1 80%, #7c3aed 100%); background-size: 300% 300%; }
body.auth[data-portal="admin"]::after {
  background: radial-gradient(60% 70% at 18% 50%, rgba(17,10,58,.92) 0%, rgba(17,10,58,.7) 45%, rgba(17,10,58,0) 75%),
              linear-gradient(0deg, rgba(11,7,38,.55) 0%, rgba(11,7,38,0) 35%);
}
body.auth[data-portal="admin"] .robot-eye { background: radial-gradient(circle, rgba(236,254,255,.95) 0%, rgba(34,211,238,.6) 22%, rgba(99,102,241,.25) 45%, rgba(99,102,241,0) 70%); }
body.auth[data-portal="admin"] .robot-eye-2 { background: radial-gradient(circle, rgba(253,242,248,.9) 0%, rgba(236,72,153,.55) 25%, rgba(236,72,153,0) 70%); }
body.auth[data-portal="admin"] .auth-card .eyebrow { color: #6d28d9; }
body.auth[data-portal="admin"] .btn.primary { background: linear-gradient(90deg, #6d28d9, #4f46e5 50%, #0891b2); border: 0; color: #fff; }
body.auth[data-portal="admin"] .btn.primary:hover { filter: brightness(1.1); }
body.auth[data-portal="admin"] .pw-show, body.auth[data-portal="admin"] .hint a { color: #6d28d9; }
body.auth[data-portal="admin"] input:focus { outline-color: #8b5cf6; }
@media (prefers-reduced-motion: no-preference) { .robot-tint { animation: tint-shift 22s ease-in-out infinite alternate; } }
@keyframes tint-shift { 0% { background-position: 0% 50%; } 100% { background-position: 100% 50%; } }
@media (max-width: 999px) { body.auth[data-portal="admin"]::after { background: rgba(17,10,58,.72); } }

/* admin image v2: white robot + orange/cyan code. Glows sit on its ear disc and shoulder light. */
body.auth[data-portal="admin"] .robot-stage img { filter: saturate(1.15) contrast(1.05) brightness(1.02); }
body.auth[data-portal="admin"] .robot-eye   { left: 72.4%; top: 19%; width: 9%; }
body.auth[data-portal="admin"] .robot-eye-2 { left: 98%; top: 56%; width: 5%;
  background: radial-gradient(circle, rgba(236,254,255,.9) 0%, rgba(34,211,238,.55) 25%, rgba(34,211,238,0) 70%); }
body.auth[data-portal="admin"] .robot-tint { opacity: .45;
  background: linear-gradient(120deg, #f97316 0%, #06b6d4 28%, #8b5cf6 55%, #f59e0b 80%, #f97316 100%); background-size: 300% 300%; }
body.auth[data-portal="admin"]::after {
  background: radial-gradient(60% 70% at 18% 50%, rgba(8,10,20,.9) 0%, rgba(8,10,20,.65) 45%, rgba(8,10,20,0) 75%),
              linear-gradient(0deg, rgba(8,10,20,.5) 0%, rgba(8,10,20,0) 35%);
}
body.auth[data-portal="admin"] .btn.primary { background: linear-gradient(90deg, #ea580c, #f59e0b 45%, #0891b2); }
body.auth[data-portal="admin"] .auth-card .eyebrow, body.auth[data-portal="admin"] .pw-show, body.auth[data-portal="admin"] .hint a { color: #c2410c; }
body.auth[data-portal="admin"] input:focus { outline-color: #06b6d4; }

/* ---------- Admin sign-in v3: pure black + tall robot panel on the right ---------- */
body.auth[data-portal="admin"] { background: #000; }
body.auth[data-portal="admin"]::after { display: none; }
.robot-side { position: fixed; top: 0; right: 0; height: 100vh; aspect-ratio: 986 / 1480; overflow: hidden; z-index: 0; pointer-events: none;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 38%), linear-gradient(0deg, transparent 0%, #000 12%);
  -webkit-mask-composite: source-in; mask-image: linear-gradient(90deg, transparent 0%, #000 38%); }
.robot-side picture, .robot-side img { display: block; width: 100%; height: 100%; object-fit: cover; }
.robot-side img { transform-origin: 75% 45%; }
.ring-glow { position: absolute; left: 81.2%; top: 39.9%; width: 26%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%;
  background: radial-gradient(circle, rgba(255,237,213,.9) 0%, rgba(251,146,60,.55) 24%, rgba(249,115,22,.18) 45%, rgba(249,115,22,0) 68%);
  mix-blend-mode: screen; opacity: .35; }
@media (prefers-reduced-motion: no-preference) {
  .robot-side img { animation: side-zoom 24s ease-in-out infinite alternate; }
  .ring-glow { animation: ring-pulse 3s ease-in-out infinite; }
}
@keyframes side-zoom { from { transform: scale(1); } to { transform: scale(1.06); } }
@keyframes ring-pulse { 0%, 100% { opacity: .25; transform: translate(-50%, -50%) scale(.85); } 50% { opacity: .85; transform: translate(-50%, -50%) scale(1.08); } }
@media (max-width: 999px) {
  .robot-side { width: 100vw; aspect-ratio: auto; opacity: .3; -webkit-mask-image: none; mask-image: none; }
  .ring-glow { display: none; }
}

/* ---------- Admin sign-in v4: landscape robot-at-laptop, right panel on black ---------- */
/* The image covers the panel at full viewport height (width = 178.4vh) and is anchored to the right edge,
   so glow positions are measured from the right: left = 100% - (1 - x) * 178.4vh. */
.robot-side.robot-wide { aspect-ratio: auto; width: 68vw;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, rgba(0,0,0,.6) 22%, #000 45%); mask-image: linear-gradient(90deg, transparent 0%, rgba(0,0,0,.6) 22%, #000 45%); }
.robot-wide img { object-position: right center; transform-origin: 62% 30%; }
.robot-wide .ring-glow { left: calc(100% - 0.366 * 178.4vh); top: 20.8%; width: 21vh;
  background: radial-gradient(circle, rgba(255,237,213,.95) 0%, rgba(251,146,60,.6) 24%, rgba(249,115,22,.2) 46%, rgba(249,115,22,0) 68%); }
.robot-wide .ring-glow-2 { left: calc(100% - 0.375 * 178.4vh); top: 41.9%; width: 9vh; animation-delay: .8s; }
@media (max-width: 999px) { .robot-side.robot-wide { width: 100vw; } }

/* ---------- Student (Labs) sign-in: same black + robot look as admin ---------- */
body.auth[data-portal="student"] { background: #000; }
body.auth[data-portal="student"]::after { display: none; }
body.auth[data-portal="student"] .btn.primary { background: linear-gradient(90deg, #ea580c, #f59e0b 45%, #0891b2); border: 0; color: #fff; }
body.auth[data-portal="student"] .btn.primary:hover { filter: brightness(1.1); background: linear-gradient(90deg, #ea580c, #f59e0b 45%, #0891b2); }
body.auth[data-portal="student"] .auth-card .eyebrow, body.auth[data-portal="student"] .pw-show, body.auth[data-portal="student"] .hint a { color: #c2410c; }
body.auth[data-portal="student"] input:focus { outline-color: #06b6d4; }

/* ---------- Student sign-in: big running terminal ---------- */
.term { position: fixed; z-index: 1; right: 6vw; top: 50%; transform: translateY(-50%); width: min(640px, 44vw);
  background: rgba(10, 14, 22, .8); -webkit-backdrop-filter: blur(12px) saturate(1.2); backdrop-filter: blur(12px) saturate(1.2);
  border: 1px solid rgba(255,255,255,.12); border-radius: 22px; padding: 26px 32px 22px; box-shadow: 0 30px 80px rgba(0,0,0,.55);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: #e5e7eb; }
.term-head { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; font-size: 16px; color: #7f9cb0; }
.term-dots { display: inline-flex; gap: 8px; }
.term-dots i { width: 12px; height: 12px; border-radius: 50%; background: #1f2a3a; display: block; }
.term-body { min-height: 13.2em; font-size: 20px; line-height: 1.85; transition: opacity .4s; }
.term-body.fade { opacity: 0; }
.term-line { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.term-line.res { opacity: 0; transform: translateY(4px); transition: opacity .35s, transform .35s; }
.term-line.res.show { opacity: 1; transform: none; }
.term-line .p { color: #67e8f9; }
.term-line .tick, .term-line.res .tx { color: #86efac; }
.term-line.cmd .tx { color: #f3f4f6; }
.term-line.typing .tx::after { content: ""; display: inline-block; width: .55em; height: 1.05em; margin-left: 2px; vertical-align: -0.15em; background: #67e8f9; animation: caret 1s steps(2) infinite; }
.term-line.spin .dim { color: #64748b; }
.term-line .sp { display: inline-block; width: .8em; height: .8em; border: 2px solid #334155; border-top-color: #67e8f9; border-radius: 50%; vertical-align: -0.05em; animation: spin .7s linear infinite; }
.term-foot { margin-top: 18px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.08); font-family: Outfit, system-ui, sans-serif; font-size: 16px; color: #cbd5e1; display: flex; align-items: center; gap: 10px; }
.term-live { width: 10px; height: 10px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 0 rgba(74,222,128,.6); animation: live 2s infinite; }
@keyframes caret { 50% { opacity: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes live { 0% { box-shadow: 0 0 0 0 rgba(74,222,128,.55); } 70% { box-shadow: 0 0 0 10px rgba(74,222,128,0); } 100% { box-shadow: 0 0 0 0 rgba(74,222,128,0); } }
@media (max-width: 1100px) { .term { display: none; } }

/* student: robot faded behind the terminal */
body.auth[data-portal="student"] .robot-side { opacity: .38; }
body.auth[data-portal="student"] .ring-glow { opacity: .2; }
@media (max-width: 1100px) { body.auth[data-portal="student"] .robot-side { opacity: .3; } }
/* terminal sits lower so the robot's face stays visible, and is a little see-through */
.term { top: auto; bottom: 5vh; transform: none; background: rgba(10, 14, 22, .58);
  -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); border-color: rgba(255,255,255,.1); }
body.auth[data-portal="student"] .robot-side { opacity: .45; }
@media (max-height: 760px) { .term { bottom: 3vh; } .term-body { font-size: 17px; min-height: 12.5em; } }

/* ---------- Student sign-in layout: card centred, terminal on the left ---------- */
@media (min-width: 1000px) {
  body.auth[data-portal="student"] .auth-wrap { align-items: center; padding-left: 16px; }
}
body.auth[data-portal="student"] .term {
  left: 3vw; right: auto; top: 50%; bottom: auto; transform: translateY(-50%);
  width: calc(50vw - 230px - 5vw); max-width: 600px; padding: 22px 26px 18px;
}
body.auth[data-portal="student"] .term-body { font-size: clamp(12px, 1.08vw, 18px); }
body.auth[data-portal="student"] .term-head, body.auth[data-portal="student"] .term-foot { font-size: clamp(12px, 1vw, 15px); }
@media (max-width: 1199px) { body.auth[data-portal="student"] .term { display: none; } }
/* student: card on the right, terminal on the left */
@media (min-width: 1000px) {
  body.auth[data-portal="student"] .auth-wrap { align-items: flex-end; padding-left: 16px; padding-right: max(7vw, 40px); }
}
body.auth[data-portal="student"] .term { left: 5vw; width: calc(100vw - 400px - max(7vw, 40px) - 5vw - 6vw); max-width: 640px; }
body.auth[data-portal="student"] .term-body { font-size: clamp(13px, 1.3vw, 19px); }
/* student: back to card on the left, terminal low on the right (under the robot's face) */
@media (min-width: 1000px) {
  body.auth[data-portal="student"] .auth-wrap { align-items: flex-start; padding-left: max(7vw, 40px); padding-right: 16px; }
}
body.auth[data-portal="student"] .term { left: auto; right: 6vw; top: auto; bottom: 5vh; transform: none; width: min(640px, 44vw); max-width: none; padding: 26px 32px 22px; }
body.auth[data-portal="student"] .term-body { font-size: clamp(14px, 1.35vw, 20px); }
body.auth[data-portal="student"] .term-head, body.auth[data-portal="student"] .term-foot { font-size: 16px; }
@media (max-height: 760px) { body.auth[data-portal="student"] .term { bottom: 3vh; } body.auth[data-portal="student"] .term-body { font-size: 16px; } }
select[data-role] { min-width: 140px; }

/* ---------- Student: terminal in front of the robot, like the screen it's working on ---------- */
/* Robot image is 178.4vh wide, anchored right. Shift it 30vh further right so its face sits at 100vw - 57.4vh,
   leaving room in its line of sight for the terminal. */
@media (min-width: 1200px) {
  body.auth[data-portal="student"] .robot-side { transform: translateX(30vh); opacity: .6; }
  body.auth[data-portal="student"] .term {
    left: auto; top: auto; bottom: 9vh; right: calc(57.4vh + 26px);
    width: min(600px, calc(100vw - 57.4vh - 26px - max(7vw, 40px) - 400px - 48px));
    transform: perspective(1400px) rotateY(16deg); transform-origin: right center;
    background: rgba(8, 14, 24, .72); border-color: rgba(103, 232, 249, .22);
    box-shadow: 0 30px 80px rgba(0,0,0,.6), 40px 0 90px rgba(34, 211, 238, .16);
  }
  body.auth[data-portal="student"] .term-body { font-size: clamp(13px, 1.2vw, 19px); }
}
/* text scales with the terminal's own width so long commands always fit */
@media (min-width: 1200px) {
  body.auth[data-portal="student"] .term { container-type: inline-size; }
  body.auth[data-portal="student"] .term-body { font-size: clamp(11px, 4.3cqi, 19px); }
  body.auth[data-portal="student"] .term-head, body.auth[data-portal="student"] .term-foot { font-size: clamp(11px, 3.2cqi, 16px); }
}
