/* Brand tokens from the wireframe handoff notes */
:root {
  --ink: #2E2E30;
  --ink-soft: #45454A;
  --grey-mid: #6C6A70;
  --grey-line: #DAD8D2;
  --grey-line-soft: #EDEBE6;
  --bg: #F4F3F0;
  --card-bg: #FFFFFF;
  --orange: #F5791F;
  --orange-deep: #C55A0B;
  --orange-tint: #FDF0E3;
  --orange-tint-soft: #FDF4EC;
  --teal: #00929E;
  --teal-deep: #006A73;
  --teal-tint: #E6F4F5;
  --ink-tint: #F1F0ED;
  --grey-dark: #6C6A70;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  font-family: "Public Sans", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  color: var(--ink);
}

a { color: var(--teal); }
a:hover { color: var(--orange); }

.app-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.card {
  width: 100%;
  max-width: 420px;
  background: var(--card-bg);
  border: 1px solid var(--grey-line);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.screen { display: flex; flex-direction: column; }
.screen[hidden] { display: none; }

/* ---- Headers ---- */
.card-header--brand {
  padding: 18px 20px 16px;
  border-bottom: 1px solid var(--grey-line-soft);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.card-header--brand .logo { width: 116px; height: auto; display: block; margin-bottom: 6px; }
.tagline { font-family: "Jost", sans-serif; font-size: 21px; font-weight: 600; letter-spacing: -0.01em; }

.card-header--back {
  padding: 16px 20px;
  border-bottom: 1px solid var(--grey-line-soft);
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.card-header--compact { padding: 14px 18px; align-items: center; }

.back-link {
  font-size: 20px;
  line-height: 1;
  color: var(--teal);
  font-weight: 600;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 6px 4px 0;
  font-family: inherit;
}
.back-link:hover { color: var(--orange); }

.header-title { font-family: "Jost", sans-serif; font-size: 19px; font-weight: 600; }
.card-header--compact .header-title { font-size: 17px; }
.header-subtitle { font-size: 13px; color: var(--grey-mid); }

/* ---- Body / search ---- */
.card-body { padding: 24px 20px 28px; display: flex; flex-direction: column; gap: 10px; }
.field-label { font-size: 15px; font-weight: 600; }

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 2px solid var(--grey-line);
  border-radius: 12px;
  padding: 0 14px;
  height: 52px;
  background: #fff;
  transition: border-color 0.15s ease;
}
.search-box:focus-within { border-color: var(--orange); }
.search-box input {
  border: none;
  outline: none;
  font-size: 16px;
  font-family: "Public Sans", sans-serif;
  color: var(--ink);
  flex: 1;
  min-width: 0;
  background: transparent;
}
.search-box input::placeholder { color: #8A888E; }

.hint-mono { font-family: "IBM Plex Mono", monospace; font-size: 11px; color: var(--grey-mid); }

.results-list {
  border: 1px solid var(--grey-line);
  border-radius: 12px;
  overflow: hidden;
  margin-top: 2px;
  max-height: 340px;
  overflow-y: auto;
}
.results-list:empty { display: none; }

.result-row {
  padding: 13px 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  cursor: pointer;
  border-bottom: 1px solid var(--grey-line-soft);
  background: #fff;
}
.result-row:last-child { border-bottom: none; }
.result-row:hover, .result-row.active { background: var(--orange-tint-soft); }
.result-row-title { font-size: 16px; font-weight: 600; }
.result-row-sub { font-size: 13px; color: var(--grey-mid); }
.result-row-sub--mono { font-family: "IBM Plex Mono", monospace; font-size: 12px; color: var(--grey-mid); }

.results-footer {
  padding: 10px 16px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  color: var(--grey-mid);
  background: #FAF9F7;
  border-top: 1px solid var(--grey-line-soft);
}

.fine-print { font-size: 13px; color: var(--grey-mid); line-height: 1.5; }

.empty-state {
  border: 1px dashed #C9C7C1;
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-soft);
}
.empty-state a { font-size: 14px; font-weight: 600; text-decoration: none; }

/* ---- Lookup (transient) screen ---- */
.lookup-body {
  padding: 72px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}
.spinner {
  width: 34px; height: 34px;
  border-radius: 999px;
  border: 3px solid var(--grey-line-soft);
  border-top-color: var(--orange);
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.lookup-text { font-size: 17px; color: var(--ink-soft); }

/* ---- Result screen ---- */
.result-body { gap: 18px; }
.result-course-title {
  font-family: "Jost", sans-serif;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.status-pill {
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: 12px;
  padding: 14px 16px;
}
.status-icon {
  width: 30px; height: 30px;
  border-radius: 999px;
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 16px;
  flex: none;
}
.status-label { font-family: "Jost", sans-serif; font-size: 20px; font-weight: 600; }

.status-pill--match { background: var(--teal-tint); }
.status-pill--match .status-icon { background: var(--teal); }
.status-pill--match .status-label { color: var(--teal-deep); }

.status-pill--no-match { background: var(--ink-tint); }
.status-pill--no-match .status-icon { background: var(--ink); }

.status-pill--mismatch { background: var(--orange-tint); }
.status-pill--mismatch .status-icon { background: var(--orange); }
.status-pill--mismatch .status-label { color: #A8480A; }

.status-pill--not-applicable { background: var(--ink-tint); }
.status-pill--not-applicable .status-icon { background: var(--grey-dark); }
.status-pill--not-applicable .status-label { color: #55555A; }

.counts-toward-label { font-size: 14px; font-weight: 600; color: var(--ink-soft); margin-bottom: 8px; }
.subject-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 16px; }
.subject-list li { display: flex; gap: 10px; }
.subject-list li::before { content: "•"; color: var(--teal); }

.plain-explain { font-size: 16px; line-height: 1.5; color: var(--ink-soft); }

.compare-box { border: 1px solid var(--grey-line-soft); border-radius: 12px; overflow: hidden; }
.compare-row { display: flex; justify-content: space-between; gap: 12px; padding: 12px 14px; font-size: 14px; border-bottom: 1px solid var(--grey-line-soft); }
.compare-row:last-child { border-bottom: none; }
.compare-label { color: var(--grey-mid); }
.compare-value { font-weight: 600; }

.mismatch-note { font-size: 15px; line-height: 1.5; color: var(--ink-soft); }
.mismatch-note a { font-weight: 600; text-decoration: none; }

.provenance { border-top: 1px solid var(--grey-line-soft); padding-top: 14px; font-size: 13px; color: var(--grey-mid); line-height: 1.5; }

.policy-note { font-size: 14px; line-height: 1.55; color: var(--ink-soft); background: var(--ink-tint); border-radius: 12px; padding: 12px 14px; }
.policy-note a { font-weight: 600; text-decoration: none; }

.source-line { font-size: 13px; color: var(--grey-mid); line-height: 1.5; border-top: 1px solid var(--grey-line-soft); padding-top: 14px; margin-top: 6px; }
.source-line a { font-weight: 600; text-decoration: none; }

.btn-secondary {
  border: 2px solid var(--orange);
  color: var(--orange-deep);
  border-radius: 12px;
  height: 50px;
  display: grid;
  place-items: center;
  font-size: 16px;
  font-weight: 600;
  background: #fff;
  cursor: pointer;
  font-family: "Public Sans", sans-serif;
  width: 100%;
}
.btn-secondary:hover { background: var(--orange-tint-soft); }

/* result card gets an amber border for the mismatch state */
.card.card--mismatch { border: 2px solid var(--orange); box-shadow: 0 2px 10px rgba(245,121,31,0.14); }

/* ---- toast ---- */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 14px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  max-width: 90vw;
  text-align: center;
}

@media (max-width: 480px) {
  .app-shell { padding: 0; align-items: stretch; }
  .card { max-width: none; min-height: 100vh; border-radius: 0; border-left: none; border-right: none; }
}
