:root {
  --ink: #393541;
  --ink-soft: #746F7B;
  --paper: #FAF7F3;
  --paper-raised: #FFFDFC;
  --border: #E5DFE8;
  --teal: #827098;
  --teal-deep: #69567E;
  --amber: #9B684F;
  --error: #B23A3A;

  --display: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --body: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
}

body {
  display: flex;
  min-height: 100vh;
}

/* ====== Глобальный сайдбар-меню ====== */
.sidenav {
  width: 230px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  padding: 40px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-brand {
  all: unset;
  cursor: pointer;
  font-family: var(--display);
  font-weight: 600;
  font-size: 18px;
  color: var(--ink);
  margin: 0 12px 28px;
  display: block;
}
.nav-brand span { color: var(--amber); }

.nav-item {
  all: unset;
  box-sizing: border-box;
  cursor: pointer;
  font-family: var(--body);
  font-size: 14px;
  color: var(--ink-soft);
  padding: 11px 12px;
  border-radius: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.nav-item:hover { background: var(--paper-raised); color: var(--ink); }
.nav-item.active { background: #EDE7F3; color: var(--teal-deep); font-weight: 600; }
.nav-item:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }

.nav-num {
  font-family: var(--display);
  font-size: 12px;
  color: var(--border);
}
.nav-item.active .nav-num { color: var(--amber); }

.view-area {
  flex: 1;
  min-width: 0;
}

.view[hidden] { display: none; }

/* ====== Заглавная страница ====== */
.welcome {
  width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
}

.welcome-box {
  max-width: 560px;
  text-align: center;
}

.welcome-box h1 {
  font-size: 34px;
  margin-bottom: 40px;
}

.welcome-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.welcome-btn {
  padding: 13px 22px !important;
  border: 1px solid var(--border) !important;
  border-radius: 8px !important;
}
.welcome-btn:hover { border-color: var(--teal) !important; }

.test-back-wrap {
  padding: 64px 48px 0;
}

/* Внутренний rail+stage флекс-макет теста (кнопка "назад" — вне этого ряда) */
.test-layout {
  display: flex;
  min-height: 100vh;
}

/* ====== Статичные страницы: Вакансия / База знаний / Контакты ====== */
.page {
  max-width: 680px;
  padding: 64px 48px 100px;
}

.page-list {
  padding-left: 20px;
  line-height: 1.7;
  color: var(--ink);
  margin: 0 0 28px;
}
.page-list li { margin-bottom: 8px; }

.note {
  font-size: 13px;
  color: var(--ink-soft);
  background: #F1ECE7;
  padding: 12px 14px;
  border-radius: 6px;
  margin: 24px 0;
}
.note code {
  background: rgba(0,0,0,0.06);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 12px;
}

.kb-block {
  margin-bottom: 32px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.kb-block:last-child { border-bottom: none; }
.kb-block h3 {
  font-family: var(--display);
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 12px;
}
.kb-block p {
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--ink);
  margin: 0 0 14px;
}

/* ====== Списки (вакансии / база знаний) ====== */
.list-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.list-card {
  all: unset;
  box-sizing: border-box;
  width: 100%;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--paper-raised);
}
.list-card:hover { border-color: var(--teal); }
.list-card:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }

.list-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}

.list-card-arrow {
  color: var(--teal);
  font-size: 16px;
  flex-shrink: 0;
}

.btn-back {
  all: unset;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
  margin-bottom: 24px;
  display: inline-block;
}
.btn-back:hover { color: var(--teal-deep); }
.btn-back:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }

.closing-note {
  font-size: 14.5px;
  color: var(--teal-deep);
  background: #EDE7F3;
  padding: 14px 16px;
  border-radius: 6px;
  margin: 28px 0;
}

@media (max-width: 780px) {
  body { flex-direction: column; }
  .sidenav {
    width: 100%;
    flex-direction: row;
    overflow-x: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 14px 16px;
    gap: 6px;
  }
  .nav-brand { display: none; }
  .test-layout { flex-direction: column; }
  .page { padding: 36px 22px 80px; }
}

