/* ==========================================================================
   Public careers site
   Brand variables (--brand, --accent, --page-bg, --radius, --font …) are
   generated from Settings → Branding and injected in the page <head>.
   ========================================================================== */

:root {
  --brand: #1d4ed8; --brand-hover: #1a43b8; --brand-text: #1d4ed8; --brand-soft: #e8edfb; --brand-softer: #f4f6fd; --brand-ring: #a5b8f0; --on-brand: #fff;
  --accent: #f59e0b; --accent-soft: #fdf0d5; --on-accent: #111827;
  --page-bg: #f3f5fa; --header-bg: #fff; --header-fg: #111827;
  --radius: 12px; --radius-sm: 6px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-heading: var(--font);

  --surface: #ffffff;
  --ink: #111827;
  --ink-2: #4b5563;
  --ink-3: #6b7280;
  --line: #e5e7eb;
  --line-strong: #d1d5db;
  --danger: #c62828;
  --danger-soft: #fdecec;
  --warning-ink: #8a5300;
  --warning-soft: #fff5e0;
  --success: #15803d;
  --shadow-sm: 0 1px 2px rgba(17, 24, 39, .06);
  --shadow: 0 1px 3px rgba(17, 24, 39, .06), 0 6px 24px rgba(17, 24, 39, .05);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.6; color: var(--ink); background: var(--page-bg); -webkit-font-smoothing: antialiased; display: flex; flex-direction: column; min-height: 100vh; }
