/* lsr-kariera - один файл стилей на весь проект.
   Два контура: .cand-* - экраны кандидатки (телефон, крупно, спокойно),
   .rec-* - кабинет рекрутёра (Катя, Влада, Оля, Андрей).
   Мобильный первым: базовые правила - для телефона, десктоп добирается медиазапросами.
   Внешних шрифтов и CDN нет - всё локально, страница поднимается без сети. */

:root {
  /* палитра бренда (business/assets/brand-guidelines.md) */
  --brand: #1b98a9;
  --brand-dark: #0f5870;
  --brand-soft: #e8f4f6;
  --ink: #242828;
  --muted: #6b7684;
  --line: #e2e7ea;
  --bg: #f4f4f4;
  --card: #ffffff;
  --ok: #1a7f5a;
  --warn: #a76a00;
  --danger: #b3261e;
  --danger-soft: #fdeceb;

  --radius: 12px;
  --radius-lg: 16px;
  --shadow: 0 1px 2px rgba(36, 40, 40, .05), 0 10px 26px rgba(36, 40, 40, .06);
  /* минимальная высота кнопки и поля: палец, а не курсор */
  --tap: 52px;

  color-scheme: light;   /* иначе тёмная тема телефона перекрашивает поля формы */
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, sans-serif;
}

a { color: var(--brand-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }

img, video { max-width: 100%; }

/* =========================================================================
   Кабинет рекрутёра
   ========================================================================= */

.rec-top {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px 18px;
  flex-wrap: wrap;
}

.rec-brand {
  font-weight: 700;
  font-size: 16px;
  color: var(--ink);
  white-space: nowrap;
}
.rec-brand:hover { text-decoration: none; }
.rec-brand span { color: var(--brand); font-weight: 600; }

.rec-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.rec-nav a {
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 600;
  font-size: 15px;
}
.rec-nav a:hover { background: var(--bg); text-decoration: none; }
.rec-nav a.active { background: var(--brand-soft); color: var(--brand-dark); }

.rec-user {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}
.rec-user__name { color: var(--muted); font-size: 14px; }
.rec-user form { margin: 0; }

.rec-wrap { max-width: 1200px; margin: 0 auto; padding: 16px 14px 48px; }

.rec-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
}

.rec-h1 { font-size: 22px; line-height: 1.25; margin: 0 0 6px; }
.rec-h2 { font-size: 17px; line-height: 1.3; margin: 18px 0 8px; }
.rec-note { color: var(--muted); font-size: 14px; margin: 0 0 14px; }
.rec-hint { color: var(--muted); font-size: 13px; margin: 14px 0 0; }

.rec-err {
  background: var(--danger-soft);
  color: var(--danger);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin: 0 0 12px;
  font-size: 15px;
}
.rec-ok { color: var(--ok); font-size: 15px; margin: 0 0 12px; }

.rec-empty {
  color: var(--muted);
  text-align: center;
  padding: 40px 16px;
}

/* --- кнопки и поля --- */

