/* Dean document capture (doc-capture.js) — Take photo / Upload file control.
 * Shared by the staff app and the public pages; uses the tokens both themes define,
 * with plain fallbacks. No inline styles anywhere (CSP). */

/* The page's own file input stays in the form (it is what gets submitted) but is
   visually replaced by the buttons below. */
.dc-native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  opacity: 0 !important;
}
.dc-proxy { display: none; }
.dc-label-hidden { display: none !important; }

.dc { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; min-width: 0; }
.dc-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.dc-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px; padding: 8px 14px;
  border: 1px solid var(--line, #d5d9e2); border-radius: var(--r-sm, 8px);
  background: var(--surface, var(--card, #fff)); color: var(--ink, #1c2533);
  font: inherit; font-size: 14px; font-weight: 600; line-height: 1.2;
  cursor: pointer; text-align: center;
}
.dc-btn:hover { background: var(--surface-hover, var(--surface-2, #f3f5f9)); }
.dc-btn:focus-visible, .dc-link:focus-visible { outline: 2px solid var(--ring, var(--navy, #1f3a8a)); outline-offset: 2px; }
.dc-btn:disabled { opacity: .55; cursor: not-allowed; }
.dc-btn.dc-primary { background: var(--navy, #1f3a8a); border-color: var(--navy, #1f3a8a); color: #fff; }
.dc-btn.dc-ghost { background: transparent; }
.dc-ico { font-size: 16px; line-height: 1; }

.dc-file {
  display: flex; align-items: center; gap: 10px; min-width: 0;
  padding: 6px 8px; border: 1px dashed var(--line, #d5d9e2); border-radius: var(--r-sm, 8px);
}
.dc-file[hidden] { display: none; }
.dc-thumb { width: 48px; height: 48px; object-fit: cover; border-radius: 6px; flex: 0 0 auto; background: var(--surface-2, #eef1f6); }
.dc-doc { font-size: 26px; line-height: 1; flex: 0 0 auto; }
.dc-name { flex: 1 1 auto; min-width: 0; font-size: 13px; overflow-wrap: anywhere; color: var(--ink, #1c2533); }
.dc-link {
  background: none; border: 0; padding: 6px 4px; font: inherit; font-size: 13px; font-weight: 600;
  color: var(--bad, #b42318); cursor: pointer; text-decoration: underline; flex: 0 0 auto;
}
.dc-msg { margin: 0; font-size: 13px; color: var(--ink-2, #475467); }
.dc-msg.dc-err { color: var(--bad, #b42318); }
.dc.dc-invalid .dc-btns .dc-btn { border-color: var(--bad, #c0392b); box-shadow: 0 0 0 1px var(--bad, #c0392b); }

/* Sheet: choose Take photo / Upload file, and the desktop webcam view. */
.dc-backdrop {
  position: fixed; inset: 0; z-index: 10000;
  display: flex; align-items: flex-end; justify-content: center;
  background: rgba(15, 23, 42, .45);
  padding: 16px;
  padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
}
@media (min-width: 640px) { .dc-backdrop { align-items: center; } }
.dc-sheet {
  width: 100%; max-width: 380px; box-sizing: border-box;
  background: var(--surface, var(--card, #fff)); color: var(--ink, #1c2533);
  border-radius: var(--r-lg, 14px); box-shadow: var(--shadow-pop, 0 12px 40px rgba(0,0,0,.25));
  padding: 18px;
}
.dc-sheet-cam { max-width: 720px; }
.dc-title { margin: 0 0 12px; font-size: 17px; font-weight: 700; }
.dc-stack { display: flex; flex-direction: column; gap: 10px; }
.dc-big { min-height: 52px; font-size: 16px; }
.dc-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin-top: 12px; }
.dc-video, .dc-shot { display: block; width: 100%; max-height: 60vh; object-fit: contain; background: #000; border-radius: var(--r-sm, 8px); }
.dc-video[hidden], .dc-shot[hidden] { display: none; }
/* `hidden` must win over the display rules above. */
.dc [hidden], .dc-sheet [hidden] { display: none !important; }
