:root {
  --green: #94c11f;
  --green-dark: #7aa317;
  --blue: #4a53a0;
  --blue-dark: #32397a;
  --peri: #8b96c7;
  --peri-soft: #eef0f8;
  --ink: #1e2454;
  --muted: #5c6494;
  --line: #d9deef;
  --paper: #f4f6fb;
  --white: #ffffff;
  --err: #b42318;
  --ok: #3b7d0c;
  --shadow: 0 10px 30px rgba(50, 57, 122, 0.08);
  --radius: 18px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  color: var(--ink);
  background: var(--paper);
  font-family: "Nunito Sans", "Segoe UI", sans-serif;
  line-height: 1.55;
}

img { max-width: 100%; display: block; }

a { color: var(--blue); }

.shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.site-header::before {
  content: "";
  display: block;
  height: 4px;
  background: linear-gradient(90deg, var(--green) 0 34%, var(--peri) 34% 66%, var(--blue) 66% 100%);
}

.site-header .shell,
.site-footer .shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--blue);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand img {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.brand small {
  display: block;
  color: var(--peri);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.site-header nav {
  display: flex;
  gap: 8px;
}

.site-header nav a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 700;
  padding: 8px 12px;
  border-radius: 999px;
}

.site-header nav a.is-active,
.site-header nav a:hover {
  color: var(--blue);
  background: var(--peri-soft);
}

.hero {
  padding: 36px 0 8px;
}

.hero-card {
  background:
    radial-gradient(circle at 92% 12%, rgba(148, 193, 31, 0.28), transparent 28%),
    linear-gradient(135deg, #ffffff 0%, var(--peri-soft) 100%);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: clamp(24px, 5vw, 48px);
  box-shadow: var(--shadow);
}

.hero h1 {
  margin: 0 0 10px;
  font-size: clamp(1.8rem, 6vw, 3rem);
  line-height: 1.12;
  letter-spacing: -0.03em;
  max-width: 16ch;
}

.hero p {
  margin: 0;
  max-width: 46ch;
  color: var(--muted);
  font-size: 1.05rem;
}

.toolbar input,
.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: 12px;
  padding: 12px 14px;
  font: inherit;
  font-size: 16px;
  color: var(--ink);
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0 18px;
}

.toolbar input { flex: 1 1 auto; }

.jobs-count {
  flex: 0 0 auto;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted, #6b7280);
  white-space: nowrap;
}

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

.job-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 20px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
}

.job-card h2 {
  margin: 0 0 8px;
  font-size: 1.25rem;
}

.job-card p {
  margin: 10px 0 0;
  color: var(--muted);
}

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

.meta span {
  background: var(--peri-soft);
  color: var(--blue);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
}

.btn,
button.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 12px 18px;
  border: 0;
  border-radius: 999px;
  background: var(--green);
  color: #1b2a00;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.btn:hover,
button.btn:hover { background: var(--green-dark); color: #fff; }

.btn-ghost {
  background: var(--peri-soft);
  color: var(--blue);
}

.btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

.alert {
  margin: 16px 0;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--white);
  border: 1px solid var(--line);
}

.alert-error {
  background: #fff4f2;
  border-color: #f5c2c0;
  color: var(--err);
}

.alert-ok {
  background: #f3fbe6;
  border-color: #cbe48a;
  color: var(--ok);
}

.empty {
  color: var(--muted);
  padding: 12px 4px 64px;
}

.job-page {
  padding: 24px 0 96px;
}

.back-link {
  display: inline-flex;
  margin-bottom: 16px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 700;
}

.job-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 22px;
  align-items: start;
}

.job-article,
.apply-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: clamp(18px, 3vw, 28px);
}

.job-article h1 {
  margin: 0 0 12px;
  font-size: clamp(1.6rem, 4vw, 2.3rem);
  letter-spacing: -0.03em;
}

.job-body {
  margin-top: 18px;
  overflow-wrap: anywhere;
}

.job-body img { border-radius: 12px; }

.apply-card {
  position: sticky;
  top: 92px;
}

.apply-card h2 {
  margin: 0 0 6px;
}

.apply-card .lede {
  margin: 0 0 16px;
  color: var(--muted);
}

.field, fieldset.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0 0 14px;
  border: 0;
  padding: 0;
  min-width: 0;
}

.field span,
.field legend {
  font-weight: 800;
  font-size: 0.92rem;
}

.dropzone {
  position: relative;
  border: 1.5px dashed var(--peri);
  background: var(--peri-soft);
  border-radius: 16px;
  padding: 18px 14px;
  text-align: center;
  cursor: pointer;
}

.dropzone.is-on { border-color: var(--green); background: #f3fbe6; }

.dropzone.has-file {
  border-style: solid;
  border-color: var(--green);
  background: #f7fcec;
  text-align: left;
}

.dropzone input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.dropzone strong { display: block; color: var(--blue); }
.dropzone small, .field small { color: var(--muted); }
.dropzone .file-name { font-weight: 800; word-break: break-all; }

.inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: 12px;
  font-weight: 600;
}

