/* No framework, no build step. The front serves this file as it is, so what is here is what
   runs, for the check page and the sign-up page alike. Colors are stated twice, once for
   each scheme, because a student checking their code at 23:00 is on a dark screen. */

:root {
  --bg: #f7f7f5;
  --card: #ffffff;
  --ink: #1a1a1a;
  --muted: #5c5c5c;
  --line: #e2e2dd;
  --accent: #1f5fa8;
  --pass: #17693f;
  --pass-bg: #e8f4ec;
  --fail: #a4232b;
  --fail-bg: #fbeaea;
  --warn: #7a5100;
  --warn-bg: #fdf3df;
  --skip: #6b6b6b;
  --skip-bg: #f0f0ee;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17181a;
    --card: #1f2124;
    --ink: #e8e8e6;
    --muted: #a2a2a0;
    --line: #33353a;
    --accent: #7fb0e8;
    --pass: #7fd3a3;
    --pass-bg: #16291f;
    --fail: #f0908f;
    --fail-bg: #2c1a1b;
    --warn: #e5bd6d;
    --warn-bg: #2b2314;
    --skip: #9a9a98;
    --skip-bg: #232528;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 2rem 1rem 4rem;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
        sans-serif;
}

main { max-width: 46rem; margin: 0 auto; }

h1 { font-size: 1.55rem; line-height: 1.25; margin: 0 0 .75rem; }
h2 { font-size: 1.05rem; margin: 1.5rem 0 .5rem; }

code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: .92em;
  background: var(--skip-bg);
  padding: .1em .35em;
  border-radius: 3px;
}
code.cmd { background: transparent; padding: 0; color: var(--accent); }

.lede { color: var(--muted); margin: 0 0 .9rem; }
.small { font-size: .875rem; }
p.small { color: var(--muted); }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.25rem;
  margin: 1.25rem 0;
}

.drop {
  border: 2px dashed var(--line);
  border-radius: 8px;
  padding: 2rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: border-color .12s, background .12s;
}
.drop:hover, .drop:focus, .drop.over {
  border-color: var(--accent);
  background: var(--skip-bg);
  outline: none;
}
.drop p { margin: .2rem 0; }
.filename {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--accent);
  margin-top: .8rem !important;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .6rem;
  margin-top: 1.1rem;
}
.controls label { flex: 1 1 100%; color: var(--muted); font-size: .9rem; }
.controls input {
  font: inherit;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  width: 9.5rem;
  letter-spacing: .04em;
  padding: .5rem .6rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  color: var(--ink);
  text-transform: uppercase;
}
.controls button {
  font: inherit;
  font-weight: 600;
  padding: .55rem 1.3rem;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}
.controls button:disabled { opacity: .45; cursor: not-allowed; }

.status {
  margin: 1rem 0 0;
  padding: .7rem .9rem;
  border-radius: 6px;
  font-size: .93rem;
}
.status.busy { background: var(--skip-bg); color: var(--muted); }
.status.warn { background: var(--warn-bg); color: var(--warn); }
.status.problem { background: var(--warn-bg); color: var(--warn); }

.summary {
  margin: 0 0 1.1rem;
  font-size: 1.05rem;
  font-weight: 600;
}
.summary.good { color: var(--pass); }
.summary.bad { color: var(--fail); }

.row {
  display: flex;
  gap: .85rem;
  padding: .85rem 0;
  border-top: 1px solid var(--line);
}
.row:first-child { border-top: 0; }
.mark {
  flex: 0 0 3.4rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .78rem;
  font-weight: 700;
  text-align: center;
  height: 1.55rem;
  line-height: 1.55rem;
  border-radius: 4px;
}
.row.pass .mark { background: var(--pass-bg); color: var(--pass); }
.row.fail .mark { background: var(--fail-bg); color: var(--fail); }
.row.skip .mark { background: var(--skip-bg); color: var(--skip); }
.row.warn .mark { background: var(--warn-bg); color: var(--warn); }
.row.skip .row-title, .row.skip .row-body { color: var(--skip); }

.row-title { margin: 0 0 .2rem; font-weight: 600; }
.row-body { margin: 0; color: var(--muted); font-size: .93rem; }

.detail {
  margin: .6rem 0 0;
  padding: .6rem .75rem;
  background: var(--skip-bg);
  border-radius: 5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .82rem;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-x: auto;
  max-height: 18rem;
}

.notes p { color: var(--muted); font-size: .93rem; }
.notes p strong { color: var(--ink); }

footer { margin-top: 2rem; }
footer p { margin: .4rem 0; }

/* The figures a student pastes into their report, and the shape of the run. */
.figures {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin: 1rem 0;
}
.figures > div {
  flex: 1 1 8rem;
  padding: .6rem .75rem;
  background: var(--skip-bg);
  border-radius: 6px;
}
.fig-key { display: block; font-size: .78rem; color: var(--muted); }
.fig-val {
  display: block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.05rem;
  font-weight: 600;
}
.chart {
  width: 100%;
  height: auto;
  margin: .5rem 0 1rem;
  background: var(--skip-bg);
  border-radius: 6px;
}
.chart-line { fill: none; stroke-width: 1.6; }
.chart-line.up { stroke: var(--pass); }
.chart-line.down { stroke: var(--fail); }
.chart-base { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 3; }
#runinfo h2 { margin-top: 1.75rem; }

a { color: var(--accent); }

/* The interview sign-up: one row per slot, under a heading per day. */
.day { font-size: .95rem; margin: 1.2rem 0 .3rem; }
.day:first-child { margin-top: .4rem; }
.slot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .4rem .8rem;
  padding: .45rem .3rem;
  border-top: 1px solid var(--line);
}
.slot.yours { background: var(--pass-bg); border-radius: 6px; }
.slot-time {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  min-width: 7.2rem;
}
.slot-room { color: var(--muted); font-size: .9rem; min-width: 5.5rem; }
.slot-state {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .78rem;
  font-weight: 700;
  padding: .1rem .5rem;
  border-radius: 4px;
}
.slot-state.free { background: var(--pass-bg); color: var(--pass); }
.slot-state.taken { background: var(--skip-bg); color: var(--skip); }
.slot-state.yours { background: var(--accent); color: var(--card); }
button.book {
  font: inherit;
  font-size: .88rem;
  margin-left: auto;
  padding: .3rem .85rem;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
}
button.book:hover { background: var(--skip-bg); }
