:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #0b1018;
  color: #edf4ff;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  min-height: 100vh;
  margin: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 20% 10%, rgba(45, 111, 255, 0.2), transparent 38%),
    #0b1018;
}

.card {
  width: min(100%, 560px);
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  overflow: auto;
  padding: 32px;
  border: 1px solid #26364e;
  border-radius: 18px;
  background: #111a27;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.36);
}

.eyebrow {
  margin: 0 0 8px;
  color: #82a9ff;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(1.55rem, 5vw, 2rem);
  line-height: 1.12;
}

h2 {
  margin: 24px 0 0;
  font-size: 1.15rem;
}

.intro {
  margin: 10px 0 26px;
  color: #aebbd0;
  line-height: 1.5;
}

form {
  display: grid;
  gap: 10px;
}

fieldset {
  min-width: 0;
  display: grid;
  gap: 10px;
  margin: 12px 0 0;
  padding: 18px;
  border: 1px solid #31445f;
  border-radius: 12px;
}

legend {
  padding: 0 7px;
  color: #dce8fb;
  font-weight: 750;
}

label {
  margin-top: 8px;
  font-weight: 650;
}

input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #3a4b65;
  border-radius: 10px;
  background: #0c1420;
  color: inherit;
  font: inherit;
}

input:focus {
  border-color: #79a4ff;
  outline: 3px solid rgba(75, 126, 238, 0.26);
}

button {
  margin-top: 14px;
  padding: 12px 16px;
  border: 0;
  border-radius: 10px;
  background: #5688f5;
  color: #fff;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

button.secondary {
  margin-top: 2px;
  background: transparent;
  color: #b8c9e7;
}

.status {
  min-height: 1.4em;
  margin: 18px 0 0;
  color: #ffb7b7;
}

.status.success {
  color: #91dfad;
}

.status.pending {
  color: #ffd58f;
}

.enrollment-summary {
  display: grid;
  gap: 8px;
  margin: 18px 0 4px;
  padding: 14px;
  border: 1px solid #26364e;
  border-radius: 10px;
  background: #0c1420;
}

.enrollment-summary > div {
  display: grid;
  grid-template-columns: minmax(112px, auto) minmax(0, 1fr);
  gap: 12px;
}

.enrollment-summary dt {
  color: #aebbd0;
  font-size: 0.82rem;
  font-weight: 700;
}

.enrollment-summary dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.setup-copy,
.recovery-panel p,
fieldset small,
details {
  color: #aebbd0;
  line-height: 1.45;
}

.setup-copy {
  margin: 0;
}

.enrollment-qr {
  width: min(100%, 286px);
  margin: 4px auto;
  padding: 10px;
  border-radius: 10px;
  background: #fff;
}

.enrollment-qr-svg {
  display: block;
  width: 100%;
  height: auto;
}

details {
  padding: 10px 0 2px;
}

summary {
  color: #c7d8f4;
  cursor: pointer;
  font-weight: 700;
}

.enrollment-secret {
  display: block;
  padding: 10px;
  border-radius: 8px;
  background: #070d15;
  color: #edf4ff;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  overflow-wrap: anywhere;
  user-select: all;
}

.recovery-panel {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid #3b5e4c;
  border-radius: 12px;
  background: #101f1a;
}

.recovery-panel h2 {
  margin-top: 0;
}

.recovery-codes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 24px;
  margin: 18px 0;
  padding-left: 28px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

@media (max-width: 520px) {
  body {
    align-items: start;
    padding: 12px;
  }

  .card {
    max-height: calc(100dvh - 24px);
    padding: 22px 18px;
  }

  .enrollment-summary > div,
  .recovery-codes {
    grid-template-columns: minmax(0, 1fr);
  }

  .enrollment-summary > div {
    gap: 2px;
  }
}
