/*
 * Beloknet — модальные окна и формы в них.
 *
 * Правила секции «MODAL» и связанные медиа-запросы перенесены ДОСЛОВНО
 * из assets/css/main.css старой темы GrampusTheme-main (строки 634–876,
 * 919–939, 966–985), включая правила .wpcf7 — на старом сайте ранее
 * использовался Contact Form 7.
 *
 * Добавлено (в конце файла, с пометкой): фон-затемнение #modal-background
 * (на старом сайте его стили задавал JS) и скрытие закрытых окон от
 * вспомогательных технологий.
 */

/* ============== MODAL ============= */.wpcf7 .wpcf7-response-output,
.wpcf7 .wpcf7-not-valid-tip {
  display: none;
}

.wpcf7 .ajax-loader {
  display: none;
}

.wpcf7 .wpcf7-spinner {
  display: none;
}

.theme-modal {
  /* height: 400px; */
  width: 600px;
  max-height: 90vh;
  max-width: 90vw;
  background-color: #fff;
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(0);
  pointer-events: none;
  transition: transform .3s ease-in;
  z-index: 99999;
}

.theme-modal.modal-open {
  pointer-events: all;
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}

.theme-modal .close-modal {
  position: absolute;
  right: 20px;
  top: 20px;
  font-size: 40px;
  font-weight: 750;
  color: var(--primary);
  cursor: pointer;
}

.theme-modal .form__holder {
  padding: 40px 80px;
}

.theme-modal.review {
  overflow-y: auto;
}

.theme-modal.cback {
  width: 500px;
}

input.error {
  border: 1px solid red !important;
}

.form.modalCallBack .title {
  font-size: 30px;
  margin-bottom: 30px;
}

.form.modalCallBack .text-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

.form.modalCallBack .text-section input {
  max-width: 225px;
  width: 100%;
  padding: 15px;
  border-radius: 5px;
  border: 1px solid var(--primary);
}

.form.modalCallBack .text-section input:focus {
  outline: none;
  border: 2px solid var(--primary);
}

.form.modalCallBack .lover-input {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
}

.form.modalCallBack .lover-input .privacy {
  text-align: center;
  font-weight: 400;
  font-size: 12px;
  line-height: 135%;
  color: var(--txtColor2);
}

.form.form-review .title {
  margin-bottom: 30px;
}

.form.form-review .inputs .text-section {
  display: flex;
  justify-content: space-between;
}

.form.form-review .inputs input {
  width: calc(50% - 10px);
  padding: 13px 20px;
  border-radius: 5px;
  border: 1px solid var(--primary);
}

.form.form-review .inputs input:focus,
.form.form-review .inputs textarea:focus {
  outline: none;
  border: 2px solid var(--primary);
}

.form.form-review .inputs input.error {
  border: 1px solid red;
}

.form.form-review .inputs textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid var(--primary);
  color: var(--primary);
  margin-top: 20px;
  height: 150px;
  padding: 15px;
}

.form.form-review .inputs .file-input {
  border-radius: 0;
  border: none;
  width: 100%;
  cursor: pointer;
}

.form.form-review .inputs textarea::placeholder {
  color: var(--primary);
}

.form.form-review .inputs input:first-child::placeholder {
  color: var(--primary);
}

.form.form-review .inputs .input-file {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 15px;
  gap: 10px;
}

.form.form-review .inputs .input-file-btn {
  position: relative;
  display: inline-block;
  cursor: pointer;
  outline: none;
  text-decoration: none;
  vertical-align: middle;
  color: var(--black);
  text-align: center;
  border-radius: 4px;
  background-color: var(--static);
  /* padding: 10px 20px; */
  box-sizing: border-box;
  border: none;
  margin: 0;
  transition: background-color 0.2s;
  font-weight: 600;
  font-size: 16px;
  line-height: 150%;
}

.form.form-review .inputs .input-file-text {
  max-width: 225px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.form.form-review .inputs .input-file-btn:hover {
  background-color: var(--hover);
}

.form.form-review .inputs .input-file input[type=file] {
  position: absolute;
  z-index: -1;
  opacity: 0;
  display: block;
  width: 0;
  height: 0;
}

.form.form-review .lover-input {
  margin-top: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  flex-direction: column-reverse;
}

.form.form-review .lover-input .btn-form {
  max-width: 225px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.form.form-review .lover-input .btn-form:hover svg {
  transform: rotate(-45deg);
}

.form.form-review .lover-input .privacy {
  text-align: center;
}

.form.form-review .lover-input .privacy span {
  font-weight: 300;
  font-size: 16px;
  line-height: 150%;
  color: var(--bl);
}

.form.form-review .lover-input .privacy a {
  color: var(--txtColor2);
  transition: .6s;
}

.form.form-review .lover-input .privacy a:hover {
  color: var(--primary);
}



/* ============= MEDIA QUERIES (перенесено из старого main.css) =========== */
@media (max-width: 778px) {
  .theme-modal .form__holder {
    padding: 60px 30px;
  }

  .form.form-review .inputs .text-section {
    flex-direction: column;
    gap: 10px;
  }

  .form.form-review .inputs input {
    width: 100%;
  }

  .form.form-review .inputs .input-file {
    flex-direction: column;
    gap: 0;
  }
}

@media (max-width: 470px) {
  .form.modalCallBack .title {
    font-size: 20px;
  }

  .form.form-review .title {
    margin-bottom: 15px;
    font-size: 20px;
  }

  .form.form-review .lover-input .privacy span,
  .form.form-review .lover-input .privacy a {
    font-size: 15px;
  }

  .form.form-review .inputs textarea {
    margin-top: 15px;
  }
}

/* ============= ДОБАВЛЕНО В НОВОЙ ТЕМЕ =========== */

/* Затемнение фона — как у старого themeModal.js (black, opacity .5, z-index 9999). */
#modal-background {
  position: fixed;
  inset: 0;
  background: #000;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease-in;
  z-index: 9999;
}

#modal-background.is-visible {
  opacity: .5;
  pointer-events: all;
}

/* Кнопка закрытия стала <button>: убираем оформление кнопки браузера. */
.theme-modal .close-modal {
  background: none;
  border: 0;
  padding: 0;
  line-height: 1;
}

/* Окна успеха и ошибки: текст по центру, отступы как у форм. */
#modal-success,
#modal-error {
  padding: 60px 40px;
  text-align: center;
}

#modal-success .subtitle,
#modal-error .subtitle {
  margin-top: 15px;
  color: var(--txtColor2);
}