/* ================================================================
   sofee.ai/jobs page styles. Layered on top of styles.css design system.
   Only adds rules specific to the listing and detail pages.
   ================================================================ */

/* Active state for the Jobs nav link when on /jobs surfaces */
.nav-links a.nav-link-active {
  color: var(--ink);
  font-weight: 600;
  position: relative;
}
.nav-links a.nav-link-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -22px;
  height: 2px;
  background: var(--orange);
}

/* Hero on /jobs */
.jobs-hero {
  padding: 64px 0 24px;
  border-bottom: 1px solid var(--line);
}
.jobs-hero h1 {
  margin-top: 18px;
  margin-bottom: 20px;
  max-width: 22ch;
}

/* Empty state */
.jobs-empty {
  padding: 96px 0;
  text-align: center;
}
.jobs-empty h2 {
  margin: 0 auto 16px;
  max-width: 24ch;
}
.jobs-empty p {
  color: var(--ink-soft);
  max-width: 56ch;
  margin: 0 auto 28px;
}

/* Listing */
.jobs-list {
  padding: 28px 0 120px;
}

/* ============================================================
   Toolbar: count + filters + active chips, sat above the grid
   No card. Inline. Bottom rule separates from cards.
   ============================================================ */

.jobs-toolbar {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-bottom: 20px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--line);
}

.jobs-toolbar .jobs-list-count {
  font-family: var(--f-display);
  font-size: 18px;
  font-weight: 450;
  letter-spacing: -0.01em;
  color: var(--ink-soft);
  margin: 0;
  text-transform: none;
}

.jobs-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
  margin: 0;
}

/* Each filter wraps a label + a select inline, e.g. "Location  All" */
.jobs-filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--ink-soft);
  cursor: pointer;
  position: relative;
}
.jobs-filter > span {
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
}
.jobs-filter select {
  appearance: none;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 6px 26px 6px 10px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6' fill='none'><path d='M1 1L5 5L9 1' stroke='%231A1614' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  transition: background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  outline: none;
}
.jobs-filter select:hover {
  background-color: rgba(200, 72, 32, 0.06);
}
.jobs-filter select:focus-visible {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(200, 72, 32, 0.14);
}

/* Clear-all button in the toolbar */
.jobs-filter-clear {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--orange-deep);
  cursor: pointer;
  transition: background-color 0.18s ease;
}
.jobs-filter-clear:hover {
  background: rgba(200, 72, 32, 0.08);
}

/* Active filter chips */
.jobs-active-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.jobs-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--orange-tint);
  color: var(--orange-deep);
  border: none;
  border-radius: 999px;
  padding: 6px 12px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.18s ease;
}
.jobs-chip:hover {
  background: rgba(200, 72, 32, 0.18);
}
.jobs-chip svg { opacity: 0.6; }
.jobs-chip:hover svg { opacity: 1; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Empty state when filters match nothing */
.jobs-list-empty {
  text-align: center;
  padding: 64px 24px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
}
.jobs-list-empty p {
  color: var(--ink-soft);
  margin-bottom: 16px;
}

/* Mobile: filters wrap onto multiple lines naturally */
@media (max-width: 640px) {
  .jobs-filters {
    gap: 6px 12px;
  }
  .jobs-filter {
    font-size: 13px;
  }
  .jobs-filter > span {
    display: none;
  }
  .jobs-filter select {
    font-size: 13.5px;
    padding: 8px 24px 8px 12px;
    background-color: var(--surface);
    border-color: var(--line);
  }
  .jobs-toolbar .jobs-list-count {
    font-size: 16px;
  }
}
.jobs-list-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

/* Card */
.job-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 24px 28px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}
.job-card:hover {
  border-color: var(--ink);
  transform: translateY(-1px);
  box-shadow: 0 12px 24px -16px rgba(26, 22, 20, 0.18);
}
.job-card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.job-card h3 {
  font-family: var(--f-display);
  font-size: clamp(20px, 2.4vw, 26px);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: var(--ink);
}
.job-card-arrow {
  font-family: var(--f-display);
  font-size: 28px;
  color: var(--orange);
  line-height: 1;
}
.job-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-top: 10px;
  font-size: 14px;
  color: var(--ink-soft);
}
.job-card-meta span {
  display: inline-flex;
  align-items: center;
}
.job-card-meta span:not(:last-child)::after {
  content: "·";
  color: var(--orange);
  margin-left: 18px;
  font-weight: 600;
}
.job-card-summary {
  margin-top: 14px;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 80ch;
}

/* Detail */
.job-detail {
  padding: 48px 0 96px;
}
.job-detail-back {
  display: inline-block;
  margin-bottom: 24px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-soft);
  text-decoration: none;
  transition: color 0.18s ease;
}
.job-detail-back:hover {
  color: var(--orange);
}
.job-detail-header {
  margin-bottom: 40px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}
