/* Компоненты для лендинга таролога */

/* Кнопки мессенджеров */
.contact-button {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-md) var(--spacing-xl);
  border-radius: var(--radius-xl);
  text-decoration: none;
  font-weight: var(--font-weight-medium);
  transition: all var(--transition-normal);
  min-height: 48px;
  font-size: var(--text-base);
}

.contact-icon {
  font-size: var(--text-lg);
}

.contact-text {
  white-space: nowrap;
}

/* Анимации при скролле */
/* Базовое скрытие элементов до анимации с GPU подготовкой */
[data-scroll-reveal] {
  opacity: 0;
  will-change: opacity, transform;
  backface-visibility: hidden;
  -webkit-font-smoothing: antialiased;
  transform: translateZ(0);
  /* Оптимизация: используем layout style вместо paint для лучшей производительности */
  contain: layout style;
  /* Дополнительная стабилизация: предотвращаем layout shifts */
  min-height: 0;
  position: relative;
}

/* Исключение для slideInRight - карточки должны быть видимы с начала */
[data-scroll-reveal="slideInRight"] {
  opacity: 1; /* Видимы с начала, без fade */
  transform: translateX(100px) translateZ(0); /* Начальное состояние для slide */
  will-change: transform; /* Только transform для плавности */
}

/* Утилиты для прокрутки - УДАЛЕНЫ неиспользуемые классы .scroll-momentum и .scroll-contain */

/* Оптимизация для contact-info: contain убран - вызывал клиппинг, уже изолирован через [data-scroll-reveal] */
.contact-info {
  /* contain: layout style убран - двойная изоляция вызывала клиппинг */
  backface-visibility: hidden;
  transform: translateZ(0);
  contain: none;
}

/* Оптимизация для contact-title: contain убран - вызывал клиппинг, уже изолирован через [data-scroll-reveal] */
#contact-title {
  /* contain: layout style убран - двойная изоляция вызывала клиппинг */
  backface-visibility: hidden;
  transform: translateZ(0);
}

/* После анимации убираем will-change и contain */
[data-scroll-reveal].animated {
  will-change: auto;
  contain: none;
}

/* Для slideInRight гарантируем финальное состояние после анимации */
[data-scroll-reveal="slideInRight"].animated {
  transform: translateX(0) translateZ(0);
  opacity: 1; /* Гарантируем видимость после анимации */
}

/* Анимация снизу вверх с GPU ускорением */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px) translateZ(0);
  }
  to {
    opacity: 1;
    transform: translateY(0) translateZ(0);
  }
}

/* Анимация слева с GPU ускорением */
@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px) translateZ(0);
  }
  to {
    opacity: 1;
    transform: translateX(0) translateZ(0);
  }
}

/* Анимация справа с GPU ускорением */
@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(30px) translateZ(0);
  }
  to {
    opacity: 1;
    transform: translateX(0) translateZ(0);
  }
}

/* Простое появление с GPU ускорением */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateZ(0);
  }
  to {
    opacity: 1;
    transform: translateZ(0);
  }
}

/* Плавное скольжение вправо для карточек отзывов */
@keyframes slideInRight {
  from {
    opacity: 1; /* Видимы с начала, без fade */
    transform: translateX(100px) translateZ(0);
  }
  to {
    opacity: 1; /* Остаются видимыми */
    transform: translateX(0) translateZ(0);
  }
}

/* Классы для применения анимаций */
.animate-fadeInUp {
  animation: fadeInUp 0.6s ease-out forwards;
}

.animate-fadeInLeft {
  animation: fadeInLeft 0.6s ease-out forwards;
}

.animate-fadeInRight {
  animation: fadeInRight 0.6s ease-out forwards;
}

.animate-fadeIn {
  animation: fadeIn 0.6s ease-out forwards;
}

