:root{
  --bg1:#eef2f7;
  --bg2:#e7eef7;
  --card:rgba(255,255,255,0.78);
  --line:rgba(15,23,42,0.14);
  --text:#0b0f17;
  --muted:rgba(11,15,23,0.62);
  --accent:#0a84ff;
  --radius:18px;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  background:
    radial-gradient(900px 600px at 20% 0%, rgba(10,132,255,0.12), transparent 55%),
    radial-gradient(900px 600px at 90% 10%, rgba(34,197,94,0.10), transparent 55%),
    linear-gradient(180deg, var(--bg1), var(--bg2));
  color: var(--text);
}

.screen{ min-height:100vh; display:flex; align-items:center; justify-content:center; padding: 24px 14px; }
.isHidden{ display:none !important; }

.card{
  width: min(720px, 100%);
  border:1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  backdrop-filter: blur(12px);
  box-shadow: 0 18px 55px rgba(15,23,42,0.10);
  padding: 22px;
  text-align:center;
}

.logo{
  width: min(460px, 86%);
  height:auto;
  display:block;
  margin: 2px auto 0;
  filter: drop-shadow(0 18px 30px rgba(2,6,23,0.10));
}
.title{ font-weight:900; letter-spacing:-0.02em; font-size:20px; margin-top: 6px; }
.sub{ color: var(--muted); font-weight:750; margin-top: 4px; }

.qrWrap{
  display:grid;
  grid-template-columns: 1fr;
  gap: 12px;
  /* Pull QR up under logo, keep more air below */
  margin: 0 auto 18px;
  align-items:center;
  justify-items:center;
}
.qr{
  /* QR size (also used by the center glow animation) */
  --qrSize: min(168px, 50vw);
  width: var(--qrSize);
  aspect-ratio: 1/1;
  border-radius: 14px;
  border:1px solid rgba(15,23,42,0.10);
  background: rgba(255,255,255,0.65);
  box-shadow: 0 14px 32px rgba(2,6,23,0.10);
  position: relative;
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 6px;
  /* default echo-dot colors */
  --dot: rgba(34,197,94,0.95);
  --ring: rgba(34,197,94,0.28);
}
.qr.isWaiting{
  --dot: rgba(10,132,255,0.88);
  --ring: rgba(10,132,255,0.26);
}
.qr.isOffline{
  --dot: rgba(255,59,48,0.90);
  --ring: rgba(255,59,48,0.24);
}
.echoDot{
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
  pointer-events: none;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: var(--dot);
  border: 3px solid rgba(255,255,255,0.94); /* keep QR scan-friendly */
  box-shadow:
    0 0 0 10px var(--ring),
    0 12px 22px rgba(2,6,23,0.10);
  animation: echoDotPulse 1.55s cubic-bezier(.2,.8,.2,1) infinite;
}
.echoDot::before,
.echoDot::after{
  content:"";
  position:absolute;
  left: 50%;
  top: 50%;
  /* Bounce from center to ~80% of QR size */
  width: calc(var(--qrSize, 168px) * 0.80);
  height: calc(var(--qrSize, 168px) * 0.80);
  transform: translate(-50%, -50%) scale(0.06);
  border-radius: 999px;
  background: radial-gradient(circle, var(--ring), transparent 62%);
  filter: blur(2.4px);
  opacity: 0;
  animation: echoRing 1.55s cubic-bezier(.2,.9,.2,1) infinite;
}
.echoDot::after{
  animation-delay: 0.78s;
}
@keyframes echoDotPulse{
  0%, 100%{ transform: translate(-50%, -50%) scale(1); }
  55%{ transform: translate(-50%, -50%) scale(1.16); }
}
@keyframes echoRing{
  0%{ transform: translate(-50%, -50%) scale(0.06); opacity: 0.00; }
  10%{ opacity: 0.75; }
  62%{ transform: translate(-50%, -50%) scale(0.86); opacity: 0.16; }
  74%{ transform: translate(-50%, -50%) scale(0.80); opacity: 0.24; }
  100%{ transform: translate(-50%, -50%) scale(0.80); opacity: 0; }
}
.qr.isWaiting .echoDot::before,
.qr.isWaiting .echoDot::after{
  background: radial-gradient(circle, var(--ring), transparent 62%);
}
.qr.isOffline .echoDot::before,
.qr.isOffline .echoDot::after{
  background: radial-gradient(circle, var(--ring), transparent 62%);
}
@media (prefers-reduced-motion: reduce){
  .echoDot, .echoDot::before, .echoDot::after{ animation: none !important; }
}
.qr svg{ width: 100%; height: 100%; display:block; }
.qrMeta{ display:grid; gap: 6px; }
.pill{
  display:inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  border:1px solid rgba(15,23,42,0.12);
  background: rgba(255,255,255,0.65);
  font-weight:850;
}
.muted{ color: var(--muted); font-size: 12.5px; font-weight: 750; }

.actions{ display:flex; gap: 10px; justify-content:center; flex-wrap:wrap; margin-top: 12px; }
.btn{
  appearance:none;
  border:1px solid rgba(15,23,42,0.14);
  background: rgba(255,255,255,0.75);
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 850;
  cursor:pointer;
  text-decoration:none;
  color: var(--text);
}
.btn.primary{
  background: rgba(10,132,255,0.12);
  border-color: rgba(10,132,255,0.22);
  color: rgba(10,132,255,0.95);
}
.btn:active{ transform: translateY(1px); }

/* Kiosk view */
#screenKiosk{ padding:0; }
.bg{
  position:fixed;
  inset:0;
  background:
    radial-gradient(1200px 700px at 10% 10%, rgba(10,132,255,0.10), transparent 55%),
    radial-gradient(900px 600px at 90% 20%, rgba(45,212,191,0.12), transparent 55%),
    radial-gradient(900px 900px at 50% 100%, rgba(99,102,241,0.09), transparent 55%),
    linear-gradient(180deg, #e9eef6, #e6edf6);
}
.kioskBtn{
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 50;
  appearance:none;
  border:1px solid rgba(15,23,42,0.14);
  background: rgba(255,255,255,0.75);
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 900;
  cursor:pointer;
}
.kioskBtn:active{ transform: translateY(1px); }
.kioskGrid{
  position:fixed;
  inset: 0;
  display:grid;
  grid-template-columns: 1fr 420px;
  gap: 14px;
  padding: 14px;
}
@media (max-width: 980px){
  .kioskGrid{ grid-template-columns: 1fr; padding: 10px; }
  .phoneCol{ display:none; }
}
.viewer{
  width:100%;
  height:100%;
  border:1px solid rgba(15,23,42,0.14);
  border-radius: 16px;
  background: rgba(255,255,255,0.65);
  box-shadow: 0 18px 55px rgba(15,23,42,0.10);
}
.phoneCol{ display:flex; align-items:center; justify-content:center; }
.phoneFrame{
  width: 100%;
  max-width: 420px;
  height: calc(100vh - 28px);
  max-height: 820px;
  border-radius: 44px;
  border: 10px solid rgba(2,6,23,0.90);
  background: rgba(2,6,23,0.92);
  box-shadow: 0 18px 55px rgba(15,23,42,0.10);
  position: relative;
  overflow: hidden;
}
.phoneNotch{
  position:absolute;
  left: 50%;
  top: 10px;
  transform: translateX(-50%);
  width: 48%;
  height: 28px;
  border-radius: 18px;
  background: rgba(2,6,23,0.96);
  z-index: 2;
  border: 1px solid rgba(255,255,255,0.06);
}
.phoneIframe{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  border:0;
  background: transparent;
}

