/* page styles can put a label on the same line as its field; the boxes always go under the label */

.mfa-code-field > label {
  display: block;
  float: none;
  width: auto;
}

.mfa-code {
  position: relative;
  display: flex;
  clear: both;
  width: 100%;
  max-width: 300px;
  margin-top: 6px;
}

.mfa-code .mfa-code-input {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  /* iOS zooms the page when a focused input is under 16px */
  font-size: 16px;
  cursor: text;
}

.mfa-code-box {
  flex: 1 1 0;
  min-width: 0;
  max-width: 44px;
  height: 48px;
  box-sizing: border-box;
  border: 1px solid #ccc;
  border-radius: 4px;
  background-color: #fff;
  color: #333;
  font-size: 20px;
  line-height: 46px;
  text-align: center;
  text-shadow: none;
}

.mfa-code-box + .mfa-code-box {
  margin-left: 6px;
}

.mfa-code-input:focus ~ .mfa-code-box.is-active {
  border-color: #147aea;
  box-shadow: 0 0 0 2px rgba(20, 122, 234, 0.25);
}

/* the real caret is hidden with the input, so the next empty box draws one */
.mfa-code-input:focus ~ .mfa-code-box.is-active:empty::after {
  content: "";
  display: inline-block;
  width: 1px;
  height: 24px;
  vertical-align: middle;
  background-color: #333;
  animation: mfa-code-caret 1s step-end infinite;
}

@keyframes mfa-code-caret {
  50% {
    opacity: 0;
  }
}
