:root {
  --ink: #0f172a;
  --muted: #64748b;
  --card: #ffffff;
  --field: #f1f5f9;
  --line: #e2e8f0;
  --accent: #4f46e5;
  --accent-ink: #ffffff;
  --danger: #dc2626;
  --shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e2e8f0;
    --muted: #94a3b8;
    --card: #111827;
    --field: #1f2937;
    --line: #334155;
    --accent: #818cf8;
    --accent-ink: #0b1020;
    --danger: #f87171;
    --shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-height: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: linear-gradient(135deg, #4338ca 0%, #0ea5e9 100%);
  background-attachment: fixed;
}
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  color: #fff;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.01em;
  color: #fff;
  text-decoration: none;
}
.brandMark {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: #fff;
  box-shadow: inset 0 0 0 6px rgba(79, 70, 229, 0.9);
}
.picker { display: flex; align-items: center; gap: 8px; }
.picker label { font-size: 0.85rem; opacity: 0.85; }
.picker select {
  appearance: none;
  min-width: 160px;
  padding: 9px 36px 9px 14px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 999px;
  color: #fff;
  font: inherit;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.16)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='white' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E")
    no-repeat right 14px center;
  cursor: pointer;
}
.picker select option { color: #0f172a; }
.stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 16px 16px 48px;
}
.card {
  width: min(440px, 100%);
  padding: 32px 28px 28px;
  border-radius: 22px;
  background: var(--card);
  box-shadow: var(--shadow);
  text-align: center;
}
.appBadge {
  width: 64px;
  height: 64px;
  margin: -64px auto 14px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--accent-ink);
  background: var(--accent);
  border: 4px solid var(--card);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.25);
}
h1 { margin: 0 0 6px; font-size: 1.5rem; line-height: 1.25; overflow-wrap: anywhere; }
h2 { margin: 0 0 8px; font-size: 1.25rem; }
h3 { margin: 22px 0 8px; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.sectionTitle { margin: 22px 0 8px; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.subtitle, .muted { color: var(--muted); font-size: 0.92rem; line-height: 1.45; }
.subtitle { margin: 0 0 22px; }
p { line-height: 1.5; }
.srOnly { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

button, .button {
  display: inline-block;
  padding: 12px 18px;
  border: 1px solid transparent;
  border-radius: 12px;
  font: inherit;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.05s ease, filter 0.15s ease;
}
button:hover:not(:disabled), .button:hover { filter: brightness(1.06); }
button:active:not(:disabled) { transform: translateY(1px); }
button:disabled { opacity: 0.5; cursor: not-allowed; }
button:focus-visible, .button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}
.primary { width: 100%; color: var(--accent-ink); background: var(--accent); }
.secondary { color: var(--ink); background: var(--field); border-color: var(--line); }
.danger { color: #fff; background: var(--danger); }
.inactive { background: var(--danger); color: #fff; }
.link { padding: 0; border: 0; background: none; color: var(--accent); text-decoration: underline; }
.column { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.column > * { width: 100%; }
.row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.row > button { flex: 1 1 140px; }

label { display: block; margin: 12px 0 6px; font-size: 0.85rem; font-weight: 600; text-align: left; }
input[type="text"], input[type="email"], textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font: inherit;
  color: var(--ink);
  background: var(--field);
}
textarea { font-size: 0.75rem; word-break: break-all; resize: vertical; }
#autofillRow { margin: 14px 0 4px; }
.sheet button + label, .sheet textarea + button, .sheet input + button { margin-top: 10px; }

.claims {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 8px 14px;
  margin: 0 0 20px;
  padding: 14px;
  border-radius: 14px;
  background: var(--field);
  text-align: left;
  font-size: 0.85rem;
}
.claims dt { color: var(--muted); }
.claims dd { margin: 0; overflow-wrap: anywhere; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.chip {
  padding: 7px 14px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 999px;
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  font-size: 0.85rem;
}
.chip.current { color: #0f172a; background: #fff; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(3px);
}
.modal.active { display: flex; }
.sheet {
  position: relative;
  width: min(420px, 100%);
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 26px 24px 24px;
  border-radius: 20px;
  background: var(--card);
  box-shadow: var(--shadow);
}
.sheet.wide { width: min(560px, 100%); }
.close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  padding: 0;
  font-size: 1.4rem;
  line-height: 1;
  color: var(--muted);
  background: none;
}
.error {
  display: none;
  margin: 12px 0;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 12%, transparent);
  font-size: 0.9rem;
  text-align: left;
  overflow-wrap: anywhere;
}
.error.active { display: block; }

.colorPickerCard {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  font-weight: 400;
  cursor: pointer;
}
.colorPickerSwatch { width: 44px; height: 44px; border-radius: 12px; background: #3a7bd5; flex: none; }
.colorPickerCard input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }

#registerStatus, #unregisterStatus { margin: 0 0 6px; }
#contentContainer p { overflow-wrap: anywhere; }

.passkeyList { margin: 0 0 10px; padding: 0; list-style: none; text-align: left; }
.passkeyList li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 0.9rem; }
.passkeyList li button, .passkeyNotice button, .passkeyAdd { padding: 6px 12px; margin-left: auto; color: var(--ink); background: var(--field); border-color: var(--line); font-size: 0.85rem; }
.passkeyAdd { margin: 6px 0 0; }
.passkeyNotice { margin: 0 0 10px; padding: 12px; border-radius: 12px; background: color-mix(in srgb, var(--danger) 12%, transparent); font-size: 0.9rem; text-align: left; }
.passkeyNudge, .passkeyError { margin: 8px 0; color: var(--muted); font-size: 0.85rem; text-align: left; }
.passkeyError { color: var(--danger); }

.devTools { margin-top: 22px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; }
.devTools summary { cursor: pointer; font-weight: 600; font-size: 0.9rem; color: var(--muted); }
