/* ==========================================================================
   Light Check camera, photo checklist, privacy lines, sample face,
   capture badge and the live drape mirror.
   ========================================================================== */

.sca-lc-overlay {
  --lc-pass: #2f8f5b;
  --lc-warn: #b7791f;
  --lc-fail: #c53030;
  --lc-ink: var(--ink, #2c2722);
  --lc-muted: #6b6560;
  --lc-line: #e6dfd8;
  --lc-paper: #fffdfa;
  --lc-accent: var(--rose, #8c5dab);
}

/* ---- Upload form entry points ------------------------------------------ */

.sca-capture-options {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin: 12px 0 4px;
}
.sca-capture-options[hidden],
.sca-capture-option[hidden] { display: none; }

.sca-capture-option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 12px 14px;
  border: 1px solid #e3dcd4;
  border-radius: 12px;
  background: #fff;
  color: var(--ink, #2c2722);
  text-align: left;
  cursor: pointer;
  font: inherit;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.sca-capture-option:hover,
.sca-capture-option:focus-visible {
  border-color: var(--rose, #8c5dab);
  box-shadow: 0 2px 12px rgba(140, 93, 171, .12);
  outline: none;
}
.sca-capture-option:disabled { opacity: .6; cursor: progress; }
.sca-capture-option-title { font-weight: 600; font-size: .95rem; }
.sca-capture-option-sub { font-size: .8rem; color: #6b6560; }
.sca-capture-option--camera .sca-capture-option-title::before { content: "📷 "; }
.sca-capture-option--sample .sca-capture-option-title::before { content: "✨ "; }

/* ---- Overlay + panel ---------------------------------------------------- */

body.sca-lc-open { overflow: hidden; }

.sca-lc-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(20, 16, 14, .72);
}

.sca-lc-panel {
  width: min(980px, 100%);
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  overflow: auto;
  background: var(--lc-paper);
  color: var(--lc-ink);
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
}

.sca-lc-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.sca-lc-title { margin: 0; font: 500 1.4rem/1.2 var(--serif, Georgia, serif); }
.sca-lc-sub { margin: 4px 0 0; font-size: .88rem; color: var(--lc-muted); }
.sca-lc-close {
  flex: none;
  width: 40px;
  height: 40px;
  border: 1px solid var(--lc-line);
  border-radius: 50%;
  background: #fff;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  color: var(--lc-ink);
}

.sca-lc-body {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.sca-lc-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  max-height: 70vh;
  margin: 0 auto;
  background: #111;
  border-radius: 14px;
  overflow: hidden;
}
.sca-lc-video,
.sca-lc-guide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.sca-lc-video { object-fit: contain; }
/* The selfie preview behaves like a mirror; the captured frames are not mirrored. */
.sca-lc-stage[data-facing="user"] .sca-lc-video { transform: scaleX(-1); }
.sca-lc-guide { pointer-events: none; }

.sca-lc-countdown {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font: 600 6rem/1 var(--serif, Georgia, serif);
  color: #fff;
  text-shadow: 0 4px 24px rgba(0, 0, 0, .5);
  opacity: 0;
  transition: opacity .15s ease;
  pointer-events: none;
}
.sca-lc-countdown.is-on { opacity: 1; }

.sca-lc-flash {
  position: absolute;
  inset: 0;
  background: #fff;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}
.sca-lc-flash.is-on { opacity: .8; transition: none; }

.sca-lc-side { display: flex; flex-direction: column; gap: 12px; }

.sca-lc-status {
  margin: 0;
  min-height: 3em;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f4efe9;
  font-weight: 600;
  font-size: .95rem;
  line-height: 1.35;
}
.sca-lc-status[data-tone="pass"] { background: #e7f4ec; color: var(--lc-pass); }
.sca-lc-status[data-tone="warn"] { background: #fbf1e1; color: #8a5a12; }
.sca-lc-status[data-tone="fail"] { background: #fbe9e9; color: var(--lc-fail); }

.sca-lc-progress {
  height: 6px;
  border-radius: 999px;
  background: #eee7e0;
  overflow: hidden;
}
.sca-lc-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--lc-pass);
  transition: width .12s linear;
}

.sca-lc-controls { display: flex; flex-direction: column; gap: 10px; }
.sca-lc-take { width: 100%; justify-content: center; }
.sca-lc-take:disabled { opacity: .55; cursor: not-allowed; }
.sca-lc-toggle {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: .84rem;
  line-height: 1.4;
  color: var(--lc-muted);
  cursor: pointer;
}
.sca-lc-toggle input { margin-top: 3px; accent-color: var(--lc-accent); }
.sca-lc-toggle strong { color: var(--lc-ink); }

/* ---- Checklist rows (camera + upload) ------------------------------------ */

.sca-checklist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.sca-checklist-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: .9rem;
  line-height: 1.35;
}
.sca-checklist-icon {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  color: #fff;
  background: #c9c2bb;
  transition: background-color .2s ease;
}
.sca-checklist-row.is-pass .sca-checklist-icon { background: #2f8f5b; }
.sca-checklist-row.is-warn .sca-checklist-icon { background: #d69e2e; }
.sca-checklist-row.is-fail .sca-checklist-icon { background: #c53030; }
.sca-checklist-text { display: flex; flex-direction: column; gap: 2px; padding-top: 2px; }
.sca-checklist-label { font-weight: 600; color: var(--ink, #2c2722); }
.sca-checklist-row.is-pending .sca-checklist-label { color: #8a837c; font-weight: 500; }
.sca-checklist-fix { color: #5f5852; font-size: .85rem; }

/* Upload confirmation card */
.sca-upload-checklist {
  margin: 12px 0;
  padding: 14px 16px;
  border: 1px solid #f0d9a8;
  border-radius: 14px;
  background: #fffaf0;
}
.sca-upload-checklist.has-fails { border-color: #f1c0c0; background: #fff6f6; }
.sca-upload-checklist.is-all-good { border-color: #cfe6d7; background: #f4fbf6; }
.sca-upload-checklist-head { display: flex; flex-direction: column; gap: 2px; margin-bottom: 10px; }
.sca-upload-checklist.is-all-good .sca-upload-checklist-head { margin-bottom: 0; }
.sca-upload-checklist-title {
  font: 500 .72rem/1 var(--mono, ui-monospace, monospace);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #8a837c;
}
.sca-upload-checklist-verdict { font-weight: 600; font-size: .92rem; }
.sca-upload-checklist-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

/* ---- Privacy line ---------------------------------------------------------- */

.sca-privacy-line {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 8px 0 0;
  font-size: .78rem;
  line-height: 1.4;
  color: #6b6560;
}
.sca-privacy-line-icon { flex: none; display: inline-flex; padding-top: 2px; }
.sca-privacy-line--local .sca-privacy-line-icon { color: #2f8f5b; }
.sca-privacy-line--ai .sca-privacy-line-icon { color: #8c5dab; }
.sca-lc-privacy { margin-top: 2px; }

/* ---- Results: capture badge + sample banner ------------------------------- */

.sca-capture-badge {
  margin: 8px 0 0;
  font-size: .82rem;
  line-height: 1.4;
  color: #5f5852;
}
.sca-capture-badge--good::before { content: "● "; color: #2f8f5b; }
.sca-capture-badge--warn::before { content: "● "; color: #d69e2e; }
.sca-capture-badge--sample {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #f6efff;
  border: 1px solid #e2d3f2;
}
.sca-capture-badge--sample .sca-capture-badge-text { font-weight: 600; color: #4b2a66; }
.sca-capture-badge-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.sca-pro-chip {
  display: inline-block;
  margin-left: 4px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--rose, #8c5dab);
  color: #fff;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .04em;
  vertical-align: middle;
}
.sca-vdrape-live[hidden] { display: none; }

/* ---- Live drape mirror ------------------------------------------------------ */

.sca-mirror-panel { width: min(720px, 100%); }
.sca-mirror-stage {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: #111;
}
.sca-mirror-stage { display: flex; justify-content: center; }
.sca-mirror-canvas {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 60vh;
  max-height: 60dvh;
  min-height: 240px;
}
.sca-mirror-video { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.sca-mirror-verdict.sca-vdrape-verdict { left: 12px; top: 12px; bottom: auto; }
.sca-mirror-status {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  margin: 0;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .6);
  color: #fff;
  font-size: .85rem;
  white-space: nowrap;
}
.sca-mirror-status[hidden] { display: none; }
.sca-mirror-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, .85);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}
.sca-mirror-nav--prev { left: 10px; }
.sca-mirror-nav--next { right: 10px; }
.sca-mirror-rail {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 2px 4px;
  scrollbar-width: thin;
}
.sca-mirror-chip { flex: none; }
.sca-mirror-actions { display: flex; justify-content: center; margin-top: 8px; }

/* ---- Small screens ---------------------------------------------------------- */

@media (max-width: 760px) {
  .sca-lc-overlay { padding: 0; align-items: stretch; }
  .sca-lc-panel {
    max-height: none;
    height: 100%;
    border-radius: 0;
    padding: 14px 16px 24px;
  }
  .sca-lc-body { grid-template-columns: 1fr; gap: 12px; }
  .sca-lc-stage { max-height: 58vh; max-height: 58dvh; }
  .sca-lc-sub { display: none; }
  .sca-lc-checks .sca-checklist { grid-template-columns: 1fr 1fr; gap: 6px 10px; }
  .sca-lc-checks .sca-checklist-row { font-size: .8rem; }
}

@media (prefers-reduced-motion: reduce) {
  .sca-lc-progress span,
  .sca-checklist-icon,
  .sca-lc-countdown,
  .sca-lc-flash { transition: none; }
}

/* Reliability gate: the specific failing checks */
.sca-reliability-gate-checklist {
  max-width: 520px;
  margin: 14px auto 4px;
  text-align: left;
}
