/* ===== БАЗОВЫЕ СТИЛИ МОДАЛЬНЫХ ОКОН ===== */
#trialModal, #exitModal {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
}

#trialModal.active, #exitModal.active {
  display: flex !important;
  opacity: 1 !important;
  visibility: visible !important;
}

/* Отключить скролл при открытых модалках */
body.modal-open {
  overflow: hidden !important;
  position: fixed !important;
  width: 100% !important;
  height: 100% !important;
}

.modal {
  display: none;
  position: fixed;
  z-index: 10000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s cubic-bezier(0.32, 0.72, 0, 1);
}

.modal.active {
  opacity: 1;
  visibility: visible;
}

.modal__overlay {
  position: absolute;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  cursor: pointer;
}

.modal__container {
  position: relative;
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  margin: 2% auto;
  padding: 0;
  border-radius: 20px;
  width: 90%;
  max-width: 500px;
  box-shadow: 
    0 25px 50px rgba(0, 0, 0, 0.25),
    0 0 0 1px rgba(255, 255, 255, 0.1);
  transform: translateY(30px) scale(0.95);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.32, 0.72, 0, 1);
}

.modal.active .modal__container {
  transform: translateY(0) scale(1);
  opacity: 1;
}

/* ===== ЗАГОЛОВОК МОДАЛЬНОГО ОКНА ===== */
.modal__header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 30px;
  border-radius: 20px 20px 0 0;
  text-align: center;
  color: white;
  position: relative;
}

.modal__header--gift {
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
}

.modal__icon {
  font-size: 3rem;
  margin-bottom: 15px;
  display: block;
}

.modal__title {
  margin: 0;
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1.3;
}

.modal__close {
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: 2rem;
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  transition: all 0.3s ease;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
}

.modal__close:hover {
  color: white;
  background: rgba(255, 255, 255, 0.2);
  transform: rotate(90deg);
}

/* ===== ТЕЛО МОДАЛЬНОГО ОКНА ===== */
.modal__body {
  padding: 30px;
}

.modal__subtitle {
  color: #666;
  text-align: center;
  margin-bottom: 25px;
  font-size: 1.1rem;
  line-height: 1.5;
}

/* ===== ФОРМЫ ===== */
.modal__form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.input-group {
  position: relative;
}

.input-group input {
  width: 100%;
  padding: 18px 20px 18px 50px;
  border: 2px solid #e9ecef;
  border-radius: 12px;
  font-size: 16px;
  transition: all 0.3s ease;
  background: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.input-group input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
  transform: translateY(-2px);
}

.input-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.2rem;
  color: #6c757d;
}

.input-group input:focus + .input-icon {
  color: #667eea;
}

/* ===== КНОПКИ ===== */
.btn {
  border: none;
  border-radius: 12px;
  padding: 18px 30px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.btn--primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.btn--gradient {
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
  color: white;
}

.btn--large {
  padding: 20px 30px;
}

.btn--fullwidth {
  width: 100%;
}

.btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.btn:active {
  transform: translateY(-1px);
}

.btn__loader {
  display: none;
}

.btn.loading .btn__text {
  opacity: 0;
}

.btn.loading .btn__loader {
  display: inline-block;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ===== ФУТЕР И ДОПОЛНИТЕЛЬНАЯ ИНФОРМАЦИЯ ===== */
.modal__features {
  margin: 20px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal-feature-item {
  display: flex;
  align-items: center;
  padding: 0px;
  gap: 5px;
  color: #666;
  font-size: 0.95rem;
}

.modal-feature-icon {
  font-size: 0.5rem;
}

.modal__footer {
  text-align: center;
  margin-top: 20px;
}

.modal__privacy {
  color: #999;
  font-size: 0.9rem;
  margin: 0;
}

.modal__privacy a {
  color: #667eea;
  text-decoration: none;
}

.modal__privacy a:hover {
  text-decoration: underline;
}

/* ===== УВЕДОМЛЕНИЕ ОБ УСПЕХЕ ===== */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10001;
  transform: translateX(100%);
  opacity: 0;
  transition: all 0.5s cubic-bezier(0.32, 0.72, 0, 1);
  display: none;
}

.notification--success {
  background: linear-gradient(135deg, #4ecdc4 0%, #44a08d 100%);
  color: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.notification.active {
  transform: translateX(0);
  opacity: 1;
}

.notification__content {
  display: flex;
  align-items: center;
  gap: 15px;
}

.notification__icon {
  font-size: 2rem;
}

.notification__text h4 {
  margin: 0 0 5px 0;
  font-size: 1.1rem;
}

.notification__text p {
  margin: 0;
  opacity: 0.9;
}

.notification__close {
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.3s ease;
}

.notification__close:hover {
  opacity: 1;
}

/* ===== АДАПТИВНОСТЬ ===== */
@media (max-width: 768px) {
  .modal__container {
    margin: 5% auto;
    width: 95%;
    border-radius: 16px;
  }
  
  .modal__header {
    padding: 25px 20px;
  }
  
  .modal__body {
    padding: 25px 20px;
  }
  
  .modal__title {
    font-size: 1.5rem;
  }
  
  .input-group input {
    padding: 16px 16px 16px 45px;
  }
  
  .btn {
    padding: 16px 25px;
    font-size: 1rem;
  }
  
  .notification {
    left: 20px;
    right: 20px;
    transform: translateY(-100%);
  }
  
  .notification.active {
    transform: translateY(0);
  }
}

@media (max-width: 480px) {
  .modal__container {
    margin: 10% auto;
    width: 92%;
  }
  
  .modal__header {
    padding: 20px 15px;
  }
  
  .modal__body {
    padding: 20px 15px;
  }
  
  .modal__title {
    font-size: 1.3rem;
  }
  
  .modal__icon {
    font-size: 2.5rem;
  }
}

/* ===== АНИМАЦИИ ===== */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.shake {
  animation: shake 0.3s ease;
}

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

.pulse {
  animation: pulse 0.5s ease;
}

/* ===== MICRO-INTERACTIONS ===== */
.input-group input:invalid:not(:placeholder-shown) {
  border-color: #ff6b6b;
  animation: shake 0.3s ease;
}

.input-group input:valid:not(:placeholder-shown) {
  border-color: #4ecdc4;
}

/* Плавное появление элементов */
.modal__container > * {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.5s ease;
}

.modal.active .modal__container > * {
  opacity: 1;
  transform: translateY(0);
}

/* Задержки для последовательного появления */
.modal.active .modal__header { transition-delay: 0.1s; }
.modal.active .modal__subtitle { transition-delay: 0.2s; }
.modal.active .modal__form { transition-delay: 0.3s; }
.modal.active .modal__features { transition-delay: 0.4s; }
.modal.active .modal__footer { transition-delay: 0.5s; }


