@use "variables";

.fwe-stepper-horizontal {
  width: 100%;
  height: 54px;
  display: flex;
  justify-content: center;

  .fwe-step-container {
    display: flex;
    justify-content: flex-end;
    text-align: right;
    flex-direction: row;
    flex-grow: 1;
    position: relative;
    &::after {
      // this is the connector
      position: absolute;
      content: "";
      height: 2px;
      left: 4px;
      right: 28px;
      top: 11px;
      background: variables.$text-disabled;
      transition: background-color 0.3s, color 0.3s;
    }
    .fwe-step {
      padding-top: -1px;
      padding-bottom: 1px;
      position: relative;
      border-radius: 50%;
      border: 2px solid variables.$text-disabled;
      width: 24px;
      height: 24px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-feature-settings: variables.$font-feature-settings;
      font-variant-numeric: variables.$font-variant-numeric;
      transition: border-color 0.3s, background-color 0.3s, color 0.3s;

      .fwe-step-no {
        color: variables.$text-disabled;
        font-size: variables.$font-size-md;
        font-weight: variables.$font-weight-bold;
      }

      .fwe-step-name {
        font-family: variables.$font-family-base;
        font-size: variables.$font-size-md;
        position: absolute;
        top: 30px;
        left: 50%;
        transform: translateX(-50%);
        color: variables.$text-disabled;
        white-space: pre;
        transition: color 0.3s;
        @media (max-width: 900px) {
          display: none;
        }
      }
    }

    &.fwe-step-active,
    &.fwe-step-done {
      &::after {
        background: variables.$hero;
      }
      .fwe-step {
        background: variables.$hero;
        border-color: variables.$hero;
        .fwe-step-no {
          color: #ffffff;
        }
        .fwe-step-name {
          color: variables.$hero;
        }
      }
    }

    &.fwe-step-active {
      .fwe-step {
        .fwe-step-name {
          font-weight: variables.$font-weight-bold;
        }
      }
    }

    &.fwe-step-done {
      .fwe-step {
        cursor: pointer;
        &:hover {
          background: variables.$hero-active;
          border-color: variables.$hero-active;
        }
        .fwe-step-no {
          display: none;
        }
        &:before {
          content: "";
          position: absolute;
          left: 2px;
          top: 2px;
          height: 16px;
          width: 16px;
          background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNiAxNiI+PGcgZGF0YS1uYW1lPSJjb250ZW50Ij48cGF0aCBmaWxsPSJub25lIiBkPSJNMCAwaDE2djE2SDB6Ii8+PHBhdGggZmlsbD0iI2ZmZiIgZD0iTTYuMTQxIDEyLjgxNCAxLjkzNCA4LjYwN2wxLjQxNC0xLjQxNCAyLjc5MyAyLjc5MyA2Ljc5My02Ljc5MyAxLjQxNCAxLjQxNC04LjIwNyA4LjIwN3oiLz48L2c+PC9zdmc+");
        }
      }
    }
  }

  .fwe-step-container:last-child {
    .fwe-step {
      .fwe-step-name {
        right: 0px;
        left: unset;
        transform: unset;
      }
    }
  }
  .fwe-step-container:first-child {
    flex-grow: 0;
    .fwe-step {
      .fwe-step-name {
        left: 0px;
        transform: unset;
      }
    }
  }
}
