/* css/qr-sheet.css
   Bottom-sheet QR scanner.  Mounted on-demand by components/QrSheet.js. */

.qrs {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}

.qrs-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.45);
  opacity: 0;
  transition: opacity 240ms ease;
}

.qrs-panel {
  position: relative;
  background: #fff;
  border-radius: 24px 24px 0 0;
  padding: 18px 20px calc(env(safe-area-inset-bottom, 0px) + 20px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  box-shadow: 0 -8px 32px rgba(0,0,0,0.20);
  transform: translateY(100%);
  transition: transform 280ms cubic-bezier(0.2, 0.8, 0.2, 1);
  max-height: 80vh;
  max-width: 520px;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

.qrs.is-open .qrs-backdrop { opacity: 1; }
.qrs.is-open .qrs-panel    { transform: translateY(0); }

.qrs-handle {
  width: 40px;
  height: 4px;
  border-radius: 2px;
  background: #d0d8d4;
}
.qrs-title { font-size: 17px; font-weight: 700; color: #1a2a25; margin-top: 6px; }
.qrs-sub   { font-size: 12px; font-weight: 500; color: #5a6a64; text-align: center; }

.qrs-stage {
  position: relative;
  width: min(86vw, 320px);
  aspect-ratio: 1 / 1;
  margin-top: 12px;
  border-radius: 16px;
  overflow: hidden;
  background: #1a2a25;
}
.qrs-stage video,
.qrs-stage canvas {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
}

.qrs-frame {
  position: absolute;
  inset: 14px;
  pointer-events: none;
}
.qrs-corner {
  position: absolute;
  width: 28px;
  height: 28px;
}
.qrs-corner-tl { top: 0;    left: 0;    border-top: 3px solid var(--brand-light); border-left:  3px solid var(--brand-light); border-top-left-radius: 7px; }
.qrs-corner-tr { top: 0;    right: 0;   border-top: 3px solid var(--brand-light); border-right: 3px solid var(--brand-light); border-top-right-radius: 7px; }
.qrs-corner-bl { bottom: 0; left: 0;    border-bottom: 3px solid var(--brand-light); border-left:  3px solid var(--brand-light); border-bottom-left-radius: 7px; }
.qrs-corner-br { bottom: 0; right: 0;   border-bottom: 3px solid var(--brand-light); border-right: 3px solid var(--brand-light); border-bottom-right-radius: 7px; }

.qrs-scanline {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  top: 0;
  background: var(--brand-light);
  box-shadow: 0 0 12px var(--brand-light);
  animation: qrScan 2.2s ease-in-out infinite;
}

@keyframes qrScan {
  0%   { top: 0; }
  50%  { top: calc(100% - 2px); }
  100% { top: 0; }
}

.qrs-status {
  font-size: 12px;
  font-weight: 500;
  color: #5a6a64;
  min-height: 18px;
  text-align: center;
}

.qrs-cancel {
  height: 40px;
  width: 100%;
  background: #f4f6f5;
  border: none;
  border-radius: 11px;
  font-size: 14px;
  font-weight: 600;
  color: #1a2a25;
  margin-top: 8px;
  cursor: pointer;
}

.qrs-stage.is-denied {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 13px;
  text-align: center;
  padding: 20px;
  background: #1a2a25;
}
.qrs-stage.is-denied .qrs-frame { display: none; }
