/* =================================================================
   JOB2ROAM — JOB BOARD, INSTITUTIONAL REDESIGN
   Sharp-cornered, navy + orange, editorial. Matches homepage.
   No purple, no ambient blobs, no rounded everything.
   All class/ID hooks preserved for app.js + firebase.js.
   ================================================================= */

* {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}

:root {
  --ink: #0f1d3d;
  --ink-soft: #33405e;
  --inkSoft: #33405e;          /* legacy alias */
  --muted: #6b7896;
  --brand: #1a2c5b;
  --brand-deep: #122142;
  --brandDeep: #122142;        /* legacy alias */
  --brandLight: #f6f7f9;
  --accent: #f27024;
  --accent-deep: #d85f17;
  --accentLight: rgba(242, 112, 36, 0.08);
  --accentSoft: rgba(242, 112, 36, 0.18);
  --selectedBg: var(--accentLight);
  --selectedBorder: var(--accent);
  --selectedPill: var(--accent-deep);
  --selectedPillBg: var(--accentLight);
  --surface: #ffffff;
  --surfaceAlt: #f6f7f9;
  --border: #d9dde5;
  --radius: 0px;
}

body {
  font-family: Inter, system-ui, -apple-system, sans-serif;
  background: var(--surface);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 {
  font-family: "Space Grotesk", Inter, system-ui, sans-serif;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--ink);
}

#progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0%;
  z-index: 70;
  background: var(--accent);
  transition: width 120ms linear;
}

/* =================================================================
   HERO BAND — flat navy, single orange rule, no radial glow
   ================================================================= */
.hero-band {
  background: var(--ink);
  position: relative;
  overflow: hidden;
  border-bottom: 3px solid var(--accent);
}
.hero-band::before,
.hero-band::after { content: none; }

/* =================================================================
   FILTER STRIP — flat, hard border, squared controls
   ================================================================= */
.filter-strip {
  background: var(--surface);
  border-bottom: 1px solid var(--ink);
  position: sticky;
  top: 64px;
  z-index: 10;
  box-shadow: none;
}
.filter-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
  padding-right: 18px;
  border-right: 2px solid var(--accent);
  flex-shrink: 0;
}
.filter-label svg { color: var(--accent); stroke-width: 2.4; }

.filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  white-space: nowrap;
  box-shadow: none;
}
.filter-btn:hover {
  border-color: var(--ink);
  background: var(--surfaceAlt);
  transform: none;
  box-shadow: none;
}
.filter-btn.is-open {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  box-shadow: none;
}
.filter-btn.is-open .ic,
.filter-btn.is-open .chev { color: #fff; }
.filter-btn .chev {
  color: var(--muted);
  transition: transform 0.2s ease;
}
.filter-btn.is-open .chev { transform: rotate(180deg); }
.filter-btn .ic { color: var(--brand); }

/* Filter dropdown menu — square, hard border, flat offset shadow */
.filter-menu {
  position: fixed;
  z-index: 9999;
  width: 320px;
  background: #fff;
  border: 1px solid var(--ink);
  border-radius: 0;
  box-shadow: 8px 8px 0 rgba(15, 29, 61, 0.1);
  padding: 6px;
  animation: filterMenuIn 160ms ease;
}
.filter-menu.hidden { display: none; }
@keyframes filterMenuIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.opt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 0;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink);
  transition: background 0.12s ease, border-color 0.12s ease;
  cursor: pointer;
  user-select: none;
  border-left: 2px solid transparent;
}
.opt:hover {
  background: var(--surfaceAlt);
  border-left-color: var(--accent);
  transform: none;
}
.opt small {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  transition: color 0.12s ease;
}
.opt.on {
  background: var(--accentLight);
  color: var(--accent-deep);
  font-weight: 700;
  border-left-color: var(--accent);
  box-shadow: none;
}
.opt.on small { color: var(--accent-deep); font-weight: 700; }
.opt input[type="checkbox"] { cursor: pointer; accent-color: var(--accent); }

/* =================================================================
   JOB LIST CARD — flat, hard border, accent on active
   ================================================================= */
.joblist-card {
  width: 100%;
  text-align: left;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 0;
  padding: 22px;
  transition: border-color 0.15s ease, background 0.15s ease;
  cursor: pointer;
  display: block;
  margin-bottom: 10px;
  position: relative;
}
.joblist-card:hover {
  border-color: var(--ink);
  box-shadow: none;
}
.joblist-card.is-active {
  background: var(--surfaceAlt);
  border-color: var(--ink);
  border-left: 3px solid var(--accent);
}
.joblist-card.is-active .job-title { color: var(--ink); }

.job-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 0;
  background: var(--surfaceAlt);
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
}
.joblist-card.is-active .tag-pill { background: #fff; }
.tag-pill svg { color: var(--muted); flex-shrink: 0; }

.new-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 11px;
  border-radius: 0;
  background: var(--accentLight);
  color: var(--accent-deep);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: 1px solid var(--accent);
}
.timeago { font-size: 12px; color: var(--muted); font-weight: 600; }

