/* EJC — Scanner de Fichas (mobile-first) */

.oculto { display: none !important; }

body.fs-lock {
  overflow: hidden;
}

.ficha-scanner-root {
  position: fixed;
  inset: 0;
  z-index: 10000;
}

.fs-overlay {
  position: absolute;
  inset: 0;
  background: rgba(8, 24, 36, 0.72);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}

@media (min-width: 720px) {
  .fs-overlay {
    align-items: center;
    padding: 1rem;
  }
}

.fs-sheet {
  width: 100%;
  max-width: 520px;
  max-height: 96vh;
  overflow: auto;
  background: #f4f8fb;
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.25);
  color: #1a2b36;
}

@media (min-width: 720px) {
  .fs-sheet {
    border-radius: 16px;
  }
}

.fs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid #d5e3ec;
  background: #0b4f6c;
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 1;
}

.fs-header h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 650;
}

.fs-stage {
  padding: 0.85rem 1rem 1.15rem;
}

.fs-video {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  background: #0a1620;
  border-radius: 12px;
}

.fs-guide {
  position: relative;
  margin-top: -100%;
  /* guia sobreposto via absolute dentro do stage-camera */
  pointer-events: none;
}

.fs-stage-camera {
  position: relative;
}

.fs-stage-camera .fs-guide {
  position: absolute;
  left: 1rem;
  right: 1rem;
  top: 0.85rem;
  aspect-ratio: 3 / 4;
  margin: 0;
}

.fs-guide-frame {
  position: absolute;
  inset: 4%;
  border: 2px solid rgba(255, 255, 255, 0.85);
  border-radius: 8px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.18);
}

.fs-guide-foto {
  position: absolute;
  border: 2px dashed #7dd3fc;
  border-radius: 4px;
  background: rgba(14, 165, 233, 0.12);
}

.fs-hint {
  margin: 0.75rem 0 0.5rem;
  font-size: 0.88rem;
  color: #3d5a6c;
  line-height: 1.35;
}

.fs-actions {
  display: flex;
  gap: 0.6rem;
  margin-top: 0.85rem;
  flex-wrap: wrap;
}

.fs-btn {
  flex: 1;
  min-height: 48px;
  border: none;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 650;
  cursor: pointer;
  padding: 0.65rem 1rem;
}

.fs-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.fs-btn-primary {
  background: #0b4f6c;
  color: #fff;
}

.fs-btn-primary:hover:not(:disabled) {
  background: #0e6a91;
}

.fs-btn-ghost {
  background: #e8f1f6;
  color: #0b4f6c;
}

.fs-header .fs-btn-ghost {
  flex: 0;
  min-height: 36px;
  min-width: 36px;
  padding: 0.25rem 0.5rem;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.fs-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 2.5rem 1rem;
  color: #0b4f6c;
}

.fs-spinner {
  width: 42px;
  height: 42px;
  border: 3px solid #c5dbe6;
  border-top-color: #0b4f6c;
  border-radius: 50%;
  animation: fs-spin 0.8s linear infinite;
}

@keyframes fs-spin {
  to { transform: rotate(360deg); }
}

.fs-previews {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr;
  gap: 0.65rem;
}

.fs-previews figure {
  margin: 0;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #d5e3ec;
}

.fs-previews figcaption {
  font-size: 0.75rem;
  font-weight: 650;
  padding: 0.4rem 0.55rem;
  background: #eef5f9;
  color: #0b4f6c;
}

.fs-previews img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 280px;
  object-fit: contain;
  background: #f0f4f7;
}

.fs-meta {
  margin-top: 0.55rem;
  font-size: 0.8rem;
  color: #4a6675;
}

.fs-error-msg {
  margin: 1rem 0;
  padding: 0.85rem;
  background: #fef2f2;
  color: #9b1c1c;
  border-radius: 10px;
  font-size: 0.92rem;
  line-height: 1.4;
}

/* Painel da aba Fichas no EJC */
.fichas-painel .fichas-grid {
  display: grid;
  gap: 1rem;
}

@media (min-width: 800px) {
  .fichas-painel .fichas-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.fichas-resultado {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.fichas-resultado figure {
  margin: 0;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
}

.fichas-resultado figcaption {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.4rem 0.55rem;
  background: #edf2f7;
}

.fichas-resultado img {
  width: 100%;
  display: block;
  max-height: 260px;
  object-fit: contain;
  background: #f7fafc;
}

.fichas-lista {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.fichas-lista th,
.fichas-lista td {
  text-align: left;
  padding: 0.55rem 0.45rem;
  border-bottom: 1px solid #e2e8f0;
}

.fichas-lista th {
  color: #0b4f6c;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
