/* Scan to sign in (scan-sign-in.js): the code on the sign-in page, and the
   scan-to-finish screen. The code is black on white in every theme (an
   iPhone's camera reads it best that way). */

.scan-in { display: flex; gap: 16px; align-items: center; }
.scan-in .scan-words { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.scan-in .scan-words b { font-size: 15px; }

.scan-qr {
  position: relative; flex: none; display: grid; place-items: center;
  width: 148px; aspect-ratio: 1; padding: 8px; border-radius: 18px;
  background: #fff; border: 1px solid var(--hair); box-shadow: var(--shadow); overflow: hidden;
}
.scan-qr .scan-svg { display: block; width: 100%; height: 100%; stroke: none; }
.scan-cover svg { stroke: currentColor; }
.scan-qr .fs-wait { border-color: rgba(46, 50, 55, 0.12); border-top-color: #2E3237; }
.scan-qr[data-state="error"], .scan-qr[data-state="busy"] { background: var(--soft); }

/* Over the code: seen (a tick), working, or a button for a new one. */
.scan-cover {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.82); color: #2E3237;
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  animation: scan-cover-in 0.2s ease;
}
.scan-qr[data-state="error"] .scan-cover, .scan-qr[data-state="busy"] .scan-cover { background: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
.scan-cover .btn.ink { background: #2E3237; color: #fff; }
@keyframes scan-cover-in { from { opacity: 0; } to { opacity: 1; } }

.scan-note { font-size: 13px; font-weight: 600; }
.scan-note:empty { display: none; }
.scan-note.bad { color: var(--danger); font-weight: 500; }

/* Scan to finish: one screen, the code big in the middle. */
.finish { text-align: center; align-items: center; }
.finish h2 { max-width: 15em; }
.finish .scan-qr { width: min(232px, 64vw); padding: 12px; border-radius: 22px; margin: 6px 0 2px; }
.finish p { max-width: 26em; }
.finish-who { font-weight: 600; }

@media (max-width: 420px) {
  .scan-in { flex-direction: column; text-align: center; }
  .scan-in .scan-qr { width: min(200px, 60vw); }
}

@media (prefers-reduced-motion: reduce) {
  .scan-cover { animation: none; }
}