.job-detail-header h1 {
  font-family: var(--f-display);
  font-size: clamp(36px, 4.8vw, 56px);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--ink);
  max-width: 24ch;
  margin-bottom: 18px;
}
.job-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  font-size: 15px;
  color: var(--ink-soft);
}
.job-detail-meta span:not(:last-child)::after {
  content: "·";
  color: var(--orange);
  margin-left: 22px;
  font-weight: 600;
}

/* Two-column layout: content + sticky apply card */
.job-detail-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 56px;
  align-items: start;
}
.job-detail-content {
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink-soft);
}
.job-detail-content h1,
.job-detail-content h2,
.job-detail-content h3,
.job-detail-content h4 {
  font-family: var(--f-display);
  color: var(--ink);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.015em;
  margin-top: 32px;
  margin-bottom: 12px;
}
.job-detail-content h2 { font-size: 28px; }
.job-detail-content h3 { font-size: 22px; }
.job-detail-content h4 {
  font-family: var(--f-body);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0;
}
.job-detail-content p {
  margin: 0 0 18px;
}
.job-detail-content ul,
.job-detail-content ol {
  margin: 0 0 22px 22px;
  padding: 0;
}
.job-detail-content li {
  margin-bottom: 8px;
}
.job-detail-content strong {
  color: var(--ink);
}
.job-detail-content a {
  color: var(--orange);
  text-decoration: underline;
}

/* Apply card */
.job-detail-apply {
  position: sticky;
  top: 32px;
}
.job-detail-apply-card {
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 28px;
}
.job-detail-apply-card h2 {
  font-family: var(--f-display);
  font-size: 24px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin-bottom: 12px;
}
.job-detail-apply-card p {
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--ink-soft);
  margin-bottom: 18px;
}
.job-detail-apply-card .btn {
  width: 100%;
}
.apply-cta-disabled {
  background: var(--ink-muted);
  cursor: not-allowed;
  pointer-events: none;
  opacity: 0.7;
}

/* Responsive */
@media (max-width: 920px) {
  .job-detail-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .job-detail-apply {
    position: static;
  }
}
@media (max-width: 560px) {
  .jobs-hero { padding: 48px 0 16px; }
  .jobs-list { padding: 40px 0 80px; }
  .job-card { padding: 20px 22px; }
  .job-card-summary { display: none; }
  .nav-links a.nav-link-active::after { display: none; }
}

/* Apply form */
.apply-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 8px;
}
.apply-form .field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.apply-form .field > label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.apply-form .field input[type="text"],
.apply-form .field input[type="email"],
.apply-form .field input[type="tel"],
.apply-form .field input[type="url"],
.apply-form .field select {
  padding: 11px 13px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-family: inherit;
  font-size: 14.5px;
  color: var(--ink);
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.apply-form .field input:focus,
.apply-form .field select:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(200, 72, 32, 0.14);
}
.apply-form .field select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'><path d='M1 1.5L6 6.5L11 1.5' stroke='%231A1614' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

/* Two fields side by side (e.g. First name + Surname) */
.apply-form .field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 480px) {
  .apply-form .field-row {
    grid-template-columns: 1fr;
    gap: 14px;
  }
}

/* Compound input: a select pinned to its leading edge plus a free-text
   input filling the rest. Used for dial-code+phone and currency+salary. */
.apply-form .field-compound {
  display: flex;
  gap: 8px;
}
.apply-form .field-compound select {
  flex: 0 0 auto;
  width: auto;
  min-width: 92px;
  padding-right: 30px;
}
.apply-form .field-compound input {
  flex: 1 1 auto;
  min-width: 0;
}

/* Inline radios under a label, e.g. Per day / Per hour for Contract pay. */
.apply-form .field-radio-row {
  display: inline-flex;
  gap: 6px;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  width: max-content;
  margin-bottom: 6px;
}
.apply-form .field-radio {
  position: relative;
  cursor: pointer;
}
.apply-form .field-radio input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.apply-form .field-radio span {
  display: inline-block;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
  border-radius: calc(var(--radius-sm) - 2px);
  transition: background 0.18s ease, color 0.18s ease;
}
.apply-form .field-radio input[type="radio"]:checked + span {
  background: var(--orange-tint);
  color: var(--orange-deep);
}
.apply-form .field-radio input[type="radio"]:focus-visible + span {
  box-shadow: 0 0 0 3px rgba(200, 72, 32, 0.18);
}

