/* Shared styling for the pages you see before the app: sign in, sign up, onboarding,
   and the admin portal. They are deliberately plain — these are pages you pass through
   once, and the only thing that matters is that the form is obvious and the errors are
   readable. */

.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--rule-strong);
  border-radius: 12px;
  padding: 28px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .06), 0 8px 24px rgba(0, 0, 0, .04);
}

.auth-card.wide { max-width: 860px; }

.auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}
.auth-brand .wordmark { margin-bottom: 2px; }
.auth-brand h1 { color: var(--navy); }
.auth-brand h1 { margin: 0; font-size: 19px; letter-spacing: -.01em; font-family: var(--serif); }

.auth-sub {
  margin: 0 0 22px;
  color: var(--ink-3);
  font-size: 13px;
  line-height: 1.5;
}

.auth-card label { display: block; font-size: 12px; font-weight: 600; margin: 0 0 5px; color: var(--ink-3); }
.auth-card .field { margin-bottom: 15px; }
.auth-card input[type="text"],
.auth-card input[type="email"],
.auth-card input[type="password"],
.auth-card input[type="number"],
.auth-card select {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--rule-strong);
  border-radius: 7px;
  font: inherit;
  font-size: 14px;
  background: var(--surface);
  color: inherit;
}
.auth-card input:focus, .auth-card select:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
  border-color: transparent;
}

.auth-btn {
  width: 100%;
  padding: 10px;
  border: 0;
  border-radius: 7px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}
.auth-btn:hover { filter: brightness(1.07); }
.auth-btn:disabled { opacity: .55; cursor: default; filter: none; }

.auth-alt { margin: 16px 0 0; text-align: center; font-size: 13px; color: var(--ink-3); }
.auth-alt a { color: var(--accent); }

/* One error line, above the button, never a browser alert. */
.auth-error {
  background: var(--danger-soft);
  border: 1px solid var(--danger-line);
  color: var(--danger);
  border-radius: 7px;
  padding: 9px 11px;
  font-size: 13px;
  margin-bottom: 15px;
  line-height: 1.45;
}
.auth-note {
  background: var(--navy-soft);
  border: 1px solid var(--navy-line);
  border-radius: 7px;
  padding: 10px 12px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--navy);
  margin-bottom: 16px;
}
.auth-hint { font-size: 11.5px; color: var(--ink-3); margin: 5px 0 0; line-height: 1.45; }

/* ---- discipline picker ---- */

.disc-search { margin-bottom: 12px; }

.disc-list {
  max-height: 340px;
  overflow-y: auto;
  border: 1px solid var(--rule-strong);
  border-radius: 8px;
}

.disc-group-label {
  position: sticky;
  top: 0;
  background: var(--sunk);
  padding: 5px 12px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-3);
  border-bottom: 1px solid var(--rule-strong);
}

/* `.auth-card label` sets display:block for the form fields, and a discipline row is also
   a label inside that card — so this needs the extra specificity or the checkbox stacks
   above the name instead of sitting beside it. */
.auth-card label.disc-row,
.disc-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  margin: 0;
  font-weight: 400;
  font-size: inherit;
  color: inherit;
  text-align: left;
  border-bottom: 1px solid var(--rule-strong);
  cursor: pointer;
}
.disc-row:last-child { border-bottom: 0; }
.disc-row:hover { background: var(--sunk); }
.disc-row.picked { background: var(--accent-soft); }
.disc-row.empty { opacity: .45; }
.disc-row .name { flex: 1; font-size: 13.5px; min-width: 0; }
.disc-row .count { font-size: 11.5px; color: var(--ink-3); white-space: nowrap; }

/* style.css applies width:100% to bare inputs for the app's own forms, which turns each
   of these checkboxes into a 369px-wide column and squeezes the discipline name into a
   two-character strip. Pin the box to its natural size. */
.disc-row input[type="checkbox"] {
  width: 15px;
  min-width: 15px;
  height: 15px;
  flex: 0 0 auto;
  margin: 0;
  padding: 0;
}

