/* ============================================================
   _form.css — главная форма заявки сайта (.cf-*).

   Архитектура:
   - 2-колоночный grid: preview слева (что будет дальше) + form справа
   - Preview светлый, с золотой полосой и живым таймером (часы)
   - Form-карточка с floating-labels, иконками полей, custom-чекбоксом,
     chip-выбором класса, inline-валидацией, magnetic submit-кнопкой
   - На мобайле — одна колонка, preview сверху

   Логика отправки: static/js/site_lead_form.js
   ============================================================ */

.cf-section {
  background: var(--bg-alt);
  padding: 80px 0 100px;
}
.cf-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Шапка формы ─────────────────────────────────────────── */
.cf-header {
  text-align: center;
  margin-bottom: 48px;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}
.cf-header h2 {
  font-family: var(--font-serif);
  font-size: clamp(30px, 4vw, 42px);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.15;
  color: var(--dark);
  margin: 12px 0 14px;
}
.cf-header p {
  font-size: 16px;
  color: var(--muted);
  line-height: 1.65;
  margin: 0 auto;
}

/* ── Grid ────────────────────────────────────────────────── */
.cf-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.85fr) minmax(360px, 1.15fr);
  gap: 32px;
  align-items: stretch;     /* оба блока одной высоты на десктопе */
}

/* ============================================================
   ПРЕВЬЮ «Что будет дальше» — светлая карточка с золотой полосой
   ============================================================ */

.cf-preview {
  position: relative;       /* критично: без него ::before (золотая полоса) и
                               ::after (свечение) уезжают при reduce-motion,
                               когда transform убирается через !important */
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px 30px 24px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(28,18,10,0.04);
  /* Параллакс — карточка следует за мышью на ±4px (через JS --tilt-x/-y),
     transform применяется к самой карточке, тонкий 3D-эффект */
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.4s;
  transform: perspective(800px) rotateX(var(--tilt-y, 0deg)) rotateY(var(--tilt-x, 0deg));
  transform-style: preserve-3d;
  will-change: transform;
}
.cf-preview:hover {
  box-shadow: 0 12px 36px rgba(28,18,10,0.08);
}
@media (prefers-reduced-motion: reduce) {
  .cf-preview { transform: none !important; }
}
/* Золотая вертикальная полоса слева */
.cf-preview::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 4px; height: 100%;
  background: linear-gradient(180deg, var(--accent-2), #a36a1f 60%, var(--accent-2));
}
/* Тёплое свечение в правом верхнем углу */
.cf-preview::after {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 220px; height: 220px;
  background: radial-gradient(circle, rgba(194,125,42,0.18), transparent 65%);
  pointer-events: none;
}

.cf-preview-title {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--dark);
  margin: 0 0 10px;
  position: relative;
}
.cf-preview-clock {
  display: inline-flex;
  align-items: center;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--accent-1);
  padding: 4px 11px;
  background: rgba(139,26,44,0.08);
  border: 1px solid rgba(139,26,44,0.15);
  border-radius: 99px;
  margin-bottom: 22px;
  position: relative;
  /* появляется с задержкой через JS, не мерцает на загрузке */
  opacity: 0;
  transition: opacity 0.4s ease;
}
.cf-preview-clock.is-ready { opacity: 1; }
.cf-preview-clock::before {
  content: '●';
  margin-right: 6px;
  color: var(--accent-3-bright);
  animation: cfPulse 2s ease-in-out infinite;
}
@keyframes cfPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* Шаги — stagger fade-in при первом появлении preview */
.cf-steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: relative;
}
.cf-step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  align-items: start;
  position: relative;
  opacity: 0;
  transform: translateX(-12px);
  animation: cfStepIn 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  /* GPU layer для плавного въезда на мобайле */
  backface-visibility: hidden;
}
.cf-step:nth-child(1) { animation-delay: 0.10s; }
.cf-step:nth-child(2) { animation-delay: 0.22s; }
.cf-step:nth-child(3) { animation-delay: 0.34s; }
@keyframes cfStepIn {
  to { opacity: 1; transform: translateX(0); }
}
@media (prefers-reduced-motion: reduce) {
  .cf-step { opacity: 1; transform: none; animation: none; }
}
/* Вертикальная пунктирная линия, соединяющая номера 01-02-03 */
.cf-step:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 17px;
  top: 38px;
  bottom: -26px;
  width: 1px;
  background-image: linear-gradient(to bottom, rgba(194,125,42,0.5) 50%, transparent 50%);
  background-size: 1px 6px;
  background-repeat: repeat-y;
}
.cf-step-num {
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 700;
  color: var(--white);
  letter-spacing: 0.02em;
  background: linear-gradient(135deg, var(--accent-2), #a36a1f);
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(194,125,42,0.28);
}
.cf-step-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 2px;
}
.cf-step-head {
  font-size: 15px;
  font-weight: 700;
  color: var(--dark);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
/* (Бывший аватар в шаге 01 убран — выпадал из визуальной композиции.) */
.cf-step-time {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-1);
  padding: 3px 9px;
  border-radius: 99px;
  background: rgba(139,26,44,0.07);
  border: 1px solid rgba(139,26,44,0.18);
  white-space: nowrap;
}
.cf-step-time-accent {
  color: var(--accent-2);
  background: rgba(194,125,42,0.10);
  border-color: rgba(194,125,42,0.30);
}
.cf-step-desc {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--muted);
}

