.container {
  display: flex;
  height: 200px;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}

p {
  color: rgba(0, 0, 0, 0.3);
}

form {
  position: relative;
  max-width: 250px;
  width: 100%;
  display: flex;
  align-items: center;
  font-size: 20px;
  border-radius: 1.7em;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

input[type="password"] {
  border: none;
  line-height: 2.8em;
  width: 100%;
  padding-left: 1.5em;
  transition: opacity 600ms, -webkit-transform 300ms;
  transition: opacity 600ms, transform 300ms;
  transition: opacity 600ms, transform 300ms, -webkit-transform 300ms;
}
input[type="password"]:focus {
  outline: none;
}
input[type="password"]::-webkit-input-placeholder {
  color: rgba(0, 0, 0, 0.2);
}
input[type="password"]:-ms-input-placeholder {
  color: rgba(0, 0, 0, 0.2);
}
input[type="password"]::-ms-input-placeholder {
  color: rgba(0, 0, 0, 0.2);
}
input[type="password"]::placeholder {
  color: rgba(0, 0, 0, 0.2);
}

button {
  color: #fff;
  background: none;
  border: none;
  width: 2.1em;
  height: 2.1em;
  flex-shrink: 0;
  margin-right: 0.45em;
  text-align: center;
  border-radius: 50%;
  position: relative;
  z-index: 2;
  padding: 0;
}
button:focus {
  outline: none;
}
button svg {
  position: absolute;
  display: block;
  width: 50%;
  height: 40%;
  top: 30%;
  left: 25%;
  margin: 0;
  fill: currentColor;
}

.icon-error {
  opacity: 0;
}

.icon-success {
  fill: transparent;
}

.icon-error path,
.icon-success path {
  stroke: #fff;
  stroke-width: 8;
}

.icon-success path {
  stroke-dasharray: 175;
  stroke-dashoffset: 175;
}

.submit-bg {
  background: #65D9F9;
  position: absolute;
  border-radius: 50%;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: -1;
  overflow: hidden;
  transition: -webkit-transform 300ms ease-in-out;
  transition: transform 300ms ease-in-out;
  transition: transform 300ms ease-in-out, -webkit-transform 300ms ease-in-out;
}
.submit-bg::before, .submit-bg::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  opacity: 0;
  transition: opacity 500ms;
}
.submit-bg::before {
  background: #68D38B;
}
.submit-bg::after {
  background: #E8426E;
}

.message {
  position: absolute;
  color: #fff;
  left: 0;
  right: 0;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  -webkit-transform: translateX(3em);
          transform: translateX(3em);
  transition: opacity 250ms, -webkit-transform 500ms;
  transition: transform 500ms, opacity 250ms;
  transition: transform 500ms, opacity 250ms, -webkit-transform 500ms;
  z-index: 2;
}

form:not([data-state="typing"]) input {
  transition: opacity 300ms, -webkit-transform 1s;
  transition: opacity 300ms, transform 1s;
  transition: opacity 300ms, transform 1s, -webkit-transform 1s;
  -webkit-transform: translateX(-2em);
          transform: translateX(-2em);
  opacity: 0;
}
form:not([data-state="typing"]) .submit-bg {
  -webkit-transform: scale(11);
          transform: scale(11);
}
form:not([data-state="typing"]) .message {
  -webkit-transform: none;
          transform: none;
}

form[data-state="success"] .submit-bg::before,
form[data-state="success"] .message--success {
  opacity: 1;
}

form[data-state="error"] .submit-bg::after,
form[data-state="error"] .message--error {
  opacity: 1;
}