/* Signature element: sequential rail of blocks */
.rail {
  width: 220px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  padding: 40px 28px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

@media (max-width: 780px) {
  body { flex-direction: column; }
  .rail {
    width: 100%;
    flex-direction: row;
    overflow-x: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 18px 20px;
    gap: 18px;
  }
}

.rail-item {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 9px 0;
  font-size: 13px;
  color: var(--ink-soft);
  white-space: nowrap;
}

.rail-item .num {
  font-family: var(--display);
  font-size: 14px;
  color: var(--border);
  width: 18px;
}

.rail-item.active {
  color: var(--ink);
  font-weight: 600;
}
.rail-item.active .num { color: var(--amber); }

.rail-item.done .num::after { content: ''; }
.rail-item.done { color: var(--teal); }
.rail-item.done .num { color: var(--teal); }

.stage {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 64px 32px 100px;
}

.screen {
  width: 100%;
  max-width: 620px;
}

.eyebrow {
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--teal);
  font-weight: 600;
  margin: 0 0 10px;
}

h1 {
  font-family: var(--display);
  font-size: 40px;
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 18px;
}

h2 {
  font-family: var(--display);
  font-size: 28px;
  font-weight: 600;
  line-height: 1.2;
  margin: 0 0 28px;
}

h3 {
  font-family: var(--display);
  font-size: 19px;
  font-weight: 600;
  line-height: 1.3;
  margin: 32px 0 12px;
  color: var(--ink);
}

.page p {
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--ink);
  margin: 0 0 16px;
}

.vacancy-text-link {
  color: inherit;
  text-decoration: underline;
}

.lead {
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink-soft);
  margin: 0 0 32px;
  max-width: 52ch;
}

.field {
  margin-bottom: 18px;
}

.field label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--ink);
}

.field .req { color: var(--error); }
.field .opt { color: var(--ink-soft); font-weight: 400; }

.field input, .field textarea {
  width: 100%;
  font-family: var(--body);
  font-size: 15px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--paper-raised);
  color: var(--ink);
}

.field textarea {
  min-height: 90px;
  resize: vertical;
  line-height: 1.5;
}

.field input:focus, .field textarea:focus {
  outline: 2px solid var(--teal);
  outline-offset: 1px;
}

.btn-primary {
  font-family: var(--body);
  font-weight: 600;
  font-size: 15px;
  color: #fff;
  background: var(--teal-deep);
  border: none;
  border-radius: 6px;
  padding: 13px 26px;
  cursor: pointer;
}
.btn-primary:hover { background: var(--teal); }
.btn-primary:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }

.btn-ghost {
  font-family: var(--body);
  font-weight: 500;
  font-size: 15px;
  color: var(--ink-soft);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 13px 22px;
  cursor: pointer;
  margin-right: 12px;
}
.btn-ghost:hover { border-color: var(--ink-soft); color: var(--ink); }
.btn-ghost:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }

.nav-row {
  margin-top: 36px;
  display: flex;
}

.error {
  color: var(--error);
  font-size: 13px;
  min-height: 18px;
  margin: -6px 0 14px;
}

.question {
  margin-bottom: 28px;
  padding-bottom: 4px;
}

.question .q-label {
  font-size: 13px;
  color: var(--amber);
  font-weight: 600;
  margin-bottom: 6px;
}

.question .q-text {
  font-size: 16px;
  line-height: 1.5;
  margin: 0 0 12px;
}

.choice-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.choice-row label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
}

.choice-row input { accent-color: var(--teal-deep); }

.menu-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
}

.training-body p {
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--ink);
  margin: 0 0 16px;
}

