/*
 * Pages without the menu (PRD-0023 T14): views/layouts/plain.php. Sign-in, two-step, choosing a
 * password, and the error pages: one card in the middle of the page, on the library's tokens, so
 * it follows the person's theme and mode.
 */
.be-plain-main {
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100dvh;
  box-sizing: border-box;
  padding: var(--tru-space-8) var(--tru-space-4);
}

.be-plain-card {
  box-sizing: border-box;
  /* A long username or address breaks instead of making the page scroll sideways. */
  overflow-wrap: anywhere;
  width: 100%;
  max-width: 400px;
  padding: var(--tru-space-8);
  background: var(--tru-surface-card);
  border: 1px solid var(--tru-border);
  border-radius: var(--tru-radius-lg);
  box-shadow: var(--tru-shadow-card);
}

.be-plain-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--tru-space-1);
  margin-bottom: var(--tru-space-6);
}

.be-plain-context {
  font: var(--tru-type-label);
  color: var(--tru-text-muted);
}

.be-plain-card h1 {
  text-align: center;
}

/* One short line under the heading. */
.be-plain-lead {
  margin-top: var(--tru-space-2);
  text-align: center;
  color: var(--tru-text-secondary);
}

/* The page's parts, one under another: the message, the form, the links. */
.be-plain-body {
  display: grid;
  gap: var(--tru-space-5);
  margin-top: var(--tru-space-6);
}

.be-plain-form {
  display: grid;
  gap: var(--tru-space-4);
}

/* Full-width buttons. In a narrow window a long label ("Sign in with Microsoft 365") wraps,
   and the button grows, instead of running out of the card. */
.be-plain-form .tru-button,
.be-plain-body > .tru-button {
  width: 100%;
  justify-content: center;
  height: auto;
  min-height: 36px;
  padding-block: var(--tru-space-2);
  white-space: normal;
  text-align: center;
}

.be-plain-actions .tru-button {
  height: auto;
  min-height: 36px;
  padding-block: var(--tru-space-2);
  white-space: normal;
  text-align: center;
}

/* The two-step code: large digits, spaced, in the middle. */
.be-plain-code {
  font-size: 1.5rem;
  letter-spacing: 0.3em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.be-plain-card .tru-input.be-plain-code {
  height: 48px;
}

/* "or", between the Microsoft 365 button and the form. */
.be-plain-or {
  display: flex;
  align-items: center;
  gap: var(--tru-space-4);
  font: var(--tru-type-label);
  color: var(--tru-text-secondary);
}
.be-plain-or::before,
.be-plain-or::after {
  content: '';
  flex: 1;
  border-top: 1px solid var(--tru-border);
}

/* The Microsoft logo keeps its own four colours. */
.be-plain-ms {
  flex: none;
}

.be-plain-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--tru-space-2) var(--tru-space-4);
  font: var(--tru-type-label);
}

/* An error page's number: large, above its heading. */
.be-plain-status {
  font: var(--tru-type-value);
  color: var(--tru-text-secondary);
  text-align: center;
}

.be-plain-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--tru-space-2);
}

/* Recovery codes (PRD-0024): two columns of codes, easy to copy and read aloud. */
.be-recovery-codes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--tru-space-2) var(--tru-space-4);
  margin: 0;
  padding: 0;
  list-style: none;
}

.be-recovery-code {
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 1rem;
  letter-spacing: 0.05em;
}

/* The set-up page (PRD-0024): the QR code keeps a white quiet zone in dark mode, so phones can read it. */
.be-setup-qr-box {
  display: flex;
  justify-content: center;
}

.be-setup-qr {
  box-sizing: content-box;
  width: 200px;
  height: 200px;
  padding: var(--tru-space-2);
  background: white;
  border: 1px solid var(--tru-border);
  border-radius: var(--tru-radius-md);
}

.be-setup-key {
  display: grid;
  gap: var(--tru-space-1);
  margin: var(--tru-space-3) 0 0;
}

.be-setup-key dt {
  font: var(--tru-type-label);
  font-weight: 600;
  color: var(--tru-text-secondary);
}

.be-setup-key dd {
  margin: 0 0 var(--tru-space-2);
}

.be-setup-key code {
  display: block;
  padding: var(--tru-space-2) var(--tru-space-3);
  background: var(--tru-surface-sunken);
  border-radius: var(--tru-radius-sm);
  color: var(--tru-text-strong);
  word-break: break-all;
}

@media (max-width: 479.98px) {
  .be-plain-main {
    place-items: start center;
    padding: var(--tru-space-4);
  }
  .be-plain-card {
    padding: var(--tru-space-6) var(--tru-space-5);
  }
}

/* What went wrong with a passkey in the browser (PRD-0024; /ui/js/app/passkeys.js fills it). */
.be-passkey-error {
  color: var(--tru-danger-text);
  font-weight: 600;
}
