:root {
  --ink: #20242C;
  --ink-soft: #565C66;
  --paper: #FAF9F5;
  --paper-raised: #FFFFFF;
  --border: #E1DDD1;
  --teal: #3C6E68;
  --teal-deep: #2A4E4A;
  --amber: #C98A3E;
  --error: #B23A3A;

  --display: 'Fraunces', ui-serif, Georgia, serif;
  --body: 'Inter', -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: #EAF1EF; 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: #F0EEE7;
  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: #EAF1EF;
  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;
}

.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); }
}
