/* ZIXAN candidate portal — mobile-first, theme-aware, no external assets. */

:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --text: #14181f;
  --muted: #4b5566;
  --border: #d7dbe6;
  --brand: #1f4bd8;
  --brand-strong: #16349a;
  --brand-contrast: #ffffff;
  --accent: #0e7c66;
  --danger: #b3261e;
  --focus: #ffb020;
  --radius: 14px;
  --shadow: 0 6px 24px rgba(20, 24, 31, 0.08);
  --maxw: 960px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1017;
    --surface: #161b24;
    --text: #eef1f7;
    --muted: #a8b2c4;
    --border: #2a3140;
    --brand: #7ea0ff;
    --brand-strong: #a9c0ff;
    --brand-contrast: #0d1017;
    --accent: #4fd1b0;
    --danger: #ff8a80;
    --shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
}

.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 1rem; }

a { color: var(--brand-strong); }

img, svg { max-width: 100%; height: auto; }

/* Focus visibility for keyboard users. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--surface);
  padding: 0.5rem 1rem;
  border-radius: 0 0 var(--radius) 0;
  z-index: 10;
}
.skip-link:focus { left: 0; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Header */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); }
.header-inner {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.25rem;
  padding-block: 0.75rem;
}
.brand { font-weight: 800; font-size: 1.4rem; letter-spacing: 0.04em; text-decoration: none; color: var(--brand); }
.primary-nav { display: flex; gap: 1rem; flex: 1; }
.primary-nav a { text-decoration: none; font-weight: 600; }
.lang-switcher { display: flex; align-items: center; gap: 0.4rem; }
.lang-label { color: var(--muted); font-size: 0.85rem; }
.lang-buttons { display: flex; gap: 0.25rem; }
.lang-button {
  border: 1px solid var(--border); background: transparent; color: var(--text);
  border-radius: 999px; padding: 0.2rem 0.6rem; cursor: pointer; font-size: 0.85rem;
}
.lang-button.is-current { background: var(--brand); color: var(--brand-contrast); border-color: var(--brand); }

/* Layout blocks */
main { padding-block: 1.5rem 3rem; }
main:focus { outline: none; }
.panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.25rem; margin-block: 1.25rem; box-shadow: var(--shadow);
}

h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); line-height: 1.15; }
h2 { font-size: clamp(1.25rem, 3vw, 1.6rem); }
.lead { font-size: 1.1rem; color: var(--muted); }
.muted { color: var(--muted); }
.note { color: var(--muted); font-size: 0.9rem; font-style: italic; }
.hint { color: var(--muted); }

/* Hero */
.hero {
  display: grid; gap: 1.5rem; align-items: center; padding-block: 1rem;
}
@media (min-width: 720px) {
  .hero { grid-template-columns: 1.4fr 1fr; }
}
.cta-row { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1rem; }

/* Buttons */
.btn {
  display: inline-block; border-radius: 999px; padding: 0.7rem 1.4rem; font-weight: 700;
  text-decoration: none; cursor: pointer; border: 2px solid transparent; font-size: 1rem;
}
.btn-primary { background: var(--brand); color: var(--brand-contrast); border-color: var(--brand); }
.btn-primary:hover { background: var(--brand-strong); border-color: var(--brand-strong); }
.btn-secondary { background: transparent; color: var(--brand-strong); border-color: var(--brand); }
.btn-ghost { background: transparent; color: var(--muted); border-color: var(--border); padding: 0.4rem 0.9rem; }

/* Highlight card */
.highlight-card {
  display: flex; flex-direction: column; gap: 0.25rem; text-decoration: none; color: var(--text);
}
.salary { font-weight: 800; font-size: 1.2rem; color: var(--accent); }
.meta { color: var(--muted); }
.empty { color: var(--muted); }

.steps { padding-left: 1.2rem; }
.steps li { margin-block: 0.4rem; }

/* Vacancies */
.filter { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: end; margin-block: 1rem; }
.filter select { padding: 0.5rem; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); }
.vacancy-grid { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; }
@media (min-width: 640px) { .vacancy-grid { grid-template-columns: repeat(2, 1fr); } }
.vacancy-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1rem; box-shadow: var(--shadow);
}
.vacancy-card h2, .vacancy-card h3 { margin-top: 0; }
.vacancy-card a { text-decoration: none; }
.empty-state { text-align: center; }

.vacancy-detail .facts { display: grid; gap: 0.5rem; margin-block: 1rem; }
.vacancy-detail dt { font-weight: 700; }
.vacancy-detail dd { margin: 0; color: var(--muted); }
.back-link { text-decoration: none; }
.benefits { padding-left: 1.2rem; }

