:root {
  --open-house-blue: #151fc4;
  --open-house-dark-blue: #091070;
  --open-house-text: #242424;
  --open-house-white: #ffffff;
}

body.open-house-modal-is-open {
  overflow: hidden;
}

/* =========================================================
   Modal
   ========================================================= */

.open-house-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.25s ease,
    visibility 0.25s ease;
}

.open-house-modal.is-visible {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.open-house-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.68);
}

/* =========================================================
   Dialog
   ========================================================= */

.open-house-modal__dialog {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 48% 52%;
  width: min(1000px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  overflow: auto;
  background: #ffffff;
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.28);
}

/* =========================================================
   Close button
   ========================================================= */

.open-house-modal__close {
  position: absolute;
  top: 7px;
  right: 9px;
  z-index: 10;
  display: grid;
  width: 32px !important;
  height: 32px;
  padding: 0;
  place-items: center;
  border: 2px solid #111111 !important;
  border-radius: 60% !important;
  background: #ffffff !important;
  color: #111111 !important;
  font-family: Arial, sans-serif;
  font-size: 29px;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
}

.open-house-modal__close span {
  font-size: 30px;
  position: absolute;
  top: -1px;
  left: 1px;
  right: 0px;
  bottom: 0px;
}

/* =========================================================
   Promo column
   ========================================================= */

.open-house-modal__promo {
  position: relative;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  min-height: 514px;
  overflow: hidden;
  padding: 38px 34px 0;
  color: #ffffff;
  background: #0c0caf url('../images/open-house-background.png') center / cover
    no-repeat;
  border-bottom-right-radius: 48px;
  margin-bottom: 40px;
}

.open-house-modal__promo::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    45deg,
    transparent 30%,
    rgba(255, 255, 255, 0.06) 31%,
    transparent 55%
  );
}

.open-house-modal__promo-content,
.open-house-modal__logo {
  position: relative;
  z-index: 1;
}

.open-house-modal__promo-content {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
}

.open-house-modal__logo {
  margin-bottom: 30px;
}

.open-house-modal__logo img {
  display: block;
  width: auto;
  max-width: 180px;
  height: 46px;
  object-fit: contain;
  object-position: left center;
}

.open-house-modal__promo h2 {
  margin: 0 0 12px;
  color: #ffffff;
  font-family: 'Inter Medium', sans-serif !important;
  font-size: 38px !important;
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: -0.8px;
}

.open-house-modal__offer {
  font-family: 'Inter Bold', sans-serif !important;
  width: calc(100% + 3px);
  margin: 15px -35px 30px;
  padding: 13px 20px 13px 35px;
  border-top: 1px solid #ffffff;
  border-right: 1px solid #ffffff;
  border-bottom: 1px solid #ffffff;
  border-radius: 0 50px 50px 0;
  font-size: 20px;
  line-height: 1.2;
}

.open-house-modal__offer span {
 font-weight: bold;
}

.open-house-modal__description {
  max-width: 420px;
  font-size: 18px;
  line-height: 1.28;
}

.open-house-modal__description p {
  margin: 0 0 7px;
}

.open-house-modal__price {
  width: fit-content;
  min-width: 157px;
  margin: auto auto 0;
  padding: 20px 16px 13px;
  border-radius: 40px 40px 0 0;
  background: rgba(0, 0, 0, 0.3);
  text-align: center;
}

.open-house-modal__old-price {
  font-family: 'Inter Medium', sans-serif !important;
  position: relative;
  display: block;
  font-size: 26px;
  line-height: 1;
}

.open-house-modal__old-price::after {
  content: '';
  position: absolute;
  top: 50%;
  right: -4px;
  left: -4px;
  height: 2px;
  background: #ff3131;
  transform: rotate(-7deg);
}

.open-house-modal__price strong {
  font-family: 'Inter ExtraBold', sans-serif !important;
  display: block;
  margin-top: 2px;
  color: #ffffff;
  font-size: 29px;
  line-height: 1;
}

/* =========================================================
   Form column
   ========================================================= */

.open-house-modal__form {
  display: flex;
  align-items: center;
  padding: 60px 55px 23px;
  background: #ffffff;
}

.open-house-modal__form-inner {
  width: 100%;
}

