/* Candidate Test v0.3 RC 002: bounded result thread and edit shell. */
:root {
  --candidate-thread: #85243f;
  --candidate-thread-soft: rgba(133, 36, 63, .18);
  --candidate-visited: #aeb8c8;
  --candidate-future: #667184;
}

.candidate-v03-segments {
  position: relative;
  display: flex;
  gap: 0;
  margin: 0 0 28px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: thin;
  border-bottom: 1px solid rgba(255,255,255,.10);
}

.candidate-v03-segments::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--candidate-thread), transparent 72%);
  pointer-events: none;
}

.candidate-v03-step {
  position: relative;
  flex: 0 0 104px;
  min-height: 72px;
  padding: 10px 12px 12px;
  border: 0;
  border-right: 1px solid rgba(255,255,255,.07);
  border-radius: 0;
  background: transparent;
  color: var(--candidate-future);
  text-align: left;
  cursor: pointer;
}

.candidate-v03-step::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: -1px;
  height: 3px;
  background: transparent;
}

.candidate-v03-number,
.candidate-v03-state {
  display: block;
  font: 700 10px/1.25 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .06em;
}

.candidate-v03-label {
  display: block;
  margin: 5px 0 6px;
  color: inherit;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.candidate-v03-state {
  font-size: 9px;
  font-weight: 650;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.candidate-v03-step[data-state="active"] {
  color: #eef3ff;
  background: var(--candidate-thread-soft);
}

.candidate-v03-step[data-state="active"]::after {
  background: var(--candidate-thread);
}

.candidate-v03-step[data-state="visited"] {
  color: var(--candidate-visited);
}

.candidate-v03-step[data-state="visited"] .candidate-v03-number::before {
  content: "✓ ";
  color: #79c596;
}

.candidate-v03-step[data-state="future"] .candidate-v03-number::before {
  content: "· ";
}

.candidate-v03-step:focus-visible {
  outline: 3px solid #b55f74;
  outline-offset: -3px;
  z-index: 1;
}

@media (min-width: 760px) {
  .candidate-v03-segments {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    overflow: visible;
  }

  .candidate-v03-step {
    min-width: 0;
    width: 100%;
  }
}

@media (max-width: 480px) {
  .candidate-v03-step {
    flex-basis: 92px;
    min-height: 68px;
    padding-inline: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .candidate-v03-segments,
  .candidate-v03-step {
    scroll-behavior: auto;
  }
}

/* CSS-generated labels from the pinned v0.2 layer follow the selected Candidate language. */
html[lang="ru"] .candidate-page .choice.selected::after{content:"✓ Выбрано"}
html[lang="sl"] .candidate-page .choice.selected::after{content:"✓ Izbrano"}
html[lang="en"] .candidate-page .choice.selected::after{content:"✓ Selected"}
html[lang="ru"] .candidate-page .pref-chip[data-state="like"]::after{content:" · скорее выберу"}
html[lang="sl"] .candidate-page .pref-chip[data-state="like"]::after{content:" · raje izberem"}
html[lang="en"] .candidate-page .pref-chip[data-state="like"]::after{content:" · prefer"}
html[lang="ru"] .candidate-page .pref-chip[data-state="avoid"]::after{content:" · избегу"}
html[lang="sl"] .candidate-page .pref-chip[data-state="avoid"]::after{content:" · raje se izognem"}
html[lang="en"] .candidate-page .pref-chip[data-state="avoid"]::after{content:" · avoid"}
html[lang="ru"] .candidate-page .condition-chip[data-state="prefer_not"]::after{content:" · нежелательно"}
html[lang="sl"] .candidate-page .condition-chip[data-state="prefer_not"]::after{content:" · nezaželeno"}
html[lang="en"] .candidate-page .condition-chip[data-state="prefer_not"]::after{content:" · undesirable"}
html[lang="ru"] .candidate-page .condition-chip[data-state="hard_no"]::after{content:" · жёсткое «нет»"}
html[lang="sl"] .candidate-page .condition-chip[data-state="hard_no"]::after{content:" · odločen »ne«"}
html[lang="en"] .candidate-page .condition-chip[data-state="hard_no"]::after{content:" · firm no"}

/* RC 002: sequential, evidence-labelled result and a clear edit action. */
#result .result-grid{align-items:stretch}
#result .result-card{background:#0d1119;border-color:rgba(148,163,184,.17);padding:15px 16px}
#result .result-card h3{color:#e8edf5}
#result .result-thread-phase{margin:0 0 8px;color:var(--brand-rose);font-size:.68rem;font-weight:800;letter-spacing:.08em;line-height:1.35;text-transform:uppercase}
#result .result-thread-provenance{margin:0 0 12px;color:var(--role-provenance);line-height:1.5}
#result .result-card[data-result-thread-role="evidence"],
#result .result-card[data-result-thread-role="constraint"]{border-inline-start:3px solid rgba(155,45,66,.78)}
#result .result-card[data-result-thread-role="hypothesis"]{border-inline-start:3px solid var(--role-warning)}
#result .result-card[data-result-thread-role="hypothesis"] .result-thread-phase{color:var(--role-warning)}
#result .result-card[data-result-thread-role="unknowns"]{border-inline-start:3px solid var(--role-warning)}
#result .result-card[data-result-thread-role="unknowns"] .result-thread-phase{color:var(--role-warning)}
#result .result-card[data-result-thread-role="history"]{border-inline-start:3px solid #687386}
#result .result-card[data-result-thread-role="history"] .result-thread-phase{color:var(--role-provenance)}
#result .result-thread-next-step{grid-column:1 / -1;min-width:0;padding:18px;border:1px solid rgba(155,45,66,.58);border-inline-start:4px solid var(--brand-crimson);border-radius:15px;background:#171019;overflow-wrap:anywhere}
#result .result-thread-next-step__eyebrow{margin:0 0 7px;color:var(--brand-rose);font-size:.7rem;font-weight:700;letter-spacing:.08em}
#result .result-thread-next-step h3{margin:0;color:#eff6ff;font-size:1rem;line-height:1.4}
#result .result-thread-next-step__help{margin:8px 0 16px;color:#d4deed;line-height:1.5}
#result .result-thread-next-step__action{display:inline-flex;align-items:center;justify-content:center;min-height:46px;margin-top:4px}
@media(max-width:640px){
  #result .result-grid{grid-template-columns:1fr}
  #result .result-thread-next-step__action{min-height:46px}
}


/* UNDERSMER active Candidate theme: burgundy and storm, sourced from the approved DEV prototype. */
.candidate-page {
  color-scheme: dark;
  --bg: #070507;
  --panel: #10070c;
  --panel2: #170910;
  --line: rgba(126, 148, 159, .24);
  --text: #e3d9dc;
  --muted: #b2a3a8;
  --blue: #85243f;
  --blue2: #b55f74;
  --brand-crimson: #85243f;
  --brand-rose: #b55f74;
  --role-provenance: #91a1aa;
  --role-warning: #d3a85f;
  --candidate-thread: #85243f;
  --candidate-thread-soft: rgba(133, 36, 63, .18);
  --candidate-visited: #91a1aa;
  --candidate-future: #927f85;
  --ux-blue: #b55f74;
  --focus-ring: #b55f74;
  --family-neutral: #91a1aa;
}
.candidate-page body {
  background: linear-gradient(180deg, #10070c 0%, #070507 48%, #080608 100%);
  color: var(--text);
}
.candidate-page .topbar {
  gap: 16px;
  border-bottom-color: rgba(139, 40, 65, .36);
  background: rgba(7, 5, 7, .94);
  backdrop-filter: none;
}
.candidate-page .brand-lockup,
.candidate-page .candidate-header-actions {
  display: flex;
  align-items: center;
  min-width: 0;
}
.candidate-page .brand-lockup { gap: 14px; }
.candidate-page .brand-logo { display:block; width:min(148px, 32vw); height:40px; object-fit:contain; }
.candidate-page .candidate-header-actions { gap: 16px; justify-content:flex-end; flex-wrap:wrap; }
.candidate-page .subtitle,
.candidate-page .privacy { color:#b2a3a8; }
.candidate-page .privacy { line-height:1.5; }
.candidate-page .candidate-language-switch {
  display:flex;
  align-items:center;
  gap:4px;
  padding:3px;
  border:1px solid rgba(126,148,159,.3);
  border-radius:10px;
  background:#10070c;
}
.candidate-page .candidate-language-switch button {
  min-width:44px;
  min-height:44px;
  padding:8px 10px;
  border:1px solid transparent;
  border-radius:7px;
  background:transparent;
  color:#d9ced1;
  font-weight:800;
}
.candidate-page .candidate-language-switch button[aria-pressed="true"] {
  border-color:rgba(181,95,116,.55);
  background:rgba(133,36,63,.32);
  color:#fff;
}
.candidate-page .hero,
.candidate-page .wizard,
.candidate-page .result {
  border-color:rgba(139,40,65,.32);
  background:linear-gradient(180deg,rgba(16,7,12,.98),rgba(11,6,9,.98));
  box-shadow:0 18px 45px rgba(0,0,0,.34);
}
.candidate-page .eyebrow { color:#b55f74; }
.candidate-page .hero p,
.candidate-page .hint { color:#d0c2c6; }
.candidate-page .notice,
.candidate-page .final-check {
  border-color:rgba(139,40,65,.52);
  background:rgba(58,13,30,.36);
  color:#e3d9dc;
}
.candidate-page .primary { background:#85243f; color:#fff; }
.candidate-page .secondary,
.candidate-page .candidate-employer-search__submit,
.candidate-page .candidate-employer-search__back {
  border-color:rgba(126,148,159,.38);
  background:#171318;
  color:#e3d9dc;
}
.candidate-page .candidate-v03-step { color:#927f85; }
.candidate-page .candidate-v03-step[data-state="active"] {
  color:#fff;
  background:rgba(133,36,63,.22);
}
.candidate-page .candidate-v03-step[data-state="visited"] { color:#91a1aa; }
.candidate-page .candidate-v03-step:focus-visible,
.candidate-page :focus-visible {
  outline:3px solid #b55f74;
  outline-offset:2px;
}
.candidate-page input,
.candidate-page textarea,
.candidate-page select {
  border-color:rgba(126,148,159,.34);
  background:#0d090c;
  color:#f4ebee;
}
.candidate-page input:focus,
.candidate-page textarea:focus,
.candidate-page select:focus {
  border-color:#b55f74;
  box-shadow:0 0 0 3px rgba(181,95,116,.2);
}
.candidate-page .choice,
.candidate-page .chip,
.candidate-page .pref-chip,
.candidate-page .condition-chip {
  border-color:rgba(126,148,159,.28);
  background:#100c10;
  color:#e3d9dc;
}
.candidate-page .choice.selected,
.candidate-page .chip.selected,
.candidate-page .pref-chip.selected,
.candidate-page .condition-chip.selected {
  border-color:#b55f74;
  background:rgba(133,36,63,.24);
  box-shadow:inset 0 0 0 1px rgba(181,95,116,.22);
  color:#fff;
}

/* State colors follow the live data-state values from app.js after this theme overrides the base UX layer. */
.candidate-page .pref-chip[data-state="neutral"],
.candidate-page .condition-chip[data-state="neutral"] {
  border-color:rgba(126,148,159,.42);
  background:#100c10;
  color:#e3d9dc;
}
.candidate-page .pref-chip[data-state="like"] {
  border-color:rgba(102,195,163,.78);
  background:var(--ux-positive-bg);
  color:#ddfff1;
}
.candidate-page .pref-chip[data-state="avoid"] {
  border-color:rgba(217,120,128,.82);
  background:var(--ux-negative-bg);
  color:#ffe2e4;
}
.candidate-page .condition-chip[data-state="prefer_not"] {
  border-color:rgba(211,168,95,.82);
  background:var(--ux-caution-bg);
  color:#ffe9bf;
}
.candidate-page .condition-chip[data-state="hard_no"] {
  border-color:rgba(235,105,117,.9);
  background:rgba(133,36,63,.34);
  color:#fff0f2;
}

.candidate-page .task-family-nav {
  border-color:rgba(126,148,159,.28);
  background:rgba(16,7,12,.97);
  backdrop-filter:none;
}
.candidate-page .task-family-chip,
.candidate-page .task-group,
.candidate-page .signal-family {
  border-color:rgba(126,148,159,.28);
  background-color:#100c10;
}
.candidate-page .task-family-chip[aria-pressed="true"],
.candidate-page .task-group[open],
.candidate-page .signal-family[open] {
  border-color:rgba(181,95,116,.48);
  background-color:rgba(58,13,30,.38);
}
.candidate-page #result .result-card,
.candidate-page .candidate-employer-search,
.candidate-page .candidate-employer-search__dossier,
.candidate-page .candidate-employer-search__technical {
  border-color:rgba(126,148,159,.25);
  background-color:#100c10;
}
.candidate-page #result .result-card h3 { color:#e3d9dc; }
.candidate-page #result .result-thread-next-step {
  border-color:rgba(181,95,116,.55);
  background:#171019;
}
.candidate-page #result .result-thread-next-step h3 { color:#f4ebee; }
.candidate-page .candidate-vacancy__actions .candidate-vacancy__link,
.candidate-page .candidate-employer-search__actions > .candidate-employer-search__link,
.candidate-page .candidate-employer-search__more {
  border-color:rgba(181,95,116,.42);
  background:rgba(133,36,63,.14);
  color:#e7c6ce;
}
.candidate-page .candidate-vacancy__actions .candidate-vacancy__link:hover,
.candidate-page .candidate-employer-search__actions > .candidate-employer-search__link:hover,
.candidate-page .candidate-employer-search__more:hover {
  border-color:#b55f74;
  background:rgba(133,36,63,.26);
}
.candidate-page .candidate-employer-search__technical-summary::after { color:#b55f74; }
.candidate-page .candidate-employer-search__suggestion {
  border-color:rgba(181,95,116,.38);
  background:rgba(133,36,63,.1);
}
.candidate-page .candidate-employer-search__more:focus-visible,
.candidate-page .candidate-employer-search__actions a:focus-visible {
  outline:3px solid #b55f74;
  outline-offset:2px;
}
.candidate-page a { color:#d68b9d; }
.candidate-page .candidate-employer-search__card h4 { color:#f0e5e8; }
.candidate-page .candidate-employer-search__address,
.candidate-page .candidate-employer-search__registry { color:#b2a3a8; }
.candidate-page button { min-height:44px; }
.candidate-page .candidate-v03-step { min-height:68px; }
.candidate-page *, .candidate-page *::before, .candidate-page *::after {
  animation:none !important;
  transition:none !important;
  scroll-behavior:auto !important;
}
@media (max-width: 640px) {
  .candidate-page .topbar { align-items:flex-start; flex-wrap:wrap; gap:10px; padding:12px; }
  .candidate-page .brand-lockup { flex:1 1 150px; }
  .candidate-page .brand-logo { width:min(128px,39vw); height:36px; }
  .candidate-page .candidate-header-actions { width:100%; justify-content:space-between; gap:8px; }
  .candidate-page .candidate-language-switch { order:0; }
  .candidate-page .privacy { order:1; font-size:11px; }
  .candidate-page .shell { padding:18px 12px 56px; }
  .candidate-page .hero,
  .candidate-page .wizard,
  .candidate-page .result { padding:18px; border-radius:18px; }
  .candidate-page .candidate-v03-step { flex-basis:92px; min-height:68px; padding-inline:10px; }
}
@media (max-width: 360px) {
  /* Keep language and local-profile status side by side instead of stacking an extra header row. */
  .candidate-page .candidate-header-actions { align-items:center; flex-direction:row; flex-wrap:nowrap; }
  .candidate-page .candidate-language-switch { width:auto; flex:0 0 auto; }
  .candidate-page .candidate-language-switch button { flex:0 0 auto; }
  .candidate-page .privacy { flex:0 1 130px; max-width:130px; }
}


/* Shared UNDERSMER header: one approved artwork clipped into left wordmark
   and a separate visually centred jester crest. Keeps all original WebPs intact. */
.candidate-page .candidate-topbar {
  position: relative;
  min-height: 86px;
  background: #000;
  border-bottom-color: rgba(139, 40, 65, .5);
  align-items: center;
  flex-wrap: wrap;
}
.candidate-page .brand-lockup {
  flex: 0 1 auto;
  gap: 10px;
  min-width: 0;
}
.candidate-page .candidate-brand-home {
  display: block;
  width: 214px;
  height: 72px;
  position: relative;
  overflow: hidden;
  flex: 0 0 auto;
}
.candidate-page .brand-lockup .brand-logo {
  display: block;
  position: absolute;
  left: -85px;
  top: 0;
  width: 300px;
  max-width: none;
  height: auto;
  aspect-ratio: 560 / 132;
  object-fit: initial;
}
.candidate-page .candidate-topbar::before {
  content: "";
  pointer-events: none;
  position: absolute;
  z-index: 1;
  top: 11px;
  left: 50%;
  transform: translateX(-50%);
  width: 74px;
  height: 74px;
  background: #000 url("../assets/brand/undersmer-header-lockup-red.webp") no-repeat left center / 344px auto;
  filter: brightness(1.2) saturate(1.14);
}
.candidate-page .candidate-header-actions {
  flex: 0 1 auto;
  min-width: 0;
  gap: 12px;
}
.candidate-page .candidate-topbar .subtitle {
  color: #e9c5cf;
  font-size: 12px;
}
@media (max-width: 640px) {
  .candidate-page .candidate-topbar {
    min-height: 66px;
    gap: 10px;
    padding: 10px 12px;
  }
  .candidate-page .brand-lockup {
    flex: 1 1 100%;
    justify-content: space-between;
    flex-wrap: nowrap;
    gap: 8px;
  }
  .candidate-page .candidate-brand-home { width: 132px; height: 48px; }
  .candidate-page .brand-lockup .brand-logo { width: 190px; left: -54px; }
  .candidate-page .candidate-topbar::before {
    top: 9px;
    width: 56px;
    height: 57px;
    background-size: 260px auto;
  }
  .candidate-page .candidate-header-actions {
    flex: 1 1 100%;
    justify-content: space-between;
    gap: 10px;
    margin-top: 5px;
  }
  .candidate-page .candidate-topbar .privacy { font-size: 12px; }
}

/* Employer editor follows the dark navy interior palette inside the burgundy shell. */
.candidate-page .ux-work-history-row{display:block;min-width:0;padding:14px;border:1px solid #3a506b;border-radius:14px;background:#121e30;color:#edf3fc}
.candidate-page .ux-work-history-summary{display:flex;flex-wrap:wrap;align-items:baseline;gap:7px;min-width:0;line-height:1.5;color:#edf3fc}
.candidate-page .ux-work-history-number{font-size:12px;font-weight:700;letter-spacing:.03em;color:#b8cbdf}
.candidate-page .ux-work-history-preview-extra{flex-basis:100%;margin-inline-start:28px;color:#c1cddd}
.candidate-page .ux-work-history-edit{margin-top:10px}
.candidate-page .ux-work-history-edit>summary{min-height:44px;display:flex;align-items:center;cursor:pointer;color:#adcfff;font-weight:700;text-decoration:underline;text-underline-offset:3px}
.candidate-page .ux-work-history-edit>summary:focus-visible{outline:3px solid #9ecaff;outline-offset:3px;border-radius:5px}
.candidate-page .ux-work-history-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;min-width:0;margin-top:10px}
.candidate-page .ux-work-history-fields>label{display:grid;align-content:start;gap:6px;min-width:0;font-weight:650;color:#e6eefb}
.candidate-page .ux-work-history-fields input[type="text"]{width:100%;min-width:0;min-height:44px;padding:9px 11px;border:1px solid #5b7494;border-radius:10px;background:#0c1728;color:#f2f6ff;font:inherit}
.candidate-page .ux-work-history-fields input[type="text"]:focus-visible{outline:3px solid #9ecaff;outline-offset:2px}
.candidate-page .ux-work-history-fields .ux-work-history-extra-field{grid-column:1/-1}
.candidate-page .ux-work-history-legal{grid-column:1/-1;min-width:0;margin:0;padding:12px;border:1px solid #3b5776;border-radius:12px;background:#101c2e;color:#e6eefb}
.candidate-page .ux-work-history-legal legend{padding:0 5px;font-weight:700;color:#ecf3ff}
.candidate-page .ux-work-history-choices{display:flex;flex-wrap:wrap;gap:8px}
.candidate-page .ux-work-history-choice{display:flex;align-items:center;gap:7px;min-height:44px;padding:7px 10px;border:1px solid #49617e;border-radius:10px;background:#17253b;color:#e9f1fd;font-weight:650}
.candidate-page .ux-work-history-choice:has(input[type="radio"]:checked){border-color:#9dc9ff;background:#233955;color:#fff}
.candidate-page .ux-work-history-choice:focus-within{outline:2px solid #9ecaff;outline-offset:2px}
.candidate-page .ux-work-history-choice input[type="radio"]{width:20px;height:20px;margin:0;accent-color:#8fbdf5}
.candidate-page .ux-work-history-other{margin-top:10px}
.candidate-page .ux-work-history-other[hidden]{display:none!important}
.candidate-page .ux-work-history-skip,.candidate-page .ux-work-history-done{min-height:44px}
.candidate-page .ux-work-history-typed-form,.candidate-page .ux-work-history-provenance{margin:.7em 0 0;color:#bdcde0}
.candidate-page .ux-work-history-actions{grid-column:1/-1;display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:10px}
@media(max-width:560px){.candidate-page .ux-work-history-row{padding:12px}.candidate-page .ux-work-history-fields{grid-template-columns:minmax(0,1fr)}.candidate-page .ux-work-history-fields .ux-work-history-extra-field,.candidate-page .ux-work-history-legal,.candidate-page .ux-work-history-actions{grid-column:1}}


/* Return to the site is distinct from the questionnaire Back action. */
.candidate-page .candidate-home-control {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  flex:0 0 44px;
  width:44px;
  min-height:44px;
  border:1px solid rgba(126,148,159,.38);
  border-radius:10px;
  background:#171318;
  color:#f4ebee;
  text-decoration:none;
}
.candidate-page .candidate-home-control:hover { border-color:#b55f74; background:#27131d; }
.candidate-page .candidate-home-control svg { pointer-events:none; }
@media(max-width:640px) {
  .candidate-page .candidate-header-actions { flex-wrap:nowrap; gap:8px; }
  .candidate-page .candidate-topbar .privacy { flex:1 1 0; min-width:0; max-width:none; font-size:11px; }
}
