/* ── OCR modal ────────────────────────────────────────────────── */

.ocr-modal__content {
  max-width: 760px;
  width: 95%;
  padding: 2.75rem 3rem 2.25rem;
  /* position: absolute from auth-modal.css must stay — removing relative
     keeps it out of the flex flow so align-items:stretch can't force 100vh */
  max-height: 92vh;
  overflow-y: auto;
}

.ocr-modal__content--wide {
  max-width: 980px;
  padding-left: 2.25rem;
  padding-right: 2.25rem;
}

.ocr-modal__content .close-modal-button {
  top: 14px;
  right: 18px;
}

/* Step header */

.ocr-modal__step-label {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.5rem;
}

.ocr-modal__content .eyebrow {
  margin: 0;
}

.ocr-mode-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.65rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  background: rgba(125, 178, 255, 0.12);
  color: var(--accent);
  border: 1px solid rgba(125, 178, 255, 0.22);
  white-space: nowrap;
}

.ocr-mode-badge--pledge {
  background: rgba(163, 230, 236, 0.12);
  color: #a3e6ec;
  border-color: rgba(163, 230, 236, 0.25);
}

.ocr-modal__content h3 {
  margin: 0 0 1.75rem;
  color: var(--text);
  font-size: 1.5rem;
  font-weight: 700;
  text-align: left;
  letter-spacing: -0.01em;
}

/* Drop zone */

.ocr-dropzone {
  border: 2px dashed rgba(125, 178, 255, 0.35);
  border-radius: 1.25rem;
  padding: 3rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 1.5rem;
}

.ocr-dropzone:hover,
.ocr-dropzone.ocr-dropzone--drag-over {
  border-color: var(--accent);
  background: rgba(125, 178, 255, 0.06);
}

.ocr-dropzone svg { opacity: 0.5; }

.ocr-dropzone p { margin: 0; font-size: 0.96rem; }

.ocr-dropzone__hint {
  font-size: 0.8rem !important;
  opacity: 0.5;
}

/* Thumbnail grid */

.ocr-thumbnail-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
  padding: 0.25rem 0;
}

.ocr-thumb {
  position: relative;
  width: 100px;
  height: 100px;
  border-radius: 0.75rem;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  flex-shrink: 0;
}

.ocr-thumb__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ocr-thumb__remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.7);
  border: none;
  color: #fff;
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  opacity: 0;
  transition: opacity 0.15s;
}

.ocr-thumb:hover .ocr-thumb__remove {
  opacity: 1;
}

.ocr-add-more-btn {
  font-size: 0.86rem;
  margin-bottom: 0.75rem;
  display: block;
}

.ocr-modal__content .link-button {
  color: var(--accent);
  font-weight: normal;
}

.ocr-modal__content .link-button:hover {
  color: var(--text);
}

/* CTA button */

.ocr-modal__cta {
  width: 100%;
  padding: 0.85rem;
  font-size: 1.05rem;
  margin-top: 0.75rem;
  border-radius: 0.85rem;
}

.ocr-modal__cta:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
  pointer-events: none;
}

/* Review step */

.ocr-review-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.ocr-select-all-label {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  white-space: nowrap;
}

/* auth-modal.css sets .modal-content input { width:100%; padding:12px; margin-bottom:1rem }
   which hits this checkbox via the shared .modal-content class — reset it. */
.ocr-select-all-label input[type="checkbox"] {
  width: auto !important;
  padding: 0 !important;
  margin: 0 !important;
  flex-shrink: 0;
  cursor: pointer;
}

.ocr-review-table-wrap {
  overflow-y: auto;
  overflow-x: auto;
  border-radius: 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.07);
  margin-bottom: 1rem;
}

.ocr-review-table td:first-child,
.ocr-review-table th:first-child {
  width: 1.5rem;
  min-width: 1.5rem;
  text-align: center;
  padding-left: 0.35rem !important;
  padding-right: 0.35rem !important;
}

.ocr-review-table tbody tr {
  cursor: pointer;
}

.ocr-review-table tbody tr:hover {
  background: rgba(125, 178, 255, 0.05);
}

/* table.css sets .holdings-table input/select { width:100%; padding:0.65rem; border-radius:0.75rem; background:rgba... }
   auth-modal.css sets .modal-content input { width:100%; padding:12px; margin-bottom:1rem }
   Use !important to win over both for all visible properties. */
