@import (reference) './variable.less';

@stepsPrefix: ant-steps;

.@{stepsPrefix} {
  display: flex;
  overflow: hidden;
  line-height: 1.4;

  &-horizontal {
    flex-direction: row;
    justify-content: space-around;
  }

  &-vertical {
    display: block;
    padding: 64 * @rpx;
    .ant-steps-item-active {
      &::after {
        background: linear-gradient(
          to top,
          @steps-non-active-bg 0%,
          @steps-non-active-bg 50%,
          @steps-default-bg 50%,
          @steps-default-bg 100%
        );
      }
    }
    .ant-steps-item-non-active {
      &::after {
        background: @steps-non-active-bg;
      }
    }
  }

  &-item:last-child &-item-indicator-vertical::after {
    display: none;
  }
}

.ant-steps-item-vertical:last-child {
  padding-bottom: 0;
}

@stepItemPrefix: ant-steps-item;

.@{stepItemPrefix} {
  position: relative;
  z-index: 5;
  display: flex;
  margin: 16 * @rpx 0 16 * @rpx 0;

  &-vertical {
    padding-bottom: 24 * @rpx;
    margin: 0;
    .ant-steps-item-title {
      font-size: 34 * @rpx;
      color: @steps-title-color;
    }

    .ant-steps-item-desc {
      font-size: 30 * @rpx;
      color: @steps-desc-color;
      padding-top: 4 * @rpx;
    }

    &::after {
      // line
      position: absolute;
      height: 100%;
      width: 2 * @rpx;
      content: '';
      top: 27 * @rpx;
      z-index: -1;
      transform: translateX(-50%);
    }

    .ant-steps-item-text {
      display: flex;
      flex-direction: column;
      flex: 1;
    }
  }

  &-horizontal {
    flex-direction: column;
    margin-top: 16 * @rpx;
    padding: 0 16 * @rpx;

    &::after {
      position: absolute;
      width: 100%;
      height: 2 * @rpx;
      content: '';
      top: 34 * @rpx;
      left: 0;
      transform: translate(50%, -50%);
      z-index: -1;
    }

    .@{stepItemPrefix}-title,
    .@{stepItemPrefix}-desc {
      text-align: center;
    }

    .@{stepItemPrefix}-desc {
      margin-bottom: 0;
    }
  }

  &:last-child {
    &::after {
      display: none;
    }
  }

  &-indicator {
    &-vertical {
      transform: translateX(-50%);
    }

    &-horizontal {
      display: flex;
      justify-content: center;
      margin: 16 * @rpx 0 16 * @rpx 0;
    }

    &-icon {
      width: 18 * @rpx;
      height: 18 * @rpx;
      border-radius: 50%;
    }
  }

  .ant-steps-item-active-icon-image {
    transform: translateX(0);
  }

  &-horizontal {
    flex: 1;
    display: flex;

    .ant-steps-item-title {
      font-size: 24 * @rpx;

      &:empty {
        display: none;
      }
    }

    .ant-steps-item-desc {
      padding-top: 4 * @rpx;
      color: @steps-desc-color;
      font-size: 24 * @rpx;

      &:empty {
        display: none;
      }
    }
  }

  &-active {
    &::after {
      background-color: @steps-non-active-bg;
    }

    &-icon {
      display: flex;
      justify-content: center;
      align-items: center;
      background: transparent;

      &,
      & .a-image {
        height: 36 * @rpx;
        width: 36 * @rpx;
      }

      color: @steps-default-bg;

      &-default {
        height: 20 * @rpx;
        width: 20 * @rpx;
        border-radius: 50%;
        background-color: @steps-default-bg;
      }
    }

    & .@{stepItemPrefix}-title {
      color: @steps-default-bg;
    }
  }

  &-non-active {
    &::after {
      background-color: @steps-non-active-bg;
    }

    &-icon {
      display: flex;
      justify-content: center;
      align-items: center;
      background: transparent;

      &,
      & .a-image {
        height: 36 * @rpx;
        width: 36 * @rpx;
      }

      color: @steps-non-active-bg;

      &-default {
        height: 16 * @rpx;
        width: 16 * @rpx;
        border-radius: 50%;
        background-color: @steps-non-active-bg;
      }
    }
  }

  &-finish {
    &::after {
      background-color: @steps-default-bg;
    }

    &-icon {
      display: flex;
      justify-content: center;
      align-items: center;
      background: transparent;

      &,
      & .a-image {
        height: 36 * @rpx;
        width: 36 * @rpx;
      }

      color: @steps-default-bg;

      &-default {
        height: 16 * @rpx;
        width: 16 * @rpx;
        border-radius: 50%;
        background-color: @steps-default-bg;
      }
    }

    & .@{stepItemPrefix}-title {
      color: @steps-title-color;
    }
  }

  &-error-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    background: transparent;

    &,
    & .a-image {
      height: 36 * @rpx;
      width: 36 * @rpx;
    }

    color: @steps-finish-bg;

    &-default {
      height: 20 * @rpx;
      width: 20 * @rpx;
      border-radius: 50%;
      background-color: @steps-finish-bg;
    }
  }

  .ant-steps-item-title-error {
    color: @steps-finish-bg;
  }
}
