/* MI4062E practice portal: the course palette (navy, orange, blue) on a light page */
:root {
  --navy: #0f2a44;
  --orange: #eb6834;
  --blue: #2a78d6;
  --blue-dark: #1c5cab;
  --ink: #1b2430;
  --muted: #5f6b7a;
  --line: #e1e0d9;
  --page: #f1f5f9;
  --card: #ffffff;
  --green: #0b6b47;
  --green-tint: #dff3ea;
  --amber: #8a5a00;
  --amber-tint: #fdf0d5;
  --red: #a32d2d;
  --red-tint: #fbe4e4;
  --gray-tint: #eceef1;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 16px/1.5 "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}

.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
main.wrap { padding-top: 24px; padding-bottom: 48px; }

.topbar { background: var(--navy); color: #fff; }
.topbar-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; flex-wrap: wrap; }
.brand { font-weight: 700; letter-spacing: 0.02em; }
.brand span { font-weight: 400; color: #c9d6e8; margin-left: 4px; }
.user { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; margin: 0; padding: 6px 0; color: #c9d6e8; font-size: 14px; }

h1 { font-size: 28px; line-height: 1.2; margin: 4px 0 20px; color: var(--navy); }
h2 { font-size: 19px; margin: 0 0 14px; color: var(--navy); display: flex; align-items: center; gap: 10px; }
.kicker { margin: 0; color: var(--orange); font-size: 13px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.step { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--orange); color: #fff; font-size: 14px; }
.muted { color: var(--muted); }
p { margin: 0 0 12px; }
code, pre { font-family: Consolas, "Cascadia Mono", Menlo, monospace; font-size: 0.9em; }
code { background: var(--gray-tint); padding: 1px 5px; border-radius: 4px; }
pre { background: var(--navy); color: #e6edf3; padding: 12px 14px; border-radius: 8px; overflow-x: auto; }
a { color: var(--blue); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 20px 22px; margin-bottom: 18px; }
.card.narrow { max-width: 460px; margin: 32px auto 12px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.grid .card { margin-bottom: 0; }
.grid + .card { margin-top: 18px; }
.footnote { text-align: center; font-size: 14px; }

.stack { display: grid; gap: 14px; }
label { display: grid; gap: 6px; font-weight: 600; font-size: 15px; }
label.check { display: flex; align-items: center; gap: 10px; font-weight: 400; }
input[type="text"], input:not([type]), input[type="password"], textarea {
  width: 100%; padding: 10px 12px; font: inherit; color: inherit;
  border: 1px solid #c3c2b7; border-radius: 8px; background: #fff;
}
input[type="file"] { font: inherit; }
input:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 3px solid rgba(42, 120, 214, 0.35); outline-offset: 1px; }
textarea { resize: vertical; }

button, .button {
  display: inline-block; padding: 10px 18px; border: 0; border-radius: 8px; cursor: pointer;
  background: var(--blue); color: #fff; font: inherit; font-weight: 600; text-decoration: none; text-align: center;
}
button:hover, .button:hover { background: var(--blue-dark); }
button.secondary, .button.secondary { background: var(--gray-tint); color: var(--navy); }
button.secondary:hover, .button.secondary:hover { background: #dde1e6; }
button.small { padding: 6px 12px; font-size: 14px; }
button.link { background: none; padding: 0; color: #fff; text-decoration: underline; font-weight: 400; }
.stack button { justify-self: start; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 16px 0 0; }

.flash { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; border: 1px solid; }
.flash.success { background: var(--green-tint); border-color: #b5e2cd; color: var(--green); }
.flash.error { background: var(--red-tint); border-color: #f2c3c3; color: var(--red); }
.flash.info { background: #e3eefb; border-color: #c4dbf6; color: var(--navy); }

.files { list-style: none; margin: 0; padding: 0; }
.files li { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line); }
.files li:first-child { border-top: 0; padding-top: 0; }
.files li > div { min-width: 0; }
.files code { overflow-wrap: anywhere; }
.files p { margin: 4px 0 0; font-size: 15px; }
.files .button { white-space: nowrap; }
.missing { color: var(--muted); font-style: italic; white-space: nowrap; }

.howto { margin: 0 0 16px; padding-left: 22px; }
.howto li { margin-bottom: 4px; }
.closed { padding: 12px 16px; background: var(--gray-tint); border-radius: 8px; margin: 0; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); font-weight: 600; }
tr.latest td { background: #f8fbff; }
.nowrap { white-space: nowrap; }
.tag { display: inline-block; margin-left: 6px; padding: 0 7px; border-radius: 10px; background: var(--navy); color: #fff; font-size: 12px; }

.chips { display: inline-flex; flex-wrap: wrap; gap: 4px; vertical-align: middle; margin-left: 4px; }
.chip { padding: 1px 7px; border-radius: 10px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.chip.full { background: var(--green-tint); color: var(--green); }
.chip.part { background: var(--amber-tint); color: var(--amber); }
.chip.none { background: var(--gray-tint); color: var(--muted); }

.stats { display: flex; gap: 22px; flex-wrap: wrap; }
.stats strong { font-size: 24px; color: var(--navy); margin-right: 4px; }
details { margin-top: 8px; }
summary { cursor: pointer; color: var(--blue); }
ul.plain { list-style: none; padding: 0; margin: 8px 0 0; font-size: 15px; columns: 2; }

form.inline { display: flex; gap: 6px; align-items: center; }
form.inline input { min-width: 180px; padding: 6px 8px; }

@media (max-width: 640px) {
  h1 { font-size: 24px; }
  .files li { flex-direction: column; align-items: stretch; }
  ul.plain { columns: 1; }
}