@media (prefers-reduced-motion: no-preference) {
  .screen { animation: rise 0.35s ease; }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* FaFa — warm neutrals, soft lilac and rounded typography. */
[hidden] { display: none !important; }
.sidenav { background: #F3EFF4; padding-top: 42px; }
.nav-brand { font-size: 30px; font-weight: 800; letter-spacing: -1.8px; }
.nav-brand span { color: var(--teal); }
.nav-item { border-radius: 12px; transition: background .18s, border-color .18s; }
.nav-num { color: var(--ink-soft); }
.welcome { background: radial-gradient(ellipse at 18% 20%, #EDE6F3 0, transparent 50%), radial-gradient(ellipse at 85% 85%, #F5E6DD 0, transparent 50%), var(--paper); }
.welcome-box { max-width: 680px; width: 100%; }
.welcome-brand { display: inline-flex; align-items: center; position: relative; font-size: 72px; font-weight: 800; letter-spacing: -5px; margin: 0 0 38px; line-height: 1.1; }
.welcome-brand span { color: var(--teal); }
.welcome-brand i { color: #B38E75; font-size: 29px; font-style: normal; position: absolute; top: -8px; right: -33px; letter-spacing: 0; }
.welcome-box h1 { font-size: clamp(30px, 4.5vw, 46px); line-height: 1.25; letter-spacing: -1.6px; margin: 0 0 16px; }
.welcome-caption { color: var(--ink-soft); font-size: 16px; margin: 0 0 42px; }
.welcome-buttons { gap: 12px; }
.welcome-btn { background: #FFFDFBCC; border-radius: 100px !important; padding: 14px 23px !important; color: var(--ink); }
.welcome-btn:hover { background: #EDE7F3; }
h1, h2 { letter-spacing: -1px; }
.list-card { border-radius: 16px; padding: 21px 22px; transition: background .18s, border-color .18s; }
.list-card:hover { background: #F3EFF7; }
.note, .closing-note { border-radius: 12px; }
.btn-primary, .btn-ghost { border-radius: 12px; }
.field input, .field textarea, .choice-row label { border-radius: 12px; }
.choice-row label:hover { background: #F3EFF7; }
.choice-row label:has(input:checked) { background: #EDE7F3; border-color: var(--teal); }
@media (max-width: 780px) {
  .sidenav { padding: 14px 16px; }
  .sidenav .nav-item { white-space: nowrap; flex-shrink: 0; }
  .welcome { padding: 32px 22px; }
  .welcome-brand { font-size: 60px; }
  .welcome-buttons { max-width: 360px; margin: 0 auto; }
  .welcome-btn { justify-content: center; }
  .test-back-wrap { padding: 30px 22px 0; }
  .stage { padding: 32px 22px 70px; }
}

/* Clear entry points and readable vacancy details. */
.nav-links { display: flex; flex-direction: column; gap: 4px; }
.mobile-toggle { display: none; }
a { color: var(--teal-deep); text-underline-offset: 3px; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--teal-deep); outline-offset: 4px; }
.welcome-box { max-width: 800px; }
.welcome-facts { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 24px; margin: -16px 0 36px; font-size: 12px; color: var(--ink-soft); }
.welcome-facts span::before { content: '·'; margin-right: 8px; color: var(--teal); }
.welcome-main { background: var(--teal-deep); color: white; border-color: var(--teal-deep) !important; }
.welcome-main:hover { background: var(--teal); color: white; }
.welcome-secondary { display: flex; justify-content: center; gap: 18px; margin-top: 26px; color: var(--ink-soft); font-size: 13px; }
.welcome-secondary a { color: var(--ink-soft); }
.page { max-width: 840px; width: 100%; }
.list-card-title { display: block; }
.vacancy-meta { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; font-size: 12px; line-height: 1.5; color: var(--ink-soft); }
.vacancy-meta span { background: #F1ECF4; padding: 4px 9px; border-radius: 7px; }
.vacancy-facts { background: #F2EDF5; border: 1px solid var(--border); border-radius: 18px; padding: 8px 22px; margin: 28px 0 36px; }
.vacancy-facts div { display: grid; grid-template-columns: 100px 1fr; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--border); font-size: 14px; line-height: 1.65; }
.vacancy-facts div:last-child { border: 0; }
.vacancy-facts dt { color: var(--ink-soft); }
.vacancy-facts dd { margin: 0; font-weight: 600; }
.contact-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.contact-card { display: block; text-decoration: none; border: 1px solid var(--border); border-radius: 18px; padding: 24px; background: var(--paper-raised); }
.contact-card:hover { border-color: var(--teal); background: #F3EFF7; }
.contact-card .eyebrow { font-size: 11px; display: block; line-height: 1.7; }
.contact-card h3 { margin: 16px 0 8px; }
.contact-card p { margin: 18px 0 0; color: var(--ink-soft); font-size: 14px; }
.cooperation-steps { list-style: none; counter-reset: steps; padding: 0; margin: 24px 0 36px; }
.cooperation-steps li { counter-increment: steps; display: grid; grid-template-columns: 36px 1fr; column-gap: 14px; margin: 0 0 22px; font-size: 14px; line-height: 1.6; }
.cooperation-steps li::before { content: counter(steps, decimal-leading-zero); grid-row: span 2; color: var(--teal); font-weight: 700; }
.cooperation-steps strong { color: var(--ink); }
.cooperation-steps span { color: var(--ink-soft); }
@media (min-width: 781px) { .sidenav { align-self: flex-start; position: sticky; top: 0; min-height: 100vh; } }
@media (max-width: 780px) {
  .sidenav { position: sticky; top: 0; z-index: 10; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; overflow: visible; background: #F3EFF4F5; backdrop-filter: blur(12px); }
  .sidenav .nav-brand { display: block; margin: 0; font-size: 28px; }
  .mobile-toggle { display: block; border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; background: var(--paper-raised); color: var(--ink); font: inherit; font-size: 14px; cursor: pointer; }
  .nav-links { display: none; flex-basis: 100%; padding-top: 12px; }
  .menu-open .nav-links { display: flex; }
  .nav-links .nav-item { min-height: 44px; }
  .welcome-buttons { flex-direction: column; }
  .welcome-btn { width: 100%; min-height: 48px; }
  .desktop-break { display: none; }
  .welcome-facts { gap: 8px 14px; line-height: 1.6; }
  .contact-cards { grid-template-columns: 1fr; }
  .vacancy-facts { padding: 8px 16px; }
  .vacancy-facts div { grid-template-columns: 1fr; gap: 3px; }
  h1 { font-size: 32px; }
}

.proposal-card { grid-column: 1 / -1; text-align: left; font: inherit; cursor: pointer; color: var(--ink); }
#proposal-dialog { width: min(580px, calc(100% - 32px)); max-height: calc(100dvh - 32px); overflow-y: auto; border: 1px solid var(--border); border-radius: 22px; padding: 36px; background: var(--paper); color: var(--ink); }
#proposal-dialog::backdrop { background: rgb(35 28 44 / 38%); backdrop-filter: blur(4px); }
body:has(#proposal-dialog[open]) { overflow: hidden; }
.dialog-close { display: block; margin: -14px -14px 12px auto; width: 44px; height: 44px; border: 1px solid var(--border); border-radius: 50%; background: var(--paper-raised); color: var(--ink); cursor: pointer; }
#proposal-dialog h2 { margin-bottom: 16px; font-size: 27px; }
#proposal-dialog .lead { margin-bottom: 24px; font-size: 14px; }
.field-hint { color: var(--ink-soft); font-size: 12px; line-height: 1.6; margin: 7px 0 0; }
#proposal-message { min-height: 150px; }
#proposal-error { line-height: 1.6; }
button:disabled { cursor: wait; opacity: .6; }
#proposal-success:focus { outline: none; }
@media (max-width: 600px) {
  #proposal-dialog { padding: 26px 22px; }
  #proposal-send { width: 100%; }
}