.apply-card .btn { width: 100%; margin-top: 6px; }

.mobile-apply {
  display: none;
}

.thanks {
  padding: 48px 0 80px;
  max-width: 40rem;
}

.thanks-card {
  background: var(--white);
  border-radius: 28px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 32px 24px;
}

.thanks h1 { margin: 12px 0 8px; }
.thanks .check {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--green);
  color: #1b2a00;
  display: grid;
  place-items: center;
  font-size: 1.6rem;
  font-weight: 800;
}

.site-footer {
  background: var(--blue-dark);
  color: #d7dcf3;
}

.site-footer a { color: #fff; text-decoration: none; }
.footer-grid { padding: 8px 0; align-items: center; }
.footer-grid p { margin: 4px 0 0; opacity: 0.8; }

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

  .toolbar { flex-wrap: wrap; }

  .job-card .btn { width: 100%; }

  .apply-card {
    position: static;
  }

  .mobile-apply {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.96);
    border-top: 1px solid var(--line);
  }

  .mobile-apply .btn { width: 100%; }

  .job-page { padding-bottom: 118px; }
}

@media (max-width: 520px) {
  .site-header nav a:last-child { display: none; }
  .brand span { font-size: 1.05rem; }
}

/* --- Anti-bot honeypot ------------------------------------------------
   Must stay invisible and unreachable, but NOT display:none - some bots
   skip hidden inputs and some browsers skip them on autofill. Pushed off
   screen instead, with pointer events and the tab order removed. */
.hp-field {
  position: absolute !important;
  left: -9999px !important;
  top: auto !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  pointer-events: none !important;
}

.hp-field input { width: 1px; height: 1px; }

/* --- Accessibility helper --- */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* --- Radio / checkbox inputs ------------------------------------------
   `.field input { width: 100% }` is meant for text inputs; applied to a
   radio it stretches the control across the column and throws its label to
   the far right. These selectors are more specific, so they win. */
.field input[type="radio"],
.field input[type="checkbox"] {
  width: auto;
  flex: 0 0 auto;
  margin: 0;
  padding: 0;
  accent-color: var(--peri);
}

/* Keep each Oui/Non option tight around its own content instead of being
   stretched by the column flex container. */
.field .inline,
fieldset.field .inline {
  align-self: start;
  cursor: pointer;
}

/* Put the options on one row when there is space. */
fieldset.field {
  gap: 8px;
}

fieldset.field legend + .inline { margin-top: 2px; }

/* --- Per-field error text --- */
.field-error {
  display: block;
  min-height: 1em;
  margin-top: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #b42318;
}

.field-error:empty { min-height: 0; margin-top: 0; }

/* --- Privacy note under the apply button --- */
.privacy-note {
  margin: 14px 0 0;
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--muted, #6b7280);
}

/* --- Long filenames must never blow out the dropzone --- */
.dropzone .file-name {
  display: block;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* --- Recruiter-authored description: keep it inside its column --- */
.job-body { overflow-wrap: anywhere; }

.job-body img { max-width: 100%; height: auto; }

.job-body table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
}

.job-body pre {
  max-width: 100%;
  overflow-x: auto;
  white-space: pre-wrap;
}

/* --- Consent checkbox ------------------------------------------------- */
.consent-field { margin: 4px 0 14px; }

.consent-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.86rem;
  line-height: 1.55;
  color: var(--muted);
  cursor: pointer;
}

/* The full-width rule for text inputs must not stretch this checkbox. */
.consent-row input[type="checkbox"] {
  width: auto;
  flex: 0 0 auto;
  margin: 2px 0 0;
  padding: 0;
  accent-color: var(--peri);
}

.consent-row a { color: var(--peri); font-weight: 700; }

/* --- Legal pages ------------------------------------------------------ */
.legal-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 30px 28px;
  margin-bottom: 40px;
  max-width: 760px;
}

.legal-card h1 { margin: 0 0 6px; font-size: 1.7rem; }
.legal-card h2 { margin: 30px 0 10px; font-size: 1.05rem; }
.legal-card p, .legal-card li { line-height: 1.65; }
.legal-card ul { padding-left: 20px; }
.legal-card li { margin-bottom: 6px; }
.legal-card code {
  background: #f2f3f9;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.86em;
}

.legal-updated { color: var(--muted); font-size: 0.85rem; margin: 0 0 22px; }

.legal-todo {
  background: #fff8e6;
  border: 1px solid #f0d9a0;
  border-left: 3px solid #e0a800;
  border-radius: 8px;
  padding: 14px 16px;
  font-size: 0.88rem;
  line-height: 1.6;
  margin-bottom: 8px;
}

.legal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.87rem;
  margin: 10px 0 16px;
}

.legal-table th, .legal-table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.legal-table th { font-weight: 800; background: #f7f8fd; }
