/* lp/apply/apply.css — apply funnel: multi-step application quiz («заявка на разбор»).
   Loaded LAST (after /assets/css/lp.css). Tokens-only, 0 hardcode. See AGENTS.md §12. */
.lp--apply {
  --lp-accent:      var(--c-accent);
  --lp-accent-dark: var(--c-accent-dark);
  --lp-accent-text: var(--c-accent-text);
}
/* Calmer CTA on the quiz — the strong brand glow read as visual noise on the
   cover/success screens; a subtle shadow keeps the button as the focal point
   without the halo. Tokens-only. */
.lp--apply .btn--cta { box-shadow: var(--shadow-sm); }

/* ── Quiz shell — single centered column stage ───────────────────── */
.apply {
  width: 100%;
  max-width: var(--max-width-narrow);
  margin-inline: auto;
  padding: var(--sp-6) var(--gutter) var(--sp-10);
  display: flex;
  flex-direction: column;
}
/* The stage fills the space below the progress bar and vertically centers the
   active step (Typeform-like balance on every screen). `safe center` falls back
   to top-align when a step is taller than the viewport, so long steps never
   clip or hide their first option under the progress bar. */
#stage {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: safe center;
}
#stage > .q.is-active { width: 100%; }

/* Top bar: back + progress (shown on question steps only) */
.apply__top {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  margin-bottom: var(--sp-10);
  min-height: 24px;
}
.apply__top[hidden] { display: none; }
.apply__back {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  padding: var(--sp-2);
  margin-left: calc(-1 * var(--sp-2));
  background: none;
  border: 0;
  color: var(--c-text-muted);
  font: inherit;
  font-size: var(--text-base);
  cursor: pointer;
  border-radius: var(--r-md);
  transition: color var(--ease-fast);
}
.apply__back:hover { color: var(--c-primary); }
.apply__back:focus-visible { outline: 3px solid var(--c-focus); outline-offset: 2px; }
.apply__progress {
  flex: 1 1 auto;
  height: 6px;
  background: var(--c-border);
  border-radius: var(--r-full);
  overflow: hidden;
}
.apply__progress-fill {
  height: 100%;
  width: 0;
  background: var(--c-primary);
  border-radius: var(--r-full);
  transition: width var(--ease-base);
}

/* ── Steps ───────────────────────────────────────────────────────── */
.q { display: none; }
.q.is-active { display: block; animation: q-in var(--ease-base); }
@keyframes q-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) { .q.is-active { animation: none; } }

.q__eyebrow {
  margin: 0 0 var(--sp-4);
  font-size: var(--text-sm);
  font-weight: var(--fw-bold);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c-primary);
}
.q__title {
  margin: 0 0 var(--sp-3);
  font-size: var(--text-3xl);
  font-weight: var(--fw-bold);
  line-height: var(--lh-snug);
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.q__sub {
  margin: 0 0 var(--sp-6);
  font-size: var(--text-lg);
  line-height: var(--lh-relaxed);
  color: var(--c-text-2);
}
/* Pledge step: the "question" is a paragraph (commitment statement), so render
   it as readable prose, not a giant headline. */
.q__statement {
  margin: 0 0 var(--sp-8);
  font-size: var(--text-lg);
  font-weight: var(--fw-medium);
  line-height: var(--lh-relaxed);
  color: var(--c-text);
  text-wrap: pretty;
}

/* ── Option cards ────────────────────────────────────────────────── */
.q__options { display: grid; grid-template-columns: 1fr; gap: var(--sp-3); }
.q__option {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  width: 100%;
  padding: var(--sp-4) var(--sp-5);
  min-height: 44px;
  text-align: left;
  font: inherit;
  font-size: var(--text-lg);
  line-height: var(--lh-snug);
  color: var(--c-text);
  background: var(--c-bg);
  border: 2px solid var(--c-border);
  border-radius: var(--r-lg);
  cursor: pointer;
  transition: border-color var(--ease-fast), background var(--ease-fast);
}
/* Multi-select cards can wrap to 2-3 lines — top-align the checkbox with the
   first line of text instead of centering it against the whole block. */
.q__option:has(.q__check) { align-items: flex-start; }
.q__option .q__check { margin-top: 1px; }
.q__option:hover { border-color: var(--c-primary); }
.q__option.is-selected { border-color: var(--c-primary); background: var(--c-surface-blue); }
.q__option:focus-visible { outline: 3px solid var(--c-focus); outline-offset: 2px; }
.q__check {
  flex-shrink: 0;
  width: 22px; height: 22px;
  border: 2px solid var(--c-border);
  border-radius: var(--r-sm);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--c-text-inv);
  font-size: var(--text-sm);
  line-height: 1;
}
.q__check::before { content: ""; }
.q__option.is-selected .q__check { background: var(--c-primary); border-color: var(--c-primary); }
.q__option.is-selected .q__check::before { content: "\2713"; }

