@import './../theme/vars.scss';

$verify-code-success-color: #59c100;
$verify-code-success-border-color: #52b100;

// inpout code
.verify-input-code {
  cursor: pointer;
  user-select: none;
}

// slidecode

.slide-code {
  position: relative;
  width: 350px;
  height: 40px;
  margin: 5px auto;
  background: #e5e5e5;
  border: 1px solid #e0e0e0;

  &-progress {
    position: absolute;
    left: 0;
    width: 0;
    height: 40px;
    font-size: 18px;
    line-height: 40px;
    color: white;
    text-align: center;
    background: $verify-code-success-color;
    border-top: 1px solid $verify-code-success-border-color;
  }

  &-icon {
    color: #bdbdbd;
  }

  &-dragger {
    position: absolute;
    left: -1px;
    z-index: 2;
    width: 50px;
    height: 40px;
    line-height: 40px;
    text-align: center;
    cursor: move;
    background: white;
    border: 1px solid #cdcdcd;
    border-top: 0;

    &.verify-success {
      .slide-code-icon {
        color: #76c717;
      }
    }
  }

  &-tips,
  &-success {
    position: absolute;
    right: 0;
    left: 1px;
    z-index: 1;
    width: 100%;
    height: 100%;
    font-size: 12px;
    line-height: 38px;
    color: #51555c;
    text-align: center;
  }

  &-success {
    display: none;
    color: white;
    background: $verify-code-success-color;
  }
}

// SlideImgCode

.slide-img-code {
  position: relative;
  width: 310px;
  margin: 0 auto;
  font-size: 14px;
  user-select: none;

  &-refresh {
    position: absolute;
    top: 0;
    right: 0;
    width: 1.7em;
    font-size: 1.5em;
    color: white;
    cursor: pointer;
    filter: drop-shadow(1px 1px 1px black);

    i {
      font-size: 1.5em;
    }
  }

  &-match {
    position: absolute;
    top: 0;
    left: 0;
    cursor: pointer;
  }

  &-container {
    position: relative;
    width: 315px;
    height: 40px;
    margin-top: 13px;
    margin-left: -3px;
    line-height: 35px;
    color: #45494c;
    text-align: center;
    background: #dfe1e2;
    border: 1px solid #e4e7eb;
    border-radius: 20px;
    box-sizing: border-box;
  }

  &-mask {
    position: absolute;
    top: 0;
    left: 0;
    height: 40px;
    background: #d1e9fe;
    border: 0 solid #1991fa;
    border-bottom-left-radius: 20px;
    border-top-left-radius: 20px;
  }

  &-dragger {
    position: absolute;
    top: -9px;
    left: 0;
    width: 56px;
    height: 56px;
    cursor: pointer;
    background: white;
    border-radius: 33px;
    box-shadow: 0 0 3px rgba(0, 0, 0, 0.3);
    transition: background 0.2s linear;

    &-icon {
      position: relative;
      line-height: 56px;
      color: #1d83e9;

      i {
        font-size: 27px;
      }
    }
  }

  &-tips {
    color: #88949d;
  }

  &-success-tips {
    display: none;
    color: #1d83e9;
  }
}

.slide-img-code-active {
  .slide-img-code-dragger {
    border: 1px solid #1991fa;
  }

  .slide-img-code-mask {
    height: 38px;
    border-width: 1px;
  }

  .slide-img-code-tips {
    display: none;
  }
}

.slide-img-code-success {
  .slide-img-code-dragger {
    background-color: $verify-code-success-color;
    border: 1px solid $verify-code-success-border-color;
  }

  .slide-img-code-mask {
    background-color: $common-success-bg-color;
    border: 1px solid $common-success-border-color;

    .slide-img-code-success-tips {
      display: block;
    }
  }

  .slide-img-code-dragger-icon {
    color: white;
  }

  .slide-img-code-tips {
    display: none;
  }
}

.slide-img-code-fail {
  .slide-img-code-dragger {
    background-color: #f57a7a;
    border: 1px solid #f57a7a;
  }

  .slide-img-code-mask {
    height: 38px;
    background-color: #fce1e1;
    border: 1px solid #f57a7a;
  }

  .slide-img-code-dragger-icon {
    color: white;
  }

  .slide-img-code-tips {
    display: none;
  }
}
