/* Основные стили */
:root {
  --primary: #354077;
  --secondary: #F54946;
  --success: #01A759;
  --info: #3187FF;
}

html {
  scroll-behavior: smooth;
}

body {
  overflow-x: hidden;
}

/* Добавляем плавные переходы и эффекты при наведении */
a, button {
  transition: all 0.3s ease;
}

/* Анимации для элементов при прокрутке */
.fade-in {
  opacity: 0.2; /* Не полностью прозрачный на случай проблем с JS */
  transform: translateY(10px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in.active {
  opacity: 1;
  transform: translateY(0);
}

/* Стили кнопок с эффектом пульсации */
.pulse-effect:hover {
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

/* Анимация подсветки формы при переходе к ней */
.highlight-form {
  animation: highlightForm 2s ease;
}

@keyframes highlightForm {
  0% {
    box-shadow: 0 0 0 0 rgba(245, 73, 70, 0.5);
  }
  50% {
    box-shadow: 0 0 0 15px rgba(245, 73, 70, 0.2);
  }
  100% {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  }
}

/* Стиль для активного элемента навигации */
.nav-active {
  color: var(--secondary);
  position: relative;
}

.nav-active::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--secondary);
  border-radius: 2px;
}

/* Стили для FAQ секции */
.faq-content {
  display: block !important;
  padding: 1.5rem;
  border-top: 1px solid rgba(229, 231, 235, 0.5);
  background-color: rgba(249, 250, 251, 0.8);
}

.faq-toggle {
  background: linear-gradient(to right, rgba(53, 64, 119, 0.05), rgba(49, 135, 255, 0.05));
  border-radius: 0.75rem 0.75rem 0 0;
}

.faq-toggle i {
  color: var(--secondary);
}

.faq-toggle:hover {
  background: linear-gradient(to right, rgba(53, 64, 119, 0.1), rgba(49, 135, 255, 0.1));
}

/* Подсветка элементов форм при фокусе */
input:focus, textarea:focus {
  box-shadow: 0 0 0 3px rgba(49, 135, 255, 0.2);
  outline: none;
}

/* Стили для мобильного меню */
#mobileMenu {
  display: none;
}

#mobileMenu.active {
  display: block;
}

@media (max-width: 768px) {
  /* Дополнительные стили для мобильного меню */
  #mobileMenu {
    max-height: 0;
    overflow: hidden;
    transition: none;
  }
  
  #mobileMenu.active {
    max-height: 500px;
  }
}

/* Стилизованный скроллбар */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--secondary);
}

/* Анимация для счетчика */
.counter {
  display: inline-block;
  position: relative;
  font-weight: 700;
}

/* Эффект подчеркивания для ссылок */
.underline-animation {
  position: relative;
}

.underline-animation::after {
  content: '';
  position: absolute;
  width: 100%;
  transform: scaleX(0);
  height: 2px;
  bottom: -4px;
  left: 0;
  background-color: var(--secondary);
  transform-origin: bottom right;
  transition: transform 0.3s ease-out;
}

.underline-animation:hover::after {
  transform: scaleX(1);
  transform-origin: bottom left;
}

/* Стилизация карточек с тенями и эффектами */
.service-card {
  transition: all 0.3s ease;
}

.service-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Градиентный фон кнопок */
.gradient-btn {
  background: linear-gradient(90deg, var(--primary), var(--info));
  background-size: 200% auto;
  transition: background-position 0.5s ease;
}

.gradient-btn:hover {
  background-position: right center;
}

/* Стили для формы */
#form .bg-white {
  min-height: 400px;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  background: linear-gradient(145deg, rgba(255,255,255,1) 0%, rgba(249,250,251,1) 100%);
  border-top: 4px solid var(--secondary);
}

#contactForm {
  display: block;
  padding: 1.5rem;
}

#contactForm input,
#contactForm textarea {
  transition: all 0.3s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  border-radius: 0.5rem;
}

#contactForm input:focus,
#contactForm textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(53, 64, 119, 0.2);
  /* transform убран - конфликтовал с позицией иконок */
}

#contactForm button {
  background: linear-gradient(90deg, var(--secondary), #ff6c6a);
  background-size: 200% auto;
  transition: all 0.5s ease;
}

/* Современный стиль для формы */
.form-container-modern {
  position: relative;
  z-index: 1;
}

.form-container-modern::before {
  content: '';
  position: absolute;
  top: -10px;
  right: -10px;
  background: linear-gradient(45deg, var(--primary), var(--info));
  width: 100px;
  height: 100px;
  border-radius: 50%;
  z-index: -1;
  opacity: 0.2;
}

.form-container-modern::after {
  content: '';
  position: absolute;
  bottom: -15px;
  left: -15px;
  background: linear-gradient(45deg, var(--secondary), #ff8f8c);
  width: 70px;
  height: 70px;
  border-radius: 50%;
  z-index: -1;
  opacity: 0.2;
}

/* Явное позиционирование иконок для Safari - не полагаемся на Tailwind */
#contactForm .relative > div.relative {
  position: relative;
  display: block;
}

#contactForm .relative > div.relative > span {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  display: flex;
  align-items: center;
  padding-left: 0.75rem; /* pl-3 */
  pointer-events: none;
  color: #9CA3AF; /* gray-400 */
  z-index: 10;
}

/* Иконки остаются серыми всегда */
#contactForm input:focus ~ span,
#contactForm .relative:focus-within > span {
  color: #9CA3AF !important;
}

/* Стиль для кнопок с пульсацией (кроме плавающей кнопки) */
a:not(#floatingBtn)[href="#form"].pulse-effect {
  animation: pulse 2s infinite;
  box-shadow: 0 10px 25px -5px rgba(245, 73, 70, 0.3);
  transform: translateZ(0); /* Активирует аппаратное ускорение для более гладкой анимации */
  will-change: transform; /* Подсказка браузеру об анимации */
}

@keyframes pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 10px 25px -5px rgba(245, 73, 70, 0.3);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 15px 25px -5px rgba(245, 73, 70, 0.5);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 10px 25px -5px rgba(245, 73, 70, 0.3);
  }
}

/* Добавляем специальные стили для ссылок в секции услуг */
#services a[href="#form"] {
  transition: background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

#services a[href="#form"]:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

/* Стили для политики конфиденциальности в модальном окне */
#privacyContent {
  line-height: 1.7;
  color: #374151;
}

#privacyContent h1 {
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 3px solid var(--secondary);
}

#privacyContent h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--primary);
  margin-top: 2rem;
  margin-bottom: 1rem;
}

#privacyContent h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1f2937;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

#privacyContent p {
  margin-bottom: 1rem;
}

#privacyContent ul {
  list-style-type: disc;
  margin-left: 2rem;
  margin-bottom: 1rem;
}

#privacyContent li {
  margin-bottom: 0.5rem;
}

#privacyContent strong {
  color: var(--primary);
  font-weight: 600;
}

#privacyContent hr {
  border: 0;
  border-top: 2px solid #e5e7eb;
  margin: 2rem 0;
}

#privacyContent em {
  color: #6b7280;
  font-style: italic;
}

/* Стили для dialog элементов */
dialog::backdrop {
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
}

dialog {
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}