main { flex: 1; }
h1, h2, h3, h4 { font-family: var(--font-heading); line-height: 1.25; margin: 0 0 .5em; color: var(--ink); letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
a { color: var(--brand-text); text-decoration-thickness: 1px; text-underline-offset: 2px; }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
.icon { width: 1.1em; height: 1.1em; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; vertical-align: -0.18em; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -48px; background: var(--brand); color: var(--on-brand); padding: 8px 14px; border-radius: var(--radius-sm); z-index: 100; }
.skip-link:focus { top: 12px; }
.muted { color: var(--ink-3); }
:focus-visible { outline: 3px solid var(--brand-ring); outline-offset: 2px; }

.container { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.container-narrow { max-width: 780px; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: var(--radius-sm); border: 1px solid transparent; font-weight: 600; font-size: 15px; line-height: 1.2; cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s, box-shadow .15s, transform .05s; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: var(--on-brand); }
.btn-primary:hover { background: var(--brand-hover); }
.btn-outline { background: var(--surface); color: var(--brand-text); border-color: var(--line-strong); }
.btn-outline:hover { border-color: var(--brand); background: var(--brand-softer); }
.btn-lg { padding: 13px 24px; font-size: 16px; }
.btn[disabled] { opacity: .6; cursor: not-allowed; }

/* ---------- Header ---------- */
.site-header { background: var(--header-bg); color: var(--header-fg); border-bottom: 1px solid rgba(17, 24, 39, .08); position: sticky; top: 0; z-index: 20; }
.site-header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 68px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; min-width: 0; }
.brand-logo { max-height: 42px; max-width: 200px; width: auto; display: block; }
.brand-mark { width: 36px; height: 36px; border-radius: 10px; background: var(--brand); color: var(--on-brand); display: grid; place-items: center; font-weight: 800; font-size: 18px; }
.header-brand .brand-mark { background: var(--on-brand); color: var(--brand); }
.brand-name { font-weight: 750; font-size: 19px; letter-spacing: -0.02em; }
.brand-tagline { font-size: 14px; opacity: .7; padding-left: 10px; border-left: 1px solid currentColor; border-left-color: color-mix(in srgb, currentColor 30%, transparent); }
.site-nav { display: flex; gap: 20px; font-size: 15px; }
.site-nav a { color: inherit; text-decoration: none; opacity: .85; display: inline-flex; align-items: center; gap: 6px; }
.site-nav a:hover { opacity: 1; text-decoration: underline; }
.site-nav .icon { width: .9em; height: .9em; }

/* ---------- Hero & search ---------- */
.hero { background: linear-gradient(180deg, var(--brand-soft), var(--page-bg)); padding: 56px 0 40px; }
.hero h1 { font-size: clamp(30px, 4.5vw, 46px); font-weight: 800; letter-spacing: -0.03em; max-width: 760px; margin-bottom: 12px; }
.hero-text { font-size: 18px; color: var(--ink-2); max-width: 640px; margin-bottom: 28px; }
.job-search { display: flex; flex-wrap: wrap; gap: 10px; background: var(--surface); padding: 10px; border-radius: calc(var(--radius) + 4px); box-shadow: var(--shadow); max-width: 920px; }
.job-search-field { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0 12px; background: #fff; min-height: 46px; }
.job-search-field .icon { color: var(--ink-3); }
.job-search-main { flex: 1 1 260px; }
.job-search-field input, .job-search-field select { border: 0; outline: 0; background: transparent; min-height: 44px; width: 100%; font-size: 15px; }
.job-search-field select { cursor: pointer; padding-right: 4px; }
.job-search-field:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.job-search .btn { min-height: 46px; padding: 0 24px; }

/* ---------- Job list ---------- */
.jobs-section { padding: 32px 20px 64px; }
.jobs-heading { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.jobs-heading h2 { margin: 0; font-size: 22px; }
.count-pill { background: var(--brand-soft); color: var(--brand-text); font-weight: 600; font-size: 13px; padding: 3px 10px; border-radius: 99px; }
.link-clear { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; }
.job-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.job-card { display: flex; align-items: center; gap: 24px; padding: 22px 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: inherit; transition: border-color .15s, box-shadow .15s, transform .15s; }
.job-card:hover { border-color: var(--brand-ring); box-shadow: var(--shadow); transform: translateY(-1px); }
.job-card-main { flex: 1; min-width: 0; }
.job-card-dept { font-size: 13px; font-weight: 700; color: var(--brand-text); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px; }
.job-card-title { font-size: 20px; margin: 0 0 6px; }
.job-card-summary { color: var(--ink-2); margin: 0 0 12px; font-size: 15px; }
.job-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--ink-3); font-size: 14px; }
.job-meta span { display: inline-flex; align-items: center; gap: 6px; }
.job-card-cta { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; color: var(--brand-text); white-space: nowrap; }

.empty-state { text-align: center; background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: 56px 24px; }
.empty-state .empty-icon { width: 44px; height: 44px; color: var(--brand); margin-bottom: 12px; stroke-width: 1.5; }
.empty-state p { color: var(--ink-3); margin: 0; }

/* ---------- Job detail ---------- */
.preview-bar { background: #111827; color: #fff; font-size: 14px; padding: 10px 0; }
.preview-bar .container { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.preview-bar a { color: #fff; font-weight: 600; margin-left: auto; }
.job-hero { background: linear-gradient(180deg, var(--brand-soft), var(--page-bg)); padding: 28px 0 36px; }
.job-hero h1 { font-size: clamp(28px, 4vw, 40px); font-weight: 800; letter-spacing: -0.025em; margin: 4px 0 14px; }
.back-link { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; text-decoration: none; margin-bottom: 18px; font-weight: 600; }
.job-meta-lg { font-size: 15px; color: var(--ink-2); margin-bottom: 24px; }
.job-body { padding-bottom: 72px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.job-description { padding: 28px 32px; margin-bottom: 28px; }
.prose h2 { font-size: 22px; margin-top: 1.4em; }
.prose h3 { font-size: 18px; margin-top: 1.3em; }
.prose h4 { font-size: 16px; margin-top: 1.2em; }
.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1em; }
.prose li { margin: .25em 0; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 1.5em 0; }

.notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius-sm); margin-bottom: 20px; font-size: 15px; border: 1px solid transparent; }
.notice .icon { margin-top: 3px; }
.notice-warning { background: var(--warning-soft); color: var(--warning-ink); border-color: #f5d9a8; }
.notice-error { background: var(--danger-soft); color: var(--danger); border-color: #f5c2c2; }

/* ---------- Application form (Google Forms-inspired) ---------- */
.apply-form { display: grid; gap: 14px; scroll-margin-top: 90px; }
.q-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; margin: 0; min-width: 0; transition: border-color .15s, box-shadow .15s; position: relative; }
fieldset.q-card { display: block; }
.q-card:focus-within { border-color: var(--brand-ring); box-shadow: 0 0 0 3px var(--brand-softer); }
.q-card.has-error { border-color: #ef9a9a; box-shadow: 0 0 0 3px var(--danger-soft); }
.q-card-header { border-top: 8px solid var(--brand); padding-top: 20px; }
.q-card-header h2 { font-size: 24px; margin-bottom: 4px; }
.q-card-header p { margin: 0; color: var(--ink-3); font-size: 14px; }
.q-title { display: block; font-weight: 600; font-size: 16px; margin-bottom: 4px; padding: 0; color: var(--ink); float: none; width: 100%; }
/* Legends normally sit on the fieldset border; floating keeps them inside the card. */
legend.q-title { float: left; width: 100%; margin-bottom: 4px; }
legend.q-title ~ * { clear: both; }
.q-desc { color: var(--ink-3); font-size: 14px; margin: 0 0 12px; }
.q-title + .input, .q-title + .choices, .q-title + .scale, .q-title + .dropzone { margin-top: 10px; }
.req { color: var(--danger); font-weight: 700; }
.q-error { color: var(--danger); font-size: 14px; margin-top: 8px; display: flex; gap: 6px; align-items: center; }
.q-error:empty { display: none; }
.q-note { color: var(--ink-3); font-size: 13px; margin-top: 6px; }

.input { display: block; width: 100%; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: #fff; padding: 10px 12px; font-size: 16px; line-height: 1.4; transition: border-color .15s, box-shadow .15s; }
.input:hover { border-color: #9ca3af; }
.input:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
textarea.input { resize: vertical; min-height: 110px; }
.input-narrow { max-width: 260px; }
.input-select { max-width: 420px; appearance: none; background-image: linear-gradient(45deg, transparent 50%, #6b7280 50%), linear-gradient(135deg, #6b7280 50%, transparent 50%); background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; cursor: pointer; }
.has-error .input { border-color: #e57373; }

.choices { display: grid; gap: 4px; }
.choices-inline { grid-template-columns: repeat(auto-fit, minmax(120px, max-content)); gap: 8px 12px; }
.choice { display: flex; align-items: flex-start; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm); cursor: pointer; transition: background .12s; }
.choice:hover { background: var(--brand-softer); }
.choice input[type=radio], .choice input[type=checkbox] { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--brand); flex-shrink: 0; cursor: pointer; }
.choices-inline .choice { border: 1px solid var(--line-strong); padding: 10px 18px 10px 12px; }
.choices-inline .choice:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.choice-other { align-items: center; flex-wrap: wrap; }
.choice-other label { cursor: pointer; }
.input-other { flex: 1; min-width: 160px; padding: 6px 10px; font-size: 15px; }
.choice-consent { padding: 0; }
.choice-consent:hover { background: transparent; }

.scale { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; }
.scale-label { font-size: 14px; color: var(--ink-3); padding-bottom: 10px; }
.scale-options { display: flex; gap: 4px; flex-wrap: wrap; }
.scale-option { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 40px; padding: 6px 4px; border-radius: var(--radius-sm); cursor: pointer; font-size: 14px; color: var(--ink-2); }
.scale-option:hover { background: var(--brand-softer); }
.scale-option input { width: 20px; height: 20px; margin: 0; accent-color: var(--brand); cursor: pointer; }

.dropzone { position: relative; border: 2px dashed var(--line-strong); border-radius: var(--radius); background: var(--brand-softer); transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.is-dragover { border-color: var(--brand); background: var(--brand-soft); }
.dropzone-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; z-index: 2; }
.dropzone-body { display: flex; align-items: center; gap: 14px; padding: 20px; color: var(--ink-2); }
.dropzone-body strong { color: var(--brand-text); }
.dropzone-icon { width: 30px; height: 30px; color: var(--brand); }
.dropzone-hint { font-size: 13px; color: var(--ink-3); margin-top: 2px; }
.dropzone-files { list-style: none; margin: 0; padding: 0 12px; display: grid; gap: 6px; position: relative; z-index: 3; }
.dropzone-files:not(:empty) { padding-bottom: 12px; }
.dropzone-files li { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 12px; font-size: 14px; }
.dropzone-files li .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.dropzone-files li .size { color: var(--ink-3); }
.dropzone-files li.is-invalid { border-color: #ef9a9a; color: var(--danger); background: var(--danger-soft); }

.form-section { padding: 12px 4px 0; }
.form-section h3 { font-size: 20px; margin-bottom: 4px; }
.form-section p { color: var(--ink-2); margin: 0; }

.form-actions { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding: 10px 0 0; }
.form-actions-hint { display: inline-flex; gap: 6px; align-items: center; color: var(--ink-3); font-size: 13px; }
.hp-field { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Thank you ---------- */
.thanks { padding: 64px 20px 96px; }
.thanks-card { text-align: center; padding: 44px 32px; border-top: 8px solid var(--brand); }
.thanks-icon { width: 64px; height: 64px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; margin: 0 auto 16px; }
.thanks-icon .icon { width: 32px; height: 32px; stroke-width: 2.5; }
.thanks-card h1 { font-size: 30px; margin-bottom: 4px; }
.thanks-job { color: var(--ink-2); }
.thanks-message { color: var(--ink-2); max-width: 520px; margin: 0 auto 24px; }
.thanks-ref { display: inline-flex; flex-direction: column; gap: 2px; border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); padding: 10px 22px; margin-bottom: 28px; }
.thanks-ref span { font-size: 13px; color: var(--ink-3); }
.thanks-ref strong { font-size: 20px; letter-spacing: .08em; font-variant-numeric: tabular-nums; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); color: var(--ink-3); font-size: 14px; }
.site-footer-inner { display: flex; justify-content: space-between; gap: 16px; padding-top: 22px; padding-bottom: 22px; flex-wrap: wrap; }
.site-footer-links { display: flex; gap: 18px; flex-wrap: wrap; }
.site-footer a { color: var(--ink-2); text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.site-footer a:hover { color: var(--brand-text); }

/* ---------- Error page ---------- */
.error-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.error-card { background: var(--surface); border-radius: var(--radius); border-top: 8px solid var(--brand); padding: 40px; text-align: center; max-width: 480px; box-shadow: var(--shadow); }
.error-code { font-size: 56px; font-weight: 800; color: var(--brand); line-height: 1; margin-bottom: 8px; }
.error-card p { color: var(--ink-2); }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .container { padding: 0 16px; }
  .site-header-inner { min-height: 60px; }
  .brand-tagline, .site-nav a + a { display: none; }
  .hero { padding: 36px 0 28px; }
  .hero-text { font-size: 16px; }
  .job-search { padding: 8px; }
  .job-search-field { flex: 1 1 100%; }
  .job-search .btn { flex: 1 1 100%; }
  .jobs-section { padding: 24px 16px 48px; }
  .job-card { flex-direction: column; align-items: flex-start; gap: 12px; padding: 18px; }
  .job-description { padding: 20px; }
  .q-card { padding: 18px 16px; }
  .form-actions .btn { width: 100%; }
  .scale { align-items: flex-start; flex-direction: column; gap: 6px; }
  .scale-label { padding: 0; }
}

@media print {
  .site-header, .site-footer, .apply-form, .btn { display: none !important; }
  body { background: #fff; }
}
