/* NYSAIS Job Fair Candidate Portal
   Brand: navy #1d4380 primary, orange #f4a72b accent, red #c53030 logout
   System fonts only. Vanilla CSS. */

:root {
  --bg: #f4f6fb;
  --bg-2: #eef1f8;
  --card: #ffffff;
  --ink: #14213d;
  --ink-2: #2a3553;
  --muted: #5b6479;
  --muted-2: #7a8398;
  --border: #dde2ee;
  --border-2: #e8ecf4;
  --primary: #1d4380;
  --primary-deep: #15336a;
  --primary-soft: #eaf0fa;
  --primary-ink: #ffffff;
  --accent: #f4a72b;
  --accent-soft: #fff4dc;
  --accent-ink: #7a4f00;
  --danger: #c53030;
  --danger-deep: #9b2424;
  --danger-soft: #fde8e8;
  --success: #1d8a3a;
  --success-soft: #e6f6ec;
  --warn: #b06b00;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .04);
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 6px 20px rgba(20, 33, 61, .06);
  --shadow-lg: 0 4px 14px rgba(20, 33, 61, .08), 0 18px 40px rgba(20, 33, 61, .10);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, h4 { color: var(--ink); letter-spacing: -0.01em; }
h1 { font-size: 30px; line-height: 1.15; margin: 0 0 6px; font-weight: 700; }
h2 { font-size: 20px; line-height: 1.25; margin: 0 0 14px; font-weight: 650; }
h3 { font-size: 16px; margin: 0 0 8px; font-weight: 600; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--muted); }
.muted-2 { color: var(--muted-2); }
.small { font-size: 12px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.container { max-width: 1280px; margin: 0 auto; padding: 0 24px; }
hr.rule { border: 0; border-top: 1px solid var(--border); margin: 24px 0; }

/* ---------- Top bar ---------- */
.topbar {
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 1px 0 rgba(20, 33, 61, .02);
}
.topbar-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 700; }
.brand:hover { text-decoration: none; }
.brand-torch {
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary) 0%, #2a5aa3 100%);
  color: #fff; font-weight: 800; font-size: 13px;
  box-shadow: 0 2px 6px rgba(29, 67, 128, .25);
}
.brand-mark { color: var(--primary); font-weight: 800; letter-spacing: 0.04em; }
.brand-sub { color: var(--muted); font-weight: 500; font-size: 14px; margin-left: 2px; }
.topnav { display: flex; align-items: center; gap: 14px; }
.who { color: var(--muted); font-size: 13px; line-height: 1.3; text-align: right; }
.who .name { color: var(--ink); font-weight: 600; display: block; }
.who .school { color: var(--muted-2); }
.logout-form { display: inline; margin: 0; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  background:
    linear-gradient(135deg, rgba(20, 33, 61, .82) 0%, rgba(29, 67, 128, .72) 55%, rgba(42, 90, 163, .55) 100%),
    radial-gradient(1200px 280px at 80% 0%, rgba(244, 167, 43, .25), transparent 60%),
    linear-gradient(180deg, #1d4380, #14213d);
  color: #fff;
  border-bottom: 4px solid var(--accent);
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute; inset: 0;
  background-image:
    radial-gradient(circle at 12% 18%, rgba(255,255,255,.07) 0 2px, transparent 3px),
    radial-gradient(circle at 78% 62%, rgba(255,255,255,.05) 0 2px, transparent 3px),
    radial-gradient(circle at 42% 88%, rgba(255,255,255,.05) 0 2px, transparent 3px);
  pointer-events: none;
}
.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 1280px;
  margin: 0 auto;
  padding: 38px 24px 30px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  flex-wrap: wrap;
}
.hero-eyebrow {
  display: inline-block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: rgba(255, 255, 255, .82);
  font-weight: 600;
  margin-bottom: 6px;
}
.hero h1 {
  color: #fff;
  font-size: 36px;
  line-height: 1.1;
  margin: 0 0 8px;
  font-weight: 750;
  letter-spacing: -0.02em;
}
.hero .subtitle { color: rgba(255, 255, 255, .85); margin: 0; font-size: 15px; }
.hero .subtitle strong { color: #fff; font-weight: 600; }
.hero-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.hero-meta {
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .22);
  color: #fff;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  line-height: 1.4;
  backdrop-filter: blur(6px);
}
.hero-meta .lbl { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em; color: rgba(255,255,255,.7); }
.hero-meta .val { font-weight: 600; }