/* Questionnaire */
.questionnaire { max-width: 640px; }
.progress {
  background: var(--border); border-radius: 999px; height: 10px; overflow: hidden; margin-bottom: 1rem;
}
.progress-bar { background: var(--brand); height: 100%; transition: width 0.3s ease; }
.progress-label { font-weight: 600; color: var(--muted); margin-bottom: 0.25rem; }
.q-form fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; }
.q-form legend { font-weight: 700; padding-inline: 0.4rem; }
.field { display: flex; flex-direction: column; gap: 0.4rem; margin-block: 0.75rem; font-weight: 600; }
.field input, .field select {
  padding: 0.65rem; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-size: 1rem; font-weight: 400;
}
.choice {
  display: flex; align-items: center; gap: 0.6rem; padding: 0.6rem 0.5rem;
  border-radius: 10px; cursor: pointer; font-weight: 500;
}
.choice:hover { background: rgba(31, 75, 216, 0.08); }
.choice input { width: 1.15rem; height: 1.15rem; }
.choice--suggested { outline: 2px solid var(--accent); outline-offset: 1px; }
.choice--consent { align-items: flex-start; }
.inline-fields { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.suggestions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.5rem; }
.q-actions { display: flex; justify-content: space-between; gap: 0.75rem; margin-top: 1.25rem; }
.form-error { color: var(--danger); font-weight: 700; }

/* Honeypot: visually and semantically removed, still in the DOM for bots. */
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Guide mascot.
   The role is expressed by distinct SVG shapes (hard hat, steering wheel, sun
   hat, apron, medical coat, hi-vis tabard, lanyard, suit tie), not by a colour
   swap. Colour only reinforces the outfit that is already drawn. */
