/* lms.css: the fake learning-platform dropbox page. Clean, blue-grey, a little dated on purpose.
   No real LMS names, logos or colours. The grading show (show.css) styles #stage separately. */

:root {
  --navy: #1f3556;
  --navy-deep: #172844;
  --blue: #1b6ec2;
  --blue-dark: #14548f;
  --blue-tint: #e6f1fd;
  --bg: #e8edf3;
  --card: #ffffff;
  --line: #c5cfdb;
  --line-soft: #dde4ec;
  --ink: #1c2a3a;
  --muted: #556679;
  --red: #b3261e;
  --red-tint: #fdf1f0;
  --gold: #f0b429;
  --green: #2e7d4f;
  --green-tint: #f1faf4;
  --radius: 4px;
  --focus: 0 0 0 3px #fff, 0 0 0 6px #1b6ec2;
  font-family: "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: var(--ink);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
}
body.show-active { overflow: hidden; }
h1, h2, h3, p, dl, dd, ol, ul, fieldset { margin: 0; padding: 0; }
button, input { font: inherit; color: inherit; }
a { color: var(--blue); }

:focus-visible { outline: none; box-shadow: var(--focus); }
button:focus-visible, a:focus-visible { border-radius: 3px; }

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 50; background: #fff; color: var(--navy);
  padding: 10px 16px; border-radius: 4px; font-weight: 600; text-decoration: none; transition: top .15s;
}
.skip-link:focus { top: 10px; }

