$primary: #6571da;
$success: #198754;
$danger: #dc3545;

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Roboto, sans-serif;
  background: #f4f4f4;
}

.container {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.card {
  background: #fff;
  border-radius: 0.375rem;
  box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px;
  padding: 1.5rem;
  width: 90%;
  max-width: 600px;
}

.card-head {
  h2 {
    font-size: 1.5rem;
    margin: 0;
    color: #2f3336;
  }
}

.card-body {
  margin-top: 1.5rem;
  .captcha-box {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.8rem;
    border-radius: 0.375rem;
    background-color: #e5e5f7;
    opacity: 0.8;
    background-image: linear-gradient(
        30deg,
        #444cf7 12%,
        transparent 12.5%,
        transparent 87%,
        #444cf7 87.5%,
        #444cf7
      ),
      linear-gradient(
        150deg,
        #444cf7 12%,
        transparent 12.5%,
        transparent 87%,
        #444cf7 87.5%,
        #444cf7
      ),
      linear-gradient(
        30deg,
        #444cf7 12%,
        transparent 12.5%,
        transparent 87%,
        #444cf7 87.5%,
        #444cf7
      ),
      linear-gradient(
        150deg,
        #444cf7 12%,
        transparent 12.5%,
        transparent 87%,
        #444cf7 87.5%,
        #444cf7
      ),
      linear-gradient(
        60deg,
        #444cf777 25%,
        transparent 25.5%,
        transparent 75%,
        #444cf777 75%,
        #444cf777
      ),
      linear-gradient(
        60deg,
        #444cf777 25%,
        transparent 25.5%,
        transparent 75%,
        #444cf777 75%,
        #444cf777
      );
    background-size: 20px 35px;
    background-position: 0 0, 0 0, 10px 18px, 10px 18px, 0 0, 10px 18px;
    .captcha-text {
      font-size: 2rem;
      font-weight: 600;
      user-select: none;
      pointer-events: none;
    }
  }
}

.form-group {
  margin-top: 1.5rem;
  position: relative;
  width: 100%;
  label {
    position: absolute;
    top: 48%;
    transform: translateY(-50%);
    left: 2%;
    color: #6c757d;
    padding: 0 0.4rem;
    transition: 300ms ease;
    pointer-events: none;
    user-select: none;
  }
  .form-control {
    display: block;
    width: 100%;
    border: 2px solid #e9e7e7;
    font-size: 1rem;
    padding: 0.775rem 1rem;
    border-radius: 0.375rem;
    color: #212529;
    transition: 300ms ease;
    &:focus + label,
    &:not(:placeholder-shown) ~ label {
      top: 0%;
      background-color: #fff;
      font-size: 0.75rem;
    }

    &::placeholder {
      opacity: 0;
    }

    &:focus {
      & + label {
        color: $primary;
      }
      border-color: $primary;
      outline: none;
    }

    &.success {
      border-color: $success;
      & + label {
        color: $success;
      }
    }
    &.danger {
      border-color: $danger;
      & + label {
        color: $danger;
      }
    }
  }
}

.card-foot {
  display: flex;
  justify-content: flex-end;
  margin-top: 1rem;
  .btn-primary {
    padding: 0.675rem 1.2rem;
    font-size: 1rem;
    color: #fff;
    border: none;
    background: $primary;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: 200ms ease background-color;
    &:disabled {
      opacity: 0.65;
      pointer-events: none;
      cursor: not-allowed;
    }
  }
}