/* The chosen tracks, in order, with the primary one called out — because which is
   primary changes what the whole app leads with. */
.track-chips { display: flex; flex-wrap: wrap; gap: 7px; margin: 14px 0 4px; min-height: 30px; }
.track-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 9px;
  border-radius: 20px;
  font-size: 12.5px;
  background: var(--sunk);
  border: 1px solid var(--rule-strong);
}
.track-chip.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.track-chip button { background: none; border: 0; color: inherit; cursor: pointer; font-size: 15px; line-height: 1; opacity: .7; padding: 0; }
.track-chip button:hover { opacity: 1; }
.track-chip .role { font-size: 10px; text-transform: uppercase; letter-spacing: .05em; opacity: .8; }

/* ---- admin ---- */

.admin-page { max-width: 1080px; margin: 0 auto; padding: 24px 20px 60px; }
.admin-top { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.admin-top .faint { font-size: 12.5px; }
.admin-h2 { margin: 34px 0 10px; font-size: 16px; }
.admin-h2 .faint { font-weight: 400; font-size: 13px; }
.warn-text { color: var(--warn); font-weight: 600; }
.fail-text { color: var(--danger); font-weight: 600; }

/* ---------- admin: data sync ---------- */

.syncbar { border: 1px solid var(--rule-strong); border-radius: 6px; background: var(--surface); }
.syncrow { display: flex; align-items: center; gap: 16px; padding: 12px 16px; }
.syncrow + .syncrow, .syncmore { border-top: 1px solid var(--rule); }
.syncrow.big { padding: 16px; }
.syncrow-main { flex: 1; min-width: 0; }
.syncrow-title { font-size: 14px; font-weight: 600; }
.syncrow.big .syncrow-title { font-family: var(--serif); font-size: 18px; letter-spacing: -.01em; }
.syncrow-title .faint { font-weight: 400; font-size: 12px; margin-left: 6px; }
.syncrow-last { font-size: 12.5px; margin-top: 3px; }
.syncmore > summary {
  cursor: pointer; list-style: none; padding: 9px 16px; font-size: 12.5px; color: var(--ink-3);
}
.syncmore > summary::-webkit-details-marker { display: none; }
.syncmore > summary::before { content: '▸ '; }
.syncmore[open] > summary::before { content: '▾ '; }
.syncmore .syncrow { background: var(--sunk); }

/* The scraper's own stdout, shown while it runs and until dismissed. */
.synclog {
  margin-top: 10px; border: 1px solid var(--rule-strong); border-radius: 6px;
  overflow: hidden; background: var(--surface);
}
.synclog-head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 9px 12px; border-bottom: 1px solid var(--rule-strong);
  font-size: 12.5px; background: var(--sunk);
}
.synclog-body {
  margin: 0; padding: 10px 12px; max-height: 280px; overflow: auto;
  font: 12px/1.55 ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  white-space: pre-wrap; word-break: break-word; color: var(--ink-2);
}

/* ---------- admin: overview ---------- */

.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
@media (max-width: 720px) { .stat-row { grid-template-columns: repeat(2, 1fr); } }
.stat {
  border: 1px solid var(--rule-strong); border-radius: 6px; padding: 14px 16px 12px;
  background: var(--surface);
}
.stat-v { font-family: var(--serif); font-size: 32px; line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat-l { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); margin-top: 8px; }
.stat-s { font-size: 12px; color: var(--ink-3); margin-top: 3px; }

.stat-card { border: 1px solid var(--rule-strong); border-radius: 6px; padding: 12px 16px; background: var(--surface); }
.stat-h { font-size: 13px; font-weight: 600; margin-bottom: 10px; }
.stat-h .faint { font-weight: 400; font-size: 12px; }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 2px; background: var(--ink); vertical-align: -1px; }
.swatch.soft { background: var(--rule-strong); }