/* ---------- Layout ---------- */
.page { padding: 28px 0 56px; }
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.page-head h2 { margin: 0; font-size: 22px; }
.match-summary { color: var(--muted); font-size: 14px; margin-top: 4px; }
.match-summary strong { color: var(--ink); font-weight: 700; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  line-height: 1.2;
  transition: background .12s ease, border-color .12s ease, color .12s ease, box-shadow .12s ease, transform .04s ease;
  white-space: nowrap;
}
.btn:hover { border-color: var(--primary); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.btn-primary {
  background: var(--primary);
  color: var(--primary-ink);
  border-color: var(--primary);
  box-shadow: 0 2px 6px rgba(29, 67, 128, .25);
  font-weight: 600;
}
.btn-primary:hover { background: var(--primary-deep); border-color: var(--primary-deep); color: #fff; }
.btn-secondary {
  background: #fff;
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 600;
}
.btn-secondary:hover { background: var(--primary-soft); }
.btn-outline {
  background: #fff;
  border-color: var(--border);
  color: var(--ink-2);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: rgba(29, 67, 128, .08); color: var(--primary); border-color: transparent; }
.btn-danger {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(197, 48, 48, .25);
}
.btn-danger:hover { background: var(--danger-deep); border-color: var(--danger-deep); color: #fff; }
.btn-danger-outline {
  background: #fff;
  color: var(--danger);
  border-color: var(--danger);
  font-weight: 600;
}
.btn-danger-outline:hover { background: var(--danger); color: #fff; }
.btn-sm { padding: 6px 11px; font-size: 13px; }
.btn-lg { padding: 11px 22px; font-size: 15px; }

/* ---------- Card ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-2);
}
.card-header h2 { margin: 0; }

/* ---------- Alerts ---------- */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); margin: 12px 0; line-height: 1.5; }
.alert-success { background: var(--success-soft); color: var(--success); border: 1px solid #c9e9d3; }
.alert-error { background: var(--danger-soft); color: var(--danger); border: 1px solid #f4c1bc; }

/* ---------- Login ---------- */
.login-card {
  max-width: 480px;
  margin: 64px auto;
  padding: 32px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}
.login-card h1 { margin: 0 0 8px; font-size: 26px; }
.form { display: flex; flex-direction: column; gap: 14px; margin-top: 16px; }
.form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 600;
  color: var(--ink-2);
  font-size: 13px;
  letter-spacing: 0.01em;
}
.form input,
.form textarea,
.form select,
textarea,
.filter-grid input,
.filter-grid select {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: #fff;
  font: inherit;
  color: var(--ink);
  transition: border-color .12s ease, box-shadow .12s ease;
}
.form input:focus,
textarea:focus,
.filter-grid input:focus,
.filter-grid select:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(29, 67, 128, .15);
}

/* ---------- Filter card (the marquee piece) ---------- */
.filter-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px;
  margin-bottom: 22px;
  position: relative;
}
.filter-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary) 0%, var(--primary) 60%, var(--accent) 100%);
  border-radius: var(--radius) var(--radius) 0 0;
}
.filter-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, .8fr);
  gap: 14px 14px;
  align-items: end;
}
.filter-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0;
  min-width: 0;
}
.filter-grid input,
.filter-grid select { font-weight: 400; text-transform: none; letter-spacing: 0; font-size: 14px; width: 100%; min-width: 0; }
.filter-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px dashed var(--border-2);
  flex-wrap: wrap;
}
.filter-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-spacer { flex: 1; }

