$a-wizard-border_color:                      var(--a_color_gray_200, #eeeeee) !default;
$a-wizard-border-width:                      var(--a_border_width, 1px) !default;
$a-wizard-step-default-primary-color:        var(--a_color_gray_200, #f8f9fa) !default;
$a-wizard-step-default-secondary-color:      var(--a_color_gray_500, #b0b0b1) !default;
$a-wizard-step-active-primary-color:         var(--a_color_primary, #009EF7) !default;
$a-wizard-step-active-secondary-color:       var(--a_color_white, #ffffff) !default;
$a-wizard-step-active-font-weight:           700 !default;
$a-wizard-step-done-primary-color:           var(--a_color_primary_50, #90d4fa) !default;
$a-wizard-step-done-secondary-color:         var(--a_color_gray_100, #fefefe) !default;
$a-wizard-step-disabled-primary-color:       var(--a_color_gray_500, #adb5bd) !default;
$a-wizard-step-disabled-secondary-color:     var(--a_color_gray_100, #fefefe) !default;
$a-wizard-step-error-primary-color:          var(--a_color_danger, #dc3545) !default;
$a-wizard-step-error-secondary-color:        var(--a_color_white, #ffffff) !default;
$a-wizard-step-warning-primary-color:        var(--a_color_warning, #ffc107) !default;
$a-wizard-step-warning-secondary-color:      var(--a_color_white, #ffffff) !default;
$a-wizard-step-focus-shadow:                 var(--a_color_primary_50, #90d4fa) !default;
$a-wizard-step-focus-box-shadow:             0 0 0 0.25rem var(--a_wizard_step_focus_shadow) !default;

.a_wizard {
  --a_wizard_border_color: #{$a-wizard-border_color};
  --a_wizard_border_width: #{$a-wizard-border-width};
  --a_wizard_step_default_primary_color: #{$a-wizard-step-default-primary-color};
  --a_wizard_step_default_secondary_color: #{$a-wizard-step-default-secondary-color};
  --a_wizard_step_active_primary_color: #{$a-wizard-step-active-primary-color};
  --a_wizard_step_active_secondary_color: #{$a-wizard-step-active-secondary-color};
  --a_wizard_step_active_font_weight: #{$a-wizard-step-active-font-weight};
  --a_wizard_step_done_primary_color: #{$a-wizard-step-done-primary-color};
  --a_wizard_step_done_secondary_color: #{$a-wizard-step-done-secondary-color};
  --a_wizard_step_disabled_primary_color: #{$a-wizard-step-disabled-primary-color};
  --a_wizard_step_disabled_secondary_color: #{$a-wizard-step-disabled-secondary-color};
  --a_wizard_step_error_primary_color: #{$a-wizard-step-error-primary-color};
  --a_wizard_step_error_secondary_color: #{$a-wizard-step-error-secondary-color};
  --a_wizard_step_warning_primary_color: #{$a-wizard-step-warning-primary-color};
  --a_wizard_step_warning_secondary_color: #{$a-wizard-step-warning-secondary-color};
  --a_wizard_step_focus_shadow: #{$a-wizard-step-focus-shadow};
  --a_wizard_step_focus_box_shadow: #{$a-wizard-step-focus-box-shadow};

  border: var(--a_wizard_border_width) solid var(--a_wizard_border_color);
  position: relative;

  *,
  *::before,
  *::after {
    box-sizing: border-box;
  }
  &:focus {
    box-shadow: var(--a_wizard_step_focus_box_shadow);
    outline: 0;
  }
}

.a_wizard_basic {
  > .a_wizard__steps {
    box-shadow: 0 .125rem .25rem rgba(0, 0, 0, .1);
    .a_wizard__step__link {
      position: relative;
      height: 100%;
      min-height: 100%;
      margin-right: 0.3125rem;
      &::after {
        content: "";
        position: absolute;
        pointer-events: none;
        height: 0.125rem;
        left: 0;
        bottom: -0.0625rem;
        transition: all .35s ease .15s;
        width: 100%;
      }
      &.default {
        color: var(--a_wizard_step_default_secondary_color);
        cursor: not-allowed;
        &::after {
          background-color: var(--a_wizard_step_default_secondary_color);
        }
      }
      &.done {
        color: var(--a_wizard_step_done_primary_color);
        cursor: pointer;
        &::after {
          background: var(--a_wizard_step_done_primary_color);
        }
      }
      &.active {
        color: var(--a_wizard_step_active_primary_color);
        cursor: pointer;
        &::after {
          background: var(--a_wizard_step_active_primary_color);
        }
      }

      &.disabled {
        color: var(--a_wizard_step_disabled_primary_color) !important;

        &::after {
          background: var(--a_wizard_step_disabled_primary_color);
        }
      }

      &.error {
        color: var(--a_wizard_step_error_primary_color) !important;

        &::after {
          background: var(--a_wizard_step_error_primary_color) !important;
        }
      }

      &.warning {
        color: var(--a_wizard_step_warning_primary_color) !important;

        &::after {
          background: var(--a_wizard_step_warning_primary_color) !important;
        }
      }
    }
  }
}
.a_wizard_arrows {
  .a_wizard__step {
    margin-top: .5rem;
  }
  > .a_wizard__steps {
    margin-left: 3.75rem;
    .a_wizard__step {
      position: relative;
    }

    .a_wizard__step__divider {
      position: absolute;
      display: none;
      left: -4.25rem;
      top: -0.1875rem;
      width: calc(100% + 2.625rem);
      height: calc(100% + 0.375rem);
      clip-path: polygon(0 0, calc(100% - 2.0625rem) 0, 100% 50%, calc(100% - 2.0625rem) 100%, 0 100%, 2.0625rem 50%);
      z-index: 3;
      background-color: rgba(var(--a_wizard_step_focus_shadow_rgb), .5);
    }
    .a_wizard__step__link {
      position: relative;
      height: 100%;
      padding: 0.625rem 3.125rem 0.625rem 1.875rem;
      margin-right: 1.875rem;
      margin-left: -3.75rem;
      clip-path: polygon(0 0, calc(100% - 1.875rem) 0, 100% 50%, calc(100% - 1.875rem) 100%, 0 100%, 1.875rem 50%);
      z-index: 2;
      &:focus {
        box-shadow: none;
        z-index: 4;
        & + .a_wizard__step__divider {
          display: block;
        }
        &:after {
          width: 100%;
        }
      }

      &:after {
        content: "";
        position: absolute;
        display: block;
        left: 0;
        top: 0;
        background-color: transparent;
        z-index: -1;
        width: calc(100% - 0.125rem);
        height: 100%;
        clip-path: polygon(0 0, calc(100% - 1.875rem) 0, 100% 50%, calc(100% - 1.875rem) 100%, 0 100%, 1.875rem 50%);
      }

      &.default {
        color: var(--a_wizard_step_default_secondary_color);
        background-color: var(--a_wizard_step_default_secondary_color);
        cursor: not-allowed;

        &:after {
          background-color: var(--a_wizard_step_default_primary_color);
        }
      }

      &.active {
        color: var(--a_wizard_step_active_secondary_color) !important;
        border-color: var(--a_wizard_step_active_primary_color);
        background-color: var(--a_wizard_step_active_secondary_color);
        cursor: pointer;

        &:after {
          background-color: var(--a_wizard_step_active_primary_color);
        }
      }

      &.done {
        color: var(--a_wizard_step_done_secondary_color);
        border-color: var(--a_wizard_step_done_primary_color);
        background-color: var(--a_wizard_step_done_secondary_color);
        cursor: pointer;

        &:after {
          background-color: var(--a_wizard_step_done_primary_color);
        }
      }

      &.disabled {
        color: var(--a_wizard_step_disabled_secondary_color);
        border-color: var(--a_wizard_step_disabled_primary_color);
        background-color: var(--a_wizard_step_disabled_secondary_color);

        &:after {
          background-color: var(--a_wizard_step_disabled_primary_color);
        }
      }

      &.error {
        color: var(--a_wizard_step_error_secondary_color);
        border-color: var(--a_wizard_step_error_primary_color);
        background-color: var(--a_wizard_step_error_secondary_color);

        &:after {
          background-color: var(--a_wizard_step_error_primary_color);
        }
      }

      &.warning {
        color: var(--a_wizard_step_warning_secondary_color);
        border-color: var(--a_wizard_step_warning_primary_color);
        background-color: var(--a_wizard_step_warning_secondary_color);

        &:after {
          background-color: var(--a_wizard_step_warning_primary_color);
        }
      }
    }
  }
}
.a_wizard_line {
  // default
  --a_wizard_line_step_default_text_color: var(--a_wizard_step_default_secondary_color);
  --a_wizard_line_step_default_number_color: var(--a_wizard_step_default_secondary_color);
  --a_wizard_line_step_default_number_bg: var(--a_wizard_step_default_primary_color);
  --a_wizard_line_step_default_number_border_width: 0;
  --a_wizard_line_step_default_number_border_style: none;
  --a_wizard_line_step_default_number_border_color: transparent;
  // active
  --a_wizard_line_step_active_text_color: var(--a_wizard_step_active_primary_color);
  --a_wizard_line_step_active_number_color: var(--a_wizard_step_active_secondary_color);
  --a_wizard_line_step_active_number_bg: var(--a_wizard_step_active_primary_color);
  --a_wizard_line_step_active_number_border_width: 0;
  --a_wizard_line_step_active_number_border_style: none;
  --a_wizard_line_step_active_number_border_color: transparent;
  --a_wizard_line_step_active_number_box_shadow: 0 1px 7px 1px rgba(0, 0, 0, .3);
  // done
  --a_wizard_line_step_done_text_color: var(--a_wizard_step_done_primary_color);
  --a_wizard_line_step_done_number_color: var(--a_wizard_step_done_secondary_color);
  --a_wizard_line_step_done_number_bg: var(--a_wizard_step_done_primary_color);
  --a_wizard_line_step_done_number_border_width: 0;
  --a_wizard_line_step_done_number_border_style: none;
  --a_wizard_line_step_done_number_border_color: transparent;
  // disabled
  --a_wizard_line_step_disabled_text_color: var(--a_wizard_step_disabled_primary_color);
  --a_wizard_line_step_disabled_number_color: var(--a_wizard_step_disabled_secondary_color);
  --a_wizard_line_step_disabled_number_bg: var(--a_wizard_step_disabled_primary_color);
  --a_wizard_line_step_disabled_number_border_width: 0;
  --a_wizard_line_step_disabled_number_border_style: none;
  --a_wizard_line_step_disabled_number_border_color: transparent;
  // error
  --a_wizard_line_step_error_text_color: var(--a_wizard_step_error_primary_color);
  --a_wizard_line_step_error_number_color: var(--a_wizard_step_error_secondary_color);
  --a_wizard_line_step_error_number_bg: var(--a_wizard_step_error_primary_color);
  --a_wizard_line_step_error_number_border_width: 0;
  --a_wizard_line_step_error_number_border_style: none;
  --a_wizard_line_step_error_number_border_color: transparent;
  // warning
  --a_wizard_line_step_warning_text_color: var(--a_wizard_step_warning_primary_color);
  --a_wizard_line_step_warning_number_color: var(--a_wizard_step_warning_secondary_color);
  --a_wizard_line_step_warning_number_bg: var(--a_wizard_step_warning_primary_color);
  --a_wizard_line_step_warning_number_border_width: 0;
  --a_wizard_line_step_warning_number_border_style: none;
  --a_wizard_line_step_warning_number_border_color: transparent;

  .a_wizard__steps {
    position: relative;
    margin-bottom: 0.625rem;
  }
  .a_wizard__step {
    text-align: center;
    &:before {
      content: " ";
      position: absolute;
      left: 0;
      width: 100%;
      border-radius: 0.5rem;
      z-index: 0;
      border: 3px dashed var(--a_wizard_border_color);
      margin-top: 1.5625rem;
    }
  }
  .a_wizard__step__link {
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
    &:before {
      content: " ";
      display: none;
      position: absolute;
      left: 0;
      width: 100%;
      z-index: 1;
      border: 3px solid var(--a_wizard_step_active_primary_color);
      margin-top: 1.0625rem;
    }

    & > .a_wizard__step__number {
      display: flex;
      align-items: center;
      margin-left: auto;
      margin-right: auto;
      margin-bottom: .5rem;
      transition: all 0.5s ease-in-out;
      height: 2.5rem;
      min-width: 2.5rem;
      background: var(--a_wizard_border_color);
      border-radius: var(--a_wizard_border_radius);
      padding: 0 0.75rem;
      z-index: 1;
    }

    &.default {
      color: var(--a_wizard_line_step_default_text_color);
      cursor: not-allowed;

      & > .a_wizard__step__number {
        color: var(--a_wizard_line_step_default_number_color);
        background-color: var(--a_wizard_line_step_default_number_bg);
        border: var(--a_wizard_line_step_default_number_border_width) var(--a_wizard_line_step_default_number_border_style) var(--a_wizard_line_step_default_number_border_color);
      }
    }

    &.active {
      color: var(--a_wizard_line_step_active_text_color) !important;
      cursor: pointer;
      &:before {
        display: block;
      }

      & > .a_wizard__step__number {
        color: var(--a_wizard_line_step_active_number_color) !important;
        background-color: var(--a_wizard_line_step_active_number_bg) !important;
        border: var(--a_wizard_line_step_active_number_border_width) var(--a_wizard_line_step_active_number_border_style) var(--a_wizard_line_step_active_number_border_color) !important;
        box-shadow: var(--a_wizard_line_step_active_number_box_shadow);
      }
    }

    &.done {
      color: var(--a_wizard_line_step_done_text_color);
      cursor: pointer;

      & > .a_wizard__step__number {
        color: var(--a_wizard_line_step_done_number_color) !important;
        background-color: var(--a_wizard_line_step_done_number_bg) !important;
        border: var(--a_wizard_line_step_done_number_border_width) var(--a_wizard_line_step_done_number_border_style) var(--a_wizard_line_step_done_number_border_color) !important;
      }
    }

    &.disabled {
      color: var(--a_wizard_line_step_disabled_text_color);

      & > .a_wizard__step__number {
        color: var(--a_wizard_line_step_disabled_number_color);
        background-color: var(--a_wizard_line_step_disabled_number_bg);
        border: var(--a_wizard_line_step_disabled_number_border_width) var(--a_wizard_line_step_disabled_number_border_style) var(--a_wizard_line_step_disabled_number_border_color);
      }
    }

    &.error {
      color: var(--a_wizard_line_step_error_text_color) !important;

      & > .a_wizard__step__number {
        color: var(--a_wizard_line_step_error_number_color) !important;
        background-color: var(--a_wizard_line_step_error_number_bg) !important;
        border: var(--a_wizard_line_step_error_number_border_width) var(--a_wizard_line_step_error_number_border_style) var(--a_wizard_line_step_error_number_border_color) !important;
      }
    }

    &.warning {
      color: var(--a_wizard_line_step_warning_text_color) !important;

      & > .a_wizard__step__number {
        color: var(--a_wizard_line_step_warning_number_color) !important;
        background-color: var(--a_wizard_line_step_warning_number_bg) !important;
        border: var(--a_wizard_line_step_warning_number_border_width) var(--a_wizard_line_step_warning_number_border_style) var(--a_wizard_line_step_warning_number_border_color) !important;
      }
    }
    &.before_active {
      &:before {
        display: block;
      }
    }
  }
  .a_wizard__step__number {
    position: relative;
  }
}
.a_wizard_line_square,
.a_wizard_line_square_bordered {
  --a_wizard_border_radius: var(--a_border_radius, .5rem);
}
.a_wizard_line_circle,
.a_wizard_line_circle_bordered {
  --a_wizard_border_radius: 2rem;
}
.a_wizard_line_square_bordered,
.a_wizard_line_circle_bordered{
  --a_wizard_line_step_active_number_additional_border_width: 2px;
  --a_wizard_line_step_active_number_additional_border_style: solid;
  --a_wizard_line_step_active_number_additional_border_color: var(--a_wizard_step_active_primary_color);
  --a_wizard_line_step_active_number_additional_border_space: 0.3125rem;
  --a_wizard_line_step_active_number_box_shadow: none;

  .a_wizard__step__link.active > .a_wizard__step__number{
    &:before {
      content: "";
      border-radius: var(--a_wizard_border_radius);
      border-width: var(--a_wizard_line_step_active_number_additional_border_width);
      border-style: var(--a_wizard_line_step_active_number_additional_border_style);
      border-color: var(--a_wizard_line_step_active_number_additional_border_color);
      pointer-events: none;
      position: absolute;
      top: calc(-1 * var(--a_wizard_line_step_active_number_additional_border_space));
      right: calc(-1 * var(--a_wizard_line_step_active_number_additional_border_space));
      bottom: calc(-1 * var(--a_wizard_line_step_active_number_additional_border_space));
      left: calc(-1 * var(--a_wizard_line_step_active_number_additional_border_space));
      z-index: 1;
    }
  }
}

.a_wizard_round {
  --a_wizard_step_focus_shadow: #{$a-wizard-step-active-primary-color};
  .a_wizard__step {
    margin-top: .5rem;
  }
  .a_wizard__step__link {
    position: relative;
    height: 100%;
    min-height: 100%;
    border-radius: 10em;
    margin-right: 0.25rem;
    transition: all 0.5s ease-in-out;

    &.default {
      background-color: var(--a_wizard_step_default_primary_color);
      color: var(--a_wizard_step_default_secondary_color);
      cursor: not-allowed;
    }

    &.active {
      background-color: var(--a_wizard_step_active_primary_color);
      color: var(--a_wizard_step_active_secondary_color) !important;
      box-shadow: 0 1px 7px 1px rgba(0, 0, 0, .3);
      cursor: pointer;
    }

    &.done {
      background-color: var(--a_wizard_step_done_primary_color);
      color: var(--a_wizard_step_done_secondary_color);
      cursor: pointer;
    }

    &.disabled {
      background-color: var(--a_wizard_step_disabled_primary_color);
      color: var(--a_wizard_step_disabled_secondary_color) !important;
    }

    &.error {
      background-color: var(--a_wizard_step_error_primary_color);
      color: var(--a_wizard_step_error_secondary_color) !important;
    }

    &.warning {
      background-color: var(--a_wizard_step_warning_primary_color);
      color: var(--a_wizard_step_warning_secondary_color) !important;
    }

  }
}

.a_wizard__steps {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  padding-left: 0;
  margin-top: 0;
  margin-bottom: 0;
}

.a_wizard__step__link {
  display: block;
  padding: 0.5rem 1rem;
  text-decoration: none;
  &:hover,
  &:active,
  &:focus {
    text-decoration: none;
  }
  &:focus {
    box-shadow: var(--a_wizard_step_focus_box_shadow);
    outline: 0;
  }
  &::-moz-focus-inner {
    border: 0;
  }
  &.disabled,
  &.default {
    cursor: not-allowed;
    --a_wizard_step_focus_box_shadow: none;
  }
  &.hidden {
    display: none;
    visibility: hidden;
  }
  &.active {
    font-weight: var(--a_wizard_step_active_font_weight);
  }
}
.a_wizard__step__number {
  display: flex;
  justify-content: center;
  align-items: center;
  float: left;
  pointer-events: none;
  height: 100%;
  padding-left: .5rem;
  padding-right: .5rem;
  border-radius: 10em;
  text-align: center;
  font-size: 2em;
  font-weight: 800;
  clear: both;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}
.a_wizard__step__number__icon {
  width: 1.5rem;
  height: auto;
}
.a_wizard__step__text__icon {
  margin-left: .5rem;
}
.a_wizard__tab_content {
  position: relative;
  overflow: hidden;
}
.a_wizard__tab_pane {
  padding: .8rem;
}

.a_wizard__toolbar {
  padding: .8rem;
  text-align: right;
  > button {
    margin-left: .2rem;
    margin-right: .2rem;
  }
}
.a_wizard_justified {
  .a_wizard__step {
    flex: 1 1 auto;
  }
}

.a_wizard_mobile {
  .a_wizard__step__link {
    display: flex;
    align-items: center;
  }
  &.a_wizard_arrows > .a_wizard__steps {
    .a_wizard__step__divider {
      width: calc(100% + 4.5rem);
    }
    .a_wizard__step__link {
      overflow: hidden;
      margin-right: unset;
      text-align: left !important;
      &:after {
        width: 100%;
      }
      &.default {
        border-bottom: 1px solid var(--a_wizard_step_default_primary_color);
      }
      &.active {
        border-bottom: 1px solid var(--a_wizard_step_active_secondary_color);
      }
      &.done {
        border-bottom: 1px solid var(--a_wizard_step_done_secondary_color);
      }
      &.disabled {
        border-bottom: 1px solid var(--a_wizard_step_disabled_secondary_color);
      }
      &.error {
        border-bottom: 1px solid var(--a_wizard_step_error_secondary_color);
      }
      &.warning {
        border-bottom: 1px solid var(--a_wizard_step_warning_secondary_color);
      }
    }
  }
  &.a_wizard_line {
    .a_wizard__steps {
      &:before {
        content: " ";
        position: absolute;
        top: 0;
        left: 0;
        width: 0;
        height: 100%;
        border-radius: 0.5rem;
        z-index: 0;
        border: 3px dashed var(--a_wizard_border_color);
        margin-left: 2.0625rem;
      }
    }
    .a_wizard__step {
      &:before {
        content: none;
      }
    }
    .a_wizard__step__link {
      flex-direction: row;
      align-items: center;
      &:before {
        margin-top: 0;
        top: 0;
        width: 0;
        height: 100%;
        margin-left: 2.0625rem;
      }
      & > .a_wizard__step__number {
        margin: 0 .5rem 0 0;
      }
    }
  }
  &.a_wizard_round {
    .a_wizard__step__link {
      margin-right: unset;
      text-align: left !important;
    }
  }
  .a_wizard__steps {
    flex-direction: column !important;
    flex: 1 auto;
  }
  &.a_wizard_show_only_active_step_mobile {
    .a_wizard__step:not(.a_wizard__step_active) {
      display: none;
    }
    &.a_wizard_line {
      .a_wizard__steps {
        &:before {
          display: none;
        }
      }
      .a_wizard__step__link:before {
        display: none;
      }
    }
  }
}