.notice { background: #fff6dd; border: 1px solid #e5c76b; padding: 12px 16px; border-radius: var(--radius); }

/* ---------- top bar ---------- */
.topbar {
  background: linear-gradient(#27426a, #1b3150);
  border-bottom: 3px solid var(--gold);
  color: #fff;
}
.topbar-inner { display: flex; align-items: center; gap: 10px; min-height: 52px; }
.topbar-spacer { flex: 1; }
.logo { display: inline-flex; align-items: baseline; text-decoration: none; margin-right: 18px; color: #fff; letter-spacing: .02em; }
.logo-mark {
  font-weight: 800; font-size: 22px; background: #fff; color: var(--navy);
  padding: 0 7px; border-radius: 4px 0 0 4px; line-height: 30px;
}
.logo-word {
  font-weight: 800; font-size: 22px; color: var(--navy); background: var(--gold);
  padding: 0 8px; border-radius: 0 4px 4px 0; line-height: 30px;
}
.topnav { display: flex; gap: 2px; }
.nav-link {
  background: none; border: 0; color: #dbe6f5; padding: 14px 12px; cursor: pointer; font-size: 15px;
  border-bottom: 3px solid transparent; margin-bottom: -3px;
}
.nav-link:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.icon-btn {
  position: relative; background: none; border: 0; color: #dbe6f5; padding: 8px; cursor: pointer; border-radius: 4px;
  display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn:hover { color: #fff; background: rgba(255, 255, 255, .1); }
.badge {
  position: absolute; top: 2px; right: 2px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px;
  background: var(--red); color: #fff; font-size: 11px; font-weight: 700; line-height: 17px; text-align: center;
}
.user { display: inline-flex; align-items: center; gap: 8px; padding-left: 8px; }
.avatar {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  background: #8fb0da; color: var(--navy-deep); font-weight: 700; font-size: 13px;
}
.user-name { font-size: 14px; color: #e9f0fa; }

/* ---------- course bar ---------- */
.coursebar { background: #fff; border-bottom: 1px solid var(--line); box-shadow: 0 1px 3px rgba(20, 40, 70, .06); }
.course-title { font-size: 22px; font-weight: 700; color: var(--navy); padding: 10px 0 2px; line-height: 1.25; }
.course-code { color: var(--blue); }
.tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: thin; }
.tab {
  background: none; border: 0; border-bottom: 3px solid transparent; padding: 7px 14px 8px; cursor: pointer;
  color: var(--muted); font-size: 15px; white-space: nowrap;
}
.tab:hover { color: var(--navy); background: #f2f6fb; }
.tab[aria-current="page"] { color: var(--navy); font-weight: 600; border-bottom-color: var(--blue); }

/* ---------- crumbs ---------- */
.crumbs { padding: 9px 0 8px; font-size: 13.5px; color: var(--muted); }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 8px; }
.crumbs li + li::before { content: "\203A"; margin-right: 8px; color: #8795a8; }
.crumbs a { color: var(--blue); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.crumbs li[aria-current="page"] { color: var(--ink); font-weight: 600; }

/* ---------- layout ---------- */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 22px; padding-bottom: 36px; align-items: start; }
.main-col { display: grid; gap: 18px; min-width: 0; outline: none; }
.side-col { display: grid; gap: 18px; min-width: 0; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(20, 40, 70, .1);
  animation: rise .45s ease both;
}
.main-col .card:nth-child(2) { animation-delay: .06s; }
.side-col .card:nth-child(1) { animation-delay: .1s; }
.side-col .card:nth-child(2) { animation-delay: .14s; }
.side-col .card:nth-child(3) { animation-delay: .18s; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.card-head {
  font-size: 15px; font-weight: 700; color: var(--navy); padding: 11px 18px;
  background: linear-gradient(#f6f9fc, #e8eef5); border-bottom: 1px solid var(--line); border-radius: 3px 3px 0 0;
}

/* ---------- assignment card ---------- */
.assignment { padding: 18px 26px 16px; }
.assignment h1 { font-size: 25px; line-height: 1.2; color: var(--navy); font-weight: 700; margin-bottom: 8px; }
.due-row { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; margin-bottom: 10px; }
.due { font-weight: 700; color: var(--ink); background: #fff6dd; border: 1px solid #ecd388; padding: 3px 10px; border-radius: 3px; }
.late { color: var(--red); font-weight: 600; }
.prose p + p { margin-top: 8px; }
.prose p { max-width: 96ch; }
.facts { display: flex; flex-wrap: wrap; gap: 6px 26px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line-soft); }
.facts > div { display: flex; gap: 7px; align-items: baseline; }
.facts dt { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.facts dd { font-size: 14px; }

/* ---------- submit card ---------- */
.submit-card form { padding: 18px 26px 24px; }
.submit-left { display: flex; flex-direction: column; min-width: 0; }
.submit-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 28px; }
.step { font-size: 14px; font-weight: 700; color: var(--navy); margin-bottom: 10px; letter-spacing: .01em; }

.dropzone {
  width: 100%; flex: 1 1 auto; min-height: 236px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; padding: 24px 20px; text-align: center; cursor: pointer;
  border: 2px dashed #7390b6; border-radius: 8px;
  background: linear-gradient(180deg, #f8fbff, #edf3fb);
  color: var(--navy);
  transition: border-color .15s, background .15s, box-shadow .18s, transform .18s;
}
.dropzone:hover { border-color: var(--blue); background: linear-gradient(180deg, #f2f8ff, #e3eefb); }
.dropzone.is-dragging {
  border-color: var(--blue); border-style: solid;
  background: linear-gradient(180deg, #e9f3ff, #d4e7fb);
  box-shadow: 0 0 0 4px rgba(27, 110, 194, .28), 0 0 38px rgba(27, 110, 194, .45);
  transform: scale(1.012);
}
.dropzone:focus-visible { box-shadow: var(--focus); }
.drop-icon { color: var(--blue); animation: bob 3.2s ease-in-out infinite; }
.drop-ready-icon { display: none; color: var(--green); }
.drop-title { font-size: 20px; font-weight: 700; line-height: 1.25; max-width: 100%; overflow-wrap: anywhere; }
.drop-sub { font-size: 15px; color: var(--blue); text-decoration: underline; text-underline-offset: 3px; }
.drop-formats { font-size: 13px; color: var(--muted); margin-top: 4px; }

.dropzone[data-state="ready"] { border-style: solid; border-color: #4aa36b; background: linear-gradient(180deg, #f6fcf8, #eaf6ee); }
.dropzone[data-state="ready"] .drop-icon { display: none; }
.dropzone[data-state="ready"] .drop-ready-icon { display: block; }
.dropzone[data-state="ready"] .drop-sub { color: var(--muted); text-decoration: none; font-size: 14px; }
.dropzone[data-state="error"] { border-color: var(--red); background: linear-gradient(180deg, #fff8f7, #fdeeed); animation: shake .4s; }
.dropzone[data-state="busy"] { cursor: progress; border-color: var(--blue); }
.dropzone[data-state="busy"] .drop-icon { animation: spin-bob 1.1s linear infinite; }

@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes spin-bob { to { transform: translateY(0) rotate(360deg); } }
@keyframes shake { 0%, 100% { transform: none; } 20% { transform: translateX(-6px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }

.drop-actions { display: flex; gap: 8px; justify-content: center; margin-top: 8px; font-size: 14px; color: var(--muted); }
.drop-actions[hidden] { display: none; }
.link-btn { background: none; border: 0; padding: 2px 4px; color: var(--blue); text-decoration: underline; cursor: pointer; font-size: 14px; }
.drop-status { min-height: 1.5em; margin-top: 8px; font-size: 14px; color: var(--muted); text-align: center; }
.drop-status.is-error { color: var(--red); font-weight: 600; }

/* ---------- options ---------- */
.field { margin-bottom: 16px; border: 0; min-width: 0; }
.field > label, .field > legend { display: block; font-weight: 600; font-size: 14.5px; margin-bottom: 5px; padding: 0; }
.field input[type="text"] {
  width: 100%; padding: 10px 12px; border: 1px solid #8795a8; border-radius: var(--radius); background: #fff; font-size: 16px;
}
.field input[type="text"]::placeholder { color: #8a97a8; }
.hint { display: block; font-size: 13px; color: var(--muted); margin-top: 4px; line-height: 1.4; }

.spice-layout { display: grid; justify-items: center; gap: 6px; }
.gauge { overflow: visible; }
.gauge .needle { transform-origin: 60px 62px; transition: transform .45s cubic-bezier(.3, 1.6, .5, 1); transform: rotate(0deg); }
.spice[data-spice="mild"] .needle { transform: rotate(-60deg); }
.spice[data-spice="medium"] .needle { transform: rotate(0deg); }
.spice[data-spice="well-done"] .needle { transform: rotate(60deg); }
.seg-group { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; }
.seg { position: relative; display: block; cursor: pointer; margin: 0; }
.seg input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.seg-body {
  display: block; height: 100%; text-align: center; padding: 8px 6px 9px; border: 1px solid #8795a8; background: #fff;
  margin-left: -1px; transition: background .15s, color .15s, border-color .15s;
}
.seg:first-child .seg-body { border-radius: 4px 0 0 4px; margin-left: 0; }
.seg:last-child .seg-body { border-radius: 0 4px 4px 0; }
.seg-body strong { display: block; font-size: 15px; }
.seg-body small { display: block; font-size: 11.5px; color: var(--muted); line-height: 1.25; margin-top: 1px; }
.seg:hover .seg-body { background: var(--blue-tint); }
.seg input:checked + .seg-body { background: var(--blue); border-color: var(--blue-dark); color: #fff; position: relative; z-index: 1; }
.seg input:checked + .seg-body small { color: rgba(255, 255, 255, .88); }
.seg input:focus-visible + .seg-body { box-shadow: var(--focus); position: relative; z-index: 2; }

.switch { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; margin: 0; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.track { flex: none; width: 46px; height: 26px; border-radius: 13px; background: #8b99ab; position: relative; margin-top: 1px; transition: background .2s; }
.thumb { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .35); transition: transform .2s; }
.switch input:checked + .track { background: var(--green); }
.switch input:checked + .track .thumb { transform: translateX(20px); }
.switch input:focus-visible + .track { box-shadow: var(--focus); }
.switch-text strong { display: block; font-size: 15px; line-height: 1.3; }

/* ---------- consent + actions ---------- */
.consent-row { margin-top: 18px; padding: 14px 16px; background: #f5f8fc; border: 1px solid var(--line-soft); border-radius: var(--radius); transition: background .2s, border-color .2s; }
.consent-row.has-error { background: var(--red-tint); border-color: var(--red); animation: shake .4s; }
.check { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; margin: 0; font-size: 15px; line-height: 1.4; }
.check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check .box {
  flex: none; width: 22px; height: 22px; border: 2px solid #5f7691; border-radius: 4px; background: #fff; margin-top: 1px;
  display: inline-grid; place-items: center; transition: background .15s, border-color .15s;
}
.check .box::after {
  content: ""; width: 6px; height: 11px; border: solid #fff; border-width: 0 3px 3px 0; transform: rotate(45deg) scale(0); margin-top: -2px;
  transition: transform .15s;
}
.check input:checked + .box { background: var(--blue); border-color: var(--blue-dark); }
.check input:checked + .box::after { transform: rotate(45deg) scale(1); }
.check input:focus-visible + .box { box-shadow: var(--focus); }

.form-error { margin-top: 12px; color: var(--red); font-weight: 600; font-size: 15px; }
.form-error:empty { display: none; }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 14px; margin-top: 18px; }
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px; cursor: pointer;
  padding: 12px 28px; border-radius: var(--radius); border: 1px solid; font-size: 16px; font-weight: 700; line-height: 1.2;
  transition: background .15s, transform .08s, box-shadow .15s;
}
.btn:active { transform: translateY(1px); }
.btn.primary { background: linear-gradient(#2d86dc, #1b6ec2); border-color: var(--blue-dark); color: #fff; box-shadow: 0 1px 2px rgba(10, 40, 80, .35), inset 0 1px 0 rgba(255, 255, 255, .25); min-width: 150px; }
.btn.primary:hover { background: linear-gradient(#2a7dcf, #175fa8); }
.btn.secondary { background: #fff; border-color: var(--blue); color: var(--blue-dark); }
.btn.secondary:hover { background: var(--blue-tint); }
.btn[disabled], .btn.is-busy { cursor: progress; opacity: .85; }
.spinner { display: none; width: 16px; height: 16px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .45); border-top-color: #fff; animation: spin .8s linear infinite; }
.btn.is-busy .spinner { display: inline-block; }
.btn.secondary.is-busy .spinner { border-color: rgba(27, 110, 194, .3); border-top-color: var(--blue); }
@keyframes spin { to { transform: rotate(360deg); } }
.or { color: var(--muted); font-size: 14px; }
.sample-hint { color: var(--muted); font-size: 13.5px; flex: 1 1 200px; }

/* ---------- sidebar ---------- */
.side-col .card-head { font-size: 14px; }
.instructor-body { display: flex; gap: 14px; align-items: center; padding: 16px 18px; }
.instructor-avatar { flex: none; line-height: 0; border-radius: 50%; box-shadow: 0 0 0 3px #fff, 0 0 0 4px var(--line); }
.instructor-name { font-weight: 700; font-size: 17px; line-height: 1.2; }
.muted { color: var(--muted); font-size: 13.5px; line-height: 1.35; }
.presence { display: flex; align-items: center; gap: 7px; margin-top: 6px; font-size: 13px; color: var(--green); font-weight: 600; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #37b466; box-shadow: 0 0 0 0 rgba(55, 180, 102, .6); animation: ping 2s infinite; }
@keyframes ping { 70% { box-shadow: 0 0 0 8px rgba(55, 180, 102, 0); } 100% { box-shadow: 0 0 0 0 rgba(55, 180, 102, 0); } }

.kv { padding: 6px 18px 10px; }
.kv > div { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px dotted var(--line); font-size: 14.5px; }
.kv > div:last-child { border-bottom: 0; }
.kv dt { color: var(--muted); }
.kv dd { font-weight: 600; text-align: right; }

.rubric { width: calc(100% - 36px); margin: 6px 18px 12px; border-collapse: collapse; font-size: 14px; }
.rubric td { padding: 7px 0; border-bottom: 1px dotted var(--line); vertical-align: top; }
.rubric td:last-child { text-align: right; padding-left: 10px; font-variant-numeric: tabular-nums; font-weight: 600; }
.rubric tfoot td { border-bottom: 0; border-top: 2px solid var(--line); font-weight: 700; }

/* ---------- footer, toast ---------- */
.site-footer { border-top: 1px solid var(--line); background: #dfe6ee; padding: 18px 0 26px; font-size: 13px; color: var(--muted); }
.site-footer p + p { margin-top: 4px; }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: #1c2a3a; color: #fff; padding: 11px 18px; border-radius: 6px; font-size: 15px; max-width: min(92vw, 520px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .3); transition: opacity .2s, transform .2s; z-index: 40; text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- the stage (the show takes this over) ---------- */
#stage[hidden] { display: none !important; }
#stage { position: fixed; inset: 0; z-index: 1000; overflow: hidden; background: #0b1020; color: #fff; }

/* ---------- responsive ---------- */
@media (max-width: 1020px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .side-col { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
}
@media (max-width: 860px) {
  .topnav { display: none; }
}
@media (max-width: 760px) {
  .submit-grid { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .dropzone { min-height: 200px; }
  .assignment { padding: 18px 18px; }
  .assignment h1 { font-size: 22px; }
  .submit-card form { padding: 16px 18px 20px; }
  .facts { flex-direction: column; }
}
@media (max-width: 560px) {
  .container { padding: 0 14px; }
  .user-name { display: none; }
  .course-title { font-size: 19px; }
  .btn { width: 100%; }
  .or { display: none; }
  .actions { gap: 10px; }
  .seg-body small { display: none; }
  .seg-body { padding: 10px 4px; }
}

/* ---------- motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .dropzone.is-dragging { transform: none; }
}

/* Instructor avatar: the real Professor Redpen art (web/img/avatar.png) */
.instructor-avatar img { display: block; width: 64px; height: 64px; border-radius: 50%; object-fit: cover; background: #1f3556; }
