/* Анкета кандидата — одна страница: заголовок и форма по центру, ничего лишнего.
   Стилистика «платформенная»: голубая заливка, белая карточка со скруглениями,
   заполненные поля, кнопки-пилюли. Названий, логотипов и упоминаний платформы
   нет — только цвет и формы. Только светлая тема.
   Inline-стилей нет (CSP style-src 'self'), всё здесь. */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/assets/fonts/inter-cyrillic.woff2?v=1') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/assets/fonts/inter-latin.woff2?v=1') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Montserrat — геометрический гротеск для заголовков и кнопок. */
@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('/assets/fonts/montserrat-cyrillic.woff2?v=1') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('/assets/fonts/montserrat-latin.woff2?v=1') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light;
  --bg: #ffffff;
  --wash: #eaf7fe;
  --surface: #ffffff;
  --field: #f2f6fa;
  --soft: #f3f7fa;
  --soft-2: #e3ebf2;
  --text: #10171f;
  --text-2: #4b5765;
  --text-3: #6b7683;
  --line: #e6ecf2;
  --line-2: #d4dde6;
  /* Голубой в двух тонах: яркий — заливки и полосы, тёмный — там, где текст
     (на ярком белый текст даёт всего 2.5:1). */
  --brand: #00aff0;
  --accent: #008cd1;
  --accent-hover: #0079b8;
  --accent-ink: #0072a6;
  --accent-soft: #e8f6fe;
  --accent-ring: rgba(0, 175, 240, 0.24);
  --danger: #d32f2f;
  --danger-ring: rgba(211, 47, 47, 0.14);
  --card-shadow: 0 2px 8px rgba(16, 23, 31, 0.05), 0 28px 56px -28px rgba(16, 23, 31, 0.26);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Montserrat', 'Inter', system-ui, sans-serif;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* ── основа ─────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  /* Карточка по центру экрана; safe center не даёт срезать верх, когда
     содержимое выше окна (маленькие телефоны, открытая клавиатура). */
  display: grid; align-content: safe center; justify-items: center;
  background: linear-gradient(180deg, var(--wash) 0%, rgba(234, 247, 254, 0) 62%), var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { display: block; max-width: 100%; height: auto; }
a { color: var(--accent-ink); text-underline-offset: 3px; }
p { margin: 0; }
h1, h2, h3 { margin: 0; font-weight: 700; }
h1, h2, h3, .btn, .badge-18, .q, .done-title, .prose h1, .prose h2, .notice h1 {
  font-family: var(--font-display);
}
button { font: inherit; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 999px; }
::selection { background: var(--accent-soft); }
.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;
}
.ic { flex: none; display: block; }

/* ── страница: заголовок, карточка, две строки мелким шрифтом ───────────── */
.shell {
  width: 100%; max-width: 468px;
  margin-inline: auto;
  padding: clamp(24px, 5vh, 56px) 20px calc(32px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 22px;
}
.intro { text-align: center; animation: rise 0.5s var(--ease) both; }
.badge-18 {
  display: inline-grid; place-items: center;
  height: 26px; padding: 0 12px; margin-bottom: 14px; border-radius: 999px;
  background: var(--surface); color: var(--accent-ink);
  box-shadow: 0 1px 3px rgba(16, 23, 31, 0.1);
  font-size: 12px; font-weight: 700;
}
.title { font-size: clamp(27px, 7.4vw, 34px); line-height: 1.16; letter-spacing: -0.025em; }
.lead { margin-top: 10px; font-size: 16px; color: var(--text-2); }
.perks {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px;
  font-size: 14px; color: var(--text-3);
}
.perks li { display: inline-flex; align-items: center; gap: 8px; }
.perks li::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: var(--brand); }
.foot { text-align: center; font-size: 13px; color: var(--text-3); }
.foot a { color: var(--text-3); }

/* ── анкета ─────────────────────────────────────────────────────────────── */
.quiz-card {
  position: relative;
  padding: clamp(22px, 5vw, 30px);
  border-radius: 24px;
  background: var(--surface); box-shadow: var(--card-shadow);
  animation: rise 0.6s 0.06s var(--ease) both;
}
.quiz-card:focus { outline: none; }
.quiz-head { margin-bottom: 10px; }
.quiz-step { font-size: 13px; font-weight: 500; color: var(--text-3); }
.progress { height: 4px; margin-bottom: 24px; border-radius: 999px; background: var(--soft-2); overflow: hidden; }
.progress span {
  display: block; width: 25%; height: 100%; border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), var(--accent));
  transition: width 0.4s var(--ease);
}

