/* Модальное окно */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-content {
    background: var(--white);
    border-radius: 15px;
    width: 100%;
    max-width: 500px;
    padding: 40px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
    position: relative;
    animation: modalAppear 0.4s ease-out;
    margin-top: var(--header-height);
    max-height: calc(100vh - var(--header-height) - 40px);
    overflow-y: auto;
}

@keyframes modalAppear {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 25px;
    font-size: 28px;
    cursor: pointer;
    color: #888;
    transition: var(--transition);
    background: none;
    border: none;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.close-modal:hover {
    color: var(--text-color);
}

.main-modal-title {
    font-size: 1.8rem;
    color: #1f2937;
    margin-bottom: 10px;
    font-weight: 700;
}

.modal-subtitle {
    color: var(--text-light);
    margin-bottom: 25px;
    font-size: 1.05rem;
    line-height: 1.5;
}

.form-group {
    padding-bottom: 20px;
}

.form-group.city {
    padding-bottom: 30px;
}

/* Кнопка в модальном окне с анимацией блеска */
.modal-content .btn-primary {
  position: relative;
  overflow: hidden;
  z-index: 1;
  background: linear-gradient(135deg, #ff9f43, #ff7a18);
  border: none;
  border-radius: 40px;
  padding: 16px 32px;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 100%;
}

.modal-content .btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.4),
    transparent
  );
  transition: left 0.7s ease;
  z-index: -1;
}

.modal-content .btn-primary:hover::before {
  left: 100%;
}

.modal-content .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(255, 122, 24, 0.4);
}

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

.modal-content .btn-primary i {
  transition: transform 0.3s ease;
}

.modal-content .btn-primary:hover i {
  transform: translateX(3px);
}

/* Сообщение об успехе */
.success-message {
    display: none;
    background-color: var(--success-bg);
    color: var(--success-color);
    padding: 15px;
    border-radius: 10px;
    margin-top: 20px;
    text-align: center;
    font-weight: 500;
    border-left: 4px solid var(--success-color);
}

.success-message i {
    margin-right: 8px;
}

/* Адаптивность модального окна */
@media (max-width: 768px) {
    .modal-content {
        padding: 30px 25px;
        max-width: 90%;
        margin-top: calc(var(--header-height) + 10px);
    }
    
    .main-modal-title {
        font-size: 1.6rem;
    }
    
    .modal-overlay {
        padding: 10px;
    }
}

@media (max-width: 480px) {
    .modal-content {
        padding: 25px 20px;
        max-width: 95%;
        margin-top: calc(var(--header-height) + 5px);
        max-height: calc(100vh - var(--header-height) - 20px);
    }
    
    .main-modal-title {
        font-size: 1.4rem;
    }
    
    .modal-subtitle {
        font-size: 0.95rem;
    }
    
    .close-modal {
        top: 15px;
        right: 20px;
        font-size: 24px;
    }
}

/* ===== СПЕЦИАЛЬНАЯ МОДАЛКА С ПОДАРКОМ ===== */

#exitModal.modal-overlay {
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: none; /* оставляем ваш display: none */
}

#exitModal .modal-content {
    max-width: 500px;
    padding: 0; /* убираем padding, так как внутри есть своя структура */
    overflow: hidden;
    border-radius: 24px;
    background: linear-gradient(145deg, #ffffff 0%, #fff9f5 100%);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.3);
    animation: giftModalAppear 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes giftModalAppear {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

#exitModal .close-modal {
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 24px;
    border-radius: 50%;
    z-index: 10;
    transition: all 0.3s ease;
}

#exitModal .close-modal:hover {
    background: rgba(255, 255, 255, 0.5);
    transform: rotate(90deg);
    color: white;
}

/* Хедер модалки с подарком */
#exitModal .modal__header {
    padding: 48px 32px 32px;
    background: linear-gradient(135deg, #FF9A8B 0%, #FF6A88 50%, #FF99AC 100%);
    text-align: center;
    position: relative;
    color: white;
}

#exitModal .modal__header--gift {
    background: linear-gradient(135deg, #FF9A8B, #FF6A88, #FF99AC);
    background-size: 200% 200%;
    animation: gradientMove 8s ease infinite;
}

@keyframes gradientMove {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

#exitModal .modal__icon {
    font-size: 72px;
    line-height: 1;
    margin-bottom: 16px;
    display: inline-block;
    animation: giftBounce 2s infinite;
    filter: drop-shadow(0 10px 15px rgba(0, 0, 0, 0.2));
}

@keyframes giftBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

#exitModal .modal__title {
    font-size: 28px;
    font-weight: 800;
    margin: 0;
    color: white;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    line-height: 1.2;
}

