.tdbc-button {
  display: inline-flex;
  align-items: center;
  align-self: start;
  justify-content: center;
  min-width: 10ch;
  min-height: 44px;
  padding: 0.25em 1em;
  transition: 180ms ease-in-out;
  transition-property: background, border;
  border-radius: $tdbc-border-radius/2;
  background-color: tdbc-color("primary");
  color: #fff;
  font-size: 1.125rem;
  line-height: 1.1;
  text-align: center;
  text-decoration: none;
  cursor: pointer;

  @media screen and (-ms-high-contrast: active) {
    border: 2px solid currentColor;
  }

  &:focus {
    outline-color: transparent;
    outline-style: solid;
    box-shadow: 0 0 0 3px scale-color(tdbc-color("primary"), $lightness: -30%);
  }

  &--small {
    min-height: 34px;
    font-size: 1rem;
  }

  &--center {
    align-self: center;
    margin-right: auto;
    margin-left: auto;
  }

  &__icon {
    width: 1.5em;
    height: 1.5em;
    margin-right: 0.25em;

    &--end {
      margin-right: 0;
      margin-left: 0.25em;
    }

    // stylelint-disable-next-line  selector-max-type
    svg {
      width: 100%;
      height: 100%;
      fill: currentColor;
    }
  }

  &-outlined {
    border: 2px solid tdbc-color("primary");
    background-color: transparent;
    color: tdbc-color("primary");

    &:hover,
    &:focus {
      background-color: scale-color(tdbc-color("primary"), $lightness: 80%);
    }
  }

  // stylelint-disable max-nesting-depth
  @each $key in $tdbc-button-variants {
    $color: tdbc-color($key);

    @if ($key != "primary") {
      &--#{$key} {
        background-color: $color;

        @if ($key == "light") {
          color: tdbc-color("dark");
        }

        &:focus {
          box-shadow: 0 0 0 3px scale-color($color, $lightness: -30%);
        }
      }

      &-outlined--#{$key} {
        border-color: scale-color($color, $lightness: 30%, $saturation: 15%);
        color: $color;

        &:focus {
          box-shadow: 0 0 0 3px scale-color($color, $lightness: -30%);
        }

        @if ($key == "light") {
          &:hover,
          &:focus {
            background-color: rgba($color, 0.15);
          }
        } @else {
          &:hover,
          &:focus {
            background-color: scale-color($color, $lightness: 90%);
          }
        }
      }
    }
  }
  // stylelint-enable
}
