/* Sign-in pages (T1.3): docs/design/website/project/SignIn-Email-* and
   SignIn-Code-*. Tokens and shared components live in app.css. */

.auth-back {
  align-self: flex-start;
}

.auth-card {
  align-self: center;
  width: 100%;
  max-width: 440px;
  margin-top: 24px;
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  background: var(--pc-surface);
  border-radius: 24px;
  box-shadow: var(--pc-shadow);
}

.auth-card__icon {
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--pc-radius-pill);
  background: var(--pc-chip-bg);
  color: var(--pc-primary);
}

.auth-card__head {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.auth-card__head h1 {
  margin: 0;
  font-weight: 900;
  font-size: 26px;
  line-height: 1.2;
}

.auth-card__head p {
  font-weight: 500;
  font-size: 16px;
  line-height: 1.45;
  color: var(--pc-text-2);
}

.auth-card__head strong {
  font-weight: 800;
  color: var(--pc-text);
}

/* "Sign in as <email>": long addresses must wrap. */
.auth-card__title--wrap {
  overflow-wrap: anywhere;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.auth-consent {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.auth-consent a {
  color: var(--pc-primary);
  font-weight: 700;
}

.auth-consent--error .check input {
  outline: 2px solid var(--pc-danger);
  outline-offset: 2px;
}

/* Code page help: expiry and spam-folder hint. */
.auth-hints {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-weight: 500;
  font-size: 14px;
  line-height: 1.45;
  color: var(--pc-text-2);
}

.auth-card__links {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.auth-resend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  font-weight: 500;
  font-size: 15px;
  color: var(--pc-text-2);
}

.auth-link-button {
  min-height: var(--pc-target);
  padding: 0 4px;
  border: 0;
  background: transparent;
  font: inherit;
  font-weight: 800;
  color: var(--pc-primary);
  cursor: pointer;
}

.auth-link-button:hover {
  text-decoration: underline;
}

/* Code field (plan G9): one <input maxlength="6"> drawn over six cells, so
   paste and OS autofill work without JS. Tabular digits are 1ch wide; the
   letter-spacing makes each digit advance one cell pitch. */
.code-input {
  --cell: 52px;
  --cell-gap: 8px;
  --cell-height: 60px;
  position: relative;
  width: calc(6 * var(--cell) + 5 * var(--cell-gap));
  height: var(--cell-height);
  overflow: hidden;
  /* clip, not hidden: a hidden box can still be scrolled, and the browser
     scrolls it to show the caret after the 6th digit (cells shift left). */
  overflow: clip;
}

.code-input__cells {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(6, var(--cell));
  gap: var(--cell-gap);
  pointer-events: none;
}

.code-input__cells span {
  border: 1.5px solid var(--pc-border);
  border-radius: var(--pc-radius-sm);
  background: var(--pc-surface);
}

.code-input:focus-within .code-input__cells span {
  border: 2px solid var(--pc-primary);
}

.field--error .code-input__cells span {
  border-color: var(--pc-danger);
}

.code-input__control {
  position: relative;
  /* One extra pitch: the letter-spacing after the 6th digit must not
     scroll the text. The overflow is clipped by .code-input. */
  width: calc(7 * var(--cell) + 6 * var(--cell-gap));
  height: 100%;
  margin: 0;
  padding: 0 0 0 calc((var(--cell) - 1ch) / 2);
  border: 0;
  background: transparent;
  font-weight: 900;
  font-size: 24px;
  font-variant-numeric: tabular-nums;
  letter-spacing: calc(var(--cell) + var(--cell-gap) - 1ch);
  color: var(--pc-text);
  caret-color: var(--pc-primary);
}

.code-input__control:focus,
.code-input__control:focus-visible {
  outline: none;
  box-shadow: none;
}

@media (max-width: 719px) {
  .auth-card {
    margin-top: 0;
    padding: 24px;
    gap: 16px;
  }

  .auth-card__icon {
    width: 56px;
    height: 56px;
  }

  .code-input {
    --cell: 44px;
    --cell-gap: 6px;
    --cell-height: 56px;
  }
}