#exitModal .modal__body {
    padding: 32px;
}

#exitModal .modal__subtitle {
    font-size: 16px;
    line-height: 1.6;
    color: #4B5563;
    margin: 0 0 28px 0;
    text-align: center;
}

#exitModal .modal__form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 28px;
}

#exitModal .input-group {
    position: relative;
    width: 100%;
}

#exitModal .input-group input {
    width: 100%;
    padding: 16px 48px 16px 20px;
    font-size: 16px;
    border: 2px solid #E5E7EB;
    border-radius: 16px;
    background: white;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

#exitModal .input-group input:focus {
    outline: none;
    border-color: #FF6A88;
    box-shadow: 0 0 0 4px rgba(255, 106, 136, 0.15);
}

#exitModal .input-group input:hover {
    border-color: #D1D5DB;
}

#exitModal .input-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    color: #9CA3AF;
    pointer-events: none;
    transition: color 0.3s ease;
}

#exitModal .input-group input:focus + .input-icon {
    color: #FF6A88;
}

/* Специальная кнопка для модалки с подарком */
#exitModal .btn--gradient {
    background: linear-gradient(135deg, #FF9A8B, #FF6A88);
    border: none;
    border-radius: 50px;
    padding: 18px 32px;
    font-size: 18px;
    font-weight: 700;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(255, 106, 136, 0.4);
}

#exitModal .btn--gradient:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(255, 106, 136, 0.5);
}

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

#exitModal .btn--gradient::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.7s ease;
}

#exitModal .btn--gradient:hover::before {
    left: 100%;
}

/* Преимущества */
#exitModal .modal__features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin: 24px 0;
    padding: 20px 0;
    border-top: 2px dashed #E5E7EB;
    border-bottom: 2px dashed #E5E7EB;
}

#exitModal .modal-feature-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
    font-size: 13px;
    color: #4B5563;
    line-height: 1.4;
}

#exitModal .modal-feature-icon {
    font-size: 28px;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

/* Футер модалки */
#exitModal .modal__footer {
    margin-top: 20px;
}

#exitModal .modal__privacy {
    font-size: 12px;
    color: #6B7280;
    line-height: 1.5;
    margin: 0;
    text-align: center;
}

#exitModal .modal__privacy a {
    color: #FF6A88;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

#exitModal .modal__privacy a:hover {
    color: #FF4D6D;
    text-decoration: underline;
}

/* Адаптивность */
@media (max-width: 640px) {
    #exitModal .modal__header {
        padding: 40px 20px 24px;
    }
    
    #exitModal .modal__icon {
        font-size: 56px;
    }
    
    #exitModal .modal__title {
        font-size: 24px;
    }
    
    #exitModal .modal__body {
        padding: 24px 20px;
    }
    
    #exitModal .modal__features {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    #exitModal .modal-feature-item {
        flex-direction: row;
        justify-content: center;
        font-size: 14px;
        gap: 12px;
    }
    
    #exitModal .input-group input {
        padding: 14px 44px 14px 16px;
    }
}

@media (max-width: 480px) {
    #exitModal .modal__header {
        padding: 36px 16px 20px;
    }
    
    #exitModal .modal__icon {
        font-size: 48px;
    }
    
    #exitModal .modal__title {
        font-size: 22px;
    }
    
    #exitModal .modal__body {
        padding: 20px 16px;
    }
    
    #exitModal .btn--gradient {
        padding: 16px 24px;
        font-size: 16px;
    }
}

/* ===== Модальное окно для присоединения ===== */

#joinModal .modal-content {
height: 90%;
}

#joinModal h2 {
font-size: 30px;
margin-bottom: 10px;
}

/* ===== Модальное окно выездов за границу ===== */
#travelModal .modal-content {
height: 90%;
}

#travelModal h2 {
font-size: 30px;
margin-bottom: 10px;
}

/* Модальное окно пробного урока */
#trialModal .modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  padding: 20px;
  animation: fadeIn 0.3s ease;
}

#trialModal .modal-content {
  background: linear-gradient(135deg, #ffffff 0%, #f8faff 100%);
  border-radius: 24px;
  width: 100%;
  max-width: 500px;
  padding: 40px 35px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  position: relative;
  animation: slideUp 0.4s ease;
  border: 1px solid rgba(23, 144, 201, 0.1);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Кнопка закрытия */
#trialModal .close-modal {
  position: absolute;
  top: 20px;
  right: 25px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #f1f5f9;
  border: none;
  font-size: 28px;
  line-height: 1;
  color: #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  padding: 0;
  z-index: 10;
}

#trialModal .close-modal:hover {
  background: #1790c9;
  color: white;
  transform: rotate(90deg);
}

