/* Основные стили модального окна */
.cf7-modal-opthalmology {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 999999;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.cf7-modal-opthalmology.active {
  display: block;
}

/* Фон фиксированный - не скроллится */
.cf7-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

/* Контейнер с фиксированной позицией и скроллом */
.cf7-modal-container {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: linear-gradient(135deg, #50BBE7 0%, #24AAE1 100%);
  border-radius: 20px;
  width: 90%;
  max-width: 440px;
  max-height: 90vh;
  box-shadow: 0 25px 50px rgba(37, 170, 225, 0.3);
  overflow: hidden;
  animation: cf7ModalAppear 0.3s ease-out;
  display: flex;
  flex-direction: column;
}

@keyframes cf7ModalAppear {
  from {
    opacity: 0;
    transform: translate(-50%, -48%);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

/* Заголовок - фиксированная высота */
.cf7-modal-header {
  padding: 25px 30px 20px;
  position: relative;
  text-align: center;
  flex-shrink: 0;
}

.cf7-header-content {
  max-width: 320px;
  margin: 0 auto;
}

.cf7-modal-title {
  color: #FFF;
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 8px 0;
  line-height: 1.3;
  font-family: 'Inter', sans-serif;
}

.cf7-modal-subtitle {
  color: rgba(255, 255, 255, 0.9);
  margin: 0;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.4;
  font-family: 'Inter', sans-serif;
}

.cf7-modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #FFF;
  font-size: 16px;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s ease;
  z-index: 10;
}

.cf7-modal-close:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Тело формы - СКРОЛЛИРУЕМАЯ ОБЛАСТЬ */
.cf7-modal-body {
  padding: 0 30px 30px;
  overflow-y: auto;
  flex: 1;
  -webkit-overflow-scrolling: touch;
}

/* Основные поля формы */
.cf7-form-main {
  margin-bottom: 20px;
}

.cf7-form-group {
  margin-bottom: 16px;
}

.cf7-form-label {
  display: block;
  color: #FFF;
  margin-bottom: 6px;
  font-weight: 500;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
}

.cf7-form-input {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.12);
  color: #FFF;
  font-size: 16px;
  transition: all 0.3s ease;
  box-sizing: border-box;
  font-family: 'Inter', sans-serif;
}

.cf7-form-input::placeholder {
  color: rgba(255, 255, 255, 0.6);
  font-size: 15px;
}

.cf7-form-input:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.18);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

/* Стили для подсветки обязательных полей при валидации */
.cf7-form-input.cf7-required-highlight {
  border-color: #ff6b6b !important;
  background: rgba(255, 107, 107, 0.1) !important;
  animation: cf7Pulse 0.6s ease-in-out;
}

.cf7-checkbox-wrapper.cf7-required-highlight .wpcf7-list-item-label {
  color: #ff6b6b !important;
  animation: cf7Pulse 0.6s ease-in-out;
}

.cf7-checkbox-wrapper.cf7-required-highlight .wpcf7-list-item-label::before {
  border-color: #ff6b6b !important;
}

@keyframes cf7Pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

/* Чекбокс */
.cf7-checkbox-wrapper {
  margin: 20px 0 25px;
  padding: 0 5px;
  transition: all 0.3s ease;
}

.cf7-checkbox-wrapper .wpcf7-list-item {
  display: block;
  margin: 0;
}

.cf7-checkbox-wrapper .wpcf7-list-item-label {
  color: rgba(255, 255, 255, 0.9);
  font-size: 13px;
  line-height: 1.5;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  transition: color 0.3s ease;
  font-family: 'Inter', sans-serif;
}

.cf7-checkbox-wrapper .wpcf7-list-item-label:hover {
  color: #FFF;
}

.cf7-checkbox-wrapper .wpcf7-list-item-label::before {
  content: '';
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.1);
  margin-right: 10px;
  margin-top: 2px;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.cf7-checkbox-wrapper input[type="checkbox"] {
  display: none;
}

.cf7-checkbox-wrapper input[type="checkbox"]:checked + .wpcf7-list-item-label::before {
  background: #FF6F64;
  border-color: #FF6F64;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white' width='14px' height='14px'%3E%3Cpath d='M0 0h24v24H0z' fill='none'/%3E%3Cpath d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/%3E%3C/svg%3E");
  background-size: 10px;
  background-repeat: no-repeat;
  background-position: center;
}

/* Текст соглашения */
.cf7-acceptance-text {
  display: inline;
  line-height: 1.5;
}

/* Стили для ссылки - ВСЕГДА ПОДЧЕРКНУТАЯ */
.cf7-privacy-link {
  color: rgba(255, 255, 255, 0.8) !important;
  text-decoration: none;
  transition: all 0.3s ease;
  font-weight: 500;
  white-space: nowrap;
  display: inline;
  border-bottom: 1px solid rgba(255, 255, 255, 0.5);
  padding-bottom: 1px;
}

.cf7-privacy-link:hover {
  color: #FFFFFF !important;
  text-decoration: none;
  border-bottom: 1px solid #FFFFFF;
}

/* Стили для подсветки ошибки */
.cf7-checkbox-wrapper.cf7-required-highlight .wpcf7-list-item-label {
  color: #ff6b6b !important;
  animation: cf7Pulse 0.6s ease-in-out;
}

.cf7-checkbox-wrapper.cf7-required-highlight .wpcf7-list-item-label::before {
  border-color: #ff6b6b !important;
  background: rgba(255, 107, 107, 0.1) !important;
  animation: cf7Pulse 0.6s ease-in-out;
}

.cf7-checkbox-wrapper.cf7-required-highlight .cf7-privacy-link {
  color: #ff6b6b !important;
  border-bottom: 1px solid rgba(255, 107, 107, 0.6);
}

.cf7-checkbox-wrapper.cf7-required-highlight .cf7-privacy-link:hover {
  color: #ff6b6b !important;
  border-bottom: 1px solid #ff6b6b;
}

/* Кнопка отправки - ВСЕГДА АКТИВНА, БЕЗ АНИМАЦИИ ЗАГРУЗКИ */
.cf7-form-submit {
  margin-bottom: 25px;
}

.cf7-modal-submit {
  width: 100%;
  background: linear-gradient(135deg, #FF6F64 0%, #FF8A80 100%);
  color: #FFF;
  border: none;
  padding: 16px 30px;
  border-radius: 12px;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(255, 111, 100, 0.4);
  font-family: 'Inter', sans-serif;
}

.cf7-modal-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 111, 100, 0.5);
  background: linear-gradient(135deg, #FF7A70 0%, #FF958C 100%);
}

.cf7-modal-submit:active {
  transform: translateY(0);
}

/* Убираем стандартные стили блокировки и анимации CF7 */
.cf7-modal-submit[disabled] {
  opacity: 1 !important;
  cursor: pointer !important;
  background: linear-gradient(135deg, #FF6F64 0%, #FF8A80 100%) !important;
}

/* Скрываем стандартный индикатор загрузки CF7 */
.cf7-modal-submit .ajax-loader {
  display: none !important;
}

/* Информационный блок */
.cf7-info-section {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.cf7-info-item {
  display: flex;
  align-items: flex-start;
  margin-bottom: 16px;
}

.cf7-info-item:last-child {
  margin-bottom: 0;
}

.cf7-info-icon {
  font-size: 16px;
  margin-right: 12px;
  margin-top: 2px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
  color: rgba(255, 255, 255, 0.9);
}

.cf7-info-content {
  flex: 1;
}

.cf7-info-content strong {
  display: block;
  color: #FFF;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 2px;
  font-family: 'Inter', sans-serif;
}

.cf7-info-content span {
  display: block;
  color: rgba(255, 255, 255, 0.8);
  font-size: 13px;
  line-height: 1.4;
  font-family: 'Inter', sans-serif;
}

/* Стандартная валидация CF7 */
.cf7-form-input.wpcf7-not-valid {
  border-color: #ff6b6b;
  background: rgba(255, 107, 107, 0.1);
}

.wpcf7-not-valid-tip {
  color: #ff6b6b !important;
  font-size: 12px;
  margin-top: 5px;
  display: block;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
}

.wpcf7-mail-sent-ok {
  border: 1px solid #46b450;
  background: rgba(70, 180, 80, 0.1);
  color: #FFF;
  padding: 12px;
  border-radius: 8px;
  margin: 15px 0;
  text-align: center;
  font-family: 'Inter', sans-serif;
}

/* Адаптивность */
@media (max-width: 480px) {
  .cf7-modal-container {
    width: 95%;
    max-width: 380px;
    border-radius: 16px;
    max-height: 85vh;
  }
  
  .cf7-modal-header {
    padding: 20px 20px 15px;
  }
  
  .cf7-modal-title {
    font-size: 22px;
  }
  
  .cf7-modal-subtitle {
    font-size: 15px;
  }
  
  .cf7-modal-body {
    padding: 0 20px 25px;
  }
  
  .cf7-modal-close {
    top: 15px;
    right: 15px;
    width: 28px;
    height: 28px;
    font-size: 14px;
  }
  
  .cf7-form-input {
    padding: 12px 14px;
    font-size: 15px;
  }
  
  .cf7-info-section {
    padding: 16px;
  }
  
  .cf7-info-item {
    margin-bottom: 14px;
  }
  
  .cf7-modal-submit {
    padding: 15px 25px;
    font-size: 16px;
  }
}
/* Дополнительные стили для очень высоких контентов */
@media (max-height: 600px) {
  .cf7-modal-container {
    max-height: 95vh;
  }
  
  .cf7-modal-header {
    padding: 15px 20px 10px;
  }
  
  .cf7-modal-body {
    padding: 0 20px 20px;
  }
  
  .cf7-form-main {
    margin-bottom: 15px;
  }
  
  .cf7-checkbox-wrapper {
    margin: 15px 0 20px;
  }
  
  .cf7-form-submit {
    margin-bottom: 20px;
  }
}