:root {
  --bg: #14110f;
  --card: #1e1a17;
  --card-border: #2c2521;
  --text: #f3ede3;
  --text-muted: #a99c8c;
  --jade: #2bb89d;
  --coral: #ff6b4a;
  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

.card {
  width: 100%;
  max-width: 380px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 32px 28px 24px;
  text-align: center;
}

.brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
  color: var(--jade);
  margin-bottom: 28px;
}

.state {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.status-text {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.15rem;
  margin: 0 0 20px;
  color: var(--text);
}

.status-text--success {
  color: var(--jade);
}

.hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 16px 0 0;
  line-height: 1.5;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--card-border);
  border-top-color: var(--coral);
  border-radius: 50%;
  margin-bottom: 20px;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.viewfinder {
  position: relative;
  width: 220px;
  height: 220px;
  margin: 4px 0 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qr-image {
  width: 196px;
  height: 196px;
  border-radius: 8px;
  background: #fff;
  object-fit: contain;
}

.corner {
  position: absolute;
  width: 22px;
  height: 22px;
  border: 3px solid var(--coral);
  opacity: 0.85;
  animation: pulse 2.4s ease-in-out infinite;
}

.corner--tl {
  top: 0;
  left: 0;
  border-right: none;
  border-bottom: none;
  border-radius: 6px 0 0 0;
}

.corner--tr {
  top: 0;
  right: 0;
  border-left: none;
  border-bottom: none;
  border-radius: 0 6px 0 0;
}

.corner--bl {
  bottom: 0;
  left: 0;
  border-right: none;
  border-top: none;
  border-radius: 0 0 0 6px;
}

.corner--br {
  bottom: 0;
  right: 0;
  border-left: none;
  border-top: none;
  border-radius: 0 0 6px 0;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.55;
  }
  50% {
    opacity: 1;
  }
}

.qr-overlay {
  position: absolute;
  inset: 0;
  background: rgba(20, 17, 15, 0.92);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.btn-retry {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--bg);
  background: var(--coral);
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  cursor: pointer;
}

.btn-retry:focus-visible,
.btn-retry:hover {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

.instructions {
  text-align: left;
  width: 100%;
  margin: 20px 0 0;
  padding: 0 0 0 20px;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.instructions strong {
  color: var(--text);
}

.check {
  width: 64px;
  height: 64px;
  margin-bottom: 16px;
}

.check__circle {
  fill: none;
  stroke: var(--jade);
  stroke-width: 2.5;
  stroke-dasharray: 151;
  stroke-dashoffset: 151;
  animation: draw-circle 0.5s ease-out forwards;
}

.check__mark {
  fill: none;
  stroke: var(--jade);
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 36;
  stroke-dashoffset: 36;
  animation: draw-mark 0.35s ease-out 0.45s forwards;
}

@keyframes draw-circle {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes draw-mark {
  to {
    stroke-dashoffset: 0;
  }
}

.footer {
  margin-top: 28px;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--card-border);
}

:focus-visible {
  outline: 2px solid var(--coral);
  outline-offset: 2px;
}
.state[hidden] {
  display: none;
}

.qr-overlay[hidden] {
  display: none;
}
