/* The page shell of dalu-id's server-rendered pages (spec 001 D7, §4.2): a header with the
   neutral "dalu account" name (no product branding: both products send people here), one
   centred card for the page's content, and the keyboard-focus treatment. Uses only the theme's
   tokens (theme.css). dalu-id's own: no upstream. */

.shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.shell-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--color-line);
  background: var(--color-surface);
  padding: 0.75rem 1.5rem;
}

.shell-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.875rem;
}

.shell-name {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--color-ink);
}

.shell-main {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 3rem 1rem;
}

.shell-card {
  width: 100%;
  max-width: 26rem;
  background: var(--color-card);
  border: 1px solid var(--color-line);
  border-radius: 6px;
  padding: 2rem;
}

.shell-card-wide {
  max-width: 60rem;
}

.shell-card h1 {
  font-size: 1.25rem;
  font-weight: 500;
  margin: 0 0 1rem;
}

.shell-card h2 {
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-ink2);
  margin: 2rem 0 0.75rem;
}

a {
  color: var(--color-blue);
}

.lead {
  color: var(--color-ink2);
  margin: 0 0 1rem;
}

.aside {
  font-size: 0.875rem;
  color: var(--color-ink2);
}

.notice,
.error {
  border-left: 3px solid var(--color-green);
  background: var(--color-surface);
  padding: 0.5rem 0.75rem;
  margin: 0 0 1rem;
}

.error {
  border-left-color: var(--color-red);
}

/* Forms: .stack puts fields under each other, .row beside each other. */
form.stack {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  max-width: 26rem;
}

form.row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem;
  margin: 0.75rem 0;
}

form.inline {
  display: inline;
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.875rem;
  color: var(--color-ink2);
}

input {
  font: inherit;
  color: var(--color-ink);
  background: var(--color-bg);
  border: 1px solid var(--color-line-strong);
  border-radius: 4px;
  padding: 0.5rem 0.625rem;
}

button {
  font: inherit;
  font-weight: 500;
  color: var(--color-bg);
  background: var(--color-ink);
  border: 1px solid var(--color-ink);
  border-radius: 4px;
  padding: 0.5rem 1rem;
  cursor: pointer;
}

button.secondary {
  color: var(--color-ink);
  background: transparent;
}

button.link {
  color: var(--color-blue);
  background: none;
  border: none;
  padding: 0;
  font-weight: 400;
}

button.danger {
  color: var(--color-red);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 0.5rem 0.5rem 0.5rem 0;
  border-bottom: 1px solid var(--color-line);
}

th {
  font-weight: 500;
  color: var(--color-ink2);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.75rem;
}

td.ua,
td.detail {
  word-break: break-word;
}

td.nowrap {
  white-space: nowrap;
}

.tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--color-ink2);
  border: 1px solid var(--color-line-strong);
  border-radius: 3px;
  padding: 0 0.25rem;
}

code {
  font-family: var(--font-mono);
}

.secret {
  background: var(--color-surface);
  border: 1px solid var(--color-line-strong);
  border-radius: 4px;
  padding: 0.75rem;
  word-break: break-all;
}

.shell-footer {
  padding: 1rem 1.5rem;
  font-size: 0.75rem;
  color: var(--color-ink2);
}

/* One keyboard-focus treatment for every control (as dalubank's .focus-ring, spec 81b §8a). */
:focus-visible {
  outline: 2px solid var(--color-ink);
  outline-offset: 2px;
}

/* Two-factor (P3): the enrolment steps, the QR code on a light tile (scanners need the
   contrast in either theme), the recovery codes. */
ol.steps {
  padding-left: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.qr {
  display: inline-block;
  margin: 0.75rem 0 0.25rem;
  background: #ffffff;
  border-radius: 4px;
  line-height: 0;
}

code.key {
  word-spacing: 0.25em;
}

ul.codes {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  font-size: 0.9375rem;
}

a.button {
  display: inline-block;
  font-weight: 500;
  color: var(--color-bg);
  background: var(--color-ink);
  border-radius: 4px;
  padding: 0.5rem 1rem;
  text-decoration: none;
}