.guide { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; margin: 0; }
.guide-caption { font-weight: 600; color: var(--muted); text-align: center; }
.guide-bg { fill: rgba(31, 75, 216, 0.12); }
.guide-head { fill: #c99a72; }
.guide-body { fill: var(--brand); }

/* Accessories default to a drawn outline so a role shape is always legible. */
.guide-accessory { fill: var(--surface); stroke: var(--text); stroke-width: 2; }

/* Manager: dark suit with a brand-coloured tie. */
.guide-accessory--collar { fill: var(--surface); }
.guide-accessory--tie { fill: var(--brand-strong); stroke: none; }

/* Construction: yellow hard hat over an orange vest stripe. */
.guide--construction .guide-body { fill: #d98a00; }
.guide-accessory--hardhat, .guide-accessory--hardhat-brim { fill: #ffd43b; }
.guide-accessory--hardhat-ridge { fill: none; stroke: #b38600; stroke-width: 3; }
.guide-accessory--vest-stripe { fill: #f4f6fb; stroke: none; }

/* Driving and logistics: peaked cap and a steering wheel. */
.guide--driving .guide-body { fill: #2a6df0; }
.guide-accessory--cap, .guide-accessory--cap-peak { fill: #1b2a4a; stroke: none; }
.guide-accessory--wheel { fill: none; stroke: #1b2a4a; stroke-width: 6; }
.guide-accessory--wheel-hub { fill: #1b2a4a; stroke: none; }

/* Agriculture: straw sun hat and a green leaf. */
.guide--agriculture .guide-body { fill: #2f9e44; }
.guide-accessory--sunhat, .guide-accessory--sunhat-crown { fill: #e8c468; stroke: #a8842c; }
.guide-accessory--leaf { fill: #37b24d; stroke: none; }

/* Hospitality: white apron and a serving tray. */
.guide--hospitality .guide-body { fill: #c2255c; }
.guide-accessory--apron, .guide-accessory--apron-tie { fill: #fdfdfd; stroke: #9c9c9c; }
.guide-accessory--tray { fill: #adb5bd; stroke: #6b7280; }

/* Medical: white coat with a cross badge. */
.guide--medical .guide-body { fill: #0c8599; }
.guide-accessory--coat { fill: #fdfdfd; stroke: #8a9199; }
.guide-accessory--coat-seam { fill: none; stroke: #c3c8ce; stroke-width: 2; }
.guide-accessory--cross { fill: #e03131; stroke: none; }

/* Warehouse and production: hi-vis tabard with bands and a carried box. */
.guide--warehouse .guide-body { fill: #7048e8; }
.guide-accessory--hivis { fill: #d7f542; stroke: #8a9b1c; }
.guide-accessory--hivis-band { fill: #f8f9fa; stroke: none; }
.guide-accessory--box { fill: #c49a6c; stroke: #8a6a45; }

/* General: neutral staff lanyard and ID card. */
.guide--general .guide-body { fill: var(--brand); }
.guide-accessory--lanyard { fill: none; stroke: var(--accent); stroke-width: 4; }
.guide-accessory--lanyard-card { fill: var(--surface); stroke: var(--accent); }

/* Featured verified offers (a curated list, never a ranking). */
.featured-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.75rem; }
@media (min-width: 640px) { .featured-list { grid-template-columns: repeat(3, 1fr); } }
.featured-item {
  border: 1px solid var(--border); border-radius: var(--radius); padding: 0.85rem;
}
.featured-role { font-weight: 700; }

/* Legal pages */
.legal { max-width: 720px; }
.legal .facts { display: grid; gap: 0.5rem; margin-block: 1rem; }
.legal dt { font-weight: 700; }
.legal dd { margin: 0; color: var(--muted); }

/* Footer */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); padding-block: 1.5rem; }
.site-footer p { margin-block: 0.35rem; }
.ai-note { font-weight: 500; }

/* ---------------------------------------------------------------------------
 * Master Build surfaces: the assistant and the candidate account.
 *
 * Same tokens, same components, no new dependency. Everything below degrades to
 * readable stacked content when the stylesheet fails to load, because the markup
 * underneath it is ordinary headings, lists and forms.
 * ------------------------------------------------------------------------- */

.stack { display: grid; gap: 0.75rem; }
.actions { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-block: 0.75rem; }
.help { color: var(--muted); font-size: 0.87rem; margin-block: 0.25rem; }

.form-errors {
  margin: 0.4rem 0;
  padding: 0.5rem 0.75rem 0.5rem 1.5rem;
  border: 1px solid var(--danger);
  border-radius: var(--radius);
  color: var(--danger);
}

.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 0.4rem; padding: 0; margin: 0.4rem 0; }
.chip {
  display: inline-block;
  padding: 0.1rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.82rem;
}
.chip--good { border-color: var(--accent); color: var(--accent); }
.chip--warn { border-color: var(--danger); color: var(--danger); }

/* Assistant transcript. The question is the candidate's own words echoed back
 * from the session; nothing here is persisted to the database. */
.thread { display: grid; gap: 0.75rem; margin-block: 1rem; }
.turn {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 0.85rem 1rem;
}
.turn-question { margin-block: 0 0.4rem; }
.turn-answer { margin-block: 0; }

/* Candidate account */
.data-list { display: grid; gap: 0.5rem; margin-block: 1rem; }
.data-list dt { font-weight: 700; }
.data-list dd { margin: 0; color: var(--muted); }

.timeline { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.4rem; }
.timeline li { border-inline-start: 3px solid var(--border); padding-inline-start: 0.75rem; }
.timeline li:first-child { border-inline-start-color: var(--brand); }

.apply-form { margin-block: 1rem; display: grid; gap: 0.5rem; }

.record-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.6rem; }
.record-list > li {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 0.9rem;
  background: var(--surface);
}

.token-code {
  display: inline-block;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 1.1rem;
  letter-spacing: 0.06em;
  padding: 0.4rem 0.7rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  word-break: break-all;
}

/* ---------------------------------------------------------------------------
 * Candidate dashboard. Same tokens, mobile-first: one column of cards, large
 * tap targets, and a five-step ladder that reads top-to-bottom on a phone.
 * ------------------------------------------------------------------------- */

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1rem 1.1rem; margin-block: 1rem; box-shadow: var(--shadow);
}
.card h2 { margin-top: 0; }

.messages { list-style: none; padding: 0; margin: 0.75rem 0; display: grid; gap: 0.5rem; }
.messages li {
  border: 1px solid var(--border); border-inline-start: 4px solid var(--brand);
  border-radius: var(--radius); background: var(--surface); padding: 0.6rem 0.9rem;
}
.messages li.error, .messages li.warning { border-inline-start-color: var(--danger); }
.messages li.success { border-inline-start-color: var(--accent); }

.process { border-top: 1px solid var(--border); padding-top: 0.75rem; }
.process:first-child { border-top: 0; padding-top: 0; }
.process h3 { margin-block: 0 0.2rem; }
.process--closed { opacity: 0.8; }

.ladder { list-style: none; padding: 0; margin: 0.75rem 0; display: grid; gap: 0.35rem; }
.ladder-step { display: flex; align-items: center; gap: 0.55rem; color: var(--muted); }
.ladder-dot {
  width: 0.8rem; height: 0.8rem; border-radius: 50%; flex: none;
  border: 2px solid var(--border); background: var(--surface);
}
.ladder-step.is-reached { color: var(--text); }
.ladder-step.is-reached .ladder-dot { border-color: var(--accent); background: var(--accent); }
.ladder-step.is-current .ladder-label { font-weight: 700; }
.ladder-step.is-current .ladder-dot { border-color: var(--brand); background: var(--brand); }
@media (min-width: 640px) {
  .ladder { display: flex; flex-wrap: wrap; gap: 0.4rem 1.1rem; }
}

.action-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.6rem; }
.action-list li {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 0.7rem 0.9rem; display: flex; flex-wrap: wrap; gap: 0.3rem 0.75rem;
  align-items: baseline;
}
.action-list a { font-weight: 700; text-decoration: none; }

.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
