/* =========================
   Плавающая кнопка (только мобилка)
========================= */

.floating-cta {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 900;
  border: none;
  border-radius: 999px;
  padding: 14px 18px;
  font-size: 0.95rem;
  font-weight: 600;
  text-align: center;
  cursor: pointer;

  background: linear-gradient(135deg, #f97316, #ea580c);
  color: #0b0f19;
  box-shadow: 0 18px 40px rgba(249, 115, 22, 0.7);

  display: none; /* по умолчанию скрыта */
  box-sizing: border-box;
  max-width: calc(100vw - 32px);
  width: auto;
}

/* показываем ТОЛЬКО на мобиле */
@media (max-width: 768px) {
  .floating-cta {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    line-height: 1.3;
    white-space: normal;
    text-align: center;
    word-wrap: break-word;
    hyphens: auto;
  }
}

/* =========================
   Попап формы записи
========================= */

.lead-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
}

.lead-modal.is-open {
  display: flex;
  justify-content: center;
  align-items: center;
}

.lead-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(6px);
}

.lead-modal__window {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  margin: 0 16px;
  border-radius: 24px;
  padding: 18px 20px 18px;
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.98), rgba(15, 23, 42, 0.9));
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.9);
  color: #f9fafb;

  max-height: 95vh;
  overflow-y: auto;
  overflow-x: hidden;
  box-sizing: border-box;
  -webkit-overflow-scrolling: touch;
}

/* позиционирование как "нижний лист" на мобиле */
@media (max-width: 768px) {
  .lead-modal.is-open {
    align-items: flex-end;
  }

  .lead-modal__window {
    border-radius: 24px 24px 0 0;
    margin: 0;
    width: 100%;
    max-width: 100%;
    max-height: 90vh;
    left: 0;
    right: 0;
    box-sizing: border-box;
    overflow-y: auto;
    overflow-x: hidden;
  }
}

.lead-modal__close {
  position: absolute;
  top: 10px;
  right: 12px;
  border: none;
  background: transparent;
  color: #e5e7eb;
  font-size: 1.3rem;
  cursor: pointer;
  padding: 6px;
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.18s ease, color 0.18s ease;
}

.lead-modal__close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #f97316;
}

.lead-modal__title {
  margin: 0 32px 4px 0;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.2;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.lead-modal__subtitle {
  margin: 0 0 12px;
  font-size: 0.85rem;
  color: rgba(148, 163, 184, 0.95);
  line-height: 1.4;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Форма */

.lead-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  box-sizing: border-box;
}

.lead-form__group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 100%;
  box-sizing: border-box;
}

.lead-form__group label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(148, 163, 184, 0.9);
}

.lead-form__group input {
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  padding: 10px 12px;
  background: rgba(15, 23, 42, 0.95);
  color: #f9fafb;
  font-size: 16px;
  min-height: 44px;
  outline: none;
  width: 100%;
  box-sizing: border-box;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease;
}

.lead-form__group input::placeholder {
  color: rgba(148, 163, 184, 0.8);
}

.lead-form__group input:focus {
  border-color: #f97316;
  box-shadow: 0 0 0 1px rgba(249, 115, 22, 0.5);
  background: rgba(15, 23, 42, 0.98);
}

/* Кнопка отправки */

.lead-form__submit {
  width: 100%;
  justify-content: center;
  margin-top: 4px;
  min-height: 48px;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 12px 20px;
  box-sizing: border-box;
}

/* Разделитель */

.lead-form__divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 6px 0 2px;
  font-size: 0.75rem;
  color: rgba(148, 163, 184, 0.9);
}

.lead-form__divider::before,
.lead-form__divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(51, 65, 85, 0.9);
}

/* Соц-кнопки */

.lead-form__social {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 4px;
  width: 100%;
  box-sizing: border-box;
}

.lead-social {
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 0.88rem;
  font-weight: 500;
  text-decoration: none;
  color: #f9fafb;
  min-height: 44px;
  box-sizing: border-box;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.lead-social:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.lead-social--vk {
  background: #0077ff;
}

.lead-social--wa {
  background: #22c55e;
}

/* Текст про данные */

.lead-form__privacy {
  margin: 2px 0 0;
  font-size: 0.68rem;
  line-height: 1.4;
  color: rgba(148, 163, 184, 0.9);
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.lead-form__privacy a {
  color: #f97316;
  text-decoration: none;
}

.lead-form__privacy a:hover {
  text-decoration: underline;
}

/* Чекбокс согласия (если добавишь) */
.lead-form__consent {
  margin: 6px 0 0;
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.lead-form__consent input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  flex-shrink: 0;
  cursor: pointer;
}

.lead-form__consent label {
  font-size: 0.68rem;
  line-height: 1.4;
  color: rgba(148, 163, 184, 0.9);
  cursor: pointer;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Сообщение об ошибке/успехе */

.lead-form__message {
  margin-top: 4px;
  font-size: 0.8rem;
  padding: 8px 12px;
  border-radius: 8px;
  display: none;
}

.lead-form__message.success {
  background: rgba(34, 197, 94, 0.2);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.3);
  display: block;
}

.lead-form__message.error {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
  display: block;
}

/* Адаптация шрифтов для очень маленьких экранов */

@media (max-width: 400px) {
  .lead-modal__title {
    font-size: 1.05rem;
  }
  .lead-modal__window {
    padding: 18px 14px 16px;
  }
}

/* Уменьшаем паддинги внутренних карточек на мобиле */
@media (max-width: 640px) {
  .teacher-card,
  .guarantee-card,
  .path-card,
  .review-card {
    padding: 18px 16px !important;
  }
}

/* Стрелки слайдеров и лайтбокса — нормальный тач-таргет */
.slider-arrow,
.lightbox-prev,
.lightbox-next,
.lightbox-close {
  min-width: 44px;
  min-height: 44px;
}

/* Скрываем старую плавающую кнопку */
.floating-button {
  display: none !important;
}

/* Скрываем старое модальное окно */
.modal-overlay {
  display: none !important;
}

/* =========================
   КРИТИЧЕСКИЙ FIX: предотвращаем горизонтальный скролл
========================= */
@media (max-width: 768px) {
  /* Убираем переполнение для всех секций и контейнеров */
  section,
  .container,
  .hero,
  .advantages,
  .reviews,
  .teachers,
  .gallery-section,
  .guarantees,
  .signup,
  .faq,
  .location,
  .footer {
    max-width: 100vw;
    overflow-x: hidden;
    box-sizing: border-box;
  }

  /* Все элементы с фиксированным позиционированием */
  .lead-modal,
  .lightbox,
  .floating-cta {
    max-width: 100vw !important;
    box-sizing: border-box !important;
  }

  /* Для форм и инпутов */
  input,
  textarea,
  select,
  button,
  .lead-form__group input,
  .signup-field input,
  .lead-social {
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
}

/* Дополнительные исправления для маленьких экранов */
@media (max-width: 400px) {
  .lead-modal__window {
    padding: 18px 16px 16px;
    margin: 0;
  }

  .floating-cta {
    left: 12px;
    right: 12px;
    max-width: calc(100vw - 24px);
    padding: 14px 16px;
    font-size: 0.88rem;
    line-height: 1.35;
    min-height: 52px;
  }
}