/* =================================================================
   DETAIL PANE
   ================================================================= */
.detail-pane { background: #fff; padding: 0 8px; }

.apply-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 15px 48px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 0;
  border: 1px solid var(--accent);
  cursor: pointer;
  transition: background 0.15s ease;
}
.apply-btn:hover { background: var(--accent-deep); border-color: var(--accent-deep); transform: none; box-shadow: none; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px; height: 52px;
  background: #fff;
  border: 1px solid var(--ink);
  border-radius: 0;
  cursor: pointer;
  color: var(--ink);
  transition: background 0.15s ease, color 0.15s ease;
}
.icon-btn:hover { background: var(--ink); color: #fff; }

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  color: var(--ink-soft);
  font-size: 14px;
}
.meta-row .item { display: inline-flex; align-items: center; gap: 8px; }
.meta-row .item svg { color: var(--muted); flex-shrink: 0; }

/* Results header */
.results-head {
  padding: 0 0 16px;
  border-bottom: 2px solid var(--ink);
}
.results-head h2 { font-size: 22px; font-weight: 800; color: var(--ink); letter-spacing: -0.025em; }
.results-head .count { font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); margin-top: 4px; }

/* Scrollbar */
.scrollbar-thin::-webkit-scrollbar { width: 6px; }
.scrollbar-thin::-webkit-scrollbar-thumb { background: #cdd5e4; border-radius: 0; }
.scrollbar-thin::-webkit-scrollbar-track { background: transparent; }

/* =================================================================
   SYSTEM OVERLAY — squared card, no blur
   ================================================================= */
#systemOverlay {
  position: fixed;
  inset: 0;
  z-index: 10001 !important;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 29, 61, 0.55);
}
#systemOverlay.show { display: flex; }
.sys-card {
  width: 100%;
  max-width: 500px;
  border-radius: 0;
  background: var(--surface);
  box-shadow: 12px 12px 0 rgba(15, 29, 61, 0.12);
  border: 1px solid var(--ink);
  overflow: hidden;
}
.spinner {
  width: 28px; height: 28px;
  border-radius: 0;
  border: 2.5px solid var(--border);
  border-top-color: var(--accent);
  animation: spin 800ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.fadein { animation: fadein 200ms ease-out both; }
@keyframes fadein {
  from { transform: translateY(4px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

/* Form fields — squared, orange focus */
.field {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0;
  box-shadow: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accentLight);
}

.hairline { height: 1px; background: var(--ink); }

/* =================================================================
   ADVERTISE FRAME — squared, dashed accent border
   ================================================================= */
.advertise-frame {
  position: relative;
  border-radius: 0;
  background: var(--surfaceAlt);
  border: 2px dashed var(--accent);
  overflow: hidden;
}
.advertise-frame::before { content: none; }

.page-wrap {
  max-width: 1560px;
  margin: 0 auto;
  padding: 0 20px;
}
@media (min-width: 768px) { .page-wrap { padding: 0 32px; } }
@media (min-width: 1280px) { .page-wrap { padding: 0 48px; } }
@media (max-width: 1024px) { .filter-strip { position: static; } }

/* =================================================================
   SAAS HEADER — flat white, hard 1px rule, squared (matches homepage)
   ================================================================= */
.saas-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--surface);
  border-bottom: 1px solid var(--ink);
  font-family: Inter, system-ui, -apple-system, sans-serif;
}
.saas-header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 8px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}
.saas-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
}
.saas-brand img { height: 84px; width: auto; }
.saas-nav { display: flex; align-items: center; gap: 2px; }
.saas-nav-item { position: relative; }
.saas-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ink-soft);
  text-decoration: none;
  border-radius: 0;
  cursor: pointer;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.saas-nav-link:hover,
.saas-nav-item:hover > .saas-nav-link {
  color: var(--ink);
  background: none;
  border-bottom-color: var(--accent);
}
.saas-nav-link.is-active {
  color: var(--ink);
  border-bottom-color: var(--ink);
}
.saas-nav-chevron { transition: transform 0.2s ease; color: var(--muted); }
.saas-nav-item:hover .saas-nav-chevron { transform: rotate(180deg); color: var(--ink-soft); }

