/* Shared wallet request: the phone moves in front of the QR, then its camera scans it. */
.iphone-qr-scan {
  display: grid;
  place-items: center;
  height: 388px;
  margin: 22px auto 12px;
  overflow: hidden;
  isolation: isolate;
}
/* Legacy portal requests pair the QR with explanatory text or request details. */
.term-qr > .iphone-qr-scan { flex: 0 0 330px; width: 330px; margin: 0; }
.iphone-qr-scan .iphone-scan-code { grid-area: 1 / 1; width: 330px; height: 330px; }
.iphone-qr-scan .iphone-scan-code svg.kiosk-website-qr { width: 330px; height: 330px; margin: 0; }
.iphone-qr-scan .iphone-scan-handset { grid-area: 1 / 1; z-index: 1; width: 202px; text-align: center; pointer-events: none; transform-origin: 50% 85%; animation: iphone-scan-enter 2s cubic-bezier(.2,.75,.25,1) both; }
.iphone-qr-scan .iphone-scan-phone { position: relative; width: 202px; height: 380px; padding: 7px; border: 3px solid #727b87; border-radius: 37px; background: #0c1017; box-shadow: 0 0 0 2px #18212e, 12px 18px 30px #19385440; }
.iphone-qr-scan .iphone-scan-phone::before { content: ''; position: absolute; left: -6px; top: 74px; width: 3px; height: 42px; border-radius: 2px 0 0 2px; background: #566171; box-shadow: 0 51px 0 #566171; }
.iphone-qr-scan .iphone-scan-phone::after { content: ''; position: absolute; right: -6px; top: 107px; width: 3px; height: 62px; border-radius: 0 2px 2px 0; background: #566171; }
.iphone-qr-scan .iphone-scan-screen { position: relative; width: 100%; height: 100%; overflow: hidden; border-radius: 27px; background: radial-gradient(ellipse at 50% 45%, #335063, #152631 70%); color: #fff; }
.iphone-qr-scan .iphone-scan-island { position: absolute; z-index: 2; top: 9px; left: 50%; width: 66px; height: 19px; transform: translateX(-50%); border-radius: 20px; background: #030406; }
.iphone-qr-scan .iphone-scan-island::after { content: ''; position: absolute; right: 9px; top: 6px; width: 7px; height: 7px; border-radius: 50%; background: #152334; box-shadow: inset 0 0 0 2px #0a131f; }
.iphone-qr-scan .iphone-scan-app { display: flex; align-items: center; justify-content: center; gap: 7px; margin-top: 48px; font-size: 18px; font-weight: 600; line-height: 1.2; }
.iphone-qr-scan .iphone-scan-app img { width: 23px; height: 23px; object-fit: contain; border-radius: 6px; }
.iphone-qr-scan .iphone-scan-viewfinder { position: relative; width: 164px; height: 164px; margin: 26px auto 0; }
.iphone-qr-scan .iphone-scan-camera-code { position: absolute; inset: 12px; animation: iphone-scan-camera 2s ease both; }
.iphone-qr-scan .iphone-scan-camera-code svg.kiosk-website-qr { width: 140px; height: 140px; margin: 0; border-radius: 5px; box-shadow: none; }
.iphone-qr-scan .iphone-scan-brackets { position: absolute; inset: 0; width: 100%; height: 100%; fill: none; stroke: #76e1cf; stroke-width: 3; stroke-linecap: round; animation: iphone-scan-focus 2s ease both; }
.iphone-qr-scan .iphone-scan-beam { position: absolute; left: 8px; right: 8px; top: 18px; height: 3px; opacity: 0; border-radius: 3px; background: #8fffe4; box-shadow: 0 0 12px 4px #50d2be66; animation: iphone-scan-sweep 2s ease-in-out both; }
.iphone-qr-scan .iphone-scan-status { position: relative; height: 29px; margin-top: 22px; font-size: 15px; font-weight: 600; line-height: 29px; white-space: nowrap; }
.iphone-qr-scan .iphone-scan-status > span { position: absolute; inset: 0; }
.iphone-qr-scan .iphone-scan-reading { opacity: 0; animation: iphone-scan-reading 2s linear both; }
.iphone-qr-scan .iphone-scan-found { opacity: 0; color: #92f4da; animation: iphone-scan-found 2s linear both; }
.iphone-qr-scan .iphone-scan-found b { display: inline-grid; place-items: center; width: 23px; height: 23px; margin-right: 2px; border-radius: 50%; background: #92f4da; color: #183e37; font-size: 16px; line-height: 1; }
.iphone-qr-scan .iphone-scan-home { position: absolute; left: 50%; bottom: 9px; width: 64px; height: 4px; transform: translateX(-50%); border-radius: 5px; background: #fff; opacity: .85; }

/* Keep the QR unobscured until its configured wait or the manual action ends. */
[data-qr-phase="waiting"] .iphone-qr-scan .iphone-scan-handset { visibility: hidden; }
[data-qr-phase="waiting"] .iphone-qr-scan *,
[data-qr-phase="waiting"] .iphone-qr-scan *::before,
[data-qr-phase="waiting"] .iphone-qr-scan *::after { animation: none; }
.flowbottom.kiosk-qr-navigation,
.dyou-qr-navigation { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; flex-shrink: 0; }
.kiosk-qr-navigation .kiosk-qr-start { min-width: 310px; }
.kiosk-qr-start[aria-busy="true"] { cursor: progress; }

@keyframes iphone-scan-enter {
  0%, 12% { opacity: 0; transform: translate(215px, 130px) rotate(12deg) scale(.94); }
  17% { opacity: 1; }
  42%, 100% { opacity: 1; transform: translate(0, 0) rotate(0) scale(1); }
}
@keyframes iphone-scan-camera {
  0%, 42% { opacity: 0; transform: scale(1.12); filter: blur(2px); }
  51%, 100% { opacity: 1; transform: scale(1); filter: blur(0); }
}
@keyframes iphone-scan-focus { 0%, 46% { opacity: .35; } 53%, 100% { opacity: 1; } }
@keyframes iphone-scan-sweep {
  0%, 52% { opacity: 0; transform: translateY(0); }
  55% { opacity: 1; transform: translateY(0); }
  77% { opacity: 1; transform: translateY(126px); }
  81%, 100% { opacity: 0; transform: translateY(126px); }
}
@keyframes iphone-scan-reading { 0%, 49% { opacity: 0; } 53%, 77% { opacity: 1; } 83%, 100% { opacity: 0; } }
@keyframes iphone-scan-found { 0%, 81% { opacity: 0; } 88%, 100% { opacity: 1; } }

.is-qr-paused .iphone-qr-scan *,
.is-qr-paused .iphone-qr-scan *::before,
.is-qr-paused .iphone-qr-scan *::after { animation-play-state: paused; }

@media (prefers-reduced-motion: reduce) {
  .iphone-qr-scan *,
  .iphone-qr-scan *::before,
  .iphone-qr-scan *::after { animation: none !important; }
  .iphone-qr-scan .iphone-scan-handset { opacity: 1; transform: none; }
  .iphone-qr-scan .iphone-scan-camera-code { opacity: 1; transform: none; filter: none; }
  .iphone-qr-scan .iphone-scan-beam,
  .iphone-qr-scan .iphone-scan-reading { display: none; }
  .iphone-qr-scan .iphone-scan-found { opacity: 1; }
}