.animate-slideInRight {
  animation: slideInRight 1.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  opacity: 1 !important; /* Гарантия видимости без fade */
  will-change: transform;
  backface-visibility: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Задержки для stagger эффекта */
[data-scroll-reveal][data-delay="100"] { animation-delay: 0.1s; }
[data-scroll-reveal][data-delay="200"] { animation-delay: 0.2s; }
[data-scroll-reveal][data-delay="300"] { animation-delay: 0.3s; }
[data-scroll-reveal][data-delay="400"] { animation-delay: 0.4s; }
[data-scroll-reveal][data-delay="500"] { animation-delay: 0.5s; }
[data-scroll-reveal][data-delay="600"] { animation-delay: 0.6s; }
[data-scroll-reveal][data-delay="700"] { animation-delay: 0.7s; }
[data-scroll-reveal][data-delay="800"] { animation-delay: 0.8s; }
[data-scroll-reveal][data-delay="900"] { animation-delay: 0.9s; }

/* Уважение к prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  
  [data-scroll-reveal] {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  
  .animate-fade-in-up,
  .animate-fadeInUp,
  .animate-fadeInLeft,
  .animate-fadeInRight,
  .animate-fadeIn,
  .animate-slideInRight {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  
  .service-card,
  .process-step {
    animation: none !important;
  }
  
  /* testimonial-card исключены - у них нет анимаций, только карусель */
  
  .service-icon::before,
  .service-icon::after {
    animation: none !important;
  }
  
  .tarot-card {
    animation: none !important;
    transition: opacity 0.3s ease !important;
  }
}

/* Пульсирующая кнопка CTA */
@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(13, 79, 60, 0.6);
  }
  70% {
    box-shadow: 0 0 0 15px rgba(13, 79, 60, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(13, 79, 60, 0);
  }
}

.btn-primary {
  animation: pulse 5s infinite;
}

/* УДАЛЕНЫ неиспользуемые классы: .loading-spinner и @keyframes spin */

/* УДАЛЕНЫ неиспользуемые классы: .credential-badge, .quote-mark */

/* УДАЛЕНЫ неиспользуемые классы: .overlay (используется только .modal-overlay), .responsive-image */

/* УДАЛЕНЫ неиспользуемые классы: .status-indicator, .status-online, .status-offline */

/* УДАЛЕНЫ неиспользуемые классы: .process-card, .process-card:hover, .process-card::before */

/* УДАЛЕНЫ неиспользуемые классы: @keyframes slideInFromLeft, slideInFromRight, .animate-slide-in-left, .animate-slide-in-right */

/* УДАЛЕНЫ неиспользуемые классы: .image-overlay, .image-overlay::after, .image-overlay:hover::after */

/* УДАЛЕНЫ неиспользуемые классы: .badge, .badge-primary, .badge-secondary, .badge-outline */

/* УДАЛЕНЫ неиспользуемые классы: .highlight, .section-divider, .text-gradient, .text-shadow, .text-glow */

/* Фокус стили для доступности */
*:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Убираем outline для кнопок контактов, кнопки сертификатов и стрелок карусели */
.contact-button:focus,
.contact-button:active,
.phone-btn:focus,
.phone-btn:active,
.telegram-btn:focus,
.telegram-btn:active,
.whatsapp-btn:focus,
.whatsapp-btn:active,
.question-btn:focus,
.question-btn:active,
.btn-certificates:focus,
.btn-certificates:active,
.btn-certificates:focus-visible,
.carousel-arrow:focus,
.carousel-arrow:active,
.carousel-arrow:focus-visible {
  outline: none !important;
}

/* ============================================
   КНОПКА СЕРТИФИКАТОВ
   ============================================ */

.btn-certificates {
  color: var(--color-primary);
  padding: 12px 24px;
  border: none;               /* убираем все границы */
  border: 1px solid var(--color-gold-classic); /* оставляем только нижнюю */
  border-bottom: 3px solid var(--color-gold-classic);
  border-radius: 12px;
  font-size: calc(var(--text-base) * 1.50);
  max-width: 300px;
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
  transition: 
    color 0.3s ease, 
    box-shadow 0.3s ease,
    background 0.3s ease,
    border-color 0.3s ease,
    transform 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;  
  gap: 8px;
  margin: var(--spacing-md) auto 0;
  background: none;
  box-shadow: none;
}

.btn-certificates .icon-graduation {
  transition: 
    color 0.3s ease, 
    filter 0.3s ease,
    transform 0.3s ease;
}