/* Заголовок */
#trialModal .modal__header {
  text-align: center;
  margin-bottom: 20px;
  position: relative;
}

#trialModal .modal__header::after {
  content: "🎯";
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 48px;
  opacity: 0.1;
  pointer-events: none;
}

#trialModal .modal__title {
  font-size: 28px;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 10px;
  line-height: 1.3;
  background: linear-gradient(135deg, #1790c9, #0f5b8a);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

#trialModal .modal__subtitle {
  font-size: 16px;
  color: #64748b;
  margin: 0 0 25px;
  line-height: 1.6;
  text-align: center;
  padding: 0 10px;
}

/* Форма */
#trialModal .modal__form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

#trialModal .input-group {
  position: relative;
  width: 100%;
}

#trialModal .input-group input {
  width: 100%;
  padding: 16px 20px 16px 50px;
  border: 2px solid #e2e8f0;
  border-radius: 16px;
  font-size: 16px;
  transition: all 0.3s ease;
  background: white;
  color: #1e293b;
}

#trialModal .input-group input:focus {
  outline: none;
  border-color: #1790c9;
  box-shadow: 0 0 0 4px rgba(23, 144, 201, 0.1);
}

#trialModal .input-group input::placeholder {
  color: #94a3b8;
  font-size: 15px;
}

#trialModal .input-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 20px;
  color: #1790c9;
  opacity: 0.7;
  transition: all 0.3s ease;
}

#trialModal .input-group input:focus + .input-icon {
  opacity: 1;
  transform: translateY(-50%) scale(1.1);
}

/* Кнопка отправки */
#trialModal .btn--primary {
  background: linear-gradient(135deg, #1790c9, #0f5b8a);
  color: white;
  border: none;
  padding: 16px 30px;
  border-radius: 16px;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 10px;
  position: relative;
  overflow: hidden;
}

#trialModal .btn--primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s ease;
}

#trialModal .btn--primary:hover::before {
  left: 100%;
}

#trialModal .btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px -5px rgba(23, 144, 201, 0.5);
}

#trialModal .btn--primary:active {
  transform: translateY(0);
}

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

/* Лоадер */
#trialModal .btn__loader {
  margin-left: 10px;
  font-size: 20px;
  animation: spin 1s linear infinite;
}

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

/* Футер модалки */
#trialModal .modal__footer {
  margin-top: 25px;
  text-align: center;
}

#trialModal .modal__privacy {
  font-size: 13px;
  color: #94a3b8;
  line-height: 1.5;
  margin: 0;
}

#trialModal .modal__privacy a {
  color: #1790c9;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
  position: relative;
}

#trialModal .modal__privacy a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: #1790c9;
  transition: width 0.3s ease;
}

#trialModal .modal__privacy a:hover {
  color: #0f5b8a;
}

#trialModal .modal__privacy a:hover::after {
  width: 100%;
}

/* Декоративные элементы */
#trialModal .modal-content::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(90deg, #f9b233, #1790c9, #0f5b8a);
  border-radius: 24px 24px 0 0;
}

/* Адаптивность */
@media (max-width: 768px) {
  #trialModal .modal-content {
    padding: 30px 25px;
    max-width: 90%;
  }

  #trialModal .modal__title {
    font-size: 24px;
  }

  #trialModal .modal__subtitle {
    font-size: 15px;
    margin-bottom: 20px;
  }

  #trialModal .input-group input {
    padding: 14px 20px 14px 45px;
    font-size: 15px;
  }

  #trialModal .btn--primary {
    padding: 14px 25px;
    font-size: 16px;
  }
}

@media (max-width: 480px) {
  #trialModal .modal-content {
    padding: 25px 20px;
  }

  #trialModal .modal__title {
    font-size: 22px;
  }

  #trialModal .modal__subtitle {
    font-size: 14px;
  }

  #trialModal .close-modal {
    top: 15px;
    right: 20px;
    width: 32px;
    height: 32px;
    font-size: 24px;
  }

  #trialModal .input-icon {
    left: 15px;
    font-size: 18px;
  }

  #trialModal .input-group input {
    padding: 12px 15px 12px 40px;
  }
}

/* Для очень маленьких экранов */
@media (max-width: 360px) {
  #trialModal .modal-content {
    padding: 20px 15px;
  }

  #trialModal .modal__title {
    font-size: 20px;
  }
}

