/* Card scanner. Loaded on every page but everything stays hidden until scan.js confirms the
   server has OCR enabled, so this file costs nothing when the feature is off. */

#scan_row { margin: 0 0 18px; }
#scan_btn { width: 100%; }
.scan_hint { margin: 6px 0 0; color: var(--muted); font-size: 0.8rem; text-align: center; }

/* A quieter button than the pink primary, so scanning never competes with "get my code". */
.btn-ghost {
  display: inline-block; width: auto; padding: 11px 16px; cursor: pointer;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--card); color: var(--ink); font: inherit; font-weight: 600;
}
.btn-ghost:hover { border-color: var(--brand); color: var(--brand-dark); }

#scan_panel { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; }
.scan_backdrop { position: absolute; inset: 0; background: rgba(12, 15, 22, 0.72); }
.scan_box {
  position: relative; width: min(94vw, 460px); max-height: 92vh; overflow-y: auto;
  background: var(--card); border-radius: var(--radius); padding: 16px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.3);
}

.scan_stage { position: relative; }
#scan_video {
  width: 100%; aspect-ratio: 4 / 3; object-fit: cover;
  background: #0d1017; border-radius: 10px; display: block;
}
/* Card-shaped guide (ID cards and business cards are both close to 85.6 x 54 mm). */
.scan_frame {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 84%; aspect-ratio: 1.585; pointer-events: none;
  border: 2px dashed rgba(255, 255, 255, 0.85); border-radius: 8px;
}
.scan_status {
  position: absolute; left: 0; right: 0; bottom: 8px; margin: 0; text-align: center;
  color: #fff; font-size: 0.9rem; font-weight: 600; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}
.scan_debug {
  position: absolute; top: 6px; left: 6px; margin: 0; padding: 3px 6px; border-radius: 5px;
  background: rgba(0, 0, 0, 0.62); color: #8ef; font-size: 0.7rem; font-family: ui-monospace, monospace;
}

.scan_fallback { text-align: center; padding: 18px 4px; }
.scan_fallback p { color: var(--muted); font-size: 0.88rem; margin: 0 0 12px; }

.scan_review { margin-top: 4px; }
.scan_doc { margin: 0 0 8px; font-weight: 700; color: var(--brand-dark); }
.scan_table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.scan_table td { padding: 6px 4px; border-bottom: 1px solid var(--line); vertical-align: top; }
.scan_table td:first-child { color: var(--muted); width: 38%; }
.scan_table tr.unsure td:last-child { background: #fff8e6; }
.tick { color: var(--ok); font-weight: 700; }
.scan_warn { margin: 12px 0 2px; font-size: 0.84rem; color: var(--err); }
.scan_legend { margin: 0; font-size: 0.78rem; color: var(--muted); }
.scan_err { color: var(--err); text-align: center; padding: 20px 0; margin: 0; }

.scan_actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.scan_actions .btn { flex: 1 1 140px; width: auto; }
.scan_privacy { margin: 12px 0 0; text-align: center; font-size: 0.78rem; color: var(--muted); }

/* Marks a field the scanner filled, so the customer can see what to check. */
.prefilled { background: #f2fbf5; }