.btn-certificates:hover,
.btn-certificates:focus {
  background: linear-gradient(135deg, rgba(184, 134, 11, 0.1) 0%, rgba(212, 175, 55, 0.15) 100%);
  border-color: var(--color-gold-medium);
  box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
  transform: translateY(-2px);
  outline: none;
}

.btn-certificates:focus-visible {
  outline: none;
  box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
  border-color: var(--color-gold-medium);
}

.btn-certificates:hover .icon-graduation,
.btn-certificates:focus .icon-graduation {
  color: var(--color-gold-classic); /* золото, для эффекта */
  filter: drop-shadow(0 0 6px var(--color-gold-classic));
  transform: scale(1.15) rotate(-10deg);
}

.icon-graduation {
  flex-shrink: 0;
}

/* ============================================
   МОДАЛЬНОЕ ОКНО GLASSMORPHISM
   ============================================ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  z-index: 11000; /* Выше всего контента и модалок сертификатов */
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  overflow-y: auto; /* Скролл overlay если контент не влезает */
  padding: 1rem;
}

.modal-overlay.active {
  display: flex;
  justify-content: center;
  align-items: flex-start; /* Не center - для малых экранов */
  opacity: 1;
  animation: fadeIn 0.3s ease-out;
  padding-top: 1rem; /* Отступ сверху */
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal-glassmorphism {
  background: rgba(36, 7, 25, 0.34);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  padding: 32px;
  max-width: 90vw;
  max-height: 100%;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(130, 10, 10, 0.4), 0 0 0 1px rgba(184, 134, 11, 0.1);
  position: relative;
  z-index: 10001; /* Поверх контента страницы и под overlay формы */
  animation: slideUp 0.4s ease-out;
  /* Momentum + containment */
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  /* Скрываем скроллбар */
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
}


@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Кнопка закрытия для модалки сертификатов */
.modal-glassmorphism .modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(15, 7, 2, 0.925);
  border: 1px solid var(--color-border);
  color: var(--color-primary);
  font-size: 32px;
  line-height: 1;
  width: 50px; /* WCAG 2.2 AA minimum touch target */
  height: 50px;
  min-width: 50px;
  min-height: 50px;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  z-index: 10001;
  will-change: transform;
  transform: translateY(0);
}

/* Состояние кнопки внизу (при доскролливании до конца) */
.modal-glassmorphism .modal-close.scrolled-to-bottom {
  /* transform будет установлен через JavaScript */
}

.modal-glassmorphism .modal-close:hover {
  background: rgba(15, 7, 2, 0.925);
  transform: translateY(var(--close-btn-translate-y, 0)) rotate(90deg);
  box-shadow: 0 0 15px rgba(184, 134, 11, 0.5);
}

/* Заголовок модального окна сертификатов */
.modal-glassmorphism .modal-title {
  color: var(--color-primary);
  font-size: var(--text-2xl);
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--spacing-xl);
  text-align: center;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Заголовок модального окна с кнопкой скачивания */
.modal-header {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-xl);
  align-items: center;
}

.modal-download-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm) var(--spacing-lg);
  background: rgba(184, 134, 11, 0.2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-primary);
  text-decoration: none;
  transition: all 0.3s ease;
  font-size: var(--text-sm);
}

.modal-download-btn:hover {
  background: rgba(184, 134, 11, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(184, 134, 11, 0.3);
}

/* Стили для текстового контента */
.modal-text-content {
  color: var(--color-text-primary);
  line-height: 1.8;
  font-size: var(--text-base);
}

.modal-text-content h4 {
  font-size: var(--text-lg);
  font-weight: var(--font-weight-semibold);
  margin-top: var(--spacing-xl);
  margin-bottom: var(--spacing-md);
  color: var(--color-primary);
}

.modal-text-content p {
  margin-bottom: var(--spacing-md);
}

.modal-text-content ul {
  margin-left: var(--spacing-lg);
  margin-bottom: var(--spacing-md);
}

.modal-text-content li {
  margin-bottom: var(--spacing-sm);
}

/* ============================================
   ГАЛЕРЕЯ СЕРТИФИКАТОВ
   ============================================ */

.certificates-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 90vw), 1fr));
  gap: clamp(16px, 3vw, 20px);
  margin-top: var(--spacing-lg);
  justify-items: center; /* Центрируем элементы в grid ячейках */
}

