:host {
  all: initial;
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  display: block;
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
}
* {
  box-sizing: border-box;
}
.backdrop {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  padding: 12px;
  background: rgba(2, 12, 20, 0.78);
  backdrop-filter: blur(9px);
}
.card {
  width: min(100%, 480px);
  margin: auto;
  flex: none;
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
  padding: 24px;
  border: 1px solid #55756d;
  border-radius: 20px;
  background: #10232d;
  color: #f1fbf8;
  box-shadow:
    0 30px 85px #0009,
    0 0 0 1px #9df6db12 inset;
}
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  color: #8af0d2;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
}
.close {
  width: 35px;
  height: 35px;
  border: 1px solid #56736e;
  border-radius: 9px;
  background: transparent;
  color: #d4eae5;
  font: inherit;
  font-size: 24px;
  cursor: pointer;
}
.close:hover,
.retry:hover {
  background: #24434b;
}
.phase {
  margin: 19px 0 6px;
  color: #8af0d2;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
}
h2 {
  margin: 0;
  font-size: 27px;
  line-height: 1.2;
  letter-spacing: -0.035em;
}
.status {
  min-height: 40px;
  margin: 13px 0 18px;
  color: #b7d0d0;
  font-size: 14px;
  line-height: 1.45;
}
.qr-card {
  position: relative;
  display: grid;
  place-items: center;
  padding: 12px;
  border-radius: 16px;
  background: #f9fffd;
  overflow: hidden;
}
.qr-card[hidden],
.retry[hidden],
.qr-overlay[hidden],
.qr-refresh[hidden] {
  display: none;
}
.qr {
  display: grid;
  place-items: center;
  width: 100%;
  transition:
    filter 220ms ease,
    opacity 220ms ease;
}
.qr-card:not([data-state='scan']) .qr {
  filter: blur(7px);
  opacity: 0.34;
}
.qr-overlay {
  --accent: #7af0ce;
  position: absolute;
  inset: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 18px;
  border: 1px solid #8ff6d02d;
  border-radius: 12px;
  background: linear-gradient(145deg, #0b2430ed, #0b1e28df);
  box-shadow:
    0 14px 42px #06141ab8,
    inset 0 1px #ffffff14;
  color: #f4fffb;
  text-align: center;
  animation: qr-enter 180ms ease-out both;
}
.qr-card[data-state='expired'] .qr-overlay {
  --accent: #f5c969;
  border-color: #f5c96938;
}
.qr-card[data-state='failed'] .qr-overlay {
  --accent: #ff858c;
  border-color: #ff858c38;
}
.qr-card[data-state='success'] .qr-overlay {
  --accent: #73e0a0;
  border-color: #73e0a047;
}
.qr-orb {
  display: grid;
  place-items: center;
  width: 70px;
  height: 70px;
  margin-bottom: 9px;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  border-radius: 22px;
  background: color-mix(in srgb, var(--accent) 12%, #0d2530);
  color: var(--accent);
  box-shadow: 0 0 32px color-mix(in srgb, var(--accent) 12%, transparent);
}
.qr-card[data-state='connected'] .qr-orb,
.qr-card[data-state='passkey'] .qr-orb,
.qr-card[data-state='confirming'] .qr-orb {
  animation: qr-breathe 1.8s ease-in-out infinite;
}
.qr-icon {
  display: none;
  width: 40px;
  height: 40px;
}
.qr-card[data-state='connected'] .qr-icon-phone,
.qr-card[data-state='passkey'] .qr-icon-phone,
.qr-card[data-state='confirming'] .qr-icon-phone,
.qr-card[data-state='expired'] .qr-icon-expired,
.qr-card[data-state='success'] .qr-icon-success,
.qr-card[data-state='failed'] .qr-icon-failed {
  display: block;
}
.qr-overlay-title {
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.qr-overlay-detail {
  max-width: 250px;
  color: #b9d3d1;
  font-size: 13px;
  line-height: 1.45;
}
.qr-refresh {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  margin-top: 12px;
  padding: 9px 15px;
  border: 1px solid color-mix(in srgb, var(--accent) 55%, transparent);
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 13%, #10232d);
  color: var(--accent);
  font: inherit;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
}
.qr-refresh:hover {
  background: color-mix(in srgb, var(--accent) 21%, #10232d);
}
.qr-refresh:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.qr-refresh svg {
  width: 19px;
  height: 19px;
}
@keyframes qr-enter {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
@keyframes qr-breathe {
  50% {
    box-shadow: 0 0 38px color-mix(in srgb, var(--accent) 24%, transparent);
  }
}
canvas {
  display: block;
  width: 100%;
  max-width: 408px;
  height: auto;
  aspect-ratio: 1;
  image-rendering: pixelated;
}
.note {
  margin: 17px 0 0;
  color: #94b2b4;
  font-size: 12px;
  line-height: 1.5;
}
.retry {
  width: 100%;
  margin-top: 18px;
  padding: 12px;
  border: 1px solid #6bdab9;
  border-radius: 9px;
  background: transparent;
  color: #a5f7dc;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
@media (max-width: 480px) {
  .card {
    padding: 18px;
  }
  .qr-card {
    padding: 10px;
  }
  .qr-overlay {
    inset: 10px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .qr,
  .qr-overlay,
  .qr-orb {
    animation: none !important;
    transition: none !important;
  }
}