.open-house-modal__form h2 {
  margin: 0 0 9px;
  color: var(--open-house-text);
  font-family: 'Inter Medium', sans-serif !important;
  font-size: 38px !important;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.8px;
}

.open-house-modal__subtitle {
  margin: 0 0 28px;
  color: var(--open-house-text);
  font-family: 'Inter Medium', sans-serif !important;
  font-size: 16px !important;
}

/* =========================================================
   Contact Form 7
   ========================================================= */

.open-house-modal__cf7,
.open-house-modal__cf7 .wpcf7 {
  width: 100%;
}

.open-house-modal__cf7 .wpcf7-form {
  margin: 0;
}

.open-house-modal__cf7 p {
  margin: 0;
}

/* Fields */

.open-house-form__field {
  margin-bottom: 22px;
}

.open-house-form__field label {
  display: block;
  margin: 0 0 4px 16px;
  color: #3d3d3d;
  font-size: 11px;
  line-height: 1;
}

.open-house-form__field .wpcf7-form-control-wrap {
  display: block;
  width: 100%;
}

.open-house-form__field input[type='text'],
.open-house-form__field input[type='email'],
.open-house-form__field input[type='tel'] {
  font-family: 'Roboto' !important;
  display: block;
  box-sizing: border-box;
  width: 100%;
  height: 34px;
  padding: 2px 16px 7px;
  border: 0;
  border-bottom: 1px solid #000000;
  border-radius: 0;
  outline: 0;
  background: transparent;
  color: #333333 !important;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  box-shadow: none;
  appearance: none;
}

.open-house-form__field input[type='text']:focus,
.open-house-form__field input[type='email']:focus,
.open-house-form__field input[type='tel']:focus {
  border-bottom: 2px solid var(--open-house-blue);
}

/* Validation */

.open-house-modal__cf7 .wpcf7-not-valid {
  border-bottom-color: #b42318;
}

.open-house-modal__cf7 .wpcf7-not-valid-tip {
  display: block;
  margin-top: 5px;
  padding-left: 16px;
  color: #b42318;
  font-size: 11px;
  line-height: 1.2;
}

/* Consent */

.open-house-form__consent {
  display: block;
  margin: 2px 0 23px;
  color: #171717;
  font-size: 10px;
  line-height: 1.15;
}

.open-house-form__consent .wpcf7-form-control-wrap,
.open-house-form__consent .wpcf7-form-control,
.open-house-form__consent .wpcf7-list-item {
  display: block;
  margin: 0;
}

.open-house-form__consent label {
  display: grid;
  grid-template-columns: 16px 1fr;
  gap: 6px;
  align-items: start;
  margin: 0;
  cursor: pointer;
}

.open-house-form__consent input[type='checkbox'] {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--open-house-blue);
}

.open-house-form__consent .wpcf7-list-item-label {
  display: inline;
  font-family: 'Roboto Regular' !important;
  font-size: 12px;
  color: #000000;
}

.open-house-form__consent a {
  color: inherit;
  text-decoration: underline;
}

.open-house-form__consent a:hover {
  text-decoration: none;
}

/* Submit */

.open-house-form__submit-wrapper {
  text-align: center;
}

.open-house-form__submit,
.open-house-modal__cf7 input[type='submit'].open-house-form__submit {
  display: block;
  box-sizing: border-box;
  font-family: 'Roboto Regular' !important;
  width: 88%;
  min-height: 52px;
  margin: 0 auto;
  padding: 10px 22px;
  border: 2px solid #111111;
  border-radius: 999px;
  background: #ffffff;
  color: #000000;
  font-family: inherit;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: 4px;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 2px 2px rgba(0, 0, 0, 0.35);
  transition:
    color 0.2s ease,
    background-color 0.2s ease,
    transform 0.2s ease,
    opacity 0.2s ease;
  appearance: none;
}

.open-house-form__submit:hover,
.open-house-modal__cf7 input[type='submit'].open-house-form__submit:hover {
  background: #111111;
  color: #ffffff;
}

.open-house-form__submit:active,
.open-house-modal__cf7 input[type='submit'].open-house-form__submit:active {
  transform: translateY(1px);
}