.certificate-item {
  position: relative;
  line-height: 0;
  font-size: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: 100%;
}

.certificate-item:hover img {
  border-color: rgba(184, 134, 11, 0.4);
  box-shadow: 0 4px 20px rgba(184, 134, 11, 0.2);
  transform: scale(1.05);
}

.certificate-item picture {
  display: block;
  max-width: 100%;
  line-height: 0;
}

.certificate-item img {
  max-width: 100%;
  width: auto;
  height: auto;
  display: block;
  border-radius: 8px;
  background: 
    linear-gradient(135deg, rgba(184, 134, 11, 0.1) 0%, rgba(0, 0, 0, 0.3) 100%),
    rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(184, 134, 11, 0.2);
  transition: all 0.3s ease;
  cursor: pointer;
  /* Изображения сохраняют свои оригинальные пропорции, не растягиваются принудительно */
}

/* Placeholder для загрузки изображений */
.certificate-item img[loading] {
  background: 
    linear-gradient(135deg, rgba(184, 134, 11, 0.15) 0%, rgba(0, 0, 0, 0.4) 100%),
    rgba(0, 0, 0, 0.3);
}

/* Улучшенный fallback для не загруженных изображений */
.certificate-item img:not([src]),
.certificate-item img[src=""] {
  min-height: 200px;
  background: 
    linear-gradient(135deg, rgba(184, 134, 11, 0.1) 0%, rgba(0, 0, 0, 0.3) 100%),
    rgba(0, 0, 0, 0.2);
}

/* Скроллбар для модального окна сертификатов */
.modal-glassmorphism::-webkit-scrollbar {
  width: 8px;
}

.modal-glassmorphism::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

.modal-glassmorphism::-webkit-scrollbar-thumb {
  background: rgba(184, 134, 11, 0.3);
  border-radius: 4px;
}

.modal-glassmorphism::-webkit-scrollbar-thumb:hover {
  background: rgba(184, 134, 11, 0.5);
}

/* ============================================
   АДАПТИВНОСТЬ ДЛЯ МОДАЛЬНОГО ОКНА
   ============================================ */

@media (max-width: 768px) {
  .modal-glassmorphism {
    padding: 20px 12px;
    max-width: 98vw;
    width: 98vw;
    max-height: 95vh;
    margin: 0 auto;
  }

  .modal-glassmorphism .modal-title {
    font-size: var(--text-xl);
    margin-bottom: var(--spacing-md);
  }

  .modal-header {
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-sm);
  }

  .modal-download-btn {
    width: 100%;
    justify-content: center;
    font-size: var(--text-xs);
    padding: var(--spacing-xs) var(--spacing-md);
  }

  .modal-text-content {
    font-size: var(--text-sm);
    line-height: 1.7;
  }

  .modal-text-content h4 {
    font-size: var(--text-base);
  }

  .certificates-gallery {
    grid-template-columns: 1fr;
    gap: 16px;
    width: 100%;
  }

  .certificate-item {
    width: 100%;
    max-width: 100%;
  }

  .certificate-item img {
    max-width: 100%;
    width: auto;
    height: auto;
  }

  .modal-glassmorphism .modal-close {
    width: 36px;
    height: 36px;
    font-size: 20px;
    top: 12px;
    right: 12px;
  }
}

