:root {
  --bg: #f7f9fc;
  --surface: #ffffff;
  --text: #142033;
  --muted: #64748b;
  --line: #e6eaf0;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --soft-blue: #eef4ff;
  --green: #16855b;
  --green-bg: #ebfaf4;
  --amber: #9a6700;
  --amber-bg: #fff7df;
}

* {
  box-sizing: border-box;
}

button,
input,
select {
  font: inherit;
}

.jobs-hero {
  background:
    radial-gradient(circle at 75% -30%, #dbeafe 0, transparent 42%),
    linear-gradient(180deg, #fff 0%, #f8fbff 100%);
  border-bottom: 1px solid var(--line);
}

.jobs-hero-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 58px 24px 54px;
}

.jobs-eyebrow {
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.2px;
  margin-bottom: 12px;
}

.jobs-hero h1 {
  margin: 0;
  max-width: 680px;
  font-size: clamp(38px, 5vw, 54px);
  line-height: 1.05;
  letter-spacing: -2px;
}

.jobs-hero p {
  max-width: 620px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.65;
}

.jobs-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 34px 24px 70px;
}

.job-filter-card {
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 6px 30px rgba(15, 23, 42, 0.04);
}

.search-field {
  position: relative;
}

.search-field input {
  width: 100%;
  height: 54px;
  padding: 0 18px 0 47px;
  border: 1px solid #dce2ea;
  border-radius: 12px;
  outline: none;
  font-size: 15px;
  color: var(--text);
  background: #fff;
}

.search-field input:focus,
.filter-grid select:focus {
  border-color: #8bb3ff;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.08);
}

.search-icon {
  position: absolute;
  left: 17px;
  top: 50%;
  transform: translateY(-50%);
  color: #8795a8;
  font-size: 24px;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 13px;
  margin-top: 15px;
}

.filter-grid label span {
  display: block;
  margin: 0 0 7px 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.filter-grid select {
  width: 100%;
  height: 46px;
  padding: 0 12px;
  border: 1px solid #dce2ea;
  border-radius: 10px;
  outline: none;
  color: #334155;
  background: #fff;
}

.filter-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 17px;
}

.primary-button {
  min-width: 135px;
  height: 44px;
  padding: 0 20px;
  border: 0;
  border-radius: 10px;
  background: var(--primary);
  color: white;
  font-weight: 700;
  cursor: pointer;
}

.primary-button:hover {
  background: var(--primary-dark);
}

.clear-button {
  color: #64748b;
  font-size: 14px;
  font-weight: 600;
}

.jobs-toolbar {
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.jobs-toolbar h2 {
  margin: 0;
  font-size: 20px;
  letter-spacing: -0.4px;
}

.jobs-toolbar p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.match-profile-link {
  color: var(--primary);
  font-size: 14px;
  font-weight: 700;
}

.job-list {
  display: grid;
  gap: 14px;
}

.job-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  gap: 24px;
  padding: 25px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}

.job-card:hover {
  border-color: #d7e0ed;
  box-shadow: 0 12px 35px rgba(15, 23, 42, 0.055);
  transform: translateY(-1px);
}

.job-company-row {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 17px;
}

.company-avatar {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 10px;
  background: var(--soft-blue);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 800;
  overflow: hidden;
}

.company-avatar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.company-name {
  font-size: 14px;
  font-weight: 700;
}

.job-source {
  margin-top: 2px;
  color: #8491a3;
  font-size: 11px;
}

.job-title {
  display: inline-block;
  margin-bottom: 11px;
  font-size: 19px;
  line-height: 1.35;
  letter-spacing: -0.35px;
  font-weight: 760;
}

.job-title:hover {
  color: var(--primary);
}

.job-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.job-meta span {
  padding: 5px 9px;
  border-radius: 7px;
  background: #f5f7fa;
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
}

.job-summary {
  max-width: 780px;
  margin: 15px 0 0;
  color: #627086;
  font-size: 14px;
  line-height: 1.65;
}

.job-card-side {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 9px;
}

.match-badge {
  margin: 0 auto 5px;
  text-align: center;
}

.match-badge strong {
  display: block;
  font-size: 21px;
}

.match-badge span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.match-badge.strong strong {
  color: var(--green);
}

.match-badge.potential strong {
  color: var(--amber);
}

.view-job-button,
.save-job-button {
  width: 100%;
  min-height: 40px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
}

.view-job-button {
  background: var(--primary);
  color: white;
}

.view-job-button:hover {
  background: var(--primary-dark);
}

.saved-toggle-form {
  margin: 0;
}

.save-job-button {
  border: 1px solid #dce2ea;
  background: #fff;
  color: #526176;
  cursor: pointer;
}

.save-job-button:hover {
  background: #f8fafc;
}

.jobs-empty {
  padding: 70px 30px;
  text-align: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
}

.empty-icon {
  margin-bottom: 9px;
  color: #94a3b8;
  font-size: 36px;
}

.jobs-empty h3 {
  margin: 0;
  font-size: 21px;
}

.jobs-empty p {
  margin: 8px 0 18px;
  color: var(--muted);
}

.jobs-empty a {
  color: var(--primary);
  font-weight: 700;
}

.pagination {
  margin-top: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
}

.page-link {
  min-width: 100px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  text-align: center;
  color: #475569;
  font-size: 13px;
  font-weight: 700;
}

.page-link:hover:not(.disabled) {
  border-color: #cbd5e1;
}

