/* =========================================================
   anketa.css — независимые стили standalone-анкеты кандидата.
   Не зависит от app.css сайта. Только vanilla CSS.
   ========================================================= */

:root {
  --brand:        #3F7CB3;
  --brand-hover:  #336699;
  --brand-soft:   #eef4fa;
  --brand-tint:   #d8e6f2;
  --brand-glow:   rgba(63, 124, 179, .35);

  --ink:          #0f172a;
  --ink-2:        #1f2937;
  --text:         #475569;
  --muted:        #64748b;
  --line:         rgba(15, 23, 42, .08);
  --line-2:       #e5e7eb;

  --bg:           #f6f8fa;
  --bg-soft:      #eef2f6;
  --card:         #ffffff;

  --shadow-sm:    0 6px 16px -8px rgba(15, 23, 42, .12);
  --shadow-md:    0 12px 30px -12px rgba(15, 23, 42, .14);
  --shadow-lg:    0 30px 80px -30px rgba(15, 23, 42, .18);
  --shadow-cta:   0 14px 30px -10px var(--brand-glow), 0 4px 10px rgba(63, 124, 179, .18);

  --radius-sm:    10px;
  --radius-md:    14px;
  --radius-lg:    18px;
  --radius-xl:    24px;
  --radius-2xl:   32px;
  --radius-pill:  999px;

  --font:         'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

  --ease:         cubic-bezier(.2, .7, .2, 1);
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

button {
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  border: 0;
  background: none;
  color: inherit;
}

input, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

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

/* ---------- Page wrapper ---------- */
.anketa-page {
  min-height: 100vh;
  padding: clamp(16px, 3vw, 40px);
  background:
    radial-gradient(800px 400px at 90% -10%, var(--brand-soft) 0%, transparent 60%),
    radial-gradient(600px 380px at -10% 110%, var(--brand-tint) 0%, transparent 50%),
    var(--bg);
  display: flex;
  align-items: stretch;
  justify-content: center;
}

/* ---------- Shell card ---------- */
.anketa-shell {
  width: 100%;
  max-width: 1180px;
  background: var(--card);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-lg);
  padding: clamp(20px, 2.4vw, 32px);
  display: flex;
  flex-direction: column;
  gap: clamp(16px, 2vw, 24px);
}

/* ---------- Topbar (logo + help pill) ---------- */
.anketa-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.anketa-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
  color: var(--ink);
  letter-spacing: -0.01em;
  text-decoration: none;
}

.anketa-logo:hover { color: var(--ink); }

.anketa-logo__mark {
  width: 32px; height: 32px;
  border-radius: 10px;
  background: var(--brand-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--brand);
}

.anketa-help {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--card);
  border: 1px solid var(--line-2);
  color: var(--ink-2);
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-sm);
  transition: background .2s var(--ease), border-color .2s var(--ease);
}
.anketa-help:hover { background: var(--brand-soft); border-color: var(--brand-tint); }

.anketa-help__icon {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
}

/* ---------- Body grid (form + hero) ---------- */
.anketa-body {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: clamp(16px, 2vw, 28px);
  align-items: stretch;
}

.anketa-form {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: clamp(16px, 2vw, 24px);
}

/* ---------- Hero column (side image) ---------- */
.anketa-hero {
  position: relative;
  min-height: 520px;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: linear-gradient(160deg, var(--brand-soft) 0%, #f4faf6 100%);
  box-shadow: inset 0 0 0 1px var(--line);
}
.anketa-hero img,
.anketa-hero svg {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
}

/* ---------- Progress ---------- */
.anketa-progress {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.anketa-progress__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 14px;
  color: var(--ink-2);
}
.anketa-progress__label { font-weight: 600; }
.anketa-progress__pct { font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 500; }
.anketa-progress__track {
  width: 100%;
  height: 6px;
  background: var(--brand-tint);
  border-radius: var(--radius-pill);
  overflow: hidden;
}
.anketa-progress__fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--brand) 0%, var(--brand-hover) 100%);
  border-radius: inherit;
  transition: width .35s var(--ease);
}

/* ---------- Step ---------- */
.anketa-step {
  display: none;
  flex-direction: column;
  gap: 18px;
  animation: stepIn .35s var(--ease);
}
.anketa-step.is-active { display: flex; }