/* Медиа-запрос для очень маленьких экранов */
@media (max-width: 480px) {
  .modal-glassmorphism {
    padding: 16px 8px;
    max-width: 100vw;
    width: 100vw;
    max-height: 100vh;
    margin: 0;
    border-radius: 12px;
  }

  .modal-glassmorphism .modal-title {
    font-size: clamp(1.125rem, 5vw, 1.25rem);
    margin-bottom: var(--spacing-sm);
    padding: 0 32px 0 0; /* Отступ справа для кнопки закрытия */
  }

  .certificates-gallery {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: var(--spacing-sm);
  }

  .certificate-item {
    width: 100%;
    max-width: 100%;
  }

  .certificate-item img {
    width: 100%;
    max-width: 100%;
    height: auto;
  }

  .modal-glassmorphism .modal-close {
    width: 32px;
    height: 32px;
    font-size: 18px;
    top: 8px;
    right: 8px;
    min-width: 32px;
    min-height: 32px;
  }

  /* Отключаем hover эффекты для модалки сертификатов на разрешениях 480px и ниже */
  .modal-glassmorphism .modal-close:hover {
    background: rgba(184, 134, 11, 0.2);
    transform: translateY(var(--close-btn-translate-y, 0));
    box-shadow: none;
  }

  .modal-download-btn:hover {
    background: rgba(184, 134, 11, 0.2);
    transform: none;
    box-shadow: none;
  }

  .certificate-item:hover img {
    border-color: rgba(184, 134, 11, 0.2);
    box-shadow: none;
    transform: none;
  }

  .modal-glassmorphism::-webkit-scrollbar-thumb:hover {
    background: rgba(184, 134, 11, 0.3);
  }
}

@media (min-width: 481px) and (max-width: 768px) {
  .modal-glassmorphism {
    padding: 24px 16px;
    max-width: 96vw;
    width: 96vw;
  }

  .certificates-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }

  .certificate-item img {
    max-width: 100%;
    width: auto;
    height: auto;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .certificates-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
  }
  
  .certificate-item img {
    max-width: 100%;
    width: auto;
    height: auto;
  }
}

@media (min-width: 1025px) {
  .certificates-gallery {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
  }
  
  .certificate-item img {
    max-width: 100%;
    width: auto;
    height: auto;
  }
}

/* Блокировка прокрутки body при открытом модальном окне */
body.modal-open {
  overflow: hidden !important;
  position: fixed;
  width: 100%;
  height: 100vh;
}

/* ============================================
   СТИЛИ ДЛЯ ПЕЧАТИ
   ============================================ */

@media print {
  .site-header,
  .site-footer,
  .contact-button,
  .modal-overlay,
  .btn-certificates {
    display: none;
  }

  body {
    background: white;
    color: black;
  }

  .hero {
    background: white;
    color: black;
  }
}

/* ========================================
   МОДАЛЬНОЕ ОКНО ФОРМЫ ОБРАТНОЙ СВЯЗИ
   ======================================== */


/* Контент модального окна */
.modal-content {
  background: transparent;
  backdrop-filter: blur(25px);
  border: 1px solid var(--color-gold-classic); /* Возвращаем border */
  border-radius: 20px;
  padding: 1.5rem 1.5rem 2.5rem 1.5rem; /* Увеличен нижний padding для границы */
  max-width: 500px;
  width: 100%;
  max-height: calc(100vh - 1rem); /* Максимальная высота для скролла */
  min-height: fit-content; /* Минимальная высота по контенту */
  overflow-y: auto; /* Внутренний скролл если нужен */
  position: relative;
  box-shadow: 
    0 25px 80px rgba(0, 0, 0, 0.8),
    0 0 40px rgba(212, 175, 55, 0.15); /* Золотое свечение */
  transform: scale(0.9);
  transition: transform 0.3s ease;
  margin: 0; /* Убрать margin - центрирование через flexbox */
  /* Скрываем скроллбар */
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
  /* Momentum + containment */
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  /* Обеспечиваем, что граница видна */
  box-sizing: border-box;
  display: flex;
  flex-direction: column; /* Для правильного расположения контента */
}

.modal-content::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}



.modal-overlay.active .modal-content {
  transform: scale(1);
}

/* Кнопка закрытия */
.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: transparent;
  border: none;
  font-size: 1.6rem;
  color: var(--color-text-secondary);
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s ease;
  z-index: 1000;
}

.modal-close:hover {
  background: rgba(212, 175, 55, 0.2); /* Золотой фон при hover */
  color: var(--color-gold-classic); /* Золотой цвет иконки */
  transform: rotate(90deg);
  box-shadow: 0 0 15px rgba(212, 175, 55, 0.4); /* Золотое свечение */
}

