/* ═══════════════════════════════════════════════
   QR Scanner overlay — camera with square frame
   ═══════════════════════════════════════════════ */

#dia-qr-overlay {
  position: fixed;
  inset: 0;
  z-index: 10003;
  background: #000;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

#dia-qr-overlay.active {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

/* ── Video fills entire screen ── */
.dq-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ── Header ── */
.dq-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
}

.dq-back {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}

.dq-back svg {
  width: 24px;
  height: 24px;
  stroke: #fff;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dq-header-title {
  font-family: e-UkraineHead-Regular, sans-serif;
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  margin: 0;
}

.dq-info-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.6);
  background: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.dq-info-btn svg {
  width: 18px;
  height: 18px;
  stroke: #fff;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ── Instruction text ── */
.dq-instruction {
  position: absolute;
  top: 80px;
  left: 20px;
  right: 20px;
  z-index: 3;
  text-align: center;
}

.dq-instruction p {
  font-family: e-UkraineHead-Regular, sans-serif;
  font-size: 15px;
  font-weight: 500;
  color: #fff;
  margin: 0;
  line-height: 1.5;
}

/* ── Square scan frame with corner markers ── */
.dq-frame-wrap {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 75vw;
  height: 75vw;
  max-width: 320px;
  max-height: 320px;
  z-index: 2;
}

/* Dark overlay around the frame */
.dq-frame-wrap::before {
  content: '';
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: -1;
}

.dq-corner {
  position: absolute;
  width: 28px;
  height: 28px;
  border-color: #fff;
  border-style: solid;
  border-width: 0;
}

.dq-corner--tl { top: 0; left: 0; border-top-width: 3px; border-left-width: 3px; border-top-left-radius: 8px; }
.dq-corner--tr { top: 0; right: 0; border-top-width: 3px; border-right-width: 3px; border-top-right-radius: 8px; }
.dq-corner--bl { bottom: 0; left: 0; border-bottom-width: 3px; border-left-width: 3px; border-bottom-left-radius: 8px; }
.dq-corner--br { bottom: 0; right: 0; border-bottom-width: 3px; border-right-width: 3px; border-bottom-right-radius: 8px; }

/* ── Flash toggle button ── */
.dq-flash {
  position: absolute;
  bottom: 40px;
  left: 24px;
  z-index: 3;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.5);
  background: rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.dq-flash svg {
  width: 22px;
  height: 22px;
  stroke: #fff;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dq-flash.on {
  background: rgba(255,255,255,0.3);
  border-color: #fff;
}

/* ── Safe area ── */
@supports (padding: env(safe-area-inset-top)) {
  .dq-header {
    padding-top: calc(16px + env(safe-area-inset-top));
  }
  .dq-instruction {
    top: calc(80px + env(safe-area-inset-top));
  }
  .dq-flash {
    bottom: calc(40px + env(safe-area-inset-bottom));
  }
}
