@mixin input-active($labelTop) {
  transform: translateY($labelTop) scale(0.8) !important;
  background-color: var(--secondary-color) !important;
  color: var(--secondary-text-color) !important;
}

.custom-input:not(.radio):not(.checkbox) {
  position: relative;
  width: 100%;
  height: fit-content;
  margin: 10px 0;
  z-index: 0;
  font-size: 14px;
  background-color: white;
  border-radius: 4px;
  box-sizing: border-box;

  &.drop-effect {
    border: solid 2px var(--primary-color);
    outline: solid 1px white;
  }

  .label {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    padding: 5px 10px;
    color: var(--primary-color);
    z-index: 1;
    transition: all 0.2s ease-in-out;
    display: block;
    height: 15px;
    margin: auto;
    border-radius: 4px;
  }

  input[type='number']::-webkit-inner-spin-button,
  input[type='number']::-webkit-outer-spin-button {
    appearance: none;
    margin: 0;
  }

  input:not([type='file']) {

    &:not(:placeholder-shown),
    &:focus {
      &+.label {
        @include input-active(-20px);
      }
    }
  }

  input[type='file']+.label {
    right: 0;
    width: fit-content;
  }

  textarea,
  input {
    height: 40px;
    width: 100%;
    z-index: -1;
    margin: 0;

    &[type='file'] {
      opacity: 0;

      height: 120px;
    }

    &:disabled {
      background-color: white;
    }

    &::placeholder {
      color: transparent;
    }

    &:focus {
      &::placeholder {
        color: var(--text-color);
      }
    }
  }
}

.custom-input {
  &.hidden {
    display: none !important;
  }

  &.radio,
  &.checkbox {
    max-width: fit-content !important;
    width: fit-content !important;
    display: inline-block;

    label {
      display: inline-flex;
      align-items: center;
      width: fit-content;
      padding: 0 20px;
      height: 40px;
      border: solid 1px var(--primary-text-color);
      border-radius: 20px;
      transition: all 0.2s ease-in-out;

      &.checked {
        background-color: var(--primary-text-color);
        color: var(--primary-color);
        border: solid 1px var(--primary-color);
      }

      input {
        display: none;
      }
    }
  }

  input,
  textarea {
    &::placeholder {
      opacity: 0.5;
    }
  }

  &.textarea {
    textarea {
      min-height: 100px !important;
      min-width: 100%;
      max-width: 100%;
      border-radius: 4px;
      padding: 15px 10px 10px 10px;

      &:not(:placeholder-shown),
      &:focus {
        &+.label {
          @include input-active(-10px);
        }
      }
    }

    .label {
      bottom: auto !important;
    }
  }
}