/* Заголовки модального окна */
.modal-title {
  position: relative;
  z-index: 2; /* Поверх границы */
  font-size: 2rem;
  font-weight: 600;
  background: linear-gradient(135deg, var(--color-gold-medium) 0%, var(--color-gold-medium) 50%, var(--color-gold-classic) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0 0 0.5rem 0;
  text-align: center;
}

.modal-subtitle {
  position: relative;
  z-index: 2; /* Поверх границы */
  color: var(--color-text-secondary);
  text-align: center;
  margin: 0 0 1.5rem 0; /* Уменьшено с 2rem */
  font-size: 1rem;
}

/* Форма */
.contact-form {
  position: relative;
  z-index: 2; /* Поверх границы */
  display: flex;
  flex-direction: column;
  gap: 0.5rem; /* Уменьшено для компактности */
  flex: 1; /* Занимает доступное пространство */
  min-height: 0; /* Позволяет скролл работать */
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.5rem; /* Уменьшено для компактности */
}

.form-label {
  font-weight: 500;
  color: var(--color-text-primary);
  font-size: 0.95rem;
}

.required {
  color: var(--color-gold-medium);
}

.optional {
  color: var(--color-text-secondary);
  font-weight: 400;
  font-size: 0.85rem;
}

/* Поля ввода */
.form-input,
.form-textarea {
  width: 100%;
  padding: 0.75rem 0.875rem; /* Уменьшено с 0.875rem 1rem */
  background: rgba(0, 0, 0, 0.6); /* Более темный черный фон */
  border: 2px solid rgba(212, 175, 55, 0.3); /* Золотая рамка */
  border-radius: 12px;
  color: var(--color-text-primary);
  font-size: clamp(16px, 4vw, 18px);
  font-family: inherit;
  transition: all 0.3s ease;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--color-gold-classic); /* Золотая рамка при фокусе */
  box-shadow: 
    0 0 0 3px rgba(212, 175, 55, 0.2),
    0 0 20px rgba(212, 175, 55, 0.1); /* Золотое свечение */
  background: rgba(0, 0, 0, 0.7); /* Более темный фон при фокусе */
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--color-text-secondary);
  opacity: 0.6;
}

.form-textarea {
  resize: vertical;
  min-height: clamp(80px, 15vh, 120px);
  max-height: clamp(120px, 30vh, 200px);
  margin-top: 0; /* Убираем дополнительный отступ */
}

/* Уменьшаем отступ до группы с вопросом */
.form-group:has(.form-textarea) {
  margin-top: 0.25rem; /* Минимальный отступ до textarea */
}

/* Ошибки валидации */
.form-error {
  color: var(--color-gold-medium);
  font-size: 0.85rem;
  min-height: 1.2rem;
  display: block;
}

.form-input.error,
.form-textarea.error {
  border-color: var(--color-gold-medium);
}

/* Чекбокс согласия с условиями */
.form-agreement {
  margin-top: var(--spacing-lg);
  margin-bottom: var(--spacing-lg);
}

.form-checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: var(--spacing-sm);
  cursor: pointer;
  font-size: var(--text-sm);
  line-height: 1.6;
}

.form-checkbox-label input[type="checkbox"] {
  margin-top: 0.2em;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--color-primary);
  outline: none;
  box-shadow: none;
}

.form-checkbox-label input[type="checkbox"]:focus,
.form-checkbox-label input[type="checkbox"]:focus-visible {
  outline: none;
  box-shadow: none;
}

.checkbox-text {
  flex: 1;
  color: var(--color-text-secondary);
}

.link-button {
  background: none;
  border: none;
  padding: 0;
  color: var(--color-primary);
  text-decoration: underline;
  cursor: pointer;
  font-size: inherit;
  font-family: inherit;
}

.link-button:hover {
  color: var(--color-gold-medium);
}

/* Выбор мессенджера */
.messenger-choice {
  display: grid;
  grid-template-columns: 1fr 1fr; /* Телефон слева, WhatsApp справа */
  gap: 0.75rem; /* Уменьшено для компактности */
  justify-items: start; /* Выравнивание по левому краю */
}