.page-link.disabled {
  opacity: 0.42;
  cursor: default;
}

.page-status {
  color: var(--muted);
  font-size: 13px;
}

.jobs-loading {
  opacity: 0.45;
  pointer-events: none;
}

@media (max-width: 850px) {
  .filter-grid {
    grid-template-columns: 1fr 1fr;
  }

  .job-card {
    grid-template-columns: 1fr;
  }

  .job-card-side {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .match-badge {
    grid-column: 1 / -1;
  }

  .fj-nav-links a:not(.active):not(.nav-cta),
  }

@media (max-width: 600px) {
  .jobs-hero-inner {
    padding: 41px 18px 38px;
  }

  .jobs-hero h1 {
    letter-spacing: -1.3px;
  }

  .jobs-shell {
    padding: 21px 14px 50px;
  }

  .job-filter-card {
    padding: 15px;
  }

  .filter-grid {
    grid-template-columns: 1fr;
  }

  .filter-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .primary-button {
    width: 100%;
  }

  .clear-button {
    text-align: center;
  }

  .jobs-toolbar {
    padding: 20px 2px;
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
  }

  .job-card {
    padding: 19px;
  }

  .job-card-side {
    grid-template-columns: 1fr;
  }

  .match-badge {
    grid-column: auto;
  }

  .pagination {
    gap: 8px;
  }

  .page-status {
    padding: 0 5px;
    text-align: center;
  }
}

/* Browse Jobs uses the shared FindJobs design system */
body {
  background: #f7f9fc;
}

.jobs-hero {
  margin-top: 0;
}

.jobs-shell,
.jobs-hero-inner {
  width: 100%;
}

/* --- Browse Jobs polish --- */

.jobs-hero-inner,
.jobs-shell {
  max-width: 1180px;
}

.jobs-hero-inner {
  padding-top: 38px;
  padding-bottom: 34px;
}

.jobs-hero h1 {
  font-size: 42px;
  line-height: 1.08;
  letter-spacing: -1.4px;
}

.jobs-hero p {
  margin-top: 10px;
  font-size: 15px;
}

.jobs-shell {
  padding-top: 28px;
}

.job-filter-card {
  padding: 18px 20px;
  border-radius: 14px;
  box-shadow: none;
}

.search-field input {
  height: 48px;
}

.filter-grid {
  margin-top: 12px;
}

.filter-grid select {
  height: 42px;
}

.filter-actions {
  margin-top: 14px;
}

.primary-button {
  height: 40px;
  min-width: 122px;
}

.jobs-toolbar {
  min-height: 76px;
}

.job-card {
  grid-template-columns: minmax(0, 1fr) 125px;
  padding: 20px 22px;
  gap: 20px;
}

.job-company-row {
  margin-bottom: 13px;
}

.job-title {
  margin-bottom: 9px;
  font-size: 18px;
}

.job-card-side {
  justify-content: flex-start;
  padding-top: 1px;
}

.match-badge {
  width: 64px;
  min-height: 54px;
  margin: 0 auto 6px;
  padding: 8px 6px;
  border-radius: 12px;
  background: #f3f4f6;
}

.match-badge strong {
  color: #475569;
  font-size: 19px;
}

.match-badge span {
  font-size: 9px;
}

.match-badge.potential {
  background: #fff7df;
}

.match-badge.potential strong {
  color: #9a6700;
}

.match-badge.strong {
  background: #ebfaf4;
}

.match-badge.strong strong {
  color: #16855b;
}

.view-job-button {
  min-height: 36px;
  background: #111827;
}

.view-job-button:hover {
  background: #0b1220;
}

.save-job-button {
  min-height: 36px;
}

@media (max-width: 850px) {
  .job-card {
    grid-template-columns: 1fr;
  }

  .job-card-side {
    padding-top: 0;
  }
}

/* --- Final match badge + compact results correction --- */

/* Default / weak match: neutral */
.jobs-shell .match-badge {
  width: 64px;
  min-height: 54px;
  padding: 8px 6px;
  margin: 0 auto 6px;
  border-radius: 11px;
  background: #f1f5f9 !important;
}

.jobs-shell .match-badge strong {
  color: #475569 !important;
}

.jobs-shell .match-badge span {
  color: #64748b !important;
}

/* Potential match: 60–79 */
.jobs-shell .match-badge.potential {
  background: #fff7df !important;
}

.jobs-shell .match-badge.potential strong {
  color: #9a6700 !important;
}

.jobs-shell .match-badge.potential span {
  color: #8a6514 !important;
}

/* Strong match: 80+ */
.jobs-shell .match-badge.strong {
  background: #eaf8f1 !important;
}

.jobs-shell .match-badge.strong strong {
  color: #16855b !important;
}

.jobs-shell .match-badge.strong span {
  color: #26745a !important;
}

/* Make browse results denser and easier to scan */
.jobs-shell .job-card {
  min-height: 0;
  padding: 18px 22px;
}

.jobs-shell .job-card-main {
  align-self: center;
}

.jobs-shell .job-company-row {
  margin-bottom: 10px;
}

.jobs-shell .job-title {
  margin-bottom: 8px;
}

.jobs-shell .job-card-side {
  justify-content: center;
  gap: 8px;
}

.jobs-shell .view-job-button,
.jobs-shell .save-job-button {
  min-height: 36px;
}

@media (min-width: 851px) {
  .jobs-shell .job-card {
    grid-template-columns: minmax(0, 1fr) 128px;
  }
}
