.webform-submission-form {
  @apply space-y-4;

  [type="submit"] {
    @apply sm:max-w-3/4 text-start cursor-pointer mt-10 md:mt-20 xl:mt-30 text-solvy-black;
    background-image: linear-gradient(to right, var(--color-solvy-orange) 50%, var(--color-solvy-light-blue) 50%);
  }
}

select {
  background: url("../assets/images/chevron.svg") no-repeat right center !important;
  background-size: 16px !important;
  color: var(--color-solvy-dark-blue) !important;

  option {
    color: var(--color-solvy-dark-blue) !important;
  }
}

select.is-empty {
  color: rgb(145, 146, 151) !important;
}

select,
input[type="tel"],
input[type="text"],
input[type="email"],
textarea {
  width: 100% !important;
  border: none;
  border-bottom: 1px solid var(--color-solvy-white) !important;
  border-radius: 0 !important;
  color: var(--color-solvy-white) !important;
  font-size: 16px !important;
  background: transparent;
  padding: 12px 0 !important;
  line-height: auto !important;

  &:focus {
    outline: none !important;
    box-shadow: none;
  }
}

select,
input[type="tel"],
input[type="text"],
input[type="email"] {
  height: auto !important;
}

textarea {
  /* Not !important: JS sets an inline height to auto-grow the field as the
     user types, and an !important height here would always win over that
     inline style regardless of source order. */
  height: auto;
  min-height: 60px !important;
  max-height: 360px !important; /* ~15 lines */
  overflow-y: auto;
  resize: none !important;
}

.form-item {
  description {
    @apply text-sm;
  }
}

.form-type-checkbox,
.form-type-radio {
  @apply flex items-center justify-start gap-3 mb-4;

  label {
    @apply text-sm;
    cursor: pointer;
    transition: color 0.3s ease;
  }

  input[type="checkbox"],
  input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    border: 2px solid var(--color-solvy-white) !important;
    background-color: transparent !important;
    cursor: pointer;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;

    &:hover {
      transform: scale(1.1);
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }

    &:focus {
      outline: none !important;
    }
  }

  input[type="checkbox"] {
    border-radius: 6px !important;

    &:checked {
      border: 2px solid var(--color-solvy-light-blue) !important;
      background-color: var(--color-solvy-light-blue) !important;
      animation: popIn 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    }

    &:checked::after {
      content: "";
      position: absolute;
      width: 6px;
      height: 12px;
      border: solid var(--color-solvy-white);
      border-width: 0 2px 2px 0;
      transform: rotate(45deg) scale(0);
      top: 3px;
      animation: checkmarkIn 0.3s cubic-bezier(0.4, 0, 0.2, 1) 0.1s forwards;
    }
  }

  input[type="radio"] {
    border-radius: 50% !important;

    &:checked {
      border-width: 7px !important;
      border-color: var(--color-solvy-light-blue) !important;
      background-color: var(--color-solvy-white) !important;
      animation: popIn 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    }
  }
}

.radios--wrapper {
  legend {
    @apply mb-4;
  }
}

.messages,
.form-item .description {
  @apply text-sm font-thin;
}

input[type="file"] {
  @apply text-sm w-full block;
  color: var(--color-solvy-white) !important;
  cursor: pointer;
  background: transparent;
  padding: 8px 0;

  &::file-selector-button {
    @apply mr-4 py-2 px-6 rounded-md font-semibold text-sm;
    border: 2px solid var(--color-solvy-light-blue) !important;
    background-color: transparent !important;
    color: var(--color-solvy-white) !important;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  &::file-selector-button:hover {
    background-color: var(--color-solvy-light-blue) !important;
    color: var(--color-solvy-dark-blue) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  }
}

@keyframes popIn {
  0% {
    transform: scale(0.8);
  }
  50% {
    transform: scale(1.15);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes checkmarkIn {
  0% {
    transform: rotate(45deg) scale(0);
  }
  100% {
    transform: rotate(45deg) scale(1);
  }
}
