:root {
  --paper: #eef1f4; --surface: #ffffff; --ink: #1b2430; --muted: #5b6573; --line: #d5dae0;
  --danger: #b42318; --ok: #14773b; --brand: #2f5bea; --brand-ink: #ffffff;
  --radius-field: 10px; --radius-slot: 12px;
  --step--1: 0.875rem; --step-0: 1rem; --step-1: 1.25rem; --step-2: 1.6rem; --step-3: 2.1rem;
  color-scheme: light;
  font: 400 var(--step-0)/1.5 ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root { --paper: #0f141a; --surface: #161c24; --ink: #e8edf2; --muted: #9aa5b1; --line: #2a333d; --danger: #f97066; --ok: #47cd89; color-scheme: dark; }
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--paper); color: var(--ink); -webkit-font-smoothing: antialiased; }

/* The door: a column with the tenant's color down its left edge. */
.card {
  min-height: 100dvh; background: var(--surface); padding: 32px 20px 40px 26px;
  border-left: 6px solid var(--brand); display: flex; flex-direction: column; gap: 28px;
}
@media (min-width: 640px) {
  body { padding: 8vh 0 0 12vw; }
  .card { min-height: 0; max-width: 440px; padding: 40px 40px 44px; border-radius: 0 16px 16px 0; }
}
.wordmark { display: flex; align-items: center; gap: 10px; font-weight: 650; font-size: var(--step-0); }
.wordmark img { height: 28px; width: auto; }
h1 { font-size: var(--step-2); line-height: 1.15; font-weight: 700; letter-spacing: -0.015em; margin: 0; }
.sub { color: var(--muted); margin: 6px 0 0; }
form { display: flex; flex-direction: column; gap: 14px; }
label { font-size: var(--step--1); font-weight: 600; }
input[type=email] {
  font: inherit; font-size: 1.0625rem; padding: 13px 14px; border: 1.5px solid var(--line);
  border-radius: var(--radius-field); background: var(--surface); color: var(--ink); width: 100%;
}
input:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 45%, transparent); outline-offset: 2px; }
input[type=email]:focus { border-color: var(--brand); }
button.primary {
  font: inherit; font-weight: 650; padding: 14px 18px; border: 0; border-radius: var(--radius-field);
  background: var(--brand); color: var(--brand-ink); cursor: pointer;
}
button.primary[disabled] { opacity: .6; cursor: progress; }
button.link { font: inherit; font-size: var(--step--1); background: none; border: 0; padding: 0; color: var(--brand); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
button.link[disabled] { color: var(--muted); text-decoration: none; cursor: default; }
.row { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.note { color: var(--muted); font-size: var(--step--1); margin: 0; }
.err { color: var(--danger); font-size: var(--step--1); margin: 0; }
.err:empty, .okmsg:empty { display: none; }
.feedback { display: flex; flex-direction: column; gap: 4px; min-height: 1.4em; margin-top: -14px; }
.okmsg { color: var(--ok); font-size: var(--step--1); margin: 0; }

/* The memorable bit: six keyed slots in the tenant's color. */
.slots { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; max-width: 360px; }
.slots input {
  font-family: inherit; font-size: var(--step-3); font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; text-align: center;
  width: 100%; aspect-ratio: 4 / 5; padding: 0; border: 1.5px solid var(--line); border-radius: var(--radius-slot);
  background: var(--paper); color: var(--ink); caret-color: var(--brand);
  transition: border-color .12s, background-color .12s, transform .12s;
}
.slots input:focus { border-color: var(--brand); background: var(--surface); }
.slots input.filled { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 9%, var(--surface)); }
.slots.wrong input { border-color: var(--danger); animation: shake .28s; }
.slots.right input { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); transform: translateY(-2px); }
.slots.right input:nth-child(2) { transition-delay: 30ms } .slots.right input:nth-child(3) { transition-delay: 60ms }
.slots.right input:nth-child(4) { transition-delay: 90ms } .slots.right input:nth-child(5) { transition-delay: 120ms }
.slots.right input:nth-child(6) { transition-delay: 150ms }
@keyframes shake { 25% { transform: translateX(-4px) } 75% { transform: translateX(4px) } }
@media (prefers-reduced-motion: reduce) { .slots input { transition: none; animation: none !important; transform: none !important; } }

/* Account page */
.devices { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.devices li { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 14px 0; border-bottom: 1px solid var(--line); align-items: center; }
.devices .name { font-weight: 600; }
.devices .meta { grid-column: 1; color: var(--muted); font-size: var(--step--1); }
.devices .badge { display: inline-block; white-space: nowrap; font-size: var(--step--1); font-weight: 600; color: var(--brand); margin-left: 8px; }
.devices button { grid-row: 1 / span 2; grid-column: 2; }
h2 { font-size: var(--step-1); margin: 0 0 4px; }

/* Message pages (expired link, device signed out) */
body.msg .card h1 { font-size: var(--step-1); }

.socials { display: flex; flex-direction: column; gap: 10px; }
a.social { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 0 16px; border-radius: 10px; font-weight: 600; text-decoration: none; border: 1px solid transparent; }
a.social svg { width: 20px; height: 20px; flex: none; }
a.social.google { background: #fff; color: #1f1f1f; border-color: #747775; }
a.social.apple { background: #000; color: #fff; }
a.social.facebook { background: #1877f2; color: #fff; }
a.social:hover { filter: brightness(.96); }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: var(--step--1); margin: 0; }
.divider::before, .divider::after { content: ''; flex: 1; border-top: 1px solid color-mix(in srgb, var(--muted) 35%, transparent); }