.cf-preview-note {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--muted);
}
.cf-preview-note strong { color: var(--dark); font-weight: 600; }
.cf-preview-note a {
  color: var(--accent-1);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ============================================================
   ФОРМА — поля, чипы, чекбокс, кнопка
   ============================================================ */

.cf-form {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px 32px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 4px 24px rgba(28,18,10,0.04);
  position: relative;
  overflow: hidden;       /* для прогресс-полосы и ripple-эффекта */
}
/* После успешной отправки скрываем ВСЁ кроме success-карточки.
   Это надёжнее, чем перечислять элементы через querySelectorAll —
   автоматически скрывает trust, helper, hint, progress и прочее. */
.cf-form.is-done > *:not(.cf-success) { display: none !important; }
.cf-form.is-done {
  align-items: center;
  justify-content: center;
}

/* ── Прогресс-бар заполнения — тонкая полоса сверху формы ── */
.cf-progress {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: rgba(212,201,176,0.4);
  z-index: 5;
  pointer-events: none;
}
.cf-progress-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent-1), var(--accent-2));
  border-radius: 0 2px 2px 0;
  transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
/* 100% заполнено — бар золотом пульсирует, привлекает к submit-кнопке */
.cf-progress-bar.is-complete {
  background: linear-gradient(90deg,
              var(--accent-1) 0%,
              var(--accent-2) 50%,
              #F5C06A 75%,
              var(--accent-2) 100%);
  background-size: 200% 100%;
  animation: cfProgressFlow 2.5s linear infinite;
}
@keyframes cfProgressFlow {
  0%   { background-position: 0%   50%; }
  100% { background-position: 200% 50%; }
}
@media (prefers-reduced-motion: reduce) {
  .cf-progress-bar.is-complete { animation: none; }
}

/* ── Поле — обёртка с иконкой / floating-label / check ──── */
.cf-field { position: relative; }
.cf-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
/* Иконка слева внутри поля — вертикально центрирована */
.cf-input-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  color: var(--faint);
  pointer-events: none;
  transition: color 0.25s;
  z-index: 1;
}
.cf-input-icon svg { width: 100%; height: 100%; }
/* Скрытая иконка-альтернатива (phone/tg переключаются) — display:none через [hidden]
   переопределяется блочным svg, поэтому явно гасим. */
.cf-input-icon svg[hidden] { display: none !important; }

/* Само поле — placeholder скрыт, чтобы floating-label работал */
.cf-input {
  width: 100%;
  height: 50px;
  padding: 16px 46px 2px 50px;     /* отступ слева под иконку, сверху под label, справа под чек */
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  font-size: 15px;
  font-weight: 500;
  color: var(--dark);
  font-family: 'Inter', sans-serif;
  transition: border-color 0.25s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.25s,
              background 0.25s;
  outline: none;
  appearance: none;
}
.cf-input::placeholder { color: transparent; }
.cf-input:focus {
  border-color: var(--accent-1);
  box-shadow: 0 0 0 4px rgba(139,26,44,0.08);
  background: var(--white);
}
/* Autofill стилизация — на iOS/Chrome автозаполнение красит поле в жёлтый/синий
   фон, ломая дизайн. Сбрасываем через inset-box-shadow (только так и можно). */
