body.identity-auth-page {
  min-height: 100vh;
  margin: 0;
  display: grid;
  place-items: center;
  padding:
    max(22px, var(--safe-area-top))
    max(16px, var(--safe-area-right))
    max(22px, var(--safe-area-bottom))
    max(16px, var(--safe-area-left));
  background: #faf8f4;
}

.identity-auth-shell {
  width: min(440px, 100%);
}

.identity-auth-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--accent-dark);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.identity-auth-brand img {
  width: 30px;
  height: 30px;
  border-radius: 7px;
}

.identity-auth-card {
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fffdf9;
  box-shadow: 0 12px 30px rgba(17, 24, 39, 0.06);
}

.identity-auth-card,
.identity-auth-panel,
.identity-auth-heading,
.identity-auth-form,
.identity-auth-step {
  display: grid;
  gap: 14px;
}

.identity-auth-heading { gap: 6px; }

.identity-auth-heading h1,
.identity-auth-step h2 {
  margin: 0;
  color: var(--ink);
}

.identity-auth-heading h1 { font-size: 27px; }
.identity-auth-step h2 { font-size: 19px; }

.identity-auth-heading p,
.identity-auth-step p,
.identity-auth-helper {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.identity-auth-helper { font-size: 12px; }

.identity-auth-form label {
  display: grid;
  gap: 6px;
  margin: 0;
  color: var(--ink);
}

.identity-auth-form button,
.identity-auth-form .nav-link {
  width: 100%;
  text-align: center;
}

.identity-auth-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.identity-auth-divider::before,
.identity-auth-divider::after {
  content: "";
  height: 1px;
  background: var(--line);
}

.identity-auth-link-button {
  width: auto !important;
  min-height: 0;
  justify-self: center;
  padding: 4px;
  border: 0;
  color: var(--accent-dark);
  background: transparent;
  font-size: 13px;
}

.identity-auth-link-button:hover {
  color: var(--ink);
  background: transparent;
}

.identity-auth-step {
  padding-top: 4px;
}

.invite-details {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbf7f0;
}

.invite-details-heading {
  display: grid;
  gap: 5px;
}

.identity-auth-back {
  width: auto !important;
  justify-self: start;
}

.totp-setup-grid {
  display: grid;
  grid-template-columns: 176px 1fr;
  align-items: start;
  gap: 16px;
}

.totp-qr {
  width: 176px;
  min-height: 176px;
  display: grid;
  place-items: center;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.totp-qr img,
.totp-qr canvas {
  display: block;
  width: 160px !important;
  height: 160px !important;
}

.totp-key {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.totp-key code {
  display: block;
  padding: 10px;
  border-radius: 7px;
  background: #f3eee6;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  user-select: all;
}

.totp-key span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.totp-code {
  text-align: center;
  font-size: 22px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.22em;
}

.identity-auth-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.identity-auth-card .status:empty { display: none; }

@media (max-width: 520px) {
  body.identity-auth-page {
    place-items: start center;
    padding-top: calc(14px + var(--safe-area-top));
  }

  .identity-auth-card { padding: 21px 18px; }
  .identity-auth-heading h1 { font-size: 25px; }
  .totp-setup-grid { grid-template-columns: 1fr; }
  .totp-qr { justify-self: center; }
}

[hidden] { display: none !important; }
