:root {
  --ink: #142B3B;
  --ink-2: #4A6070;
  --paper: #F3F6F5;
  --surface: #FFFFFF;
  --line: #D9E1DE;
  --teal: #0E6B66;
  --teal-d: #0A524E;
  --saffron: #E2A52B;
  --saffron-soft: #FBF1DC;
  --danger: #B4443A;
  --ok: #2F8F5B;
  --radius-lg: 18px;
  --radius: 10px;
  --font-display: "Sora", "Segoe UI", system-ui, sans-serif;
  --font-body: "Public Sans", "Segoe UI", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 1rem/1.6 var(--font-body);
}
img, svg { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--teal); }
:focus-visible { outline: 3px solid var(--saffron); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--ink-2); font-size: .85rem; }

/* ---------- Top bar ---------- */
.topbar {
  position: absolute; inset: 0 0 auto; z-index: 2;
  display: flex; justify-content: space-between; align-items: center;
  padding: 1.25rem clamp(1.25rem, 5vw, 4rem); color: #fff;
}
.brand { display: flex; gap: .65rem; align-items: center; color: inherit; text-decoration: none; font: 600 1.05rem var(--font-display); }
.brand-mark { width: 22px; height: 22px; background: var(--saffron); clip-path: polygon(50% 0, 63% 37%, 100% 50%, 63% 63%, 50% 100%, 37% 63%, 0 50%, 37% 37%); }
.topbar-link { color: #fff; text-decoration: none; font-size: .92rem; padding: .45rem .9rem; border: 1px solid rgba(255,255,255,.35); border-radius: 999px; }
.topbar-link:hover { background: rgba(255,255,255,.1); }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden; background: var(--ink); color: #fff;
  padding: clamp(7rem, 14vw, 10rem) clamp(1.25rem, 5vw, 4rem) clamp(4.5rem, 8vw, 6.5rem);
}
.hero-pattern {
  position: absolute; inset: 0; width: 100%; height: 100%; color: #2D7A73; opacity: .45;
  -webkit-mask-image: linear-gradient(100deg, transparent 30%, #000 85%);
          mask-image: linear-gradient(100deg, transparent 30%, #000 85%);
}
.hero-inner { position: relative; max-width: 1120px; margin: 0 auto; }
.hero h1 {
  margin: 0; max-width: 13ch;
  font: 700 clamp(2.4rem, 6.4vw, 4.6rem)/1.02 var(--font-display); letter-spacing: -.03em;
}
.lead { max-width: 52ch; margin: 1.4rem 0 0; font-size: 1.12rem; color: #C9D6DD; }
.hero-count { margin: 2rem 0 0; font: 600 1rem var(--font-display); color: var(--saffron); }

/* ---------- Job list ---------- */
.jobs { max-width: 1120px; margin: -2.25rem auto 0; padding: 0 clamp(1rem, 4vw, 2rem) 4rem; position: relative; }
.toolbar {
  display: grid; grid-template-columns: 1fr minmax(0, 220px) minmax(0, 200px); gap: .6rem;
  background: var(--surface); padding: .6rem; border-radius: var(--radius-lg);
  box-shadow: 0 14px 40px -18px rgba(20,43,59,.35);
}
.toolbar input, .toolbar select {
  width: 100%; height: 48px; border: 1px solid transparent; background: var(--paper);
  border-radius: var(--radius); padding: 0 .9rem;
}
.toolbar select { appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234A6070' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .8rem center; background-size: 16px; padding-right: 2.2rem; }
.toolbar input:focus, .toolbar select:focus { border-color: var(--teal); outline: none; background-color: #fff; }
.field-search { position: relative; }
.field-search svg { position: absolute; left: .85rem; top: 50%; translate: 0 -50%; width: 18px; fill: none; stroke: var(--ink-2); stroke-width: 2; }
.field-search input { padding-left: 2.6rem; }

.job-list { list-style: none; margin: 2rem 0 0; padding: 0; border-top: 1px solid var(--line); }
.job-list li { border-bottom: 1px solid var(--line); }
.job {
  display: grid; grid-template-columns: 1fr auto; gap: .4rem 1.5rem; align-items: center;
  width: 100%; text-align: left; background: none; border: 0; cursor: pointer;
  padding: 1.5rem .25rem 1.5rem 1.25rem; position: relative;
}
.job::before { content: ""; position: absolute; left: 0; top: 1.5rem; bottom: 1.5rem; width: 3px; border-radius: 3px; background: var(--line); transition: background .2s; }
.job:hover::before, .job:focus-visible::before { background: var(--saffron); }
.job-title { font: 600 clamp(1.15rem, 2.2vw, 1.4rem)/1.25 var(--font-display); letter-spacing: -.01em; }
.job-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; grid-column: 1; }
.job-date { margin-left: .35rem; }
.job-cta { grid-row: 1 / span 2; grid-column: 2; display: inline-flex; gap: .4rem; align-items: center; color: var(--teal); font-weight: 600; font-size: .95rem; }
.job-cta svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 2; transition: translate .2s; }
.job:hover .job-cta svg { translate: 3px 0; }
.job-date { color: var(--ink-2); font-size: .85rem; }

.tags { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem; margin: 0; padding: 0; }
.tag { font-size: .82rem; padding: .2rem .6rem; border-radius: 6px; background: #E6EEEC; color: var(--ink); }
.tag-contract { background: var(--saffron-soft); color: #7A5210; font-weight: 600; }

.skeleton { height: 92px; border-bottom: 1px solid var(--line); background: linear-gradient(90deg, transparent, rgba(255,255,255,.7), transparent) var(--paper); background-size: 200% 100%; animation: shimmer 1.3s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

.empty { text-align: center; padding: 3.5rem 1rem; }
.empty-title { font: 600 1.15rem var(--font-display); margin: 0 0 1rem; }

.btn-ghost { background: none; border: 1px solid var(--line); padding: .6rem 1.1rem; border-radius: var(--radius); cursor: pointer; font-weight: 600; }
.btn-ghost:hover { border-color: var(--teal); color: var(--teal); }

.footer { text-align: center; color: var(--ink-2); font-size: .85rem; padding: 2rem 1rem 3rem; }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 1rem; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(15,30,40,.6); backdrop-filter: blur(3px); animation: fade .2s; }
.modal-panel {
  position: relative; width: min(1040px, 100%); max-height: calc(100vh - 2rem); overflow: auto;
  background: var(--surface); border-radius: var(--radius-lg); animation: rise .25s ease-out;
}
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
.modal-close { position: absolute; top: .9rem; right: .9rem; z-index: 2; width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--paper); cursor: pointer; display: grid; place-items: center; }
.modal-close svg { width: 18px; stroke: var(--ink); stroke-width: 2; }
.modal-grid { display: grid; grid-template-columns: 1.35fr 1fr; }
.job-detail { padding: clamp(1.5rem, 4vw, 2.75rem); }
.job-detail h2 { font: 700 clamp(1.6rem, 3.4vw, 2.2rem)/1.12 var(--font-display); letter-spacing: -.02em; margin: 1rem 0 1.5rem; padding-right: 2rem; }
.prose { max-width: 62ch; }
.prose h4 { font: 600 1rem var(--font-display); margin: 1.6rem 0 .5rem; }
.prose p { margin: 0 0 .8rem; }
.prose ul { margin: 0 0 .8rem; padding-left: 1.15rem; }
.prose li { margin-bottom: .3rem; }
.prose li::marker { color: var(--teal); }
.deadline { margin-top: 1.5rem; padding: .7rem .9rem; border-radius: var(--radius); background: var(--saffron-soft); font-size: .9rem; }

.apply { background: var(--paper); padding: clamp(1.5rem, 4vw, 2.5rem); border-left: 1px solid var(--line); }
.apply h3 { font: 600 1.2rem var(--font-display); margin: 0 0 1.25rem; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.field { margin-bottom: .9rem; }
.field label, .field .label { display: block; font-size: .88rem; font-weight: 600; margin-bottom: .3rem; }
.field input:not([type=file]) {
  width: 100%; height: 46px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; padding: 0 .85rem;
}
.field input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(14,107,102,.15); }
.field.invalid input, .field.invalid .drop { border-color: var(--danger); }
.err { display: block; color: var(--danger); font-size: .8rem; min-height: 0; margin-top: .25rem; }
.err:empty { display: none; }
.hp { position: absolute; left: -9999px; }

.drop { display: flex; gap: .8rem; align-items: center; padding: 1rem; border: 1.5px dashed #AFC0BB; border-radius: var(--radius); background: #fff; cursor: pointer; transition: border-color .15s, background .15s; }
.drop:hover, .drop.over { border-color: var(--teal); background: #F0F7F6; }
.drop.has-file { border-style: solid; border-color: var(--teal); }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop:focus-within { outline: 3px solid var(--saffron); outline-offset: 2px; }
.drop svg { width: 30px; flex: none; fill: none; stroke: var(--teal); stroke-width: 1.6; }
.drop-text { font-size: .9rem; line-height: 1.4; word-break: break-word; }

.consent { display: flex; gap: .55rem; align-items: flex-start; font-size: .84rem; color: var(--ink-2); margin: .25rem 0 1.1rem; }
.consent input { margin-top: .25rem; accent-color: var(--teal); }

.btn-primary {
  position: relative; overflow: hidden; width: 100%; height: 52px; border: 0; border-radius: var(--radius);
  background: var(--teal); color: #fff; font: 600 1rem var(--font-display); cursor: pointer; transition: background .15s;
}
.btn-primary:hover { background: var(--teal-d); }
.btn-primary[disabled] { cursor: progress; }
.btn-primary span:first-child { position: relative; z-index: 1; }
.progress { position: absolute; inset: 0 auto 0 0; width: 0; background: rgba(255,255,255,.18); transition: width .15s; }
.form-msg { margin: .8rem 0 0; font-size: .9rem; color: var(--danger); }
.form-msg:empty { display: none; }

.apply-done { text-align: center; padding: 2rem 0; }
.apply-done svg { width: 56px; fill: none; stroke: var(--ok); stroke-width: 1.6; }
.apply-done p { color: var(--ink-2); margin: 0 0 1.5rem; }

body.locked { overflow: hidden; }

@media (max-width: 860px) {
  .toolbar { grid-template-columns: 1fr 1fr; }
  .field-search { grid-column: 1 / -1; }
  .modal { padding: 0; align-items: end; }
  .modal-panel { max-height: 94vh; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
  .modal-grid { grid-template-columns: 1fr; }
  .apply { border-left: 0; border-top: 1px solid var(--line); }
}
@media (max-width: 540px) {
  .toolbar { grid-template-columns: 1fr; }
  .job { grid-template-columns: 1fr; padding-right: 0; }
  .job-cta { grid-row: auto; grid-column: 1; }
  .row-2 { grid-template-columns: 1fr; gap: 0; }
  .topbar-link { font-size: .82rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