.step { min-width: 0; margin: 0; padding: 0; border: 0; }
.step:not(.is-active) { display: none; }
.step.enter-fwd { animation: step-fwd 0.28s var(--ease); }
.step.enter-back { animation: step-back 0.28s var(--ease); }
.q {
  display: block; margin-bottom: 14px;
  font-size: clamp(21px, 5.6vw, 24px); font-weight: 700; line-height: 1.25; letter-spacing: -0.015em;
}
.inp {
  width: 100%; height: 58px; padding: 0 18px;
  border: 1.5px solid transparent; border-radius: 16px;
  background: var(--field); color: var(--text);
  font: inherit; font-size: 18px; /* ≥16px — иначе iOS зумит поле при фокусе */
  -webkit-appearance: none; appearance: none;
  transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
}
.inp::placeholder { color: var(--text-3); opacity: 0.8; }
.inp:hover { background: #edf2f7; }
.inp:focus { border-color: var(--brand); background: var(--surface); box-shadow: 0 0 0 4px var(--accent-ring); }
.inp[aria-invalid="true"] { border-color: var(--danger); background: var(--surface); box-shadow: 0 0 0 4px var(--danger-ring); }
.inp-age { max-width: 190px; }
.input-prefix { position: relative; }
.input-prefix > span {
  position: absolute; left: 18px; top: 50%; transform: translateY(-52%);
  font-size: 18px; color: var(--text-3); pointer-events: none;
}
.input-prefix .inp { padding-left: 38px; }
.hint { margin-top: 10px; font-size: 14px; line-height: 1.45; color: var(--text-3); }
.err { margin-top: 10px; font-size: 14px; font-weight: 500; line-height: 1.4; color: var(--danger); }
.err:empty { display: none; }
/* Когда есть ошибка, подсказка под полем её дублирует — прячем. */
.step:has(.err:not(:empty)) .hint { display: none; }
.err-form { margin-top: 16px; }
.shake { animation: shake 0.4s; }

/* ── кнопки ─────────────────────────────────────────────────────────────── */
.btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 54px; padding: 0 26px;
  border: 0; border-radius: 999px;
  font-size: 16.5px; font-weight: 600; line-height: 1.2;
  text-decoration: none; cursor: pointer; user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.15s, color 0.15s, box-shadow 0.15s, transform 0.1s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 10px 22px -12px rgba(0, 140, 209, 0.95); }
.btn-primary:hover { background: var(--accent-hover); color: #fff; }
.btn-ghost { background: var(--field); color: var(--text-2); }
.btn-ghost:hover { background: #e7eef5; color: var(--text); }
.btn-icon { width: 54px; padding: 0; flex: none; }
.btn .spinner {
  display: none; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: spin 0.7s linear infinite;
}
.btn[aria-busy="true"] { pointer-events: none; }
.btn[aria-busy="true"] .spinner { display: block; }
.quiz-nav { display: flex; gap: 10px; margin-top: 22px; }
.quiz-nav .btn-primary { flex: 1; white-space: nowrap; }
.lbl-send { display: none; }
.quiz.is-last .lbl-next { display: none; }
.quiz.is-last .lbl-send { display: inline; }
.quiz-legal { margin-top: 14px; font-size: 12.5px; line-height: 1.5; color: var(--text-3); }
.quiz-legal a { color: inherit; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ── экран после отправки ──────────────────────────────────────────────── */
.quiz-done { padding: 4px 0; text-align: center; }
.quiz-done:focus { outline: none; }
.done-icon {
  width: 60px; height: 60px; margin: 0 auto 18px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-ink);
  animation: pop 0.5s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}
.done-title { font-size: 23px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
.done-text { margin-top: 10px; color: var(--text-2); }
.done-text b { color: var(--accent-ink); font-weight: 600; word-break: break-all; }
.done-tip { margin-top: 18px; padding: 14px 16px; border-radius: 16px; background: var(--soft); font-size: 13.5px; line-height: 1.5; color: var(--text-3); text-align: left; }

/* ── простые страницы (политика, спасибо, 404, ошибка формы) ────────────── */
.page-main { width: 100%; max-width: 720px; margin-inline: auto; padding: clamp(28px, 6vh, 64px) 20px 56px; }
.back-link { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 26px; font-size: 14px; font-weight: 500; text-decoration: none; }
.prose h1 { font-size: clamp(27px, 6vw, 38px); font-weight: 700; line-height: 1.12; letter-spacing: -0.025em; }
.prose .updated { margin-top: 12px; color: var(--text-3); font-size: 15px; }
.prose h2 { margin: 32px 0 10px; font-size: 19px; letter-spacing: -0.015em; }
.prose p, .prose li { color: var(--text-2); }
.prose p + p { margin-top: 12px; }
.prose ul { margin: 10px 0 0; padding-left: 22px; }
.prose li + li { margin-top: 6px; }
.prose .lead { margin-top: 18px; font-size: 17px; }
.notice { max-width: 460px; margin-inline: auto; text-align: center; }
.notice .done-icon { margin-bottom: 20px; }
.notice h1 { font-size: clamp(25px, 6vw, 32px); font-weight: 700; letter-spacing: -0.025em; line-height: 1.15; }
.notice p { margin-top: 12px; color: var(--text-2); }
.notice ul { display: inline-block; margin: 16px 0 0; padding-left: 22px; text-align: left; color: var(--danger); font-weight: 500; }
.notice .btn { margin-top: 24px; }

@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: scale(0.6); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes step-fwd { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
@keyframes step-back { from { opacity: 0; transform: translateX(-14px); } to { opacity: 1; transform: none; } }
@keyframes shake {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-4px); }
  40%, 60% { transform: translateX(4px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; transition-delay: 0s !important; }
}
