.questions-form-section {
  z-index: 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.questions-form {
  margin: 64px 128px;
  background-color: var(--green-primary);
  border-radius: 2px;
  display: flex;
  gap: 16px;
  flex-direction: column;
  padding: 48px;
  z-index: 1;
  max-width: 1184px;

  form {
    font-family: "Inter", sans-serif;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  &.hidden {
    display: none;
  }

  .btn-default {
    margin: 16px auto 0 0;

    &:hover {
      border-color: var(--white-primary);
    }
  }
}

.form-field {
  position: relative;
  border-bottom: 1px solid #ffffffcc;
  border-radius: 0;
  height: 64px;
  max-height: 84px;

  label {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    font-weight: 400;
    font-size: 16px;
    color: #ffffffcc;
    opacity: 1;
  }

  input,
  textarea {
    width: 100%;
    height: 64px;
    max-height: 84px;
    padding-block: 22px;
    background-color: transparent;
    color: var(--white-primary);
    border: none;
    outline: none;
    resize: none;
  }

  ::-webkit-scrollbar {
    width: 3px;
  }

  ::-webkit-scrollbar-track {
    background-color: transparent;
  }

  ::-webkit-scrollbar-thumb {
    background-color: var(--blue-gray);
    border-radius: 8px;
  }

  input:focus + label,
  textarea:focus + label {
    opacity: 0;
  }

  input:not(:placeholder-shown) + label,
  textarea:not(:placeholder-shown) + label {
    clip: rect(1px, 1px, 1px, 1px);
  }

  &:hover {
    border-color: var(--white-primary);

    input,
    textarea {
      + label {
        color: var(--white-primary);
      }
    }
  }

  &:has(input:focus, textarea:focus) {
    border-color: var(--white-primary);
  }
}

.form-field.error {
  border-color: var(--red-primary) !important;

  input {
    color: var(--red-primary) !important;
  }
}

.captcha {
  display: flex;
  align-items: center;
  gap: 16px;

  img {
    margin-top: 8px;
    width: 85px;
    height: 48px;
  }

  .form-field {
    width: 110px;
  }

  input {
    padding-block: 22px;
  }

  label {
    top: 50%;
  }
}

.form-bottom {
  display: flex;
  flex-direction: column;
  grid-column: span 2;
}

.form-file {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 8px;

  input[type="file"] {
    display: none;
  }

  label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--white-primary);
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    position: relative;

    img.white {
      filter: grayscale(1) brightness(3);
    }
  }
}

.form-file__delete-btn {
  width: 16px;
  height: 16px;
  position: absolute;
  right: -24px;
  top: 50%;
  transform: translateY(-42%);
  background-color: transparent;
  border: none;
  cursor: pointer;
  justify-content: center;
  align-items: center;
  display: none;

  &::after {
    content: url(../../../images/icons/delete-icon.svg);
    filter: invert(1) brightness(2);
  }
}

.form-file__delete-btn.visible {
  display: flex;
}

.form-privacy {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;

  p,
  label {
    font-weight: 400;
    font-size: 12px;
    line-height: 14.5px;
    color: #f8fafc;
    opacity: 70%;
  }
}

.checkbox-container {
  display: flex;
  gap: 8px;
  align-items: center;
  position: relative;

  input[type="checkbox"] {
    opacity: 0;
    position: absolute;
    top: 0;
    left: 0;
    cursor: pointer;
  }

  input[type="checkbox"]:checked + .checkmark {
    background-color: var(--green-primary);
    border: 1px solid var(--green-primary);

    &::after {
      display: block;
    }
  }
}

.checkmark {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 12px;
  height: 12px;
  aspect-ratio: 1;
  background-color: var(--white-primary);
  border: 1px solid var(--dark-50);
  border-radius: 2px;
  cursor: pointer;
  pointer-events: none;

  &::after {
    content: url(../../../images/icons/checkmark-icon.svg);
    position: absolute;
    display: none;
  }
}

&.hidden {
  display: none;
}

.error-message {
  position: absolute;
  white-space: nowrap;
  bottom: -20px;
  font-weight: 400;
  font-size: 13px;
  color: var(--red-primary);
}

.questions-form__title {
  display: flex;
  align-items: center;
  gap: 16px;

  h1, h2 {
    width: 50%;
    font-family: "Poppins", serif;
    font-weight: 600;
    font-size: 38px;
    color: var(--white-primary);
    line-height: 48px;
  }

  h3 {
    font-family: "Inter", sans-serif;
    font-weight: 600;
    font-size: 24px;
    color: var(--white-primary);
  }

  p {
    width: 50%;
    font-family: "Inter", sans-serif;
    font-weight: 400;
    font-size: 18px;
    line-height: 32px;
    color: var(--white-primary);
  }
}

.questions-form__success {
  margin: 64px 128px;
  width: 100%;
  max-width: 1184px;
  background-color: var(--green-primary);
  border-radius: 2px;
  display: none;
  flex-direction: column;
  padding: 48px;
  z-index: 1;
  box-shadow: 0px 13px 100px 0px rgba(199, 199, 199, 0.25);

  .questions-form__title {
    display: flex;
    flex-direction: column;
    align-items: baseline;
    gap: 16px;

    h1, h2 {
      width: 50%;
      font-family: "Poppins", serif;
      font-weight: 600;
      font-size: 38px;
      color: var(--white-primary);
      line-height: 48px;
    }

    h3 {
      font-family: "Inter", sans-serif;
      font-weight: 600;
      font-size: 24px;
      color: #f8fafc;
    }
  }

  p {
    margin-top: 24px;
    width: 50%;
    font-family: "Inter", sans-serif;
    font-weight: 400;
    font-size: 16px;
    color: #f8fafc;
  }

  &.active {
    display: flex;
  }
}

body.home {
  .questions-form__success {
    background-color: var(--white-primary);
    width: auto;
    height: 100%;
    margin: 0;

    h1,
    h2 {
      color: var(--dark-80);
    }

    p {
      color: var(--dark-50);
    }
  }
}

@media (max-width: 1280px) {
  .questions-form,
  .questions-form__success {
    margin: 56px 48px;
    padding: 56px 48px;
  }
}

@media (max-width: 768px) {
  .questions-form,
  .questions-form__success {
    .questions-form__title {
      flex-direction: column;

      h1, h2 {
        font-size: 32px;
        line-height: 32px;
        width: 100%;
      }

      p {
        font-size: 16px;
        line-height: 19.2px;
        width: 100%;
      }
    }

    p {
      width: 100%;
    }
  }

  .questions-form {
    form {
      grid-template-columns: 1fr;
    }
    .form-bottom {
      grid-column: span 1;
    }

    .btn-default {
      margin-inline: auto;
    }
  }
}

@media (max-width: 560px) {
  .questions-form,
  .questions-form__success {
    margin: 32px 16px;
    padding: 32px 16px;
  }
}
