/* AppQuest pages outside the editor: sign-in and the teacher dashboard. */
@font-face {
  font-family: "Nunito";
  src: url("nunito.woff2") format("woff2");
  font-weight: 200 1000;
  font-display: swap;
}
@font-face {
  font-family: "Titan One";
  src: url("titan-one.woff2") format("woff2");
  font-display: swap;
}
:root {
  --ink: #2b2550;
  --ink-soft: #6a648f;
  --primary: #7b5cff;
  --primary-edge: #5a3fd0;
  --primary-tint: #ece7ff;
  --teal: #16c5c8;
  --teal-edge: #0e9da0;
  --accent: #ffc53d;
  --accent-edge: #e39a00;
  --bg: #7b5cff;
  --card: #ffffff;
  --line: #dcd5fa;
  --edge: #cfc6f3;
  --ok: #0c9c78;
  --danger: #f0466a;
  --danger-edge: #c22a4c;
  --danger-tint: #ffe9ee;
  --display: "Titan One", "Nunito", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--ink);
  background-color: var(--bg);
  background-image: url("pattern.svg");
  background-size: 120px 120px;
  min-height: 100vh;
}
a { color: var(--primary-edge); font-weight: 800; }
h1, h2, h3 { margin: 0; font-family: var(--display); font-weight: 400; line-height: 1.2;
  letter-spacing: .01em; }
