/* Account pages (sign in, sign up, password reset, email verification) on Material 3 tokens. */

.auth-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100dvh - 11rem);
  padding-block: 16px;
}

.auth-card {
  width: 100%;
  max-width: 448px;
  padding: 32px 24px;
  border-radius: var(--md-sys-shape-corner-extra-large);
  background: var(--md-sys-color-surface-container-low);
  color: var(--md-sys-color-on-surface);
}
@media (min-width: 600px) {
  .auth-card { padding: 40px; }
}

.auth-header { margin-block-end: 24px; text-align: center; }
.auth-logo {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  border-radius: var(--md-sys-shape-corner-large);
}
.auth-title {
  margin: 0;
  font: var(--md-sys-typescale-headline-small-weight) var(--md-sys-typescale-headline-small-size) / var(--md-sys-typescale-headline-small-line-height) var(--md-sys-typescale-headline-small-font);
}
.auth-subtitle {
  margin: 8px 0 0;
  color: var(--md-sys-color-on-surface-variant);
  font: var(--md-sys-typescale-body-medium-weight) var(--md-sys-typescale-body-medium-size) / var(--md-sys-typescale-body-medium-line-height) var(--md-sys-typescale-body-medium-font);
}
.auth-subtitle strong { color: var(--md-sys-color-on-surface); font-weight: 500; }

.auth-tabs { margin-block-end: 24px; background: transparent; }
.auth-tabs .md-tabs__tab { flex: 1; }

.auth-social { display: grid; gap: 8px; }
.auth-social-button { width: 100%; gap: 12px; }
.auth-social-icon { width: 18px; height: 18px; flex: none; }
.auth-social-mark {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: var(--md-sys-shape-corner-full);
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
  font: var(--md-sys-typescale-label-small-weight) var(--md-sys-typescale-label-small-size) / 1 var(--md-sys-typescale-label-small-font);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-block: 20px;
  color: var(--md-sys-color-on-surface-variant);
  font: var(--md-sys-typescale-label-medium-weight) var(--md-sys-typescale-label-medium-size) / var(--md-sys-typescale-label-medium-line-height) var(--md-sys-typescale-label-medium-font);
}
.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--md-sys-color-outline-variant);
}

.auth-form { display: grid; gap: 16px; }
.auth-form .md-field { --md-field-label-bg: var(--md-sys-color-surface-container-low); }
.auth-submit { width: 100%; }
.auth-link { justify-self: center; }
.auth-state-card { display: grid; gap: 16px; }
.auth-state-card .auth-subtitle { margin: 0; }
.auth-actions { display: grid; gap: 8px; margin-block-start: 16px; }
.auth-note { margin-block-start: 16px; text-align: center; }

/* Password field: the show/hide icon button sits inside the field box. */
.auth-password-field .md-field__box { padding-inline-end: 4px; }
.auth-password-toggle { flex: none; align-self: center; margin-inline-end: 4px; }
/* Floating labels sit on the card's colour, not the page's. */
.auth-card .md-field { --md-field-label-bg: var(--md-sys-color-surface-container-low); }

.md-notice p { margin: 0; }
.auth-notice { margin-block-end: 8px; }

/* Staff two-step sign-in: numbered steps, QR picture, key, recovery codes. */
.auth-steps {
  counter-reset: auth-step;
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  display: grid;
  gap: 12px;
  color: var(--md-sys-color-on-surface);
  font: var(--md-sys-typescale-body-medium-weight) var(--md-sys-typescale-body-medium-size) / var(--md-sys-typescale-body-medium-line-height) var(--md-sys-typescale-body-medium-font);
}
.auth-steps[start="3"] { counter-reset: auth-step 2; }
.auth-steps li { counter-increment: auth-step; display: grid; grid-template-columns: 24px 1fr; gap: 12px; align-items: start; }
.auth-steps li::before {
  content: counter(auth-step);
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: var(--md-sys-shape-corner-full);
  background: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
  font-size: 0.8125rem;
  font-weight: 600;
}
.auth-qr { display: flex; justify-content: center; margin-block: 4px 16px; }
.auth-qr svg { width: 184px; height: 184px; padding: 8px; background: #fff; border-radius: var(--md-sys-shape-corner-medium); border: 1px solid var(--md-sys-color-outline-variant); }
.auth-secret-box { display: grid; justify-items: center; gap: 8px; margin-block-end: 20px; text-align: center; }
.auth-secret-box .auth-subtitle { margin: 0; }
.auth-secret {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--md-sys-shape-corner-small);
  background: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-on-surface);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9375rem;
  letter-spacing: 0.08em;
  word-break: break-all;
}
.auth-recovery-codes { list-style: none; margin: 0 0 12px; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.auth-recovery-codes code {
  display: block;
  padding: 8px;
  text-align: center;
  border-radius: var(--md-sys-shape-corner-small);
  background: var(--md-sys-color-surface-container-high);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9375rem;
}
.auth-code-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-block-end: 16px; }
.auth-code-actions .md-button { width: 100%; }
.auth-notice + .auth-subtitle { margin-block: 4px 16px; text-align: center; }

/* Front-page look: a flat ruled column with a serif title, like the home page
   and story pages, instead of a rounded tonal card. */
.auth-wrapper { align-items: flex-start; padding-block: 48px 64px; }
.auth-card {
  padding: 24px 0 0;
  border-radius: 0;
  border-top: 2px solid var(--md-sys-color-on-surface);
  background: transparent;
}
@media (min-width: 600px) {
  .auth-card { padding: 28px 0 0; }
}
.auth-header { text-align: start; }
.auth-logo { display: none; }
.auth-title {
  font-family: var(--md-ref-typeface-brand);
  font-size: 2rem;
  line-height: 1.15;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.auth-card .md-field { --md-field-label-bg: var(--md-sys-color-surface); }
.auth-note { text-align: start; }