.cf-input:-webkit-autofill,
.cf-input:-webkit-autofill:hover,
.cf-input:-webkit-autofill:focus,
.cf-input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 1000px var(--bg) inset !important;
  -webkit-text-fill-color: var(--dark) !important;
  transition: background-color 5000s ease-in-out 0s;
}
/* Shimmer/glow при фокусе — золотая полоса плывёт по нижней границе */
.cf-input-wrap::after {
  content: '';
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 1px;
  height: 1.5px;
  background: linear-gradient(90deg, transparent, var(--accent-2), transparent);
  transform: scaleX(0);
  transform-origin: left center;
  border-radius: 1px;
  opacity: 0;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1),
              opacity 0.3s;
  pointer-events: none;
  z-index: 3;
}
.cf-input-wrap:focus-within::after {
  transform: scaleX(1);
  opacity: 1;
}
/* Не показывать золотой shimmer на красном (ошибочном) поле — конфликт цветов */
.cf-field.is-error .cf-input-wrap::after { display: none; }
.cf-input:focus + .cf-floating-label,
.cf-input:not(:placeholder-shown) + .cf-floating-label {
  top: 8px;
  transform: none;          /* отменяем translateY(-50%) из baseline-состояния */
  font-size: 9.5px;
  letter-spacing: 0.08em;
  color: var(--accent-1);
  text-transform: uppercase;
  font-weight: 700;
}
.cf-input:focus ~ .cf-input-icon,
.cf-input:not(:placeholder-shown) ~ .cf-input-icon {
  color: var(--accent-1);
}

/* Floating-label */
.cf-floating-label {
  position: absolute;
  left: 50px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  pointer-events: none;
  transition: top 0.22s cubic-bezier(0.22, 1, 0.36, 1),
              font-size 0.22s cubic-bezier(0.22, 1, 0.36, 1),
              color 0.22s,
              letter-spacing 0.22s;
  z-index: 1;
  background: transparent;
}

/* Чек справа — появляется при валидации */
.cf-input-check {
  position: absolute;
  right: 16px;
  top: 50%;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent-2);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(-50%) scale(0.6);
  transition: opacity 0.3s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
  z-index: 2;
}
.cf-input-check svg {
  width: 14px;
  height: 14px;
  display: block;
}
.cf-field.is-valid .cf-input-check {
  opacity: 1;
  transform: translateY(-50%) scale(1);
}