/* Field help + error states */
.field-help {
  font-size: 12.5px;
  color: var(--ink-muted);
  margin-top: 2px;
  line-height: 1.45;
}
.field-error {
  font-size: 13px;
  line-height: 1.45;
  color: var(--orange-deep);
  margin-top: 4px;
  min-height: 0;
}
.field-error:empty { display: none; }
.field.has-error input[type="text"],
.field.has-error input[type="email"],
.field.has-error input[type="tel"],
.field.has-error input[type="url"],
.field.has-error select,
.field.has-error .cv-row {
  border-color: var(--orange) !important;
  box-shadow: 0 0 0 3px rgba(200, 72, 32, 0.14) !important;
}
.field.has-error > label {
  color: var(--orange-deep);
}

/* CV / LinkedIn either-or row */
.cv-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.cv-upload {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  background: transparent;
  cursor: pointer;
  font-size: 13.5px;
  color: var(--ink-soft);
  transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
  font-weight: 500;
  flex-shrink: 0;
}
.cv-upload:hover {
  border-color: var(--ink);
  color: var(--ink);
}
.cv-upload.has-file {
  border-style: solid;
  border-color: var(--orange);
  background: var(--orange-tint);
  color: var(--orange-deep);
}
.cv-upload-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 160px;
}
.cv-or {
  font-family: var(--f-display);
  font-style: italic;
  font-size: 13px;
  color: var(--ink-muted);
}
.cv-linkedin {
  flex: 1;
  min-width: 140px;
  border: none !important;
  background: transparent !important;
  padding: 8px 4px !important;
  font-size: 14px !important;
  outline: none !important;
  box-shadow: none !important;
}
.cv-linkedin:focus {
  box-shadow: none !important;
}

/* Submit + status */
.apply-submit {
  margin-top: 4px;
  width: 100%;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.apply-submit:disabled {
  background: var(--ink);
  cursor: progress;
  opacity: 0.85;
}
.apply-submit-spinner {
  display: none;
  animation: applySpin 0.9s linear infinite;
}
.apply-submit.is-busy .apply-submit-spinner { display: inline-block; }
.apply-submit.is-busy .apply-submit-label::after {
  content: "...";
  display: inline-block;
  width: 1em;
  text-align: left;
}
@keyframes applySpin {
  to { transform: rotate(360deg); }
}

.apply-status {
  font-size: 13.5px;
  line-height: 1.5;
  margin-top: 4px;
  min-height: 0;
  color: var(--ink-soft);
}
.apply-status:empty { display: none; }
.apply-status--error { color: var(--orange-deep); }
.apply-status--success { color: var(--orange-deep); }

/* Success state */
.job-detail-apply-card.is-success {
  background: var(--surface);
  border: 1px solid var(--line-strong);
}
.apply-success {
  text-align: center;
  padding: 12px 4px 4px;
}
.apply-success-tick {
  margin: 0 auto 18px;
}
.apply-success h2 {
  font-family: var(--f-display);
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin-bottom: 12px;
  outline: none;
}
.apply-success-lede {
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink-soft);
  margin-bottom: 28px;
}
.apply-success-next {
  text-align: left;
  background: var(--bg-alt);
  border-radius: var(--radius-sm);
  padding: 18px 22px 20px;
  margin-bottom: 24px;
}
.apply-success-next h3 {
  font-family: var(--f-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 10px;
}
.apply-success-next ol {
  margin: 0;
  padding-left: 22px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-soft);
}
.apply-success-next li {
  margin-bottom: 6px;
}
.apply-success-next li:last-child { margin-bottom: 0; }
.apply-success-back {
  width: 100%;
}

/* Mobile: stack the CV row vertically. Cramped on small screens otherwise. */
@media (max-width: 480px) {
  .cv-row {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 8px;
  }
  .cv-upload {
    justify-content: center;
    width: 100%;
  }
  .cv-or {
    text-align: center;
    padding: 4px 0;
  }
  .cv-linkedin {
    width: 100%;
    text-align: center;
  }
  .cv-upload-label {
    max-width: 100%;
  }
}

/* Quiet load animation */
.jobs-list-grid .job-card {
  opacity: 0;
  transform: translateY(8px);
  animation: fadeUp 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
}
.jobs-list-grid .job-card:nth-child(1) { animation-delay: 0.05s; }
.jobs-list-grid .job-card:nth-child(2) { animation-delay: 0.10s; }
.jobs-list-grid .job-card:nth-child(3) { animation-delay: 0.15s; }
.jobs-list-grid .job-card:nth-child(4) { animation-delay: 0.20s; }
.jobs-list-grid .job-card:nth-child(5) { animation-delay: 0.25s; }
.jobs-list-grid .job-card:nth-child(n + 6) { animation-delay: 0.30s; }

@media (prefers-reduced-motion: reduce) {
  .jobs-list-grid .job-card { animation: none; opacity: 1; transform: none; }
}