/* Filter pill chips (the discoverable toggles) */
.chip-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--ink-2);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background .12s, border-color .12s, color .12s, box-shadow .12s;
  text-decoration: none;
  line-height: 1.2;
}
.chip-toggle:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }
.chip-toggle .ico { line-height: 1; }
.chip-toggle.active {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary-deep);
  font-weight: 600;
  box-shadow: inset 0 0 0 1px var(--primary);
}
.chip-toggle .count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  padding: 0 6px;
  height: 18px;
  border-radius: 9px;
  background: var(--border-2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  margin-left: 2px;
}
.chip-toggle.active .count { background: var(--primary); color: #fff; }

/* Favorites pill specifically uses the heart/orange tint when active */
.chip-toggle.chip-fav.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-ink);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.chip-toggle.chip-fav.active .count { background: var(--accent); color: #fff; }

/* ---------- Data table ---------- */
.list-wrap {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
  table-layout: auto;
  font-size: 13px;
}
.data-table th, .data-table td { vertical-align: top; }
.data-table thead th { padding: 10px 8px; }
.data-table tbody td { padding: 11px 8px; }
.data-table th:first-child, .data-table td:first-child { padding-left: 12px; padding-right: 4px; width: 40px; }
.data-table th:last-child, .data-table td:last-child { padding-right: 12px; }
.data-table .col-narrow { max-width: 90px; word-wrap: break-word; }
.data-table .col-tight { width: 1%; white-space: nowrap; }
.data-table .col-actions { width: 1%; white-space: nowrap; }
.row-actions { display: inline-flex; align-items: center; gap: 4px; }
.row-actions .pill { min-width: 28px; height: 28px; padding: 0 6px; }
.row-actions .resume-btn { margin-left: 6px; padding: 5px 10px; font-size: 12.5px; }
.data-table thead th {
  text-align: left;
  padding: 12px 14px;
  background: #f7f9fd;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 700;
}
.data-table tbody td {
  padding: 14px;
  border-bottom: 1px solid var(--border-2);
  vertical-align: top;
  font-size: 14px;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: #f8fafd; }
.data-table .row-reviewed td { background: #fbfcff; }
.data-table .row-reviewed .cand-name { color: var(--muted); }

.cand-name { font-weight: 600; color: var(--ink); font-size: 14.5px; }
.cand-name:hover { color: var(--primary); text-decoration: none; }
.cand-email { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.pronouns { font-size: 12px; color: var(--muted); margin-left: 6px; font-weight: 400; }

/* Subject pair */
.subject-pair { display: flex; flex-direction: column; gap: 4px; }
.subject-1 { font-weight: 500; color: var(--ink); }
.subject-1 .other { color: var(--muted); font-weight: 400; font-size: 12.5px; }
.subject-2 {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--muted);
}
.subject-2::before {
  content: "2nd";
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 1px 5px;
  border-radius: 3px;
  background: var(--bg-2);
  color: var(--muted-2);
}

/* ---------- Avatar ---------- */
.avatar {
  display: inline-flex;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, #2a5aa3 100%);
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.04em;
  box-shadow: 0 1px 3px rgba(20, 33, 61, .18);
  flex-shrink: 0;
}
.avatar.avatar-lg { width: 56px; height: 56px; font-size: 17px; }

/* ---------- Chips (data presentation) ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--primary-soft);
  border: 1px solid #d6e0f1;
  color: var(--primary-deep);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  white-space: nowrap;
}
.chip-grade { background: #fff5e0; border-color: #f1d99a; color: var(--accent-ink); }
.chip-region { background: #eaf6ee; border-color: #c9e3d3; color: #155f2c; }
.chip-muted { background: var(--bg-2); border-color: var(--border); color: var(--muted); }
.chip-empty { color: var(--muted); font-size: 13px; }

/* ---------- Status pills (in table row) ---------- */
.status-pills { display: inline-flex; gap: 6px; align-items: center; }
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 30px;
  padding: 0 9px;
  border-radius: 15px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  line-height: 1;
  color: var(--muted-2);
  transition: background .12s, border-color .12s, color .12s, transform .04s;
}
.pill:hover { border-color: var(--primary); color: var(--primary); }
.pill:active { transform: scale(0.96); }
.pill.pill-fav.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.pill.pill-rev.active {
  background: var(--success-soft);
  border-color: var(--success);
  color: var(--success);
}
.pill.pill-note {
  background: var(--primary-soft);
  border-color: #cdd7e8;
  color: var(--primary);
  cursor: default;
}

/* ---------- Pager ---------- */
.pager {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  margin: 24px 0 8px;
}

/* ---------- Empty state ---------- */
.empty {
  background: #fff;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 48px 24px;
  text-align: center;
  color: var(--muted);
}
.empty h3 { color: var(--ink-2); margin-bottom: 6px; }

/* ---------- Candidate detail ---------- */
.detail-back { margin-bottom: 14px; }
.detail-head {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  display: flex;
  gap: 18px;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.detail-head::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
}
.detail-head-main { display: flex; gap: 16px; align-items: flex-start; flex: 1 1 360px; }
.detail-head-text h1 { margin: 4px 0 6px; font-size: 26px; }
.detail-head-text .contact { color: var(--muted); font-size: 14px; margin: 0 0 4px; }
.detail-head-text .contact a { color: var(--primary); }
.detail-head-text .location { color: var(--muted); font-size: 13px; margin: 0; }
.detail-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.detail-actions .pill { height: 38px; min-width: 0; padding: 0 16px; border-radius: 20px; font-size: 13px; font-weight: 500; }
.detail-actions .pill .lbl { margin-left: 4px; }

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: start;
}
.detail-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.detail-side { display: flex; flex-direction: column; gap: 16px; }
.side-card { padding: 18px 20px; }
.side-card h3 { margin: 0 0 10px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }

.kv {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 10px 18px;
  margin: 0;
  font-size: 14px;
}
.kv dt {
  color: var(--muted);
  font-weight: 500;
  font-size: 13px;
  padding-top: 2px;
}
.kv dd { margin: 0; color: var(--ink); }
.kv dd.prewrap { white-space: pre-wrap; }
.kv-stack dt { padding-top: 0; }
.kv-stack { grid-template-columns: 1fr; gap: 4px 0; }
.kv-stack dt { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; }
.kv-stack dd { margin-bottom: 10px; }
.kv-stack dd:last-child { margin-bottom: 0; }

.resume-text {
  white-space: pre-wrap;
  background: #fafbfd;
  border: 1px solid var(--border);
  padding: 16px;
  border-radius: var(--radius-sm);
  max-height: 540px;
  overflow: auto;
  font: 13px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--ink-2);
}

