$primary-color: #108ee9;
$text-color: rgba(#000, 0.65);
$border-color-split: #e9e9e9;
$disabled-color: rgba(#000, 0.25);
$component-background: #fff;
$text-color-secondary: rgba(#000, 0.43);
$error-color: #F04134;
$iconfont-css-prefix: icon;
$font-size-base: 12px;
$font-size-lg: 14px;

$steps-prefix-cls: t-steps;
$process-icon-color: $primary-color;
$process-title-color: $text-color;
$process-description-color: $process-title-color;
$process-tail-color: $border-color-split;
$wait-icon-color: $disabled-color;
$wait-title-color: $text-color-secondary;
$wait-description-color: $wait-title-color;
$wait-tail-color: $process-tail-color;
$finish-icon-color: $process-icon-color;
$finish-title-color: $wait-title-color;
$finish-description-color: $finish-title-color;
$finish-tail-color: $process-icon-color;
$error-icon-color: $error-color;
$error-title-color: $error-color;
$error-description-color: $error-color;
$error-tail-color: $error-color;
$steps-icon-size: 26px;
$steps-small-icon-size: 18px;

.#{$steps-prefix-cls} {
  font-size: 0;
  width: 100%;
  line-height: 1.5;
  .#{$steps-prefix-cls}-item {
    position: relative;
    display: inline-block;
    vertical-align: top;

    &.#{$steps-prefix-cls}-status-wait {
      .#{$steps-prefix-cls}-head-inner {
        border-color: $wait-icon-color;
        background-color: $component-background;
        > .#{$steps-prefix-cls}-icon {
          color: $wait-icon-color;
        }
      }
      .#{$steps-prefix-cls}-title {
        color: $wait-title-color;
      }
      .#{$steps-prefix-cls}-description {
        color: $wait-description-color;
      }
      .#{$steps-prefix-cls}-tail > i {
        background-color: $wait-tail-color;
      }
    }
    &.#{$steps-prefix-cls}-status-process {
      .#{$steps-prefix-cls}-head-inner {
        border-color: $process-icon-color;
        background-color: $process-icon-color;
        > .#{$steps-prefix-cls}-icon {
          color: $component-background;
        }
      }
      .#{$steps-prefix-cls}-title {
        color: $process-title-color;
      }
      .#{$steps-prefix-cls}-description {
        color: $process-description-color;
      }
      .#{$steps-prefix-cls}-tail > i {
        background-color: $process-tail-color;
      }
    }
    &.#{$steps-prefix-cls}-status-finish {
      .#{$steps-prefix-cls}-head-inner {
        border-color: $finish-icon-color;
        background-color: $component-background;
        > .#{$steps-prefix-cls}-icon {
          color: $finish-icon-color;
        }
      }
      .#{$steps-prefix-cls}-tail > i {
        height: 3px;
      }
      .#{$steps-prefix-cls}-tail > i:after {
        width: 100%;
        background-image: linear-gradient(-90deg, #43C682 0%, #1DB7BB 51%, #038CD6 100%);
        transition: all 0.6s;
        opacity: 1;
      }
      .#{$steps-prefix-cls}-title {
        color: $finish-title-color;
      }
      .#{$steps-prefix-cls}-description {
        color: $finish-description-color;
      }
    }
    &.#{$steps-prefix-cls}-status-error {
      .#{$steps-prefix-cls}-head-inner {
        border-color: $error-icon-color;
        background-color: $component-background;
        > .#{$steps-prefix-cls}-icon {
          color: $error-icon-color;
        }
      }
      .#{$steps-prefix-cls}-title {
        color: $error-title-color;
      }
      .#{$steps-prefix-cls}-description {
        color: $error-description-color;
      }
    }
    &.#{$steps-prefix-cls}-next-error {
      .#{$steps-prefix-cls}-tail > i,
      .#{$steps-prefix-cls}-tail > i:after {
        background-color: $error-tail-color;
        background-image: none;
      }
    }

    &.#{$steps-prefix-cls}-custom {
      .#{$steps-prefix-cls}-head-inner {
        background: none;
        border: 0;
        width: auto;
        height: auto;
        > .#{$steps-prefix-cls}-icon {
          font-size: $steps-icon-size;
          width: $steps-icon-size;
          height: $steps-icon-size;
        }
      }
      &.#{$steps-prefix-cls}-status-process {
        .#{$steps-prefix-cls}-head-inner > .#{$steps-prefix-cls}-icon {
          color: $process-icon-color;
        }
      }
    }
  }
  .#{$steps-prefix-cls}-head,
  .#{$steps-prefix-cls}-main {
    position: relative;
    display: inline-block;
    vertical-align: top;
  }
  .#{$steps-prefix-cls}-head {
    background: $component-background;
  }

  .#{$steps-prefix-cls}-head-inner {
    display: block;
    border: 1px solid $wait-icon-color;
    width: $steps-icon-size;
    height: $steps-icon-size;
    line-height: 23px;
    text-align: center;
    border-radius: $steps-icon-size;
    font-size: $font-size-lg;
    margin-right: 8px;
    transition: background-color 0.3s ease, border-color 0.3s ease;
    > .#{$steps-prefix-cls}-icon {
      line-height: 1;
      color: $primary-color;
      position: relative;
      &.#{$iconfont-css-prefix} {
        font-size: $font-size-base;
        &-cross,
        &-check {
          font-weight: bold;
        }
      }
    }
  }

  .#{$steps-prefix-cls}-main {
    margin-top: 2.5px;
  }
  .#{$steps-prefix-cls}-title {
    font-size: $font-size-lg;
    margin-bottom: 4px;
    color: $text-color;
    font-weight: bold;
    background: $component-background;
    display: inline-block;
    padding-right: 10px;

    > a:first-child:last-child {
      color: $text-color;
    }
  }
  .#{$steps-prefix-cls}-item-last {
    .#{$steps-prefix-cls}-title {
      padding-right: 0;
      width: 100%;
    }
  }
  .#{$steps-prefix-cls}-description {
    font-size: $font-size-base;
    color: $text-color-secondary;
  }
  .#{$steps-prefix-cls}-tail {
    position: absolute;
    left: 0;
    width: 100%;
    top: 13px;
    padding: 0 10px;
    > i {
      display: inline-block;
      vertical-align: top;
      background: $wait-tail-color;
      height: 1px;
      border-radius: 1px;
      width: 100%;
      position: relative;
      &:after {
        position: absolute;
        content: '';
        top: 0;
        width: 0;
        background: $border-color-split;
        height: 100%;
        opacity: 0;
      }
    }
  }

  &.#{$steps-prefix-cls}-small {
    .#{$steps-prefix-cls}-head-inner {
      border: 1px solid $wait-icon-color;
      width: $steps-small-icon-size;
      height: $steps-small-icon-size;
      line-height: 15px;
      text-align: center;
      border-radius: $steps-small-icon-size;
      font-size: $font-size-base;
      margin-right: 10px;
      > .#{$steps-prefix-cls}-icon.#{$iconfont-css-prefix} {
        display: inline-block;
        zoom: 1;
        top: 0;
        transform: scale(0.75) rotate(0deg);
      }
    }

    .#{$steps-prefix-cls}-main {
      margin-top: 0;
    }

    .#{$steps-prefix-cls}-title {
      font-size: $font-size-base;
      margin-bottom: 4px;
      color: $text-color;
      font-weight: bold;
    }

    .#{$steps-prefix-cls}-description {
      font-size: $font-size-base;
      color: $text-color-secondary;
    }

    .#{$steps-prefix-cls}-tail {
      top: 8px;
      padding: 0 8px;
      > i {
        height: 1px;
        border-radius: 1px;
        width: 100%;
      }
    }

    .#{$steps-prefix-cls}-custom .#{$steps-prefix-cls}-head-inner > .#{$steps-prefix-cls}-icon {
      font-size: $steps-small-icon-size;
      width: $steps-small-icon-size;
      height: $steps-small-icon-size;
    }
  }
}

