/* ==========================================================================
   Модальное окно заявки + лид-магнит «Цена заявки в вашей нише».
   Открывается всеми CTA-кнопками (data-lead-modal). Оформление — в стиле квиза.
   ========================================================================== */
.kubik-lead-modal {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.kubik-lead-modal.is-open {
  display: flex;
  animation: kubikLeadFade 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes kubikLeadFade {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes kubikLeadPop {
  from { transform: translateY(10px) scale(0.98); opacity: 0; }
  to { transform: none; opacity: 1; }
}

.kubik-lead-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 10, 14, 0.72);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.kubik-lead-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 520px;
  max-height: min(92vh, 780px);
  overflow-y: auto;
  overscroll-behavior: contain;
  box-sizing: border-box;
  padding: 36px 36px 30px;
  background: #fff;
  border-radius: 28px;
  box-shadow: 0 36px 90px -15px rgba(0, 0, 0, 0.32), 0 0 0 1px rgba(0, 0, 0, 0.05);
  animation: kubikLeadPop 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: 'Guidy', sans-serif;
  color: #111316;
}
.kubik-lead-card:focus { outline: none; }

.kubik-lead-close {
  position: absolute;
  top: 16px;
  right: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: #f1f5f9;
  color: #64748b;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.kubik-lead-close:hover { background: #0f172a; color: #fff; transform: rotate(90deg); }
.kubik-lead-close:focus-visible,
.kubik-lead-submit:focus-visible,
.kubik-lead-secondary:focus-visible { outline: 3px solid #ff5500; outline-offset: 2px; }

.kubik-lead-tag {
  display: inline-block;
  max-width: calc(100% - 56px);
  margin: 0 0 12px;
  padding: 6px 12px;
  border-radius: 100px;
  background: rgba(255, 85, 0, 0.1);
  color: #c2410c;
  font-size: 13px;
  line-height: 1.2;
}

.kubik-lead-tag[hidden] { display: none; }

.kubik-lead-title {
  margin: 0 56px 8px 0;
  font-family: 'Seenonim', sans-serif;
  font-size: clamp(23px, 5.6vw, 29px);
  font-weight: 400;
  line-height: 1.22;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.kubik-lead-desc {
  margin: 0 0 22px;
  font-size: 15px;
  line-height: 1.45;
  color: #64748b;
  text-wrap: pretty;
}

.kubik-lead-form { display: flex; flex-direction: column; gap: 14px; margin: 0; }
.kubik-lead-field { display: flex; flex-direction: column; gap: 6px; }
.kubik-lead-field[hidden] { display: none; }
.kubik-lead-label { font-size: 13px; line-height: 1.2; color: #475569; }
.kubik-lead-label small { font-size: 12px; color: #94a3b8; }

.kubik-lead-input,
.kubik-lead-select {
  width: 100%;
  height: 56px;
  box-sizing: border-box;
  padding: 0 18px;
  background: #fff;
  border: 1.5px solid #cbd5e1;
  border-radius: 16px;
  font-family: 'Guidy', sans-serif;
  font-size: 16px; /* 16px — iOS не увеличивает страницу при фокусе */
  color: #0f172a;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.kubik-lead-select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 46px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 18px center;
}
.kubik-lead-input:focus,
.kubik-lead-select:focus {
  outline: none;
  border-color: #ff5500;
  box-shadow: 0 0 0 4px rgba(255, 85, 0, 0.14);
}
.kubik-lead-input.is-invalid,
.kubik-lead-select.is-invalid { border-color: #dc2626; box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.1); }

.kubik-lead-hint { margin: -4px 0 0; font-size: 12.5px; line-height: 1.35; color: #94a3b8; }

.kubik-lead-agree {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 2px 0 0;
  font-size: 13px;
  line-height: 1.4;
  color: #64748b;
  cursor: pointer;
}
.kubik-lead-agree input {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  margin: 0;
  accent-color: #ff5500;
  cursor: pointer;
}
.kubik-lead-agree a { color: #ff5500; text-decoration: underline; text-underline-offset: 2px; }

.kubik-lead-status {
  display: none;
  margin: 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: #fef2f2;
  color: #b91c1c;
  font-size: 14px;
  line-height: 1.4;
}

.kubik-lead-submit,
.kubik-lead-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 56px;
  padding: 0 24px;
  border: 0;
  border-radius: 16px;
  font-family: 'Guidy', sans-serif;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}
.kubik-lead-submit { background: #ff5500; color: #fff; box-shadow: 0 8px 22px rgba(255, 85, 0, 0.3); }
.kubik-lead-submit:hover { background: #e04a00; transform: translateY(-2px); box-shadow: 0 12px 30px rgba(255, 85, 0, 0.4); }
.kubik-lead-submit:disabled { opacity: 0.7; cursor: progress; transform: none; }
.kubik-lead-secondary { background: #f1f5f9; color: #0f172a; }
.kubik-lead-secondary:hover { background: #e2e8f0; }

/* ---- Результат лид-магнита ---- */
.kubik-lead-result-kicker { margin: 0 56px 6px 0; font-size: 14px; color: #16a34a; }
.kubik-lead-result-niche { margin: 0 56px 14px 0; font-size: 15px; color: #64748b; }
.kubik-lead-result-box {
  margin: 0 0 16px;
  padding: 20px 22px;
  border-radius: 20px;
  background: linear-gradient(135deg, #fff7ed, #ffedd5);
  border: 1px solid rgba(255, 85, 0, 0.18);
}
.kubik-lead-result-label { margin: 0 0 4px; font-size: 13px; color: #9a3412; }
.kubik-lead-result-value {
  margin: 0;
  font-family: 'Seenonim', sans-serif;
  font-size: clamp(30px, 8vw, 40px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: #111316;
}
.kubik-lead-result-sub { margin: 6px 0 0; font-size: 13.5px; line-height: 1.4; color: #7c2d12; }
.kubik-lead-cases { margin: 0 0 14px; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.kubik-lead-cases li {
  padding: 10px 14px;
  border-radius: 12px;
  background: #f8fafc;
  font-size: 13.5px;
  line-height: 1.4;
  color: #334155;
}
.kubik-lead-cases b { color: #111316; font-weight: 700; }
.kubik-lead-note { margin: 0 0 18px; font-size: 12.5px; line-height: 1.45; color: #94a3b8; }

/* ---- Телефон: нижняя «шторка», учёт выреза экрана ---- */
@media (max-width: 767px) {
  .kubik-lead-modal { align-items: flex-end; padding: 0; }
  .kubik-lead-card {
    max-width: none;
    max-height: 94vh;
    max-height: 94dvh;
    padding: 28px 20px calc(24px + env(safe-area-inset-bottom));
    border-radius: 26px 26px 0 0;
    animation: kubikLeadSheet 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .kubik-lead-close { top: 12px; right: 12px; }
}
@keyframes kubikLeadSheet {
  from { transform: translateY(40px); opacity: 0; }
  to { transform: none; opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .kubik-lead-modal.is-open,
  .kubik-lead-card { animation: none; }
}
