.idscan-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.85rem;
  padding: 0.5rem 0.9rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 999px;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
  cursor: pointer;
}

.idscan-trigger:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(29, 78, 216, 0.18);
}

.idscan-trigger svg {
  width: 18px;
  height: 18px;
}

.idscan-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.55);
}

.idscan-overlay[hidden] {
  display: none;
}

.idscan-dialog {
  width: min(94vw, 560px);
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.4rem;
  border-radius: 18px;
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.35);
}

.idscan-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.idscan-head h3 {
  margin: 0;
  font-size: 1.1rem;
}

.idscan-head p {
  margin: 0.3rem 0 0;
  font-size: 0.85rem;
  color: #64748b;
}

.idscan-close {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #475569;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}

.idscan-shots {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

.idscan-shot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 128px;
  padding: 0.75rem;
  border: 2px dashed #cbd5e1;
  border-radius: 14px;
  background: #f8fafc;
  color: #475569;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  overflow: hidden;
}

.idscan-shot.is-filled {
  border-style: solid;
  border-color: #22c55e;
  padding: 0;
}

.idscan-shot img {
  width: 100%;
  height: 128px;
  object-fit: cover;
  border-radius: 12px;
}

.idscan-shot input[type='file'] {
  display: none;
}

.idscan-status {
  margin: 0;
  font-size: 0.85rem;
  min-height: 1.2em;
  color: #475569;
}

.idscan-status.is-error {
  color: #b91c1c;
  font-weight: 600;
}

.idscan-results {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-top: 0.25rem;
  border-top: 1px solid #e2e8f0;
}

.idscan-results[hidden] {
  display: none;
}

.idscan-row {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0;
}

.idscan-row label {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
}

.idscan-row input[type='text'] {
  width: 100%;
  padding: 0.45rem 0.6rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  background: #fff;
  color: inherit;
}

.idscan-row.is-conflict input[type='text'] {
  border-color: #f59e0b;
  background: #fffbeb;
}

.idscan-hint {
  font-size: 0.72rem;
  color: #b45309;
}

.idscan-extra {
  margin: 0;
  padding: 0.6rem 0.8rem;
  border-radius: 10px;
  background: #f1f5f9;
  font-size: 0.82rem;
  color: #334155;
  line-height: 1.5;
}

.idscan-extra[hidden] {
  display: none;
}

.idscan-warn {
  margin: 0;
  padding: 0.6rem 0.8rem;
  border-radius: 10px;
  background: #fef3c7;
  border: 1px solid #fcd34d;
  font-size: 0.82rem;
  color: #92400e;
}

.idscan-warn[hidden] {
  display: none;
}

.idscan-actions {
  display: flex;
  gap: 0.6rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.idscan-actions button {
  flex: 1 1 auto;
}

@media (max-width: 520px) {
  .idscan-shots {
    grid-template-columns: 1fr;
  }
}

@media (prefers-color-scheme: dark) {
  .idscan-trigger {
    background: #12213d;
    border-color: #1f2a44;
    color: #93c5fd;
  }

  .idscan-dialog {
    background: #0b1220;
    color: #e2e8f0;
  }

  .idscan-head p,
  .idscan-status,
  .idscan-row label {
    color: #94a3b8;
  }

  .idscan-close {
    background: #12213d;
    border-color: #1f2a44;
    color: #cbd5e1;
  }

  .idscan-shot {
    background: #12213d;
    border-color: #1f2a44;
    color: #cbd5e1;
  }

  .idscan-results {
    border-top-color: #1f2a44;
  }

  .idscan-row input[type='text'] {
    background: #0f1a2e;
    border-color: #1f2a44;
    color: #e2e8f0;
  }

  .idscan-row.is-conflict input[type='text'] {
    background: #2a1f08;
    border-color: #b45309;
  }

  .idscan-extra {
    background: #12213d;
    color: #cbd5e1;
  }

  .idscan-warn {
    background: #2a1f08;
    border-color: #b45309;
    color: #fcd34d;
  }
}