@keyframes stepIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.anketa-step__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--brand-hover);
  background: var(--brand-soft);
  padding: 6px 12px;
  border-radius: var(--radius-pill);
}

.anketa-step__title {
  margin: 0;
  font-size: clamp(22px, 2.3vw, 30px);
  line-height: 1.18;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.anketa-step__lead {
  margin: -6px 0 4px;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.55;
  max-width: 60ch;
}

/* ---------- Option cards (radio / checkbox) ---------- */
.anketa-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.opt-card {
  position: relative;
  display: grid;
  grid-template-columns: 48px 1fr 28px;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition:
    border-color .18s var(--ease),
    background .18s var(--ease),
    box-shadow .18s var(--ease),
    transform .18s var(--ease);
}
.opt-card:hover {
  border-color: var(--brand-tint);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}
.opt-card__icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-md);
  background: var(--brand-soft);
  color: var(--brand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.opt-card__icon svg { width: 24px; height: 24px; }

.opt-card__body { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.opt-card__title { font-size: 15px; font-weight: 600; color: var(--ink); line-height: 1.3; }
.opt-card__desc { font-size: 13px; color: var(--muted); line-height: 1.45; }

.opt-card__check {
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 1.5px solid #cbd5e1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  transition: border-color .18s var(--ease), background .18s var(--ease);
}
.opt-card__check::after {
  content: "";
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #fff;
  transform: scale(0);
  transition: transform .18s var(--ease);
}

/* checkbox-вариант — квадрат с галочкой */
.opt-card[data-multi="1"] .opt-card__check { border-radius: 6px; }
.opt-card[data-multi="1"] .opt-card__check::after {
  width: 12px; height: 12px;
  background: none;
  border: 0;
  border-radius: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 12px 12px;
}

.opt-card.is-selected {
  border-color: var(--brand);
  background: var(--brand-soft);
  box-shadow: 0 8px 24px -10px var(--brand-glow);
}
.opt-card.is-selected .opt-card__check {
  background: var(--brand);
  border-color: var(--brand);
}
.opt-card.is-selected .opt-card__check::after { transform: scale(1); }

/* нативный input скрыт */
.opt-card input { position: absolute; opacity: 0; pointer-events: none; }

.opt-card:focus-within {
  outline: 3px solid color-mix(in srgb, var(--brand) 35%, transparent);
  outline-offset: 2px;
}

/* ---------- Inputs (text / number / textarea) ---------- */
.anketa-input,
.anketa-textarea {
  width: 100%;
  display: block;
  background: #fff;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  font-size: 16px;
  color: var(--ink);
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.anketa-input { height: 56px; }
.anketa-textarea { min-height: 160px; resize: vertical; line-height: 1.5; }
.anketa-input::placeholder,
.anketa-textarea::placeholder { color: #94a3b8; }
.anketa-input:focus,
.anketa-textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 18%, transparent);
}

/* ---------- Consent step ---------- */
.anketa-consent {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 16px;
  align-items: flex-start;
  padding: 18px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--card);
  cursor: pointer;
  transition: border-color .18s var(--ease), background .18s var(--ease);
}
.anketa-consent:hover { border-color: var(--brand-tint); }
.anketa-consent.is-selected {
  border-color: var(--brand);
  background: var(--brand-soft);
}
.anketa-consent__check {
  width: 24px; height: 24px;
  border-radius: 6px;
  border: 1.5px solid #cbd5e1;
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .18s var(--ease), border-color .18s var(--ease);
  margin-top: 2px;
}
.anketa-consent.is-selected .anketa-consent__check {
  background: var(--brand);
  border-color: var(--brand);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 14px 14px;
}
.anketa-consent__text { font-size: 15px; color: var(--ink-2); line-height: 1.5; }
.anketa-consent input { position: absolute; opacity: 0; pointer-events: none; }

/* ---------- Step error message ---------- */
.anketa-error {
  font-size: 13px;
  color: #dc2626;
  background: #fef2f2;
  border: 1px solid #fecaca;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  display: none;
}
.anketa-error.is-visible { display: block; }

/* ---------- Bottom bar ---------- */
.anketa-bottombar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.anketa-privacy {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #f1f5f4;
  color: var(--ink-2);
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 500;
}
.anketa-privacy svg { width: 16px; height: 16px; color: var(--brand); }

.anketa-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 52px;
  padding: 0 22px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
  transition: transform .15s var(--ease), background .18s var(--ease), box-shadow .18s var(--ease), color .18s var(--ease);
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn--primary {
  background: var(--brand);
  color: #fff;
  box-shadow: var(--shadow-cta);
  padding: 0 28px;
}
.btn--primary:hover { background: var(--brand-hover); }
.btn--ghost {
  background: transparent;
  color: var(--ink-2);
  border: 1px solid var(--line-2);
}
.btn--ghost:hover { background: #f8fafc; }
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}
.btn svg { width: 18px; height: 18px; }

/* ---------- Success screen ---------- */
.anketa-success {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  text-align: center;
  padding: 60px 24px;
  min-height: 400px;
  animation: stepIn .4s var(--ease);
}
.anketa-success.is-active { display: flex; }
.anketa-success__badge {
  width: 88px; height: 88px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 16px 40px -16px var(--brand-glow);
}
.anketa-success__badge svg { width: 44px; height: 44px; }
.anketa-success__title {
  margin: 0;
  font-size: clamp(24px, 2.6vw, 32px);
  color: var(--ink);
  font-weight: 700;
  letter-spacing: -0.01em;
}
.anketa-success__lead {
  margin: 0;
  font-size: 16px;
  color: var(--muted);
  max-width: 50ch;
}

/* ---------- PIN + captcha ---------- */
.anketa-pin {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}
.anketa-pin__cell {
  width: 58px;
  height: 64px;
  padding: 0;
  text-align: center;
  font-size: 28px;
  font-weight: 700;
  color: var(--ink);
  background: var(--card);
  border: 1.5px solid var(--line-2);
  border-radius: var(--radius-md);
}
.anketa-pin__cell:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-soft);
}
.anketa-pin__hint {
  margin: 10px 0 0;
  font-size: 14px;
  color: var(--muted);
}
.anketa-captcha {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
  padding: 14px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}