/* ── Text fields ─────────────────────────────────────────────────── */
.q__field { margin-bottom: var(--sp-4); }
.q__label {
  display: block;
  margin-bottom: var(--sp-2);
  font-size: var(--text-sm);
  font-weight: var(--fw-semibold);
  color: var(--c-text-2);
}
.q__input, .q__textarea {
  width: 100%;
  padding: var(--sp-3) var(--sp-4);
  min-height: 44px;
  font: inherit;
  font-size: var(--text-lg);
  color: var(--c-text);
  background: var(--c-bg);
  border: 2px solid var(--c-border);
  border-radius: var(--r-md);
  outline: none;
  transition: border-color var(--ease-fast);
}
.q__textarea { min-height: 130px; resize: vertical; line-height: var(--lh-relaxed); }
.q__input:focus, .q__textarea:focus { border-color: var(--c-primary); }
.q__input::placeholder, .q__textarea::placeholder { color: var(--c-text-muted); }
.q__input:focus-visible, .q__textarea:focus-visible { outline: 3px solid var(--c-focus); outline-offset: 2px; }
.q__tg { display: flex; align-items: stretch; }
.q__tg-at {
  display: inline-flex; align-items: center;
  padding-inline: var(--sp-4);
  background: var(--c-surface);
  border: 2px solid var(--c-border);
  border-right: 0;
  border-radius: var(--r-md) 0 0 var(--r-md);
  color: var(--c-text-muted);
  font-size: var(--text-lg);
}
.q__tg .q__input { border-radius: 0 var(--r-md) var(--r-md) 0; }
.q__hint { margin-top: var(--sp-2); font-size: var(--text-sm); color: var(--c-text-muted); }

.q__error {
  display: none;
  margin-top: var(--sp-4);
  padding: var(--sp-3) var(--sp-4);
  background: var(--c-surface);
  border-left: 4px solid var(--c-primary);
  border-radius: var(--r-md);
  font-size: var(--text-sm);
  color: var(--c-text);
}
.q__error.is-shown { display: block; }

/* ── Nav ─────────────────────────────────────────────────────────── */
.q__nav { margin-top: var(--sp-8); display: flex; }
.q__nav .btn { margin-left: auto; }

/* ── Cover + success ─────────────────────────────────────────────── */
.q--cover, .q--success { text-align: center; }
.q--cover .q__eyebrow { margin-bottom: var(--sp-5); }
.q--cover .q__title  { margin-bottom: var(--sp-5); font-size: var(--text-4xl); }
.q--cover .q__lead   { margin-bottom: var(--sp-8); }
.q--cover .q__frame  { margin-bottom: var(--sp-8); }
/* Success lead is longer explanatory text — smaller + wider than the punchy
   cover lead so it doesn't read as a heavy wall. */
.q--success .q__lead { font-size: var(--text-lg); max-width: 46ch; margin-bottom: var(--sp-8); }
.q__lead {
  margin: 0 auto var(--sp-8);
  max-width: 38ch;
  font-size: var(--text-xl);
  line-height: var(--lh-snug);
  color: var(--c-text-2);
}
.q__frame {
  margin: 0 auto var(--sp-8);
  max-width: 42ch;
  font-size: var(--text-base);
  line-height: var(--lh-relaxed);
  color: var(--c-text-muted);
}
.q--cover .btn, .q--success .btn { margin-inline: auto; }

/* Thank-you proof block — testimonials shown after submit while the lead waits
   for the sales reply. Reuses the shared .lp-testimonials / .lp-tst cards. */
.apply-proof { margin-top: var(--sp-12); text-align: left; }
.apply-proof__title {
  margin: 0 0 var(--sp-6);
  font-size: var(--text-lg);
  line-height: var(--lh-snug);
  color: var(--c-text-2);
  text-align: center;
}
.q__meta { margin-top: var(--sp-6); font-size: var(--text-sm); color: var(--c-text-muted); }

/* ── Desktop ─────────────────────────────────────────────────────── */
@media (min-width: 769px) {
  .apply { padding-top: var(--sp-12); }
  .q__title { font-size: var(--text-4xl); }
  .q--cover .q__title { font-size: var(--text-5xl); }
  .q--success .q__title { font-size: var(--text-3xl); }
  .q--cover .btn--full, .q--success .btn--full { max-width: 420px; }
  .q--success .lp-testimonials { grid-template-columns: 1fr 1fr; }
  .q__options--2 { grid-template-columns: 1fr 1fr; }
  .q__options--2 .q__option--wide { grid-column: 1 / -1; }
}
