* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  --black: #000;
  --white: #fff;
  --right-side-bg-color: #171717;
  --text-gray-color: #4D4D4D;
  --text-black-color: #1A1A1A;
  --white-accent: #EAEAEA;
  --field-border-color: #E1E3EA;
  --error-color: #EB3131;
  --background-default-blue-color: #090C15;
  font-size: 14px;
  font-family: 'Open Sans', sans-serif;
  color: var(--white);
}

main {
  min-height: 100svh;
  overflow-y: auto;
}

main {
  display: flex;
  align-items: center;
}

.spacer {
  flex: 0 1 calc((100svw - 1212px) / 2);
}

.left {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 90px 0;
  color: var(--text-black-color);

  @media all and (max-width: 767px) {
    padding: 90px 20px;
  }

  header {
    margin-bottom: 100px;
  }

  h1 {
    font-size: 40px;
    font-weight: 600;
    line-height: 52px;
    margin-bottom: 40px;

    @media all and (max-width: 767px) {
      font-size: 32px;
    }
  }

  .form {
    width: 500px;
    display: flex;
    flex-direction: column;
    gap: 36px;
    margin-bottom: 66px;

    @media all and (max-width: 767px) {
      width: 100%;
    }

    .form__field {
      border-radius: 8px;
      border: 1px solid var(--field-border-color);
      position: relative;

      label {
        padding: 0 10px;
        background: var(--white);
        color: var(--text-gray-color);
        font-size: 12px;
        font-style: normal;
        font-weight: 400;
        line-height: 18px;
        position: absolute;
        top: 50%;
        left: 10px;
        transform: translateY(-50%);
        transition: all 200ms ease-in-out;
        pointer-events: none;
      }
    }

    .form__field:focus-within,
    .form__field:has(input:not(:placeholder-shown)) {
      label {
        transform: translateY(-200%);
      }
    }

    input, button {
      width: 100%;
      height: 55px;
    }

    input::placeholder {
      color: transparent;
    }

    input {
      border: 0;
      border-radius: 8px;
      padding: 0 20px;
      color: var(--text-black-color);
      font-size: 16px;
      line-height: 24px;
    }

    .form__error {
      color: var(--error-color);
      font-size: 12px;
      position: absolute;
      left: 20px;
      bottom: -26px;
      opacity: 0;
      transition: all 100ms ease-out;
    }

    .form__error.show {
      opacity: 1;
    }
  }

  .terms {
    font-family: 'Inter', sans-serif;
    color: var(--text-gray-color);
    text-align: center;
    font-size: 12px;
    font-weight: 400;
    line-height: 20px;
    width: 480px;

    @media all and (max-width: 767px) {
      width: 90%;
    }

    a {
      color: var(--text-gray-color);
      text-decoration-line: underline;
    }
  }
}

.left.success {
  padding: 280px 130px;
  align-items: flex-start;

  @media all and (max-width: 780px) {
    padding: 40px 20px;
    align-items: center;

    p, h1 {
      text-align: center;
    }
  }

  header {
    margin-bottom: 45px;
  }

  h1 {
    max-width: 440px;
  }

  p {
    color: var(--text-gray-color);
    font-size: 16px;
    font-weight: 400;
    line-height: 27px;
    margin-bottom: 45px;
    max-width: 520px;
  }

  .btn {
    width: 250px;

    @media all and (max-width: 780px) {
      width: 100%;
    }
  }
}

.right {
  flex: 0 0 600px;
  border-radius: 25px 0 0 25px;
  padding: 90px;
  background: url('../../assets/background.svg') no-repeat;
  background-size: cover;
  min-height: 100svh;

  @media all and (max-width: 1140px) {
    display: none;
  }

  h2 {
    font-size: 35px;
    font-weight: 600;
    line-height: 41px;
    margin-bottom: 30px;
  }

  p {
    color: var(--white-accent);
    font-size: 16px;
    font-weight: 400;
    line-height: 27px;
  }

  p:nth-of-type(2) {
    margin-bottom: 40px;
  }

  img {
    margin: 0 0 0 -24px;
  }
}

.right.success {
  padding: 280px 0;
  display: flex;

  @media all and (max-width: 991px) {
    display: none;
  }

  img {
    margin: 0 0 0 auto;
  }
}

.btn {
  border-radius: 10px;
  background: var(--black);
  padding: 0 10px;
  justify-content: center;
  align-items: center;
  display: flex;
  color: var(--white);
  font-size: 16px;
  font-style: normal;
  font-weight: 600;
  line-height: 24px;
  border: 0;
  cursor: pointer;
  text-decoration: none;
  min-height: 55px;
  position: relative;
}

.btn:disabled {
  cursor: not-allowed;
  background: gray;
}

.btn.loading {
  span {
    display: none;
  }
}

.btn.loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  margin: auto;
  border: 4px solid transparent;
  border-top-color: var(--white-accent);
  border-left-color: var(--white-accent);
  border-radius: 50%;
  animation: preparing-spinner 1s ease infinite;
}

.modal {
  display: none;
}

.modal.open {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  backdrop-filter: blur(4px);
  display: block;

  .modal__wrapper {
    top: 50%;
    position: relative;
    left: 50%;
    transform: translateX(-50%) translateY(-50%);
    width: 595px;
    max-width: 90%;
    max-height: 98%;
    display: flex;
    padding: 50px 72px;
    border-radius: 24px;
    background: var(--white);
    box-shadow: 0 0 35px 0 rgba(88, 89, 97, 0.10), 0 10px 10px 0 rgba(88, 89, 97, 0.03);
    flex-direction: column;

    .modal__title {
      color: var(--text-black-color);
      text-align: center;
      font-size: 40px;
      font-weight: 600;
      line-height: 52px;
      margin-bottom: 30px;
    }

    .modal__message {
      color: var(--text-gray-color);
      text-align: center;
      font-size: 15px;
      line-height: 24px;
    }
  }
}

.preparing-screen {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  background-color: #F7F8F9;
  display: none;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity .15s linear;

  picture img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top left;
  }

  .preparing-screen__content {
    position: relative;
    text-align: center;

    img {
      animation: preparing-spinner 1.4s infinite linear;
      transform: translateZ(0);
      width: 176px;
      margin-bottom: 60px;
    }

    p {
      font-size: 33px;
      font-weight: 300;
      color: var(--black);
      max-width: min(80%, 650px);
      margin: 0 auto;
      line-height: 1.2;
    }

    @media all and (max-width: 767px) {
      img {
        width: 114px;
      }

      p {
        font-size: 27px;
      }
    }
  }
}

.preparing-screen.preparing-screen-visible {
  display: flex;
  opacity: 1;
}

@keyframes preparing-spinner {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}