.rec-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  border: 0;
  border-radius: 10px;
  background: var(--brand);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
}
.rec-btn:hover { background: var(--brand-dark); text-decoration: none; color: #fff; }
.rec-btn[disabled] { opacity: .45; cursor: default; }
.rec-btn--ghost { background: var(--bg); color: var(--ink); border: 1px solid var(--line); }
.rec-btn--ghost:hover { background: #eceff1; color: var(--ink); }
.rec-btn--danger { background: var(--danger); }
.rec-btn--danger:hover { background: #8f1e18; }
.rec-btn--sm { min-height: 36px; padding: 6px 12px; font-size: 14px; }

.rec-form { display: flex; flex-direction: column; gap: 8px; }
.rec-label { font-size: 13px; color: var(--muted); }
.rec-input,
.rec-select,
.rec-textarea {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 16px;   /* меньше 16px - iOS Safari зумит страницу при фокусе */
}
.rec-textarea { min-height: 90px; resize: vertical; }
.rec-form .rec-btn { margin-top: 6px; min-height: var(--tap); }

.rec-login { max-width: 380px; margin: 8vh auto 0; background: var(--card);
             border: 1px solid var(--line); border-radius: var(--radius-lg);
             padding: 22px 20px; box-shadow: var(--shadow); }

/* --- фильтры со «Все» (мультивыбор из lsr-portal) --- */

.rec-filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: flex-end;
}
.rec-filters label,
.rec-filters .rec-fgroup { display: flex; flex-direction: column; gap: 4px;
                           font-size: 13px; color: var(--muted); }

.rec-msel, details.msel { position: relative; }
.rec-msel > summary, details.msel > summary {
  list-style: none;
  cursor: pointer;
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 8px 12px;
  min-width: 150px;
  max-width: 260px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-size: 15px;
  user-select: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rec-msel > summary::-webkit-details-marker,
details.msel > summary::-webkit-details-marker { display: none; }
.rec-msel > summary::after, details.msel > summary::after {
  content: " ▾"; color: var(--muted); margin-left: auto; padding-left: 8px;
}
.rec-msel .opts, details.msel .opts {
  position: absolute;
  z-index: 30;
  top: calc(100% + 4px);
  left: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px;
  box-shadow: var(--shadow);
  max-height: 320px;
  overflow: auto;
  min-width: 230px;
}
.rec-msel .opts label, details.msel .opts label {
  display: flex;
  flex-direction: row;
  gap: 10px;
  align-items: center;
  padding: 8px 6px;
  font-size: 15px;
  color: var(--ink);
  border-radius: 8px;
  white-space: nowrap;
  cursor: pointer;
}
.rec-msel .opts label:hover, details.msel .opts label:hover { background: var(--brand-soft); }
.rec-msel .opts label.all, details.msel .opts label.all {
  font-weight: 600; border-bottom: 1px solid var(--line); margin-bottom: 4px;
}
.rec-msel .opts input[type=checkbox], details.msel .opts input[type=checkbox] {
  width: 20px; height: 20px; flex: none; accent-color: var(--brand);
}

/* На телефоне список значений раскрывается прямо в форме: всплывающая панель
   шириной 230px не влезает в экран и уезжала бы за правый край. */
@media (max-width: 760px) {
  .rec-filters { flex-direction: column; align-items: stretch; }
  .rec-msel > summary, details.msel > summary { max-width: none; }
  .rec-msel .opts, details.msel .opts {
    position: static;
    min-width: 0;
    box-shadow: none;
    margin-top: 6px;
  }
}

/* --- таблица списка кандидаток --- */

.rec-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.rec-table th, .rec-table td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.rec-table th {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
  white-space: normal;   /* заголовок переносится, таблица влезает в окно */
  cursor: pointer;
  user-select: none;
}
.rec-table th:hover { color: var(--ink); }
.rec-table th.sorted-desc::after { content: " ▼"; color: var(--brand); font-size: 10px; }
.rec-table th.sorted-asc::after { content: " ▲"; color: var(--brand); font-size: 10px; }
.rec-table td.num, .rec-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.rec-table tbody tr:hover td { background: #f7fbfc; }
.rec-table a { font-weight: 600; }

/* На телефоне таблица разворачивается в карточки: подпись строки берётся
   из data-label у каждой ячейки, горизонтальной прокрутки не остаётся. */
@media (max-width: 760px) {
  .rec-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .rec-table tr {
    display: block;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 4px 12px;
    margin-bottom: 10px;
  }
  .rec-table td {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 14px;
    padding: 8px 0;
    border-bottom: 1px dashed var(--line);
    text-align: right;
  }
  .rec-table td:last-child { border-bottom: 0; }
  .rec-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 13px;
    text-align: left;
    flex: 0 0 auto;
  }
  .rec-table tbody tr:hover td { background: transparent; }
}

/* --- метки состояния --- */

.rec-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--bg);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.rec-badge--ok { background: #e7f4ee; color: var(--ok); }
.rec-badge--warn { background: #fdf3e2; color: var(--warn); }
.rec-badge--danger { background: var(--danger-soft); color: var(--danger); }
.rec-badge--brand { background: var(--brand-soft); color: var(--brand-dark); }

.rec-diamond { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* --- карточка кандидатки --- */

.rec-kv { display: grid; grid-template-columns: 1fr; gap: 8px 18px; margin: 0; }
.rec-kv dt { color: var(--muted); font-size: 13px; }
.rec-kv dd { margin: 0 0 6px; }

.rec-answer { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 14px; }
.rec-answer video { width: 100%; border-radius: var(--radius); background: #0d1516; }
.rec-transcript {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 12px;
  font-size: 15px;
  line-height: 1.55;
  max-height: 320px;
  overflow: auto;
  white-space: pre-wrap;
}
.rec-quote {
  border-left: 3px solid var(--brand);
  padding: 2px 0 2px 12px;
  margin: 8px 0;
  color: var(--ink);
  font-style: italic;
}
.rec-score { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0;
             border-bottom: 1px solid var(--line); font-size: 15px; }
.rec-score b { font-variant-numeric: tabular-nums; }
.rec-flag { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0;
            font-size: 15px; }
.rec-flag::before { content: "!"; flex: none; width: 22px; height: 22px; border-radius: 50%;
                    background: var(--danger-soft); color: var(--danger); font-weight: 700;
                    display: flex; align-items: center; justify-content: center; font-size: 13px; }

.rec-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.rec-actions form { margin: 0; }

/* десктоп кабинета */
@media (min-width: 761px) {
  .rec-wrap { padding: 20px 20px 60px; }
  .rec-card { padding: 18px 20px; }
  .rec-h1 { font-size: 24px; }
  .rec-kv { grid-template-columns: 200px 1fr; }
  .rec-kv dt { padding-top: 2px; }
  .rec-kv dd { margin-bottom: 0; }
}

/* =========================================================================
   Экраны кандидатки (телефон)
   ========================================================================= */

.cand-body { background: var(--bg); }

.cand-page {
  max-width: 560px;
  margin: 0 auto;
  padding: 18px 16px 40px;
  min-height: 100vh;
  min-height: 100dvh;   /* адресная строка мобильного браузера не режет экран */
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cand-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 20px 18px;
  box-shadow: var(--shadow);
}

.cand-logo { font-weight: 700; color: var(--brand-dark); letter-spacing: .01em; }

.cand-title { font-size: 24px; line-height: 1.22; margin: 0 0 10px; }
.cand-sub { font-size: 18px; line-height: 1.3; margin: 0 0 8px; }
.cand-lead { font-size: 17px; line-height: 1.55; margin: 0 0 14px; }
.cand-hint { color: var(--muted); font-size: 15px; line-height: 1.5; margin: 12px 0 0; }

.cand-steps { list-style: none; padding: 0; margin: 16px 0; display: grid; gap: 12px; }
.cand-steps li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 16px;
  line-height: 1.45;
}
.cand-steps li::before {
  content: "";
  flex: none;
  width: 10px;
  height: 10px;
  margin-top: 8px;
  border-radius: 50%;
  background: var(--brand);
}

/* большая кнопка на всю ширину - основной способ идти дальше */
.cand-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: var(--tap);
  padding: 14px 18px;
  border: 0;
  border-radius: 14px;
  background: var(--brand);
  color: #fff;
  font: inherit;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
}
.cand-btn:hover { background: var(--brand-dark); color: #fff; text-decoration: none; }
.cand-btn:active { transform: translateY(1px); }
.cand-btn[disabled] { opacity: .45; cursor: default; transform: none; }
.cand-btn--ghost { background: #fff; color: var(--brand-dark); border: 2px solid var(--brand); }
.cand-btn--ghost:hover { background: var(--brand-soft); color: var(--brand-dark); }
.cand-btn--quiet { background: transparent; color: var(--muted); font-weight: 500; min-height: 44px; }
.cand-btn--quiet:hover { background: transparent; color: var(--ink); }
.cand-btns { display: grid; gap: 10px; margin-top: 16px; }

/* --- поля и согласия --- */

.cand-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.cand-field > span { font-size: 15px; color: var(--muted); }
.cand-input {
  width: 100%;
  min-height: var(--tap);
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 17px;   /* крупно и не меньше 16px - iOS иначе зумит */
}
.cand-input:focus { border-color: var(--brand); }

.cand-check {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px;
  margin-bottom: 10px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  font-size: 15px;
  line-height: 1.45;
  cursor: pointer;
}
.cand-check input[type=checkbox] {
  width: 24px; height: 24px; flex: none; margin: 0; accent-color: var(--brand);
}

/* --- варианты ответа анкеты: крупные кнопки-строки --- */
.cand-options { display: grid; gap: 10px; margin: 16px 0; }
.cand-option {
  display: flex;
  gap: 12px;
  align-items: center;
  min-height: var(--tap);
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: #fff;
  font-size: 16px;
  line-height: 1.4;
  text-align: left;
  cursor: pointer;
}
.cand-option:hover { border-color: var(--brand); background: var(--brand-soft); }

/* --- видео и запись --- */

.cand-stage { position: relative; }
.cand-video {
  display: block;
  width: 100%;
  aspect-ratio: 9 / 16;
  max-height: 62vh;
  object-fit: cover;
  background: #0d1516;
  border-radius: var(--radius-lg);
}
.cand-video--mirror { transform: scaleX(-1); }   /* превью фронтальной камеры */

.cand-progress {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 15px;
  color: var(--muted);
  margin-bottom: 10px;
}
.cand-progress b { color: var(--ink); }

.cand-countdown {
  font-size: 64px;
  line-height: 1;
  font-weight: 700;
  color: var(--brand-dark);
  text-align: center;
  font-variant-numeric: tabular-nums;
  margin: 18px 0 8px;
}
.cand-countdown--short { color: var(--warn); }   /* окно 5 секунд на дожиме */

.cand-timer {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.cand-timer--low { color: var(--danger); }

.cand-rec {
  position: absolute;
  top: 12px;
  left: 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(13, 21, 22, .65);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}
.cand-rec::before {
  content: "";
  width: 10px; height: 10px; border-radius: 50%;
  background: #ff4d4f;
  animation: cand-pulse 1.2s infinite;
}
@keyframes cand-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }

/* полоса загрузки ответа */
.cand-bar { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; margin: 12px 0; }
.cand-bar__fill { height: 100%; width: 0; background: var(--brand); transition: width .25s ease; }

/* --- состояния --- */

.cand-note {
  background: var(--brand-soft);
  border-radius: var(--radius);
  padding: 14px;
  font-size: 15px;
  line-height: 1.5;
}
.cand-warn {
  background: #fdf3e2;
  border-radius: var(--radius);
  padding: 14px;
  font-size: 16px;
  line-height: 1.5;
}
.cand-err {
  background: var(--danger-soft);
  color: var(--danger);
  border-radius: var(--radius);
  padding: 14px;
  font-size: 16px;
  line-height: 1.5;
}
.cand-ok { color: var(--ok); font-weight: 600; }

/* копирование ссылки на экране «откройте в другом браузере» */
.cand-copy {
  display: flex;
  gap: 8px;
  align-items: center;
  background: var(--bg);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 14px;
  word-break: break-all;
}

.cand-final { text-align: center; padding: 24px 0; }
.cand-final .cand-title { margin-bottom: 14px; }

.cand-foot {
  margin-top: auto;
  padding-top: 20px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
}
.cand-foot a { color: var(--muted); text-decoration: underline; }

@media (min-width: 561px) {
  .cand-page { padding: 32px 16px 48px; }
  .cand-title { font-size: 28px; }
  .cand-video { max-height: 70vh; }
}

/* Уважаем системную настройку «меньше движения» */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