.messenger-option {
  cursor: pointer;
  width: 100%; /* Занимает всю ширину ячейки */
}

.messenger-option input[type="radio"] {
  display: none;
}

.messenger-btn {
  display: flex;
  align-items: center;
  justify-content: flex-start; /* Выравнивание по левому краю */
  gap: 0.5rem;
  padding: 0.625rem 0.75rem; /* Уменьшено для компактности */
  background: rgba(0, 0, 0, 0.6); /* Темный черный фон */
  border: 1px solid rgba(212, 175, 55, 0.3); /* Золотая рамка 1px */
  border-radius: 5px; /* Radial изгиб 5px */
  color: var(--color-text-primary);
  font-weight: 500;
  font-size: 0.9rem; /* Уменьшен размер текста */
  transition: all 0.3s ease;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
  width: 100%; /* Занимает всю ширину */
  box-sizing: border-box; /* Учитываем border в ширине */
}

.messenger-btn svg,
.messenger-btn i {
  width: 18px; /* Уменьшено */
  height: 18px; /* Уменьшено */
  font-size: 16px; /* Уменьшено */
  flex-shrink: 0;
}

.messenger-option input[type="radio"]:checked + .messenger-btn {
  background: linear-gradient(135deg, 
    rgba(212, 175, 55, 0.3) 0%, 
    rgba(184, 134, 11, 0.2) 100%
  ); /* Золотой градиент при выборе */
  border-color: var(--color-gold-classic); /* Золотая рамка */
  box-shadow: 
    0 0 25px rgba(212, 175, 55, 0.4),
    inset 0 2px 4px rgba(0, 0, 0, 0.3); /* Золотое свечение */
}

.messenger-option:hover .messenger-btn {
  border-color: var(--color-gold-classic); /* Золотая рамка при hover */
  transform: translateY(-2px);
  box-shadow: 
    0 0 15px rgba(212, 175, 55, 0.3),
    inset 0 2px 4px rgba(0, 0, 0, 0.3); /* Золотое свечение при hover */
}

/* Кнопка отправки */
.btn-submit {
  width: 100%;
  max-width: 100%; /* Ограничиваем ширину */
  margin: 0.5rem auto 0 auto; /* Центрируем и добавляем верхний отступ */
  padding: 1rem 2rem;
  font-size: 1.1rem;
  background: linear-gradient(315deg, 
  var(--color-emerald-dark) 0%, 
  var(--color-emerald-medium) 50%, 
  var(--color-emerald-light) 100%
  ); /* Золотой градиент */
  color: #ffffff; /* Темный текст на золотом фоне */
  border: 2px solid var(--color-emerald-light);
  border-radius: 12px;
  font-weight: 600;
  transition: all 0.4s ease;
  box-shadow: 
    0 4px 15px rgba(13, 79, 60, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  display: block; /* Блочный элемент для центрирования */
  box-sizing: border-box;
}

.btn-submit:hover {
  background: linear-gradient(315deg, 
    var(--color-emerald-dark) 0%, 
    var(--color-emerald-medium) 50%, 
    var(--color-emerald-light) 100%
  );
  transform: translateY(-2px);
  box-shadow: 
    0 8px 25px rgba(46, 125, 50, 0.5),
    0 0 20px rgba(46, 125, 50, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* Honeypot (скрытое поле от ботов) */
.honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

/* Кнопка "Задать вопрос" */
.question-btn {
  background: linear-gradient(135deg, var(--color-gold-dark) 0%, var(--color-gold-medium) 50%, var(--color-gold-classic) 100%);
  color: white;
  border: none;
}

.question-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(184, 134, 11, 0.3);
}

/* ========================================
   POP-UP УВЕДОМЛЕНИЕ
   ======================================== */

.notification-popup {
  position: fixed;
  top: var(--spacing-xl);
  right: var(--spacing-xl);
  z-index: 10000;
  opacity: 0;
  transform: translateX(400px);
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  pointer-events: none;
}

.notification-popup.show {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.notification-content {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  padding: var(--spacing-lg) var(--spacing-xl);
  background: linear-gradient(
    135deg,
    var(--color-surface) 0%,
    rgba(10, 10, 8, 0.95) 100%
  );
  backdrop-filter: blur(20px);
  border: 2px solid var(--color-primary);
  border-radius: var(--radius-lg);
  box-shadow: 
    var(--shadow-gold-lg),
    0 0 30px rgba(184, 134, 11, 0.4),
    0 10px 40px rgba(0, 0, 0, 0.6);
  position: relative;
  overflow: hidden;
}

/* Золотое свечение внутри popup */
.notification-content::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--color-gold-classic) 50%,
    transparent 100%
  );
  opacity: 0.8;
}