/* Поддержка темной темы (если нужно) */
@media (prefers-color-scheme: dark) {
  #trialModal .modal-content {
    background: linear-gradient(135deg, #1e293b, #0f172a);
  }

  #trialModal .modal__title {
    background: linear-gradient(135deg, #60a5fa, #1790c9);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
  }

  #trialModal .modal__subtitle {
    color: #f1f5f9;
  }

  #trialModal .input-group input {
    background: #334155;
    border-color: #475569;
    color: #f1f5f9;
  }

  #trialModal .input-group input:focus {
    border-color: #60a5fa;
  }

  #trialModal .close-modal {
    background: #334155;
    color: #f1f5f9;
  }

  #trialModal .close-modal:hover {
    background: #60a5fa;
    color: #0f172a;
  }

  #trialModal .modal__privacy {
    color: #64748b;
  }
}

/* Анимация для появления */
#trialModal .modal-overlay {
  display: none;
}

#trialModal .modal-overlay.modal-active {
  display: flex;
}

/* Стили для поля select (выбор города) */
#trialModal .input-group select {
  width: 100%;
  padding: 16px 45px 16px 50px; /* Отступ для иконки слева и стрелки справа */
  border: 2px solid #e2e8f0;
  border-radius: 16px;
  font-size: 16px;
  transition: all 0.3s ease;
  background: white;
  color: #1e293b;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%231790c9' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 15px center;
  background-size: 20px;
}

/* Стили для лейбла */
#trialModal .form-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: #1e293b;
  margin-bottom: 8px;
  margin-left: 5px;
}

/* Звездочка для обязательного поля */
#trialModal .form-label[data-required="true"]::after {
  content: "*";
  color: #ef4444;
  margin-left: 4px;
}

/* Стили для опций в выпадающем списке */
#trialModal .input-group select option {
  padding: 12px;
  background: white;
  color: #1e293b;
  font-size: 15px;
}

/* Стили для выбранной опции */
#trialModal .input-group select option:checked {
  background: linear-gradient(135deg, #1790c9, #0f5b8a);
  color: white;
}

/* Стили для placeholder опции */
#trialModal .input-group select option:first-child {
  color: #94a3b8;
}

/* Состояния при фокусе */
#trialModal .input-group select:focus {
  outline: none;
  border-color: #1790c9;
  box-shadow: 0 0 0 4px rgba(23, 144, 201, 0.1);
}

/* Состояние при наведении */
#trialModal .input-group select:hover {
  border-color: #1790c9;
  background-color: #f8faff;
}

/* Когда значение выбрано */
#trialModal .input-group select:valid {
  border-color: #10b981;
}

/* Иконка города (как в других полях) */
#trialModal .input-group.input-group--with-icon {
  position: relative;
}

#trialModal .input-group.input-group--with-icon::before {
  content: "📍";
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 20px;
  color: #1790c9;
  opacity: 0.7;
  z-index: 1;
  pointer-events: none;
  transition: all 0.3s ease;
  margin-top: 12px; /* Смещение из-за лейбла */
}

/* Анимация иконки при фокусе */
#trialModal .input-group.input-group--with-icon:focus-within::before {
  opacity: 1;
  transform: translateY(-50%) scale(1.1);
}

/* Адаптивность для поля с городом */
@media (max-width: 768px) {
  #trialModal .input-group select {
    padding: 14px 40px 14px 45px;
    font-size: 15px;
    background-size: 18px;
  }
  
  #trialModal .form-label {
    font-size: 13px;
    margin-bottom: 6px;
  }
  
  #trialModal .input-group.input-group--with-icon::before {
    left: 15px;
    font-size: 18px;
    margin-top: 10px;
  }
}

@media (max-width: 480px) {
  #trialModal .input-group select {
    padding: 12px 35px 12px 40px;
    font-size: 14px;
    background-size: 16px;
  }
  
  #trialModal .input-group.input-group--with-icon::before {
    left: 12px;
    font-size: 16px;
    margin-top: 9px;
  }
}

/* Темная тема для select */
@media (prefers-color-scheme: dark) {
  #trialModal .form-label {
    color: #e2e8f0;
  }
  
  #trialModal .input-group select {
    background-color: #334155;
    border-color: #475569;
    color: #f1f5f9;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2360a5fa' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  }
  
  #trialModal .input-group select option {
    background-color: #1e293b;
    color: #f1f5f9;
  }
  
  #trialModal .input-group select:hover {
    background-color: #3b4b5e;
    border-color: #60a5fa;
  }
  
  #trialModal .input-group select:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.2);
  }
  
  #trialModal .input-group.input-group--with-icon::before {
    color: #60a5fa;
  }
}

/* Стили для Firefox */
@-moz-document url-prefix() {
  #trialModal .input-group select {
    text-indent: 0.01px;
    text-overflow: '';
    padding-right: 30px;
  }
}

/* Отступ между полями */
#trialModal .input-group:has(select) {
  margin-bottom: 5px;
}