/* horizontal bars: label · track · value */
.hbar { display: grid; grid-template-columns: 180px 1fr 60px; align-items: center; gap: 10px; font-size: 12.5px; padding: 3px 0; }
@media (max-width: 720px) { .hbar { grid-template-columns: 120px 1fr 56px; } }
.hbar-l { color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar-t { display: flex; gap: 2px; height: 12px; }
.hbar-f { background: var(--ink); border-radius: 0 4px 4px 0; min-width: 0; }
.hbar-f.soft { background: var(--rule-strong); }
.hbar-f[style="width:0%"] { display: none; }
.hbar-v { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- admin: sources ---------- */

.srcbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 12.5px; margin-bottom: 8px; }
.srcbar code { font-size: 12px; }
.srclist { border: 1px solid var(--rule-strong); border-radius: 6px; background: var(--surface); }
.srcrow {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 9px 14px; font-size: 13px;
}
.srcrow + .srcrow { border-top: 1px solid var(--rule); }
.srcrow-label { font-weight: 600; flex: 1; min-width: 0; }
.srcrow-when { font-size: 12px; }
.srcrow-why {
  flex-basis: 100%; font-size: 12.5px; line-height: 1.5; color: var(--ink-2);
  padding-left: 2px;
}
.srcall { margin-top: 10px; }
.srcall > summary { cursor: pointer; font-size: 12.5px; color: var(--ink-3); }
.srcall[open] > summary { margin-bottom: 8px; }

.status {
  display: inline-block; min-width: 52px; text-align: center;
  padding: 2px 8px; border-radius: 20px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
}
.status.ok { background: var(--ok-soft); color: var(--ok); }
.status.fail { background: var(--danger-soft); color: var(--danger); }
.status.off { background: var(--sunk); color: var(--ink-3); }

.spark { display: flex; gap: 2px; align-items: flex-end; }
.spark i { width: 5px; height: 12px; border-radius: 1px; background: var(--rule-strong); display: block; }
.spark i.ok { background: var(--ok); }
.spark i.bad { background: var(--danger); }

.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-table th, .admin-table td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--rule-strong); }
.admin-table th { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); }

/* ---------- legal pages and the site-wide footer ---------- */

.legal-wrap { max-width: 720px; margin: 0 auto; padding: 40px 24px 60px; }
.legal h1 { font-family: var(--serif); font-size: 30px; margin: 14px 0 4px; letter-spacing: -.01em; }
.legal h2 { font-size: 16px; margin: 30px 0 8px; }
.legal h3 { font-size: 13.5px; margin: 16px 0 4px; color: var(--ink-2); }
.legal p, .legal li { font-size: 14px; line-height: 1.6; color: var(--ink-2); }
.legal p { margin: 0 0 10px; }
.legal ul { margin: 0 0 10px; padding-left: 20px; }
.legal li { margin-bottom: 4px; }
.legal code { font-family: var(--mono); font-size: 12.5px; }
.legal-meta { color: var(--ink-3); font-size: 13px; margin: 0 0 18px !important; }
.legal-callout {
  border: 1px solid var(--rule-strong); border-left: 3px solid var(--accent); border-radius: 6px;
  padding: 12px 14px; font-size: 14px; line-height: 1.6; color: var(--ink-2); background: var(--surface);
  margin: 0 0 8px;
}
.legal-foot { margin-top: 36px !important; font-size: 13px; }

.auth-wrap { flex-direction: column; }
.auth-wrap .site-foot { margin-top: 24px; }

/* Consent line on the sign-up form. */
.auth-consent { display: flex; gap: 9px; align-items: flex-start; font-size: 13px; line-height: 1.5; color: var(--ink-2); margin: 0 0 16px; }
.auth-consent input { margin-top: 3px; flex: none; width: auto; accent-color: var(--accent); }
.auth-consent a { text-decoration: underline; text-underline-offset: 2px; color: inherit; }

/* ---- onboarding: the two steps ---- */

.ob-steps { display: flex; gap: 14px; margin: 0 0 14px; font-size: 11.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); }
.ob-step.on { color: var(--ink); font-weight: 700; border-bottom: 2px solid var(--accent); padding-bottom: 2px; }
.ob-step.done { color: var(--ink-2); }

.auth-btn.ghost { background: transparent; color: var(--ink-2); border: 1px solid var(--rule-strong); }
.auth-btn.ghost:hover { filter: none; background: var(--sunk); }

