/**
 * Popup Contact Styles
 * Стили попап-окна "Записаться в клинику" согласно дизайну Figma
 * Интеграция с Contact Form 7
 * 
 * ВНИМАНИЕ: Используются переменные из variables.css и typography.css
 * Следует Cursor Rules: Flexbox layout, BEM методология, accessibility
 */

/* Основной контейнер попапа - Flexbox центрирование */
.popup-contact {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  display: none;
}

.popup-contact.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Overlay (затемнение фона) */
.popup-contact__overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  cursor: pointer;
}

/* Контейнер попапа - точные размеры из Figma */
.popup-contact__container {
  position: relative;
  max-width: 800px;
  /* width: 90%;
  max-height: 90vh; */
  overflow-y: auto;
  z-index: 10000;
}

/* Основное содержимое попапа - Flexbox колонка */
.popup-contact__content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: inherit;
  background-color: var(--berloga-dark-blue);
  border-radius: 30px;
  padding: 50px;
  position: relative;
  box-shadow: 0px 20px 60px rgba(0, 0, 0, 0.3);
}

/* Внутренний контейнер - Flexbox с gap из Figma */
.popup-contact__inner {
  display: flex;
  flex-direction: column;
  gap: 30px;
  align-items: flex-start;
  justify-content: center;
  min-height: inherit;
  width: 100%;
}

/* Кнопка закрытия - Flexbox центрирование */
.popup-contact__close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  color: var(--berloga-white);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.3s ease;
}

.popup-contact__close:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.popup-contact__close:focus {
  outline: 2px solid var(--berloga-blue);
  outline-offset: 2px;
}

.popup-contact__close svg {
  width: 24px;
  height: 24px;
}

/* Заголовок - точные размеры из Figma */
.popup-contact__title {
  font-family: var(--h2-font-family);
  font-size: 40px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--berloga-white);
  margin: 0;
  width: 100%;
  flex-shrink: 0;
  /* height: 58px; */
  text-align: left;
}

/* Описание - Flexbox колонка */
.popup-contact__description {
  display: flex;
  flex-direction: column;
  width: 100%;
  flex-shrink: 0;
  gap: 16px;
}

.popup-contact__subtitle {
  font-family: var(--regular-text-font-family);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--berloga-white);
  /* margin: 0 0 16px 0; */
}

.popup-contact__text {
  font-family: var(--regular-text-font-family);
  font-size: 16px;
  font-weight: 400;
  line-height: 20px;
  color: var(--berloga-white);
  /* margin: 0 0 16px 0; */
  letter-spacing: -0.64px;
}

/* .popup-contact__text:last-child {
  margin-bottom: 0;
} */

.popup-contact__content .popup-contact__phone {
  color: var(--berloga-white) !important;
  text-decoration: underline;
  text-decoration-style: solid;
  text-underline-position: from-font;
  transition: color 0.3s ease;
}

.popup-contact__content .popup-contact__phone:hover {
  color: var(--berloga-blue) !important;
}

.popup-contact__content .popup-contact__phone:focus {
  outline: 2px solid var(--berloga-blue);
  outline-offset: 2px;
}

/* Contact Form 7 - Flexbox колонка с gap из Figma */
.popup-contact__form {
  display: flex;
  flex-direction: column;
  gap: 30px;
  align-items: flex-start;
  justify-content: flex-start;
  width: 100%;
  flex-shrink: 0;
}

.popup-contact .wpcf7-form {
  display: flex;
  flex-direction: column;
  gap: 30px;
  width: 100%;
}

.popup-contact .wpcf7-form-control-wrap {
  display: block;
  /* width: 100%; */
}
.wpcf7{
  width: 100%
}

/* Поля ввода - точные размеры из Figma */
.popup-contact .wpcf7-text,
.popup-contact .wpcf7-tel,
.popup-contact .wpcf7-email {
  width: 100%;
  height: 57px;
  background-color: var(--berloga-white);
  border: none;
  border-radius: 10px;
  padding: 18px 30px;
  box-sizing: border-box;
  font-family: var(--regular-text-font-family);
  font-size: 16px;
  font-weight: 400;
  color: var(--berloga-text);
  letter-spacing: -0.64px;
  transition: box-shadow 0.3s ease;
  flex-shrink: 0;
}

.popup-contact .wpcf7-text::placeholder,
.popup-contact .wpcf7-tel::placeholder,
.popup-contact .wpcf7-email::placeholder {
  color: rgba(0, 0, 0, 0.5);
  font-family: var(--regular-text-font-family);
  font-size: 16px;
  font-weight: 400;
  letter-spacing: -0.64px;
  
}

.popup-contact .wpcf7-text:focus,
.popup-contact .wpcf7-tel:focus,
.popup-contact .wpcf7-email:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--berloga-blue);
}

