/* UW Major Choice Evaluator — College Advising Team brand:
   navy #1f4387, blue #0078b7, light cyan #97d9e9, orange #e25b26 (accent).
   Text colors are chosen for WCAG AA contrast; see README. */

@font-face { font-family: "DM Sans"; src: url("/fonts/dm-sans-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "DM Sans"; src: url("/fonts/dm-sans-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "DM Sans"; src: url("/fonts/dm-sans-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "DM Sans"; src: url("/fonts/dm-sans-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --navy: #1f4387;
  --navy-dark: #163068;
  --blue: #0078b7;
  --cyan: #97d9e9;
  --cyan-wash: #eef6fb;
  --orange: #e25b26;
  --orange-strong: #b8441a; /* brand orange darkened for AA contrast with white text */
  --ink: #1e293b;
  --ink-soft: #475569;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --page: #f6f9fc;
  --card: #ffffff;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 6px 20px rgba(15, 23, 42, 0.06);
  --focus: 0 0 0 3px rgba(0, 120, 183, 0.35);

  --ok-ink: #166534;   --ok-bg: #f0fdf4;   --ok-line: #86efac;   --ok-dot: #16a34a;
  --info-ink: #1f4387; --info-bg: #eef6fb; --info-line: #97d9e9; --info-dot: #0078b7;
  --warn-ink: #854d0e; --warn-bg: #fffbeb; --warn-line: #fcd34d; --warn-dot: #d97706;
  --bad-ink: #9a2a12;  --bad-bg: #fdf2ee;  --bad-line: #f4b9a3;  --bad-dot: #c2410c;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--page);
}
img { max-width: 100%; height: auto; }
a { color: var(--blue); text-underline-offset: 2px; }
a:hover { color: var(--navy); }
h1, h2, h3 { color: var(--navy); line-height: 1.25; margin: 0 0 0.5rem; }
p { margin: 0 0 0.75rem; }
[hidden] { display: none !important; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }

.wrap { width: min(100% - 2rem, 980px); margin-inline: auto; }
.muted { color: var(--ink-soft); }

.skip-link { position: absolute; left: -9999px; top: 0; background: var(--navy); color: #fff; padding: 0.5rem 1rem; z-index: 10; }
.skip-link:focus { left: 1rem; top: 1rem; color: #fff; }

/* ── Header ── */
.site-header { background: var(--navy); border-bottom: 4px solid var(--cyan); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: 0.75rem; }
.brand img { display: block; height: 58px; width: auto; }
.header-link { color: #fff; font-weight: 600; text-decoration: none; border: 1px solid rgba(255, 255, 255, 0.55); border-radius: 999px; padding: 0.4rem 1rem; font-size: 0.95rem; }
.header-link:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }

/* ── Intro ── */
.intro { padding: 2.25rem 0 1.25rem; }
.eyebrow { color: var(--blue); font-weight: 600; font-size: 0.85rem; letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: 0.5rem; }
.intro h1 { font-size: clamp(1.9rem, 4vw, 2.5rem); font-weight: 700; }
.lede { font-size: 1.15rem; color: var(--ink-soft); max-width: 46rem; }

.banner { border-radius: 10px; padding: 0.75rem 1rem; margin: 0 0 1rem; font-weight: 500; }
.banner-preview { background: var(--warn-bg); border: 1px solid var(--warn-line); color: var(--warn-ink); }

/* ── Cards & form ── */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.5rem; margin-bottom: 1.5rem; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.field label { display: block; font-weight: 600; color: var(--navy); margin-bottom: 0.4rem; }
.hint { color: var(--ink-soft); font-size: 0.92rem; margin: 0.9rem 0 1rem; }
.form-error { color: var(--bad-ink); background: var(--bad-bg); border: 1px solid var(--bad-line); border-radius: 8px; padding: 0.5rem 0.75rem; font-weight: 500; }

.btn { display: inline-flex; align-items: center; justify-content: center; font: inherit; font-weight: 700; border-radius: 10px; padding: 0.8rem 1.4rem; border: 0; cursor: pointer; text-decoration: none; transition: background-color 0.15s ease; }
.btn-primary { background: var(--navy); color: #fff; font-size: 1.05rem; }
.btn-primary:hover { background: var(--navy-dark); }
.btn-accent { background: var(--orange-strong); color: #fff; white-space: nowrap; }
.btn-accent:hover { background: #9c3914; color: #fff; }
.btn-link { background: none; border: 0; padding: 0.25rem 0; font: inherit; font-weight: 600; color: var(--blue); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }

/* ── Combobox ── */
.combobox { position: relative; }
.combobox input {
  width: 100%;
  font: inherit;
  color: var(--ink);
  padding: 0.75rem 2.75rem 0.75rem 0.9rem;
  border: 1.5px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
}
.combobox input:focus { outline: none; border-color: var(--blue); box-shadow: var(--focus); }
.combobox input::placeholder { color: #64748b; }
.combobox-toggle {
  position: absolute; right: 0.35rem; top: 50%; transform: translateY(-50%);
  width: 2.2rem; height: 2.2rem; border: 0; border-radius: 8px; background: transparent; cursor: pointer;
}
.combobox-toggle::before {
  content: ""; position: absolute; inset: 0; margin: auto; width: 0.55rem; height: 0.55rem;
  border-right: 2px solid var(--ink-soft); border-bottom: 2px solid var(--ink-soft); transform: translateY(-25%) rotate(45deg);
}
.combobox-toggle[aria-expanded="true"]::before { transform: translateY(15%) rotate(-135deg); }
.combobox-toggle:hover { background: var(--cyan-wash); }
[role="listbox"] {
  position: absolute; z-index: 5; left: 0; right: 0; top: calc(100% + 4px);
  max-height: 20rem; overflow-y: auto; margin: 0; padding: 0.3rem; list-style: none;
  background: #fff; border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: 0 12px 32px rgba(15, 23, 42, 0.16);
}
[role="option"] { padding: 0.5rem 0.65rem; border-radius: 7px; cursor: pointer; display: flex; flex-direction: column; }
[role="option"].is-active, [role="option"]:hover { background: var(--cyan-wash); }
[role="option"][aria-selected="true"] .option-label { font-weight: 700; color: var(--navy); }
.option-label { line-height: 1.35; }
.option-meta { font-size: 0.82rem; color: var(--ink-soft); }
.combobox-empty { padding: 0.6rem 0.65rem; color: var(--ink-soft); }

/* ── Results ── */
.results { outline: none; scroll-margin-top: 1rem; margin-bottom: 1.5rem; }
.verdict { border-radius: var(--radius); padding: 1.1rem 1.3rem; margin-bottom: 1.25rem; border: 1px solid; }
.verdict h2 { font-size: 1.35rem; margin-bottom: 0.25rem; color: inherit; }
.verdict p { margin: 0; }
.verdict-solid { background: var(--ok-bg); border-color: var(--ok-line); color: var(--ok-ink); }
.verdict-review { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn-ink); }
.verdict-change { background: var(--bad-bg); border-color: var(--bad-line); color: var(--bad-ink); }

.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; margin-bottom: 1.5rem; }
.choice-card { background: var(--card); border: 1px solid var(--line); border-top: 5px solid var(--info-dot); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.25rem 1.35rem; }
.choice-label { text-transform: uppercase; letter-spacing: 0.05em; font-size: 0.78rem; font-weight: 700; color: var(--ink-soft); margin-bottom: 0.2rem; }
.choice-card h3 { font-size: 1.3rem; }
.status { display: flex; align-items: center; gap: 0.5rem; margin: 0.75rem 0 0.5rem; }
.status-dot { width: 0.7rem; height: 0.7rem; border-radius: 50%; flex: none; background: var(--info-dot); }
.status-great, .status-good { border-top-color: var(--ok-dot); }
.status-great .status-dot, .status-good .status-dot { background: var(--ok-dot); }
.status-great .status strong, .status-good .status strong { color: var(--ok-ink); }
.status-info .status strong { color: var(--info-ink); }
.status-caution { border-top-color: var(--warn-dot); }
.status-caution .status-dot { background: var(--warn-dot); }
.status-caution .status strong { color: var(--warn-ink); }
.status-problem { border-top-color: var(--bad-dot); }
.status-problem .status-dot { background: var(--bad-dot); }
.status-problem .status strong { color: var(--bad-ink); }
.relation { font-weight: 500; color: var(--ink-soft); }
.relation-close, .relation-related { color: var(--ok-ink); }
.notes { margin: 0.5rem 0 0.75rem; padding: 0.75rem 0.9rem 0.75rem 1.9rem; background: var(--cyan-wash); border-radius: 10px; font-size: 0.95rem; }
.notes li + li { margin-top: 0.4rem; }
.uw-link { font-size: 0.92rem; margin: 0; }

.badges { list-style: none; display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.25rem 0 0; padding: 0; }
.badge { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.02em; padding: 0.2rem 0.6rem; border-radius: 999px; }
.badge-direct { background: var(--navy); color: #fff; }
.badge-open { background: #dcfce7; color: #14532d; }
.badge-minimum { background: #e0f2fe; color: #0c4a6e; }
.badge-capacity { background: #fef3c7; color: #78350f; }
.badge-exploratory { background: #f1f5f9; color: #334155; }

/* ── Alternates ── */
.alternates { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.5rem; margin-bottom: 1.5rem; }
.alternates > h2 { font-size: 1.35rem; }
.section-intro { color: var(--ink-soft); }
.tier { border-left: 5px solid var(--line-strong); padding: 0.25rem 0 0.25rem 1rem; margin-top: 1.4rem; }
.tier h3 { font-size: 1.1rem; margin-bottom: 0.1rem; }
.tier-desc { color: var(--ink-soft); font-size: 0.93rem; margin-bottom: 0.6rem; }
.tier-open { border-left-color: var(--ok-dot); }
.tier-minimum { border-left-color: var(--info-dot); }
.tier-capacity { border-left-color: var(--warn-dot); }
.tier-empty { color: var(--ink-soft); font-style: italic; }
.alt-list { list-style: none; margin: 0 0 0.25rem; padding: 0; display: grid; gap: 0.5rem; }
.alt-item { border: 1px solid var(--line); border-radius: 10px; padding: 0.6rem 0.85rem; }
.alt-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.alt-head a, .alt-head > span:first-child { font-weight: 700; }
.alt-reason { margin: 0.15rem 0 0; color: var(--ink-soft); font-size: 0.94rem; }
.closeness, .current-second { font-size: 0.75rem; font-weight: 700; padding: 0.1rem 0.5rem; border-radius: 999px; }
.closeness-1 { background: #e0f2fe; color: #0c4a6e; }
.closeness-2 { background: #f1f5f9; color: #475569; }
.current-second { background: var(--navy); color: #fff; }

/* ── CTA ── */
.cta { display: flex; align-items: center; justify-content: space-between; gap: 1.25rem; background: var(--navy); color: #fff; border-radius: var(--radius); padding: 1.4rem 1.5rem; border-bottom: 5px solid var(--orange); }
.cta h2 { color: #fff; font-size: 1.25rem; margin-bottom: 0.25rem; }
.cta p { margin: 0; color: #e2e8f0; }

/* ── Explainer ── */
.explainer h2 { font-size: 1.3rem; }
.types { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem; margin: 1rem 0; }
.type { border: 1px solid var(--line); border-left: 5px solid var(--line-strong); border-radius: 10px; padding: 0.7rem 0.9rem; }
.type dt { font-weight: 700; color: var(--navy); }
.type dd { margin: 0.15rem 0 0; color: var(--ink-soft); font-size: 0.95rem; }
.type-direct { border-left-color: var(--navy); }
.type-capacity { border-left-color: var(--warn-dot); }
.type-minimum { border-left-color: var(--info-dot); }
.type-open { border-left-color: var(--ok-dot); }

/* ── Footer ── */
.site-footer { border-top: 1px solid var(--line); background: #fff; color: var(--ink-soft); font-size: 0.88rem; padding: 1.5rem 0 2rem; margin-top: 1rem; }
.site-footer p { max-width: 60rem; }
.noscript { padding: 1rem; background: var(--warn-bg); border-radius: 10px; }

/* ── Small screens ── */
@media (max-width: 720px) {
  .fields, .choice-grid, .types { grid-template-columns: 1fr; }
  .cta { flex-direction: column; align-items: flex-start; }
  .brand img { height: 46px; }
  .header-link { font-size: 0.85rem; padding: 0.35rem 0.8rem; }
  .card, .alternates { padding: 1.15rem; }
  .btn-primary { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