.anketa-captcha__img {
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--card);
}
.anketa-captcha__reload {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  color: var(--muted);
  background: var(--card);
  border: 1px solid var(--line-2);
  border-radius: 10px;
}
.anketa-captcha__reload:hover { color: var(--brand); border-color: var(--brand); }
.anketa-captcha__reload svg { width: 18px; height: 18px; }
.anketa-captcha__input {
  flex: 1 1 140px;
  min-width: 0;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.anketa-lk-fade {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: var(--bg);
  opacity: 0;
  pointer-events: none;
  transition: opacity .65s var(--ease);
}
.anketa-lk-fade.is-on {
  opacity: 1;
  pointer-events: auto;
}

@media (max-width: 480px) {
  .anketa-pin { gap: 8px; }
  .anketa-pin__cell { width: 100%; height: 58px; font-size: 24px; }
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .anketa-body {
    grid-template-columns: 1fr;
  }
  .anketa-hero {
    order: -1;
    min-height: 200px;
    max-height: 220px;
  }
}

@media (max-width: 720px) {
  .anketa-page { padding: 0; background: var(--card); }
  .anketa-shell {
    border-radius: 0;
    box-shadow: none;
    min-height: 100vh;
    padding: 16px 16px 96px;
    gap: 16px;
  }
  .anketa-hero { display: none; }
  .anketa-help span { display: none; }
  .anketa-help { padding: 8px; }
  .opt-card { grid-template-columns: 40px 1fr 24px; padding: 12px 14px; gap: 12px; }
  .opt-card__icon { width: 40px; height: 40px; }
  .opt-card__icon svg { width: 22px; height: 22px; }

  .anketa-bottombar {
    position: fixed;
    inset: auto 0 0 0;
    background: var(--card);
    box-shadow: 0 -8px 24px -10px rgba(15, 23, 42, .12);
    padding: 12px 16px;
    border-top: 1px solid var(--line);
    z-index: 10;
  }
  .anketa-privacy { display: none; }
  .anketa-actions { width: 100%; justify-content: space-between; }
  .btn--primary { flex: 1; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
