/* ── Scanner — plein écran total, vidéo en fond ───────────────────────────── */

#videoContainer {
  position: fixed !important;
  inset: 0 !important;
  z-index: 99999 !important;
  background: #000 !important;
  align-items: stretch;
  justify-content: stretch;
  padding: 0 !important;
  margin: 0 !important;
}

/* La popup occupe tout l'écran, la vidéo est en fond */
.scanner-popup {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #000;
  border-radius: 0;
}

/* ── Caméra — remplit absolument tout ────────────────────────────────────── */

.scanner-viewport-wrap {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  background: #000;
  overflow: hidden;
}

.scanner-viewport-wrap #qr-reader {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
  background: transparent !important;
}

.scanner-viewport-wrap #qr-reader__scan_region {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
}

.scanner-viewport-wrap #qr-reader video {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block !important;
}

/* Masquer l'interface par défaut de html5-qrcode */
#qr-reader__scan_region img,
#qr-reader__dashboard,
#qr-reader__header_message,
#qr-reader__status_span { display: none !important; }

/* Masquer le fond sombre autour de la zone de scan */
#qr-shaded-region { display: none !important; }

/* ── Header flottant en haut (par-dessus la caméra) ──────────────────────── */

.scanner-popup .modal-header {
  position: relative;
  z-index: 10;
  flex-shrink: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.72) 0%, rgba(0,0,0,0) 100%) !important;
  border-bottom: none !important;
}
.scanner-popup .app-header-title        { color: #fff; }
.scanner-popup .app-header-btn          { color: rgba(255,255,255,0.85); }
.scanner-popup .app-header-feature-logo { background-color: #2A9D8F !important; }

/* ── Zone basse (hint text en bas) ───────────────────────────────────────── */

.scanner-main {
  position: relative;
  z-index: 10;
  flex: 1;
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  background: transparent !important;
  padding: 0 0 32px 0;
  pointer-events: none;
}

/* ── Cadre de visée centré ────────────────────────────────────────────────── */

.scanner-frame {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(70vw, 70vh);
  height: min(70vw, 70vh);
  pointer-events: none;
  z-index: 11;
}

.scanner-overlay { display: none; }

/* Coins du cadre */
.sc-corner {
  position: absolute;
  width: 30px;
  height: 30px;
  border-color: #fff;
  border-style: solid;
  opacity: 0.95;
}
.sc-tl { top: 0;    left: 0;   border-width: 3px 0 0 3px; border-radius: 4px 0 0 0; }
.sc-tr { top: 0;    right: 0;  border-width: 3px 3px 0 0; border-radius: 0 4px 0 0; }
.sc-bl { bottom: 0; left: 0;   border-width: 0 0 3px 3px; border-radius: 0 0 0 4px; }
.sc-br { bottom: 0; right: 0;  border-width: 0 3px 3px 0; border-radius: 0 0 4px 0; }

/* ── Texte d'indication en bas ────────────────────────────────────────────── */

.scanner-hint-text {
  color: rgba(255,255,255,0.65);
  font-size: 0.82rem;
  text-align: center;
  margin: 0;
  letter-spacing: 0.03em;
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
  pointer-events: none;
}
.scanner-hint-text i { color: #2A9D8F; margin-right: 5px; }