.notes-row { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
#notes-area {
  width: 100%;
  resize: vertical;
  min-height: 120px;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font: inherit;
  background: #fffdf6;
}
#notes-area:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(29, 67, 128, .15); background: #fff; }

/* ---------- Footer ---------- */
.sitefoot {
  margin-top: 56px;
  padding: 28px 0;
  border-top: 1px solid var(--border);
  background: #fff;
}
.sitefoot p { margin: 0; color: var(--muted); font-size: 13px; }
.sitefoot a { color: var(--primary); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .detail-grid { grid-template-columns: 1fr; }
  .filter-grid { grid-template-columns: 1fr 1fr 1fr; }
  .filter-grid .filter-search { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  .container { padding: 0 16px; }
  .hero-inner { padding: 28px 16px 22px; }
  .hero h1 { font-size: 26px; }
  .topbar-inner { padding: 12px 16px; }
  .who { display: none; }
  .filter-grid { grid-template-columns: 1fr; }
  .data-table thead { display: none; }
  .data-table, .data-table tbody, .data-table tr, .data-table td { display: block; }
  .data-table tr { border-bottom: 1px solid var(--border); padding: 12px 4px; }
  .data-table td { border: none; padding: 4px 12px; }
  .kv { grid-template-columns: 1fr; gap: 4px; }
  .kv dt { padding-top: 8px; }
  .detail-head-main { flex: 1 1 100%; }
  .detail-actions { width: 100%; }
}

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