.saas-dropdown {
  position: absolute;
  top: calc(100% + 1px);
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  min-width: 300px;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--ink);
  border-radius: 0;
  box-shadow: 8px 8px 0 rgba(15, 29, 61, 0.08);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease;
}
.saas-nav-item:hover .saas-dropdown,
.saas-nav-item:focus-within .saas-dropdown {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
.saas-dropdown::before { content: ""; position: absolute; top: -10px; left: 0; right: 0; height: 10px; }
.saas-dropdown-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 12px;
  border-radius: 0;
  text-decoration: none;
  color: var(--ink);
  border-left: 2px solid transparent;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.saas-dropdown-item:hover { background: var(--surfaceAlt); border-left-color: var(--accent); }
.saas-dropdown-icon {
  flex-shrink: 0;
  width: 34px; height: 34px;
  border-radius: 0;
  background: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.saas-dropdown-title { font-size: 13.5px; font-weight: 700; color: var(--ink); letter-spacing: -0.01em; line-height: 1.3; }
.saas-dropdown-desc { font-size: 12.5px; color: var(--muted); margin-top: 2px; line-height: 1.4; }

.saas-actions { display: flex; align-items: center; gap: 8px; }
.saas-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #fff;
  background: var(--accent);
  border: 1px solid var(--accent);
  cursor: pointer;
  border-radius: 0;
  text-decoration: none;
  box-shadow: none;
  transition: background 0.15s ease;
}
.saas-cta:hover { background: var(--accent-deep); border-color: var(--accent-deep); }
.saas-cta:active { transform: translateY(1px); }
.saas-cta svg { transition: transform 0.2s ease; }
.saas-cta:hover svg { transform: translateX(2px); }

#loginTooltip {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  padding: 4px 8px;
  background: var(--ink);
  color: #fff;
  font-size: 11px;
  border-radius: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  white-space: nowrap;
}
.saas-signin:hover #loginTooltip { opacity: 1; }

.saas-mobile-login,
.saas-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border-radius: 0;
  background: var(--surface);
  border: 1px solid var(--ink);
  color: var(--ink);
  cursor: pointer;
  transition: background 0.15s ease;
}
.saas-mobile-login:hover, .saas-menu-btn:hover { background: var(--surfaceAlt); }

@media (max-width: 900px) {
  .saas-nav, .saas-signin { display: none; }
  .saas-mobile-login, .saas-menu-btn { display: inline-flex; }
  .saas-header-inner { padding: 8px 18px; }
  .saas-brand img { height: 64px; }
}

/* =================================================================
   AMBIENT BG — neutralized (was purple/blue blobs)
   ================================================================= */
.ambient-bg { position: relative; overflow-x: clip; }
.ambient-bg::before, .ambient-bg::after { content: none; }

/* =================================================================
   FOOTER alt-mail callout — squared, orange accent (was blue)
   ================================================================= */
.alternativeMail {
  margin-top: 1.5rem;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  background: var(--surfaceAlt);
  border-radius: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-soft);
}
.alternativeMail p { font-size: 0.7rem; }
.alternativeMail a { color: var(--accent); font-weight: 700; text-decoration: none; }
.alternativeMail a:hover { text-decoration: underline; }

/* =================================================================
   LOAD MORE BUTTON — squared
   ================================================================= */
.load-more-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 32px;
  background: #fff;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: 0;
  border: 1px solid var(--accent);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.load-more-btn:hover { background: var(--accent); color: #fff; transform: none; box-shadow: none; }
.load-more-btn:active { transform: translateY(1px); }

/* =================================================================
   MODALS — all squared
   ================================================================= */
#loadMoreOverlay.show { opacity: 1; pointer-events: auto; }
#loadMoreModal.show { opacity: 1; pointer-events: auto; }

.modal-box,
#loadMoreModal,
#applyCard,
#shareCard,
#loadMoreModal .bg-white,
#loadMoreModal .rounded-2xl,
#applyModal .rounded-2xl,
#shareModal .rounded-2xl,
#applyCard .rounded-xl,
#applyModal .field,
#shareCard .rounded-xl {
  border-radius: 0 !important;
}
#loadMoreModal .spinner { width: 48px; height: 48px; }

/* Word counter / validation states (unchanged behavior, kept) */
#wordCountDisplay { transition: color 200ms ease; }
#wordCountDisplay.warning { color: #f59e0b; font-weight: 700; animation: pulse-warning 0.5s ease; }
#wordCountDisplay.error { color: #ef4444; font-weight: 700; animation: pulse-error 0.5s ease; }
@keyframes pulse-warning { 0%,100% { opacity: 1; } 50% { opacity: 0.7; } }
@keyframes pulse-error { 0%,100% { opacity: 1; } 50% { opacity: 0.6; } }
#apply_message { transition: border-color 150ms ease; }
#apply_message.char-limit-warning { border: 1px solid #f59e0b; }
#apply_message.char-limit-error { border: 1px solid #ef4444; }
.char-counter { font-size: 0.75rem; font-weight: 600; transition: color 150ms ease; }
.char-counter.warning { color: #f59e0b; font-weight: 700; }
.char-counter.error { color: #ef4444; font-weight: 700; }
#apply_name.input-warning, #apply_email.input-warning, #apply_wechat.input-warning { border: 1px solid #f59e0b; }
#apply_name.input-error, #apply_email.input-error, #apply_wechat.input-error { border: 1px solid #ef4444; }

/* Z-index stack (preserved) */
.filter-strip { z-index: 10 !important; }
#applyModal { z-index: 9999 !important; }
#applyBackdrop { z-index: 9999 !important; }
#applyCard { z-index: 10000 !important; }
#shareModal { z-index: 9998 !important; }
#loadMoreOverlay, #loadMoreModal { z-index: 9997 !important; }