/* The email sign-in and code-entry screens. */

.auth {
  display: grid;
  gap: 18px;
  margin-top: 36px;
}

.auth__title {
  margin: 0;
  font-size: var(--type-page);
  font-weight: 700;
  line-height: 1.3;
  text-wrap: balance;
}

.auth__lede {
  margin: 6px 0 0;
  color: var(--ink-soft);
  font-size: .8125rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.auth__form {
  display: grid;
  gap: 14px;
}

.field {
  display: grid;
  gap: 6px;
}

.field__label {
  color: var(--ink-soft);
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

:lang(ja) .field__label {
  letter-spacing: 0.04em;
  text-transform: none;
}

.field__input {
  width: 100%;
  min-height: 46px;
  padding: 11px 12px;
  border: 1px solid var(--control-edge);
  border-radius: var(--radius-control);
  outline: 0;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 1rem; /* Stops iOS zoom-on-focus. */
}

.field__input::placeholder {
  color: var(--text-placeholder);
}

.field__input:focus {
  border-color: var(--accent);
  background: var(--raised);
}

.field__input[aria-invalid="true"],
.field__input[aria-invalid="true"]:focus {
  border-color: var(--grade-c);
}

.field__error {
  margin: 0;
  color: var(--grade-c);
  font-size: .75rem;
  line-height: 1.45;
}

/* The indent matches the tracking, so the trailing space after the last digit
   doesn't pull the code off centre. */
.field__input--code {
  padding: 10px 12px;
  font-size: clamp(1.75rem, 7.5vw, 1.875rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.24em;
  text-align: center;
  text-indent: 0.24em;
}

.field__input--code::placeholder {
  letter-spacing: 0.24em;
}

/* Em queries follow the reader's text size, so enlarged text or a narrow
   viewport tightens the tracking until the whole code fits. */
@media (max-width: 14.5em) {
  .field__input--code,
  .field__input--code::placeholder {
    letter-spacing: 0.06em;
    text-indent: 0.06em;
  }
}

.auth__secondary {
  justify-self: center;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.auth__secondary:hover {
  color: var(--ink-soft);
}
