axa-input-file {
  display: inline-block;
  vertical-align: bottom; // Just for IE
}

.a-input-file {
  @include text(t4);
  position: relative;
  display: inline-block;
  width: 100%;
  text-align: center;
  box-sizing: border-box;
  padding: 0 30px;
  margin: 0;
  min-height: 40px;
  vertical-align: bottom;
  hyphens: auto;
  overflow-wrap: break-word;
  word-wrap: break-word;
  text-transform: uppercase;
  color: $color-prim-white;
  background-color: $color-axa-blue;
  border: solid 2px $color-axa-blue;
  border-bottom-color: $color-deep-sapphire;

  &__flex-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    min-height: 36px;
    // IE11 workaround
    height: 35px;
    box-sizing: border-box;
  }

  &:hover,
  &:active,
  &:focus {
    cursor: pointer;
    text-decoration: none;
    background-color: $color-deep-sapphire;
    border-color: $color-deep-sapphire;
  }

  &__icon {
    display: flex;
    margin-right: 10px;
  }

  &__input {
  	width: 0.001px;
  	height: 0.001px;
  	opacity: 0;
  	overflow: hidden;
  	position: absolute;
  	z-index: -1;
  }
}

.a-input-file--large .a-input-file__flex-wrapper {
  min-height: 50px;
  @include text(t3);
}

.a-input-file--motion {
  $button__motion-duration: 0.3s;
  $button__motion-easing: cubic-bezier(0.455, 0.03, 0.515, 0.955);

  z-index: 0;
  overflow: hidden;

  transition: color $button__motion-duration $button__motion-easing 0s;

  &::after {
    position: absolute;
    top: 50%;
    left: 50%;

    z-index: -1;

    display: block;

    // fix iOS double tap for :hover
    // zero width is considered hidden
    width: 0.001px;
    height: 100vw;
    content: '';

    transform: translateX(-50%) translateY(-50%) rotate(45deg);
    transition: width $button__motion-duration $button__motion-easing 0s;

    background-color: $color-deep-sapphire;
  }

  &:hover,
  &:focus {
    background-color: $color-axa-blue;
    color: $color-prim-white;

    &::after {
      width: 110%;
      background-color: $color-deep-sapphire;
    }
  }
}

.a-input-file--red {
  background-color: $color-burnt-sienna;
  border-color: $color-burnt-sienna;
  border-bottom-color: $color-flamingo;

  &:hover,
  &:active,
  &:focus {
    background-color: $color-flamingo;
    border-color: $color-flamingo;
  }

  &.a-input-file--motion {
    &::after {
      background-color: $color-flamingo;
    }

    &:hover,
    &:focus {
      background-color: $color-burnt-sienna;
      color: $color-prim-white;

      &::after {
        background-color: $color-flamingo;
      }
    }
  }
}

.a-input-file--secondary {
  background-color: transparent;
  border-bottom-color: $color-axa-blue;
  color: $color-axa-blue;

  &:hover,
  &:active,
  &:focus {
    color: $color-prim-white;
  }

  &.a-input-file--motion {
    background-color: transparent;
  }
}

.a-input-file--inverted {
  background-color: transparent;
  border-color: $color-prim-white;
  color: $color-prim-white;

  &:hover,
  &:active,
  &:focus {
    background-color: $color-prim-white;
    border-color: $color-prim-white;
    color: $color-deep-sapphire;
  }

  &.a-input-file--motion {
    background-color: transparent;

    &::after {
      background-color: $color-prim-white;
    }
  }
}

.a-input-file--disabled {
  color: $color-light-grey;
  background-color: $color-mercury;
  border-color: $color-mercury;
  border-bottom-color: $color-silver;
  pointer-events: none;
}
