/* CodeBoxes (built here): a code typed one digit a box, large, set in a row as wide as the field. Without JavaScript the
   single field shows, large and spaced as a code reads; with it the script makes it a hidden field. The error turns the
   boxes red. Tokens only. */
.wi-code-boxes__single {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  padding: var(--wi-field-padding-block, var(--space-3)) var(--wi-field-padding-inline, var(--space-4));
  font: inherit;
  font-size: var(--font-size-2xl);
  font-variant-numeric: tabular-nums;
  letter-spacing: var(--space-2);
  text-align: center;
  color: var(--text-primary);
  background: var(--background-surface);
  border: var(--border-1) solid var(--border-default);
  border-radius: var(--wi-field-radius, var(--radius-full));
}
.wi-code-boxes__single:focus-visible {
  outline: none;
  border-color: var(--wi-field-focus-border, var(--border-strong));
  box-shadow: var(--wi-field-focus-shadow, var(--focus-ring));
}
.wi-code-boxes__boxes {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: var(--space-2);
  max-width: 26.25rem;
}
.wi-code-boxes__boxes[hidden] {
  display: none;
}
.wi-code-boxes__box {
  box-sizing: border-box;
  width: 100%;
  aspect-ratio: 1 / 1.15;
  max-height: 4.5rem;
  padding: 0;
  font: inherit;
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-semibold);
  font-variant-numeric: tabular-nums;
  text-align: center;
  color: var(--text-primary);
  background: var(--background-surface);
  border: var(--border-2) solid var(--border-default);
  border-radius: var(--radius-xl);
  caret-color: var(--brand-secondary-bg);
}
.wi-code-boxes__box:hover {
  border-color: var(--border-strong);
}
.wi-code-boxes__box:not(:placeholder-shown) {
  border-color: var(--blue-gray-400);
}
/* A box's border is already 2px: its focus is that border in the field's focus colour, a filled box's too, with the
   halo but no inset line on top. */
.wi-code-boxes__box:focus {
  outline: none;
  border-color: var(--wi-field-focus-border, var(--brand-secondary-bg));
  box-shadow: var(--wi-field-focus-halo, var(--focus-ring));
}
.wi-field--error .wi-code-boxes__box {
  border-color: var(--red-300);
  background: var(--feedback-error-bg);
}
.wi-field--error .wi-code-boxes__box:focus {
  border-color: var(--wi-field-error-border, var(--feedback-error-border));
  box-shadow: var(--wi-field-error-focus-halo, var(--focus-ring-danger));
}
.wi-field--error .wi-code-boxes__single {
  border-color: var(--wi-field-error-border, var(--feedback-error-border));
}
.wi-field--error .wi-code-boxes__single:focus-visible {
  box-shadow: var(--wi-field-error-focus-shadow, var(--focus-ring-danger));
}