.brand { display: inline-flex; align-items: center; gap: 12px; font-family: var(--display);
  font-size: 26px; color: #fff; text-decoration: none; text-shadow: 0 3px 0 rgba(43, 37, 80, .35); }
.brand img { width: 40px; height: 40px; }
.card { background: var(--card); border-radius: 18px; box-shadow: 0 7px 0 rgba(43, 37, 80, .28); }
label { display: block; font-weight: 800; font-size: 14px; margin: 14px 0 4px; }
input[type=text], input[type=password], input[type=email], textarea {
  width: 100%; font: inherit; font-weight: 700; color: inherit; padding: 11px 14px;
  border: 3px solid var(--line); border-radius: 12px; background: #fff;
}
input:focus, textarea:focus { outline: none; border-color: var(--primary); }
button:focus-visible, a:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* chunky buttons: a solid bottom edge that squashes when pressed */
.btn { --face: #fff; --rim: var(--edge); font: inherit; font-weight: 800; cursor: pointer;
  border-radius: 12px; padding: 9px 18px; border: 0; background: var(--face); color: var(--ink);
  box-shadow: 0 5px 0 var(--rim), 0 0 0 2px var(--rim) inset; text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px; position: relative; top: 0;
  transition: top .06s, box-shadow .06s, filter .12s; margin-bottom: 5px; }
.btn:hover { filter: brightness(1.06); }
.btn:active { top: 4px; box-shadow: 0 1px 0 var(--rim), 0 0 0 2px var(--rim) inset; }
.btn.primary { --face: var(--primary); --rim: var(--primary-edge); color: #fff; }
.btn.teal { --face: var(--teal); --rim: var(--teal-edge); color: #fff; }
.btn.danger { color: var(--danger-edge); }
.btn.danger:hover { --face: var(--danger-tint); }
.btn.small { padding: 5px 12px; font-size: 14px; border-radius: 10px;
  box-shadow: 0 4px 0 var(--rim), 0 0 0 2px var(--rim) inset; margin-bottom: 4px; }
.btn.small:active { top: 3px; box-shadow: 0 1px 0 var(--rim), 0 0 0 2px var(--rim) inset; }
.btn[disabled] { opacity: .55; cursor: default; }
.error { background: var(--danger-tint); color: var(--danger-edge); border-radius: 12px;
  padding: 10px 14px; margin-top: 16px; font-size: 15px; font-weight: 800; }
.muted { color: var(--ink-soft); }
.hidden { display: none !important; }

/* ---- sign in ---- */
.signin { min-height: 100vh; display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 28px 16px; }
.signin .brand { font-size: 46px; gap: 14px; }
.signin .brand img { width: 62px; height: 62px; }
.signin .card { width: 100%; max-width: 420px; padding: 24px 26px 26px; margin-top: 24px; }
.signin .tagline { margin: 8px 0 0; color: #fff; font-weight: 800; font-size: 18px; }
.tabs { display: flex; gap: 8px; }
.tabs button { flex: 1; font: inherit; font-weight: 800; border: 0; padding: 9px;
  border-radius: 12px; cursor: pointer; color: var(--ink-soft); background: #f1eefc;
  box-shadow: 0 4px 0 var(--edge); position: relative; top: 0; margin-bottom: 4px; }
.tabs button[aria-selected=true] { background: var(--teal); color: #fff;
  box-shadow: 0 1px 0 var(--teal-edge); top: 3px; }
.signin form .btn { width: 100%; justify-content: center; margin-top: 22px; padding: 12px;
  font-family: var(--display); font-weight: 400; font-size: 20px; letter-spacing: .02em; }
.signin .switch { margin: 16px 0 0; text-align: center; font-size: 15px; }
.signin .switch button { font: inherit; font-weight: 800; background: none; border: 0; padding: 0;
  color: var(--primary-edge); cursor: pointer; text-decoration: underline; }
.signin footer { margin-top: 26px; font-size: 13.5px; color: #fff; text-align: center; }
.signin footer a { color: #fff; }

/* ---- teacher dashboard ---- */
.topbar { background: var(--primary-edge); padding: 10px 24px; box-shadow: 0 5px 0 rgba(43, 37, 80, .3);
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap; color: #fff; position: relative; }
.topbar .muted { color: #e2dbff; }
.topbar .spacer { flex: 1; }
.topbar .btn { --rim: #3d2a99; }
.layout { max-width: 1080px; margin: 0 auto; padding: 28px 20px 60px; }
.layout > h1 { color: #fff; font-size: 34px; text-shadow: 0 3px 0 rgba(43, 37, 80, .35); }
.classes { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 16px 0 22px; }
.classes .chip { font: inherit; font-weight: 800; padding: 8px 16px; border-radius: 12px; border: 0;
  background: #fff; cursor: pointer; color: var(--ink); box-shadow: 0 5px 0 rgba(43, 37, 80, .28);
  position: relative; top: 0; margin-bottom: 5px; }
.classes .chip[aria-pressed=true] { background: var(--accent); box-shadow: 0 1px 0 var(--accent-edge);
  top: 4px; }
.panel { padding: 22px 24px; margin-bottom: 22px; }
.panel h2 { font-size: 24px; }
.panel h3 { font-size: 19px; }
.panel-head { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.panel-head .grow { flex: 1; min-width: 220px; }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 700; letter-spacing: .08em; background: var(--accent);
  color: var(--ink); padding: 2px 9px; border-radius: 8px; }
.table-wrap { overflow-x: auto; margin-top: 14px; }
table { border-collapse: collapse; width: 100%; }
th { text-align: left; font-size: 13px; color: var(--ink-soft); font-weight: 800;
  text-transform: uppercase; letter-spacing: .05em;
  padding: 8px 10px; border-bottom: 3px solid var(--line); white-space: nowrap; }
td { padding: 10px; border-bottom: 2px solid #eeeafc; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td.actions { white-space: nowrap; text-align: right; }
td .code { background: var(--primary-tint); color: var(--primary-edge); }
.projects { display: flex; flex-direction: column; gap: 4px; }
.projects a { text-decoration: none; }
.projects a:hover { text-decoration: underline; }
.projects .when { font-weight: 600; color: var(--ink-soft); font-size: 13.5px; margin-left: 6px; }
.empty { text-align: center; padding: 34px 16px; color: var(--ink-soft); }
.row-form { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.row-form > div { flex: 1; min-width: 200px; }
.newpins { background: #fff6dc; border: 3px solid var(--accent); border-radius: 14px;
  padding: 12px 16px; margin-top: 14px; }
.cards { display: none; }

@media (prefers-reduced-motion: reduce) { .btn, .chip, .tabs button { transition: none; } }

@media print {
  body { background: #fff; }
  .topbar, .layout > :not(.cards) { display: none !important; }
  .cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .cards .logincard { border: 1.5px dashed #999; border-radius: 10px; padding: 12px 14px;
    break-inside: avoid; font-size: 13px; }
  .cards .logincard b { font-size: 15px; }
}