/* Ошибка — карминовая обводка + shake */
.cf-field.is-error .cf-input {
  border-color: #c1272d;
  box-shadow: 0 0 0 4px rgba(193,39,45,0.08);
}
.cf-field.is-error .cf-floating-label,
.cf-field.is-error .cf-input-icon { color: #c1272d; }
.cf-field.is-shaking .cf-input-wrap,
.cf-field.is-shaking .cf-grade-chips {
  animation: cfShake 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}
@keyframes cfShake {
  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) {
  .cf-field.is-shaking .cf-input-wrap,
  .cf-field.is-shaking .cf-grade-chips { animation: none; }
}

.cf-error {
  font-size: 12px;
  color: #c1272d;
  line-height: 1.4;
  padding-left: 4px;
}
.cf-error:empty { display: none; }
.cf-error:not(:empty) { margin-top: 4px; }
/* Подсказка под выбором класса — описание режима подготовки */
.cf-grade-hint {
  font-size: 12.5px;
  color: var(--muted);
  padding-left: 4px;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.3s, transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.cf-grade-hint:empty { display: none; }
.cf-grade-hint:not(:empty) {
  opacity: 1;
  transform: translateY(0);
  margin-top: 8px;
}
.cf-grade-hint strong { color: var(--accent-1); font-weight: 600; }

/* Trust-маркеры под кнопкой — три значка SSL/152-ФЗ/время */
.cf-trust {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  align-self: stretch;
}
.cf-trust-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}
.cf-trust-item svg {
  width: 16px; height: 16px;
  color: var(--accent-2);
  flex-shrink: 0;
  /* Лёгкий heart-beat — иконки "живые", оживляют trust-маркеры.
     translateZ(0) — поднимает SVG на GPU-слой для плавного pulse на мобайле */
  animation: cfHeartbeat 3s ease-in-out infinite;
  transform: translateZ(0);
  backface-visibility: hidden;
}
.cf-trust-item:nth-child(2) svg { animation-delay: 1s; }
.cf-trust-item:nth-child(3) svg { animation-delay: 2s; }
@keyframes cfHeartbeat {
  0%, 70%, 100% { transform: scale(1); }
  10%           { transform: scale(1.15); }
  20%           { transform: scale(1); }
  30%           { transform: scale(1.10); }
}
@media (prefers-reduced-motion: reduce) {
  .cf-trust-item svg { animation: none; }
}

/* Helper-подсказка под полем (например, «Распознал Telegram») */
.cf-helper {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--accent-2);
  margin-top: 4px;
  padding-left: 4px;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.3s, transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.cf-helper:not([hidden]) {
  opacity: 1;
  transform: translateY(0);
}
.cf-helper[hidden] { display: none; }
.cf-helper svg { width: 12px; height: 12px; flex-shrink: 0; }

/* ── Класс — chips (radio-buttons под капотом) ───────────── */
.cf-field--grade {
  border: none;
  margin: 0;
  padding: 0;
}
.cf-field-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--dark);
  letter-spacing: 0.005em;
  padding: 0;
  margin: 0 0 12px 4px;
}
.cf-grade-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.cf-grade-chips input[type="radio"] {
  position: absolute;
  width: 1px; height: 1px;
  opacity: 0;
  pointer-events: none;
}
.cf-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 48px;
  height: 44px;
  padding: 0 16px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  color: var(--dark);
  cursor: pointer;
  justify-content: center;
  overflow: hidden;       /* для ripple-эффекта */
  transition: background 0.2s,
              border-color 0.25s cubic-bezier(0.22, 1, 0.36, 1),
              color 0.2s,
              transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  user-select: none;
}
/* Ripple-эффект при клике на chip — координаты x/y задаются JS-ом */
.cf-chip::after {
  content: '';
  position: absolute;
  left: var(--ripple-x, 50%);
  top: var(--ripple-y, 50%);
  width: 8px; height: 8px;
  border-radius: 50%;
  background: rgba(139,26,44,0.30);
  transform: translate(-50%, -50%) scale(0);
  opacity: 0;
  pointer-events: none;
}
.cf-chip.is-rippling::after {
  animation: cfRipple 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  will-change: transform, opacity;
}
@keyframes cfRipple {
  0%   { transform: translate(-50%, -50%) scale(0);  opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(40); opacity: 0; }
}
/* Hover применяется ТОЛЬКО на устройствах с настоящим hover (мышь).
   Без этого на touch-устройствах :hover «залипает» после tap — после клика
   на chip он остаётся в hover-состоянии до тапа в другое место. */