.ocr-review-table td input[type="text"],
.ocr-review-table td input[type="number"],
.ocr-review-table td input[type="date"],
.ocr-review-table td select {
  background: transparent !important;
  border: none !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  color: var(--text) !important;
  font-size: 0.92rem !important;
  padding: 0.28rem 0.3rem !important;
  margin: 0 !important;
  width: 100% !important;
  min-width: 4.5rem !important;
  outline: none;
  transition: border-color 0.15s;
}

.ocr-review-table td input[type="date"] {
  min-width: 7.5rem !important;
  color-scheme: dark;
}

.ocr-review-table td select {
  min-width: 4rem !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  padding-right: 0 !important;
}

/* Per-row checkboxes: reset width/padding/margin forced by auth-modal + table CSS */
.ocr-review-table td input[type="checkbox"] {
  width: auto !important;
  height: auto !important;
  padding: 0 !important;
  margin: 0 !important;
  min-width: 0 !important;
  border-radius: 3px !important;
}

.ocr-review-table td input:focus,
.ocr-review-table td select:focus {
  border-bottom-color: var(--accent) !important;
}

.ocr-field--empty {
  border-bottom-color: rgba(255, 120, 80, 0.7) !important;
  color: rgba(255, 120, 80, 0.9);
}

.ocr-field--empty::placeholder {
  color: rgba(255, 120, 80, 0.55);
}

.ocr-empty-msg {
  text-align: center;
  color: var(--muted);
  font-size: 0.94rem;
  padding: 2rem 1rem;
  line-height: 1.65;
}

/* Loading overlay */

.ocr-loading {
  position: absolute;
  inset: 0;
  background: rgba(8, 13, 26, 0.9);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  color: var(--muted);
  font-size: 0.96rem;
  z-index: 10;
  backdrop-filter: blur(6px);
}

.ocr-loading p { margin: 0; }

.ocr-spinner {
  width: 2.8rem;
  height: 2.8rem;
  border: 3px solid rgba(125, 178, 255, 0.18);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: ocr-spin 0.75s linear infinite;
}

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

/* ── Reset responsive.css card-collapse for OCR review table ─────
   responsive.css ≤840px hides thead + makes tbody rows flex cards.
   The OCR review table must always stay as a scrollable table.     */

.ocr-review-table thead {
  display: table-header-group !important;
}

.ocr-review-table thead th {
  display: table-cell !important;
  position: sticky;
  top: 0;
  background: rgba(8, 13, 26, 0.97);
  z-index: 2;
}

.ocr-review-table tbody tr {
  display: table-row !important;
  padding: 0 !important;
  margin: 0 !important;
  background: none !important;
  border: none !important;
  border-radius: 0 !important;
  cursor: default !important;
}

.ocr-review-table tbody td {
  display: table-cell !important;
  padding: 0.55rem 0.65rem !important;
  border: none !important;
  border-top: 1px solid rgba(255, 255, 255, 0.06) !important;
}

.ocr-review-table tbody td::before {
  display: none !important;
}

.ocr-review-table tbody td:last-child {
  margin-left: 0 !important;
  flex-shrink: unset !important;
}

.ocr-review-table tbody td:last-child::before {
  content: none !important;
}

/* ── Mobile breakpoints ────────────────────────────────────────── */

@media (max-width: 680px) {
  .ocr-modal__content {
    padding: 2rem 1.25rem 1.5rem;
    width: 98%;
    max-height: 88vh;
  }

  .ocr-modal__content--wide {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .ocr-modal__content h3 {
    font-size: 1.2rem;
    margin-bottom: 1.25rem;
  }

  .ocr-dropzone {
    padding: 2rem 1rem;
  }

  .ocr-thumb {
    width: 80px;
    height: 80px;
  }

  .ocr-review-controls {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .ocr-review-table td input[type="text"],
  .ocr-review-table td input[type="number"],
  .ocr-review-table td input[type="date"],
  .ocr-review-table td select {
    font-size: 0.82rem !important;
    min-width: 3.5rem !important;
  }

  .ocr-review-table td input[type="date"] {
    min-width: 6.5rem !important;
  }
}

@media (max-width: 400px) {
  .ocr-modal__content {
    padding: 1.5rem 0.9rem 1.25rem;
  }

  .ocr-dropzone {
    padding: 1.5rem 0.75rem;
    border-radius: 1rem;
  }

  .ocr-thumb {
    width: 70px;
    height: 70px;
  }

  .ocr-modal__cta {
    font-size: 0.96rem;
    padding: 0.75rem;
  }
}