.picker-links { font-size: 12.5px; color: var(--ink-3); white-space: nowrap; }
.picker-links .linkbtn, .auth-alt .linkbtn { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; cursor: pointer; }
.picker-links .linkbtn:hover, .auth-alt .linkbtn:hover { text-decoration: underline; }
.auth-alt .linkbtn:disabled { color: var(--ink-3); cursor: default; text-decoration: none; }

/* ---- onboarding: the program picker ---- */
/* One card per school, its picture at the top left. The picture is what makes a list of
   nineteen near-identical "University of …" rows scannable. */

.school-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 12px; }
@media (max-width: 560px) { .school-grid { grid-template-columns: 1fr; } }

.school-card { border: 1px solid var(--rule-strong); border-radius: 8px; background: var(--surface); overflow: hidden; }
.school-card.picked { border-color: var(--ink); }

.school-head { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: var(--sunk); border-bottom: 1px solid var(--rule-strong); }
.school-pic { width: 92px; height: 46px; object-fit: contain; border-radius: 4px; flex: none; display: block; background: #fff; padding: 4px; box-sizing: border-box; border: 1px solid var(--rule); }
.school-pic.blank { background: var(--rule-strong); }
.school-title { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.school-title b { font-size: 14px; font-family: var(--serif); letter-spacing: -.005em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.school-title .faint { font-size: 11.5px; color: var(--ink-3); }

.auth-card label.school-all,
.school-all { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 11.5px; font-weight: 500; color: var(--ink-3); cursor: pointer; white-space: nowrap; }
.school-all input[type="checkbox"] { width: 15px; min-width: 15px; height: 15px; margin: 0; flex: none; }

.school-progs { display: flex; flex-direction: column; }
.school-title .stream-note { display: block; font-size: 11px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.school-fold { display: block; width: 100%; background: var(--surface); border: 0; border-bottom: 1px solid var(--rule); padding: 8px 12px; text-align: left; font: inherit; font-size: 12.5px; color: var(--accent); cursor: pointer; }
.school-fold:hover { background: var(--sunk); }
.school-card.folded .school-fold { border-bottom: 0; }
.auth-card label.prog-row,
.prog-row { display: flex; align-items: center; gap: 10px; padding: 7px 12px; margin: 0; font-weight: 400; font-size: 13px; color: inherit; border-bottom: 1px solid var(--rule); cursor: pointer; }
.prog-row:last-child { border-bottom: 0; }
.prog-row:hover { background: var(--sunk); }
.prog-row.picked { background: var(--accent-soft); }
.prog-row input[type="checkbox"] { width: 15px; min-width: 15px; height: 15px; margin: 0; padding: 0; flex: none; }
.prog-row .prog-name { font-weight: 550; flex: none; min-width: 84px; }
.prog-row .prog-meta { flex: 1; min-width: 0; font-size: 11.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prog-row .prog-seats { flex: none; font-size: 12px; color: var(--ink-2); font-variant-numeric: tabular-nums; }

/* ---------- admin: feedback ---------- */
.fbbar { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 0; margin-bottom: 10px; }
.fbbar .chip { margin-right: 10px; }
.fbrow { border: 1px solid var(--rule-strong); background: var(--surface); padding: 10px 14px 9px; margin-bottom: 8px; }
.fbrow.resolved { border-color: var(--rule); background: none; }
.fbrow.resolved .fbrow-text { color: var(--ink-3); }
.fbrow.new { border-left: 3px solid var(--accent); }
.fbrow-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13.5px; }
.fbrow-head .faint { font-size: 12px; }
.fbrow-prompts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.fbrow-prompts span { font-size: 12.5px; color: var(--ink-2); border: 1px solid var(--rule-strong); padding: 1px 8px; }
.fbrow-text { margin-top: 8px; font-size: 14px; line-height: 1.55; white-space: pre-wrap; max-width: 80ch; }
.fbrow-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 9px; font-size: 12.5px; }
.fbrow-foot a { color: var(--ink-2); }