@media (hover: hover) and (pointer: fine) {
  .cf-chip:hover {
    border-color: var(--accent-2);
    color: var(--accent-1);
    transform: translateY(-1px);
  }
}
.cf-chip-tag {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--accent-2);
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(194,125,42,0.10);
}
.cf-chip--exam { padding: 0 12px 0 14px; }
.cf-grade-chips input[type="radio"]:checked + .cf-chip {
  background: linear-gradient(180deg, var(--accent-1), #6e1422);
  border-color: var(--accent-1);
  color: var(--white);
  box-shadow: 0 6px 16px rgba(139,26,44,0.28);
  transform: translateY(-2px);
}
.cf-grade-chips input[type="radio"]:checked + .cf-chip .cf-chip-tag {
  background: rgba(255,255,255,0.18);
  color: var(--white);
}
.cf-grade-chips input[type="radio"]:focus-visible + .cf-chip {
  outline: 2px solid var(--accent-1);
  outline-offset: 2px;
}

/* ── Кастомный чекбокс ──────────────────────────────────── */
.cf-consent {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
}
.cf-consent input[type="checkbox"] {
  position: absolute;
  width: 1px; height: 1px;
  opacity: 0;
  pointer-events: none;
}
.cf-checkbox-box {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.25s, border-color 0.25s, transform 0.2s;
  margin-top: 1px;
}
.cf-checkbox-box svg {
  width: 14px; height: 14px;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.2s, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.cf-consent input[type="checkbox"]:checked + .cf-checkbox-box {
  background: var(--accent-1);
  border-color: var(--accent-1);
}
.cf-consent input[type="checkbox"]:checked + .cf-checkbox-box svg {
  opacity: 1;
  transform: scale(1);
}
.cf-consent input[type="checkbox"]:focus-visible + .cf-checkbox-box {
  outline: 2px solid var(--accent-1);
  outline-offset: 2px;
}
.cf-consent-text {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.55;
}
.cf-consent-text a {
  color: var(--accent-1);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ── Кнопка submit ──────────────────────────────────────── */
.cf-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 52px;
  padding: 0 30px;
  border-radius: 99px;
  background: linear-gradient(135deg, var(--accent-1) 0%, #6e1422 100%);
  color: var(--white);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  font-family: 'Inter', sans-serif;
  border: none;
  cursor: pointer;
  box-shadow: 0 6px 22px rgba(139,26,44,0.32),
              inset 0 1px 0 rgba(255,255,255,0.10);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.3s,
              background 0.3s;
  align-self: flex-start;
  will-change: transform;
}
@media (hover: hover) and (pointer: fine) {
  .cf-btn:hover {
    background: linear-gradient(135deg, #a31f35 0%, var(--accent-1) 100%);
    box-shadow: 0 10px 32px rgba(139,26,44,0.45),
                0 0 0 1px rgba(194,125,42,0.4) inset,
                inset 0 1px 0 rgba(255,255,255,0.15);
    transform: translateY(-2px);
  }
  .cf-btn:hover::before { left: 125%; }
  .cf-btn:hover .cf-btn-arrow { transform: translateX(5px); }
}
/* Shine-эффект — диагональная полоса проходит по кнопке при hover */
.cf-btn { overflow: hidden; }
.cf-btn::before {
  content: '';
  position: absolute;
  top: -50%; left: -75%;
  width: 50%; height: 200%;
  background: linear-gradient(115deg,
              transparent 30%,
              rgba(255,255,255,0.22) 50%,
              transparent 70%);
  transform: skewX(-25deg);
  transition: left 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}
.cf-btn:active { transform: translateY(0); }
.cf-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}
/* Smart-submit пульсация — все 4 поля валидны, кнопка зовёт нажать.
   Лёгкий glow вокруг кнопки 2 раза, потом утихает. */
.cf-btn.is-ready { animation: cfReadyPulse 2.4s cubic-bezier(0.4, 0, 0.6, 1) 2; }
@keyframes cfReadyPulse {
  0%, 100% { box-shadow: 0 6px 22px rgba(139,26,44,0.32), inset 0 1px 0 rgba(255,255,255,0.10); }
  50%      { box-shadow: 0 8px 28px rgba(139,26,44,0.50),
                         0 0 0 6px rgba(194,125,42,0.18),
                         inset 0 1px 0 rgba(255,255,255,0.12); }
}
@media (prefers-reduced-motion: reduce) {
  .cf-btn.is-ready { animation: none; }
}
.cf-btn-arrow {
  display: inline-block;
  font-size: 16px;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
/* hidden-атрибут даёт display:none — но inline-flex/inline-block в CSS
   перебивают его. Явно гасим через !important для всех внутренних частей
   кнопки (text/arrow/loader). */
.cf-btn-text[hidden],
.cf-btn-arrow[hidden],
.cf-btn-loader[hidden] { display: none !important; }
.cf-btn-loader {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.cf-btn-loader-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--white);
  animation: cfBounce 1s ease-in-out infinite;
}
.cf-btn-loader-dot:nth-child(2) { animation-delay: 0.15s; }
.cf-btn-loader-dot:nth-child(3) { animation-delay: 0.30s; }
@keyframes cfBounce {
  0%, 80%, 100% { transform: scale(0.7); opacity: 0.6; }
  40% { transform: scale(1); opacity: 1; }
}

.cf-honeypot {
  position: absolute;
  width: 1px; height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* ── Индикатор «черновик сохранён» — появляется при печати ── */
.cf-draft-saved {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  padding: 8px 14px;
  background: rgba(45,125,95,0.06);
  border: 1px solid rgba(45,125,95,0.18);
  border-radius: 99px;
  align-self: flex-start;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.35s, transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}
.cf-draft-saved.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.cf-draft-saved[hidden] { display: none; }
.cf-draft-saved svg {
  width: 14px; height: 14px;
  color: var(--accent-3-bright);
  flex-shrink: 0;
}

/* ── Success-карточка с анимацией + конфетти ────────────── */
.cf-success {
  position: relative;
  text-align: center;
  padding: 24px 0 12px;
}
/* Конфетти-частицы — 16 элементов, разлетающихся из центра */
.cf-confetti {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: visible;
}
.cf-confetti-piece {
  position: absolute;
  top: 50%; left: 50%;
  width: 8px; height: 8px;
  border-radius: 2px;
  opacity: 0;
  animation: cfConfetti 1.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  /* GPU-acceleration — плавная анимация на мобайле */
  will-change: transform, opacity;
  backface-visibility: hidden;
}
@keyframes cfConfetti {
  0%   { opacity: 1; transform: translate(-50%, -50%) rotate(0deg); }
  100% { opacity: 0; transform: translate(var(--cx), var(--cy)) rotate(var(--cr)); }
}
/* Уважение reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .cf-confetti { display: none; }
}
.cf-success-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 18px;
  color: var(--accent-2);
}
.cf-success-icon svg { width: 100%; height: 100%; display: block; }
.cf-success-circle {
  stroke-dasharray: 188;
  stroke-dashoffset: 188;
  animation: cfDraw 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.cf-success-check {
  stroke-dasharray: 50;
  stroke-dashoffset: 50;
  animation: cfDraw 0.45s cubic-bezier(0.22, 1, 0.36, 1) 0.45s forwards;
}
@keyframes cfDraw {
  to { stroke-dashoffset: 0; }
}
.cf-success-title {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 700;
  color: var(--dark);
  letter-spacing: -0.01em;
  margin-bottom: 8px;
}
.cf-success-sub {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.6;
  max-width: 380px;
  margin: 0 auto;
}
.cf-success-sub a {
  color: var(--accent-1);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 900px) {
  .cf-section { padding: 56px 0 72px; }
  .cf-header { margin-bottom: 32px; }
  .cf-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  /* На мобайле убираем 3D-tilt и will-change — композит-слой из transform-perspective
     может «мылить» текст на iOS/Android. Параллакс и так был desktop-only,
     просто убираем сам transform с CSS. */
  .cf-preview {
    padding: 26px 24px 24px;
    transform: none !important;
    will-change: auto;
  }
  .cf-preview-title { font-size: 19px; }
  .cf-preview-clock { font-size: 11px; padding: 3px 9px; }
  .cf-steps { gap: 20px; }
  .cf-step { gap: 14px; }
  .cf-step:not(:last-child)::before { left: 14px; top: 30px; bottom: -22px; }
  .cf-step-head { font-size: 14.5px; }
  .cf-step-desc { font-size: 13px; }
  .cf-form { padding: 28px 24px 24px; }
  .cf-btn { width: 100%; }
}

@media (max-width: 640px) {
  .cf-inner { padding: 0 16px; }
  .cf-preview { padding: 22px 20px; border-radius: 16px; }
  .cf-form { padding: 22px 18px 84px; border-radius: 16px; } /* зазор снизу под sticky-кнопку */
  /* После успешной отправки sticky-кнопки нет → лишний padding убираем */
  .cf-form.is-done { padding-bottom: 22px; }
  .cf-input { font-size: 16px; }   /* iOS не зумит при тапе */
  .cf-chip { font-size: 14.5px; min-width: 44px; height: 44px; padding: 0 14px; }

  /* Sticky-кнопка submit на мобайле — всегда видна внизу экрана при скролле формы.
     Активируется через JS-класс .cf-form.is-sticky-cta когда форма в viewport. */
  .cf-form.is-sticky-cta .cf-btn {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    z-index: 40;
    width: auto;
    box-shadow: 0 8px 28px rgba(139,26,44,0.40),
                inset 0 1px 0 rgba(255,255,255,0.10);
    animation: cfStickyIn 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  }
  /* TG-FAB прячется когда sticky-кнопка submit активна — иначе они визуально
     перекрываются в правом нижнем углу. Плавный fade-out. */
  body.cf-sticky-cta-active .tg-float {
    opacity: 0;
    transform: translateY(20px) scale(0.85);
    pointer-events: none;
  }
  @keyframes cfStickyIn {
    from { transform: translateY(20px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
  }
}
