/* Cámara real (OT-04): visor con vídeo, tarjeta de estado, ubicación en vivo, captura pendiente y revisión. */

/* ---------- Visor en vivo ---------- */
.scene--live {
  background: #11161d;
}

/* Se muestra el ENCUADRE COMPLETO (contain): lo que se ve en el visor es lo que contiene la fotografía. */
.scene__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #11161d;
}

.scene__video.is-mirrored {
  transform: scaleX(-1); /* solo el visor se refleja (cámara frontal); el archivo no */
}

/* Tarjeta sobre el visor cuando no hay imagen: iniciando, permiso denegado, sin cámara, ocupada… */
.stage-status {
  position: absolute;
  z-index: 4;
  top: 42%;
  left: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5em;
  width: max-content;
  max-width: min(86%, 30em);
  padding: 0.9em 1.1em;
  border-radius: 0.9em;
  background: rgb(8 35 75 / 0.9);
  font-size: 0.9em;
  line-height: 1.35;
  text-align: center;
  transform: translate(-50%, -50%);
}

.stage-status__title {
  font-size: 1.05em;
}

.stage-status__detail {
  margin: 0;
  color: var(--stamp-ink-soft);
}

.stage-status__spinner {
  width: 1.6em;
  height: 1.6em;
  border: 3px solid rgb(255 255 255 / 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: stage-spin 0.9s linear infinite;
}

.stage-status__retry {
  margin-top: 0.3em;
}

@keyframes stage-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .stage-status__spinner {
    animation: none;
  }
}

/* ---------- Ubicación en vivo ---------- */
.gps-card--live {
  align-items: flex-start;
}

.gps-card--live[data-tone='ok'] {
  background: var(--c-success-tint);
}

.gps-card--live[data-tone='wait'],
.gps-card--live[data-tone='neutral'] {
  background: var(--c-tint-strong);
}

.gps-card--live[data-tone='warn'] {
  background: var(--c-warning-tint);
}

.gps-card--live[data-tone='wait'] .gps-card__icon,
.gps-card--live[data-tone='neutral'] .gps-card__icon {
  color: var(--c-ink-soft);
}

.gps-card--live[data-tone='wait'] .gps-card__title,
.gps-card--live[data-tone='neutral'] .gps-card__title {
  color: var(--c-ink);
}

.gps-card--live[data-tone='warn'] .gps-card__icon,
.gps-card--live[data-tone='warn'] .gps-card__title {
  color: var(--c-warning-ink);
}

.gps-card__retry {
  margin-top: 4px;
  padding-left: 0;
}

/* ---------- Controles reales ---------- */
.controls--4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.control[data-busy] .control__disc {
  opacity: 0.7;
}

.live-feedback:empty {
  display: none;
}

.live-feedback {
  width: 100%;
  max-width: 760px;
}

/* ---------- Captura pendiente (aviso en la cámara) ---------- */
.pending-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  margin-bottom: 14px;
}

.pending-bar .notice {
  flex: 1 1 320px;
}

.pending-bar__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ---------- Revisión ---------- */
.review-screen {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.review-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

@media (min-width: 1100px) {
  .review-layout {
    grid-template-columns: minmax(0, 1fr) 380px;
  }
}

.review-photo {
  margin: 0;
  min-width: 0;
}

/* Marco oscuro: la imagen se ve ENTERA (contain), nunca recortada ni deformada, con su proporción real. */
.review-photo__frame {
  display: grid;
  place-items: center;
  padding: 8px;
  border-radius: var(--radius-md);
  background: #11161d;
  box-shadow: var(--shadow-card);
}

.review-photo__img {
  display: block;
  max-width: 100%;
  max-height: min(76vh, 760px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 6px;
}

.review-photo__caption {
  margin-top: 8px;
  color: var(--c-ink-soft);
  font-size: 0.8125rem;
}

.review-panel .panel__title {
  margin-bottom: 12px;
}

.review-status {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.review-note {
  margin: -6px 0 12px;
  color: var(--c-ink-soft);
  font-size: 0.8125rem;
}

.review-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.review-actions .btn {
  flex: 1 1 150px;
}

@media (max-width: 599px) {
  .review-actions .btn {
    flex-basis: 100%;
  }
}

/* Franja de ubicación junto a los controles: solo en móvil (donde no hay panel lateral). */
.gps-card--strip {
  max-width: 560px;
  margin-top: 4px;
}

@media (min-width: 768px) {
  .gps-card--strip {
    display: none;
  }
}

/* ---------- Revisión con sello (OT-05) ---------- */
.review-photo__frame {
  position: relative;
  min-height: 160px;
}

.review-busy {
  position: absolute;
  inset: 8px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px;
  border-radius: 6px;
  background: rgb(8 35 75 / 0.82);
  color: #fff;
  text-align: center;
}

.review-busy span:last-child {
  color: rgb(255 255 255 / 0.86);
  font-size: 0.875rem;
}

.review-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  margin-top: 10px;
}

.review-toolbar .segmented {
  margin: 0;
}

.review-evidence:empty {
  display: none;
}

.review-field {
  margin-bottom: 12px;
}

.review-observation {
  min-height: 84px;
  padding: 10px 12px;
  resize: vertical;
  font: inherit;
}

.review-details {
  margin-bottom: 12px;
  border: 1px solid var(--c-line);
  border-radius: var(--radius-md);
  background: var(--c-tint);
}

.review-details > summary {
  min-height: var(--tap);
  padding: 10px 14px;
  font-weight: 600;
  cursor: pointer;
}

.review-details > summary:focus-visible {
  outline: 3px solid var(--c-primary);
  outline-offset: -3px;
  border-radius: var(--radius-md);
}

.review-details > .stack {
  padding: 0 14px 12px;
}