/* Кнопка отправки - Flexbox центрирование */
.popup-contact .wpcf7-submit {
  background-color: var(--berloga-magenta);
  border: none;
  border-radius: 10px;
  width: 100%;
  flex-shrink: 0;
  color: var(--berloga-white);
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.popup-contact .wpcf7-submit .wpcf7-spinner {
  display: none;
}

/* Внутренний контейнер кнопки */
.popup-contact .wpcf7-submit::before {
  content: '';
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  padding: 15px 45px;
  width: 100%;
}

.popup-contact .wpcf7-submit {
  font-family: var(--regular-text-font-family);
  font-size: 20px;
  font-weight: 700;
  line-height: normal;
  text-align: center;
  white-space: nowrap;
}

.popup-contact .wpcf7-submit:hover {
  background-color: #9a0639;
  transform: translateY(-2px);
}

.popup-contact .wpcf7-submit:active {
  transform: translateY(0);
}

.popup-contact .wpcf7-submit:focus {
  outline: 2px solid var(--berloga-white);
  outline-offset: 2px;
}

.popup-contact__checkbox-wrapper {
  display: flex;
  align-items: center;
  gap: 30px;
  color: white; /* Белый цвет текста */
}

.popup-contact__checkbox-wrapper input[type="checkbox"] {
  flex-shrink: 0; /* Чекбокс не сжимается */
}

.popup-contact__checkbox-wrapper .wpcf7-list-item-label {
  color: white;
  margin: 0;
}

.popup-contact .wpcf7-acceptance .wpcf7-list-item {
  margin: 0;
}

/* Чекбокс согласия - Flexbox строка с gap из Figma */
.popup-contact .wpcf7-acceptance {
  display: flex;
  flex-direction: row;
  gap: 30px;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  flex-shrink: 0;
}

.popup-contact .wpcf7-acceptance input[type="checkbox"] {
  width: 24px;
  height: 24px;
  margin: 0;
  flex-shrink: 0;
}

.popup-contact .wpcf7-acceptance label {
  margin: 0;
  cursor: pointer;
  flex-basis: 0;
  flex-grow: 1;
  min-height: 1px;
  min-width: 1px;
  font-family: var(--regular-text-font-family);
  font-size: 14px;
  font-weight: 400;
  line-height: 16px;
  color: var(--berloga-white);
  letter-spacing: -0.56px;
}

.popup-contact__checkbox-wrapper span a {
  color: var(--berloga-white);
  text-decoration: underline;
  text-decoration-style: solid;
  text-underline-position: from-font;
  transition: color 0.3s ease;
}

.popup-contact .wpcf7-acceptance a:hover {
  color: var(--berloga-blue);
}

.popup-contact .wpcf7-acceptance a:focus {
  outline: 2px solid var(--berloga-blue);
  outline-offset: 2px;
}

/* Сообщения Contact Form 7 */
.popup-contact .wpcf7-response-output {
  padding: 15px 20px;
  border-radius: 10px;
  font-family: var(--regular-text-font-family);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.4;
  margin: 20px 0 0 0;
  border: none;
}

.popup-contact .wpcf7-mail-sent-ok {
  background-color: var(--berloga-blue-10);
  border: 1px solid var(--berloga-blue);
  color: var(--berloga-white);
}

.popup-contact .wpcf7-mail-sent-ng,
.popup-contact .wpcf7-validation-errors,
.popup-contact .wpcf7-spam-blocked {
  background-color: var(--berloga-magenta-10);
  border: 1px solid var(--berloga-magenta);
  color: var(--berloga-white);
}

/* Ошибки валидации Contact Form 7 */
.popup-contact .wpcf7-not-valid-tip {
  color: var(--berloga-magenta);
  font-size: 12px;
  margin-top: 5px;
}

/* Сообщение об отсутствии формы */
.popup-contact__no-form {
  padding: 30px;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.popup-contact__no-form p {
  color: var(--berloga-white);
  margin: 0;
  font-family: var(--regular-text-font-family);
  font-size: 16px;
  line-height: 1.4;
}

.popup-contact__no-form a {
  color: var(--berloga-blue);
  text-decoration: underline;
}

/* Анимации появления */
@keyframes popupFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes popupSlideIn {
  from {
    opacity: 0;
    transform: scale(0.8) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.popup-contact.active {
  animation: popupFadeIn 0.3s ease-out;
}

.popup-contact.active .popup-contact__content {
  animation: popupSlideIn 0.3s ease-out;
}
@media (max-width: 1024px) {
  .popup-contact__container{
    max-width: 600px;
  }
}
/* Адаптивность - Mobile-first подход согласно Cursor Rules */
@media (max-width: 768px) {
  .popup-contact__container{
    max-width: calc(100% - 60px);
  }
  .popup-contact__content {
    padding: 20px;
    border-radius: 20px;
  }
  
  .popup-contact__inner {
    gap: 20px;
  }
  
  .popup-contact__title {
    font-size: 32px;
    height: auto;
  }
  
  .popup-contact__subtitle {
    font-size: 18px;
  }
  
  .popup-contact__text {
    font-size: 14px;
    line-height: 18px;
  }
  
  .popup-contact__form {
    gap: 20px;
  }
  
  .popup-contact .wpcf7-form {
    gap: 20px;
  }
  
  .popup-contact .wpcf7-text,
  .popup-contact .wpcf7-tel,
  .popup-contact .wpcf7-email {
    height: 50px;
    padding: 0 20px;
    font-size: 14px;
  }
  
  .popup-contact .wpcf7-submit {
    font-size: 18px;
    padding: 12px 30px;
  }
  
  .popup-contact .wpcf7-acceptance {
    gap: 10px;
  }
  
  .wpcf7-acceptance-label {
    font-size: 12px;
    line-height: 14px;
  }
  
  .popup-contact .wpcf7-acceptance input[type="checkbox"] {
    width: 20px;
    height: 20px;
  }

  .popup-contact__close {
    
    top: 0px;
    right: 3px;
  }
}

@media (max-width: 480px) {
  .popup-contact__container {
    width: 95%;
  }
  
  .popup-contact__content {
    padding: 25px 15px;
  }
  
  .popup-contact__inner {
    gap: 25px;
  }
  
  .popup-contact__title {
    font-size: 24px;
  }
} 