/* Стили для exit попапа */
#exitPopup {
  animation: fadeIn 0.3s ease-in-out;
  font-family: 'Tilda Sans', Arial, sans-serif;
}

@keyframes fadeIn {
  from { 
    opacity: 0; 
    transform: translateY(-20px); 
  }
  to { 
    opacity: 1; 
    transform: translateY(0); 
  }
}

/* Контейнер попапа */
#exitPopup > div {
  animation: slideUp 0.4s ease-out;
  border: 2px solid rgba(255, 255, 255, 0.1);
  position: relative;
  overflow: hidden;
}

@keyframes slideUp {
  from { 
    transform: translateY(30px) scale(0.95);
    opacity: 0;
  }
  to { 
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

/* Кнопка закрытия */
#exitPopup button[style*="position: absolute; top: 15px; right: 15px;"] {
  transition: all 0.3s ease;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

#exitPopup button[style*="position: absolute; top: 15px; right: 15px;"]:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  transform: rotate(90deg);
}

/* Основная кнопка отправки */
#exitPopup button[type="submit"] {
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  position: relative;
  overflow: hidden;
}

#exitPopup button[type="submit"]:hover:not(:disabled) {
  background: #E68A00 !important;
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(255, 157, 0, 0.4);
}

#exitPopup button[type="submit"]:active:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(255, 157, 0, 0.4);
}

#exitPopup button[type="submit"]:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none !important;
}

/* Эффект блеска на кнопке при наведении */
#exitPopup button[type="submit"]:hover:not(:disabled)::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    transparent,
    rgba(255, 255, 255, 0.1),
    transparent
  );
  transform: rotate(45deg);
  animation: shine 1.5s ease-in-out;
}

@keyframes shine {
  0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
  100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

/* Поля ввода */
#exitPopup input[type="tel"] {
  transition: all 0.3s ease;
  border: 2px solid transparent !important;
}

#exitPopup input[type="tel"]:focus {
  outline: none;
  border-color: #FF9D00 !important;
  box-shadow: 0 0 0 3px rgba(255, 157, 0, 0.2);
  transform: scale(1.02);
}

#exitPopup input[type="tel"]::placeholder {
  color: #999;
  transition: color 0.3s ease;
}

#exitPopup input[type="tel"]:focus::placeholder {
  color: #ccc;
}

/* Бейдж "БЕСПЛАТНЫЙ ПОДАРОК" */
#exitPopup > div > div[style*="background: white; color: #0077FF;"] {
  animation: pulse 2s infinite;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

/* Блок с описанием чека-листа */
#exitPopup > div > div[style*="background: rgba(255,255,255,0.1);"] {
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

#exitPopup > div > div[style*="background: rgba(255,255,255,0.1);"]:hover {
  background: rgba(255, 255, 255, 0.15) !important;
  transform: translateY(-2px);
}

/* Список преимуществ */
#exitPopup ul {
  transition: all 0.3s ease;
}

#exitPopup ul li {
  transition: all 0.3s ease;
  position: relative;
}

#exitPopup ul li::before {
  content: '';
  position: absolute;
  left: -15px;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  background: #FF9D00;
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.3s ease;
}

#exitPopup ul li:hover {
  transform: translateX(5px);
}

#exitPopup ul li:hover::before {
  opacity: 1;
}

/* Текст гарантии */
#exitPopup p[style*="color: rgba(255,255,255,0.7);"] {
  transition: all 0.3s ease;
  position: relative;
}

#exitPopup p[style*="color: rgba(255,255,255,0.7);"]::before {
  content: '🔒';
  margin-right: 5px;
}

/* Адаптивность для мобильных */
@media (max-width: 600px) {
  #exitPopup > div {
    margin: 10px !important;
    padding: 25px 15px !important;
    max-width: 95% !important;
  }
  
  #exitPopup h3 {
    font-size: 20px !important;
    margin-bottom: 10px !important;
  }
  
  #exitPopup p[style*="font-size: 18px;"] {
    font-size: 16px !important;
    margin-bottom: 15px !important;
  }
  
  #exitPopup button[type="submit"] {
    padding: 15px !important;
    font-size: 16px !important;
  }
  
  #exitPopup input[type="tel"] {
    padding: 12px !important;
    font-size: 14px !important;
  }
  
  #exitPopup ul {
    padding-left: 15px !important;
    margin-bottom: 20px !important;
  }
  
  #exitPopup ul li {
    font-size: 13px !important;
    margin-bottom: 6px !important;
  }
}

/* Для очень маленьких экранов */
@media (max-width: 400px) {
  #exitPopup > div {
    padding: 20px 12px !important;
  }
  
  #exitPopup h3 {
    font-size: 18px !important;
  }
  
  #exitPopup p[style*="font-size: 18px;"] {
    font-size: 14px !important;
  }
  
  #exitPopup button[type="submit"] {
    font-size: 14px !important;
    padding: 12px !important;
  }
}

/* Анимация появления фона */
#exitPopup {
  backdrop-filter: blur(5px);
}

/* Улучшение читаемости текста */
#exitPopup h3,
#exitPopup p,
#exitPopup li {
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Плавное исчезновение при закрытии */
#exitPopup[style*="display: none"] {
  transition: opacity 0.3s ease;
  opacity: 0;
}

/* Стили для состояния загрузки */
#exitPopup button[type="submit"]:disabled::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid transparent;
  border-top: 2px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Улучшение контрастности для доступности */
#exitPopup input[type="tel"] {
  color: #333;
}

#exitPopup input[type="tel"]::placeholder {
  color: #666;
}

/* Фокус-состояния для доступности */
#exitPopup button:focus {
  outline: 2px solid #FF9D00;
  outline-offset: 2px;
}

#exitPopup input:focus {
  outline: 2px solid #FF9D00;
  outline-offset: 2px;
}