.notification-icon {
  font-size: var(--text-2xl);
  background: linear-gradient(
    135deg,
    var(--color-emerald-dark) 0%,
    var(--color-emerald-medium) 50%,
    var(--color-emerald-light) 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  position: relative;
  animation: bounce 0.6s ease;
}

@keyframes bounce {
  0%, 100% { 
    transform: scale(1);
  }
  50% { 
    transform: scale(1.2);
  }
}

.notification-message {
  color: var(--color-text-primary);
  font-family: var(--font-family-body);
  font-weight: var(--font-weight-medium);
  font-size: var(--text-lg);
  margin: 0;
  line-height: 1.5;
}

/* ========================================
   АДАПТИВНОСТЬ
   ======================================== */

@media (max-width: 768px) {
  .modal-content {
    padding: clamp(1rem, 4vw, 1.25rem) clamp(1rem, 4vw, 1.25rem) clamp(2rem, 5vw, 2.5rem) clamp(1rem, 4vw, 1.25rem); /* Увеличен нижний padding */
    max-width: min(90vw, 500px);
    max-height: calc(100vh - 1rem); /* Максимальная высота для скролла */
    min-height: fit-content; /* Минимальная высота по контенту */
    margin: 0 auto; /* Убираем верхний margin */
  }
  
  .modal-overlay.active {
    padding: 0.5rem 0.5rem 1rem 0.5rem; /* Только нижний padding */
    align-items: flex-start;
    padding-top: 0.5rem; /* Минимальный верхний отступ */
  }
  
  .modal-title {
    font-size: 1.5rem;
  }
  
  .modal-subtitle {
    font-size: 0.9rem;
  }
  
  .btn-submit {
    margin-left: auto;
    margin-right: auto; /* Центрируем кнопку */
  }

  .messenger-choice {
    grid-template-columns: 1fr 1fr; /* Оставляем в ряд на мобильных */
    gap: 0.5rem; /* Уменьшаем gap на мобильных */
  }

  .notification-popup {
    top: 1rem;
    right: 1rem;
    left: 1rem;
  }

  .notification-content {
    padding: 1rem 1.25rem;
  }

  .notification-message {
    font-size: 1rem;
  }
}

/* ========================================
   БЛОКИРОВКА СКРОЛЛА BODY ПРИ ОТКРЫТОЙ МОДАЛКЕ
   ======================================== */

/* Дублирование удалено - используется определение выше */

@media (max-width: 480px) {
  .modal-overlay.active {
    padding: 0.25rem 0.5rem 0.75rem 0.5rem; /* Только нижний padding */
    align-items: flex-start;
    padding-top: 0.25rem; /* Минимальный верхний отступ */
  }

  .modal-content {
    padding: clamp(0.75rem, 3vw, 1rem) clamp(0.75rem, 3vw, 1rem) clamp(1.75rem, 4vw, 2rem) clamp(0.75rem, 3vw, 1rem); /* Увеличен нижний padding */
    max-width: min(95vw, 400px);
    max-height: calc(100vh - 0.75rem); /* Максимальная высота для скролла */
    min-height: fit-content; /* Минимальная высота по контенту */
    margin: 0 auto; /* Убираем верхний margin */
  }
  
  .modal-title {
    font-size: clamp(1.25rem, 5vw, 1.5rem);
  }

  .form-input,
  .form-textarea {
    font-size: max(16px, 4vw); /* Предотвращает zoom на iOS */
  }
  
  .btn-submit {
    margin-left: auto;
    margin-right: auto; /* Центрируем кнопку */
  }
}