.#{$steps-prefix-cls}-vertical {
  .#{$steps-prefix-cls}-item {
    display: block;
    &.#{$steps-prefix-cls}-status-finish {
      .#{$steps-prefix-cls}-tail > i {
        width: 3px;
        height: 100%;
      }
      .#{$steps-prefix-cls}-tail > i:after {
        background-image: linear-gradient(-180deg, #43C682 0%, #1DB7BB 51%, #038CD6 100%);
        height: 100%;
      }
    }
    &.#{$steps-prefix-cls}-status-error {
      .#{$steps-prefix-cls}-tail > i {
        height: 100%;
      }
      .#{$steps-prefix-cls}-tail > i:after {
        height: 100%;
      }
    }
    &.#{$steps-prefix-cls}-next-error {
      .#{$steps-prefix-cls}-tail > i,
      .#{$steps-prefix-cls}-tail > i:after {
        background-color: $error-tail-color;
        background-image: none;
      }
    }
  }
  .#{$steps-prefix-cls}-tail {
    position: absolute;
    left: 13px;
    top: 0;
    height: 100%;
    width: 1px;
    padding: 30px 0 4px 0;
    > i {
      height: 100%;
      width: 1px;
      &:after {
        height: 0;
        width: 100%;
      }
    }
  }
  .#{$steps-prefix-cls}-head {
    float: left;
    &-inner {
      margin-right: 16px;
    }
  }
  .#{$steps-prefix-cls}-main {
    min-height: 47px;
    overflow: hidden;
    display: block;
    .#{$steps-prefix-cls}-title {
      line-height: $steps-icon-size;
    }
    .#{$steps-prefix-cls}-description {
      padding-bottom: 12px;
    }
  }
}

.#{$steps-prefix-cls}-vertical.#{$steps-prefix-cls}-small {
  .#{$steps-prefix-cls}-tail {
    position: absolute;
    left: 9px;
    top: 0;
    padding: 22px 0 4px 0;
    > i {
      height: 100%;
    }
  }
  .#{$steps-prefix-cls}-title {
    line-height: $steps-small-icon-size;
  }
}

.#{$steps-prefix-cls}-horizontal {
  &.#{$steps-prefix-cls}-hidden {
    visibility: hidden;
  }
  .#{$steps-prefix-cls}-description {
    max-width: 120px;
  }
  .#{$steps-prefix-cls}-item:not(:first-child) .#{$steps-prefix-cls}-head {
    padding-left: 10px;
    margin-left: -10px;
  }
}
