/* Driver Solution — Captura de documento desde la cámara
   Modal a pantalla completa con guías de encuadre.
   Se usa desde driver-lex.html y driver-docs.html. */

.dc-modal {
  position: fixed;
  inset: 0;
  margin: 0;
  width: 100vw;
  height: 100vh;
  max-width: 100vw;
  max-height: 100vh;
  padding: 0;
  border: 0;
  background: #000;
  color: #fff;
  z-index: 11000;
}

.dc-modal::backdrop {
  background: #000;
}

.dc-modal[hidden] {
  display: none;
}

.dc-stage {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
}

.dc-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}

.dc-canvas {
  display: none;
}

/* Marco de encuadre centrado, proporción documento A4 vertical (1 : 1.41).
   En orientación landscape se invierte vía media query. */
.dc-guides {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.dc-frame {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(86vw, 56vh);
  aspect-ratio: 1 / 1.414;
  border: 2px dashed rgba(255, 255, 255, 0.85);
  border-radius: 8px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.45);
}

@media (orientation: landscape) {
  .dc-frame {
    width: min(78vw, 78vh);
    aspect-ratio: 1.414 / 1;
  }
}

/* Esquinas reforzadas estilo cámara profesional */
.dc-corner {
  position: absolute;
  width: 28px;
  height: 28px;
  border: 4px solid #38bdf8;
}
.dc-corner--tl { top: -2px; left: -2px; border-right: none; border-bottom: none; border-top-left-radius: 8px; }
.dc-corner--tr { top: -2px; right: -2px; border-left: none; border-bottom: none; border-top-right-radius: 8px; }
.dc-corner--bl { bottom: -2px; left: -2px; border-right: none; border-top: none; border-bottom-left-radius: 8px; }
.dc-corner--br { bottom: -2px; right: -2px; border-left: none; border-top: none; border-bottom-right-radius: 8px; }

.dc-hint {
  position: absolute;
  left: 50%;
  top: 24px;
  transform: translateX(-50%);
  padding: 10px 16px;
  font-size: 0.92rem;
  font-weight: 600;
  text-align: center;
  background: rgba(0, 0, 0, 0.55);
  border-radius: 999px;
  max-width: 90vw;
}

.dc-error {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  padding: 18px 22px;
  font-size: 0.95rem;
  text-align: center;
  background: rgba(220, 38, 38, 0.92);
  border-radius: 12px;
  max-width: 86vw;
  line-height: 1.45;
}

.dc-actions {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
  display: flex;
  justify-content: center;
  gap: 12px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0));
}

/* Sobreescribe `.ds-btn--ghost` para que sea legible sobre el fondo negro del modal */
.dc-modal .ds-btn--ghost {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.45);
  background: transparent;
}
.dc-modal .ds-btn--ghost:hover,
.dc-modal .ds-btn--ghost:focus-visible {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.7);
}
.dc-modal .ds-btn--ghost .ds-ico {
  stroke: #ffffff;
}

.dc-shutter {
  /* Variante grande del primario para el botón "Capturar" */
  min-width: 168px;
}

@media (max-width: 480px) {
  .dc-actions {
    gap: 10px;
  }
  .dc-shutter {
    min-width: 130px;
  }
}