.open-house-modal__cf7 form.submitting .open-house-form__submit {
  cursor: wait;
  opacity: 0.55;
}

/* Spinner */

.open-house-modal__cf7 .wpcf7-spinner {
  display: block;
  margin: 10px auto 0;
}

/* Response messages */

.open-house-modal__cf7 .wpcf7-response-output {
  margin: 12px 0 0;
  padding: 8px 10px;
  border-width: 1px;
  font-size: 12px;
  line-height: 1.3;
  text-align: center;
}

.open-house-modal__cf7 form.invalid .wpcf7-response-output,
.open-house-modal__cf7 form.unaccepted .wpcf7-response-output,
.open-house-modal__cf7 form.payment-required .wpcf7-response-output,
.open-house-modal__cf7 form.failed .wpcf7-response-output,
.open-house-modal__cf7 form.aborted .wpcf7-response-output {
  border-color: #b42318;
  color: #b42318 !important;
}

.open-house-modal__cf7 form.sent .wpcf7-response-output {
  border-color: #187b34!important;
  color: #187b34!important;
}

.open-house-modal .open-house-modal__cf7 form.sent .wpcf7-response-output {
  border-color: #187b34 !important;
  background: #f0fff4 !important;
  color: #187b34 !important;
}

/* =========================================================
   Tablet and mobile
   ========================================================= */

@media (max-width: 767px) {
  .open-house-modal {
    display: block;
    padding: 0 16px 70px;
    overflow-y: auto;
  }

  .open-house-modal__dialog {
    display: block;
    width: 100%;
    max-height: none;
    margin: 121px auto 0;
    overflow: visible;
  }

  .open-house-modal__close {
    top: -15px;
    right: 17px;
    width: 30px;
    height: 30px;
    border-color: #ffffff !important;
    background: transparent !important;
    color: #ffffff !important;
    font-size: 27px;
    padding: 0px !important;
  }

  .open-house-modal__promo {
    min-height: 457px;
    padding: 34px 14px 0;
    border-bottom-right-radius: 47px;
  }

  .open-house-modal__logo {
    display: none;
  }

  .open-house-modal__promo h2 {
    margin-bottom: 18px;
    font-size: 38px;
    line-height: 1.02;
    letter-spacing: -0.8px;
  }

  .open-house-modal__offer {
    width: calc(100% + 14px);
    margin-left: -15px;
    padding: 15px 15px 15px 15px;
    font-size: 20px;
    line-height: 1.2;
  }

  .open-house-modal__description {
    max-width: none;
    margin-top: 15px;
    font-size: 16px;
    line-height: 1.28;
  }

  .open-house-modal__price {
    min-width: 160px;
    margin: auto auto 0;
  }

  .open-house-modal__form {
    display: block;
    padding: 10px 13px 39px;
  }

  .open-house-modal__form h2 {
    font-size: 38px;
    line-height: 1.12;
  }

  .open-house-modal__subtitle {
    margin-bottom: 32px;
    font-size: 17px;
    line-height: 1.3;
  }

  .open-house-form__field {
    margin-bottom: 29px;
  }

  .open-house-form__field label {
    margin-left: 16px;
  }

  .open-house-form__consent {
    margin-top: -3px;
    margin-bottom: 29px;
    font-size: 10px;
  }

  .open-house-form__submit,
  .open-house-modal__cf7 input[type='submit'].open-house-form__submit {
    width: 94%;
    min-height: 52px;
    font-size: 13px;
    letter-spacing: 3px;
  }
}

@media (max-width: 390px) {
  .open-house-modal__dialog {
    margin-top: 90px;
  }

  .open-house-modal__promo h2 {
    font-size: 33px;
  }

  .open-house-modal__offer {
    font-size: 18px;
  }

  .open-house-modal__form h2 {
    font-size: 34px;
  }

  .open-house-form__submit,
  .open-house-modal__cf7 input[type='submit'].open-house-form__submit {
    width: 100%;
    padding-right: 15px;
    padding-left: 15px;
    letter-spacing: 2.5px;
  }
}

/* =========================================================
   Reduced motion
   ========================================================= */

@media (prefers-reduced-motion: reduce) {
  .open-house-modal,
  .open-house-form__submit {
    transition: none;
  }
}
