/* ═══════════════════════════════════════════════
   Camera scanner overlay — MRZ scan view
   ═══════════════════════════════════════════════ */

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

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

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

/* ── Dark overlay on top of video ── */
.dc-dim {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 1;
}

/* ── Header ── */
.dc-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 3;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 20px;
}

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

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

.dc-header-title {
  font-family: e-UkraineHead-Regular, sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  margin: 0;
  line-height: 1.3;
  padding-top: 6px;
}

/* ── Instruction banner ── */
.dc-banner {
  position: absolute;
  top: 100px;
  left: 16px;
  right: 16px;
  z-index: 3;
  background: #2ecc40;
  border-radius: 16px;
  padding: 16px 20px;
  text-align: center;
}

.dc-banner p {
  font-family: e-UkraineHead-Regular, sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  margin: 0;
  line-height: 1.4;
}

/* ── Scan frame (cutout rectangle) ── */
.dc-frame {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 85%;
  max-width: 380px;
  height: 100px;
  z-index: 2;
  border: 3px solid rgba(255, 255, 255, 0.85);
  border-radius: 16px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.55);
}

/* ── Animated scan line ── */
.dc-scanline {
  position: absolute;
  left: 8px;
  right: 8px;
  height: 2px;
  background: linear-gradient(90deg, transparent, #2ecc40, transparent);
  top: 50%;
  animation: dc-scan 2s ease-in-out infinite;
}

@keyframes dc-scan {
  0%, 100% { top: 10%; }
  50% { top: 85%; }
}

/* ── Safe area ── */
@supports (padding: env(safe-area-inset-top)) {
  .dc-header {
    padding-top: calc(16px + env(safe-area-inset-top));
  }
  .dc-banner {
    top: calc(100px + env(safe-area-inset-top));
  }
}
