/* Face enrollment — colorful app shell */
.face-app {
  min-height: calc(100vh - var(--ca-nav-h, 56px));
  background:
    radial-gradient(800px 360px at 0% -10%, rgba(20, 184, 166, 0.2), transparent 55%),
    radial-gradient(700px 320px at 100% 0%, rgba(56, 189, 248, 0.18), transparent 50%),
    var(--ca-bg, #e8eef4);
  margin: -1.5rem -0.75rem;
  padding: 1.25rem 1rem 2.5rem;
}

.face-app-hero {
  max-width: 1100px;
  margin: 0 auto 1.1rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 0.75rem;
}
.face-app-hero h1 {
  font-family: var(--ca-font-cond, "IBM Plex Sans Condensed", sans-serif);
  font-size: clamp(1.45rem, 3vw, 1.9rem);
  font-weight: 600;
  margin: 0.2rem 0 0;
  color: var(--ca-navy, #0a1628);
}
.face-app-hero .sub { color: var(--ca-muted); margin: 0; font-size: 0.9rem; }

.face-chip {
  display: inline-flex;
  padding: 0.22rem 0.7rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(13, 92, 99, 0.12);
  color: #0d5c63;
}

.face-kpis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
  max-width: 1100px;
  margin: 0 auto 1rem;
}
.face-kpi {
  background: #fff;
  border: 1px solid var(--ca-border, #d3dde8);
  border-radius: 14px;
  padding: 0.85rem 1rem;
  box-shadow: var(--ca-shadow);
  text-align: center;
}
.face-kpi strong {
  display: block;
  font-size: 1.45rem;
  font-weight: 700;
  font-family: var(--ca-font-cond, sans-serif);
  color: var(--ca-navy);
}
.face-kpi span {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ca-muted);
}
.face-kpi.reg strong { color: #16a34a; }
.face-kpi.pend strong { color: #d97706; }

.face-layout {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 1rem;
  align-items: start;
}

.face-panel {
  background: #fff;
  border: 1px solid var(--ca-border);
  border-radius: 18px;
  box-shadow: var(--ca-shadow);
  overflow: hidden;
}
.face-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--ca-border);
  font-weight: 700;
  font-size: 0.85rem;
}
.face-list {
  list-style: none;
  margin: 0;
  padding: 0.5rem;
  max-height: 520px;
  overflow: auto;
}
.face-list-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.75rem;
  border-radius: 12px;
  margin-bottom: 0.35rem;
  border: 1px solid transparent;
  background: var(--ca-surface-2, #f4f7fa);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.face-list-item:hover { border-color: rgba(13, 92, 99, 0.35); }
.face-list-item.active {
  background: rgba(13, 92, 99, 0.1);
  border-color: rgba(13, 92, 99, 0.45);
}
.face-list-item.done { opacity: 0.85; }
.face-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(145deg, #14b8a6, #0ea5e9);
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.face-list-item .meta { flex: 1; min-width: 0; }
.face-list-item .meta strong { display: block; font-size: 0.92rem; }
.face-list-item .meta small { color: var(--ca-muted); }
.face-badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
}
.face-badge.ok { background: rgba(22,163,74,0.15); color: #15803d; }
.face-badge.wait { background: rgba(217,119,6,0.15); color: #b45309; }

.face-stage {
  position: relative;
  overflow: hidden;
  border-radius: 0;
  background: #0a1628;
  aspect-ratio: 4 / 3;
  border: 0;
}
.face-stage.app {
  border-radius: 0;
  min-height: 320px;
}
.face-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #000;
}
.face-guide {
  position: absolute;
  inset: 14%;
  border: 2px solid rgba(94, 234, 212, 0.55);
  border-radius: 50%;
  pointer-events: none;
  box-shadow: 0 0 0 999px rgba(10, 22, 40, 0.4), inset 0 0 30px rgba(20, 184, 166, 0.25);
}
.face-capture-upgraded .face-guide { display: none; }
.face-stage-footer {
  padding: 1rem 1.15rem 1.25rem;
  background: #fff;
}
.face-status {
  color: var(--ca-muted);
  font-size: 0.9rem;
  min-height: 1.4em;
  font-weight: 500;
  margin: 0 0 0.75rem;
}
.face-current {
  font-weight: 700;
  color: var(--ca-navy);
  margin: 0 0 0.85rem;
  font-size: 1.05rem;
}
.face-btn {
  width: 100%;
  border: 0;
  border-radius: 999px;
  padding: 0.8rem 1.2rem;
  font-weight: 700;
  background: linear-gradient(135deg, #14b8a6, #0ea5e9);
  color: #042f2e;
  box-shadow: 0 8px 22px rgba(14,165,233,0.28);
}
.face-btn:disabled { opacity: 0.5; }
.face-btn.ghost {
  background: #fff;
  color: var(--ca-navy);
  border: 1px solid var(--ca-border);
  box-shadow: none;
  margin-top: 0.5rem;
}

.face-progress {
  height: 8px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
  margin-top: 0.65rem;
}
.face-progress > div {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #14b8a6, #22c55e);
  transition: width 0.3s ease;
}

.face-enroll-filters {
  max-width: 1100px;
  margin: 0 auto 1rem;
}

.face-kpis-5 {
  grid-template-columns: repeat(5, 1fr);
}
.face-kpi.rate strong { color: #0d9488; }
.face-kpi.next strong {
  font-size: 1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.face-progress-wrap {
  max-width: 1100px;
  margin: -0.35rem auto 1rem;
}

.face-list-tools {
  padding: 0.55rem 0.75rem 0.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  border-bottom: 1px solid var(--ca-border, #e2e8f0);
}
.face-list-search {
  width: 100%;
  border: 1px solid var(--ca-border, #d3dde8);
  border-radius: 10px;
  padding: 0.5rem 0.7rem;
  font-size: 0.85rem;
  background: var(--ca-surface-2, #f8fafc);
}
.face-list-search:focus {
  outline: none;
  border-color: #14b8a6;
  box-shadow: 0 0 0 3px rgba(20,184,166,0.15);
}
.face-list-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}
.face-list-filters button {
  border: 1px solid var(--ca-border, #d3dde8);
  background: #fff;
  color: var(--ca-muted);
  border-radius: 999px;
  padding: 0.25rem 0.65rem;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  cursor: pointer;
}
.face-list-filters button.on {
  background: linear-gradient(135deg, #14b8a6, #0ea5e9);
  color: #042f2e;
  border-color: transparent;
}

.face-list-empty {
  text-align: center;
  color: var(--ca-muted);
  font-size: 0.82rem;
  padding: 1.75rem 0.75rem !important;
  list-style: none;
}

.face-enroll-flash {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, rgba(20,184,166,0.94), rgba(14,165,233,0.9));
  animation: faceFlashIn 0.3s ease;
  text-align: center;
  padding: 1rem;
}
.face-enroll-check {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #fff;
  color: #0d9488;
  font-size: 2rem;
  font-weight: 800;
  display: grid;
  place-items: center;
  margin-bottom: 0.65rem;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}
.face-enroll-name {
  font-size: 1.35rem;
  font-weight: 800;
  color: #042f2e;
}
.face-enroll-sub {
  margin-top: 0.35rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #134e4a;
}
@keyframes faceFlashIn {
  from { opacity: 0; transform: scale(0.94); }
  to { opacity: 1; transform: none; }
}

.face-btn-row { display: flex; flex-direction: column; gap: 0.45rem; }
.face-hint {
  margin: 0.65rem 0 0;
  font-size: 0.72rem;
  color: var(--ca-muted);
  text-align: center;
}

.face-auto-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  cursor: pointer;
  user-select: none;
}

.face-login-card .face-stage {
  border-radius: 16px;
  overflow: hidden;
  min-height: 280px;
}

.face-capture-panel .face-stage.app {
  min-height: 340px;
}

@media (max-width: 900px) {
  .face-layout { grid-template-columns: 1fr; }
  .face-kpis-5 { grid-template-columns: repeat(3, 1fr); }
  .face-list { max-height: 280px; }
}

.face-login-card .face-stage {
  margin-bottom: 0.65rem;
  border-radius: 12px;
}

/* ——— Live verify ring overlay (face-verify-ui.js) ——— */
.face-capture-stage { position: relative; }
.face-verify-wrap { position: relative; width: 100%; height: 100%; }
.face-circle-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
.face-circle-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.face-circle-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 80px rgba(0,0,0,0.35);
}
.face-circle-guide {
  position: absolute;
  inset: 14%;
  border-radius: 50%;
  pointer-events: none;
  border: 2px solid rgba(148,163,184,0.35);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.face-circle-guide[data-state="detecting"] {
  border-color: rgba(56,189,248,0.65);
  box-shadow: 0 0 0 4px rgba(56,189,248,0.15);
}
.face-circle-guide[data-state="blink"] {
  border-color: rgba(250,204,21,0.85);
  box-shadow: 0 0 0 4px rgba(250,204,21,0.2);
}
.face-circle-guide[data-state="ready"],
.face-circle-guide[data-state="success"] {
  border-color: rgba(34,197,94,0.9);
  box-shadow: 0 0 0 4px rgba(34,197,94,0.25);
}
.face-circle-ring {
  position: absolute;
  inset: 12%;
  border-radius: 50%;
  pointer-events: none;
  border: 3px solid transparent;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.face-circle-ring[data-state="detecting"] { border-color: rgba(56,189,248,0.5); }
.face-circle-ring[data-state="blink"] {
  border-color: rgba(250,204,21,0.75);
  animation: face-ring-pulse 0.6s ease infinite;
}
.face-circle-ring[data-state="ready"] { border-color: rgba(34,197,94,0.85); }
.face-circle-ring[data-state="success"] {
  border-color: #22c55e;
  transform: scale(1.02);
}
.face-circle-ring[data-state="fail"] { border-color: #ef4444; }
@keyframes face-ring-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.03); opacity: 0.85; }
}
.face-circle-lock {
  position: absolute;
  top: 10%;
  right: 10%;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #22c55e;
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  box-shadow: 0 4px 14px rgba(34,197,94,0.45);
  transition: transform 0.2s ease;
}
.face-circle-lock.is-on { transform: scale(1); }
.face-circle-eyes { position: absolute; inset: 0; pointer-events: none; }
.face-eye-dot {
  position: absolute;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  border-radius: 50%;
  background: rgba(56,189,248,0.9);
  opacity: 0;
  transition: opacity 0.15s ease, transform 0.1s ease;
  box-shadow: 0 0 8px rgba(56,189,248,0.6);
}
.face-eye-dot.visible { opacity: 1; }
.face-eye-dot.blinking { transform: scaleY(0.15); background: #facc15; }
.face-circle-canvas { position: absolute; inset: 0; pointer-events: none; }
.face-circle-progress {
  display: flex;
  gap: 0.4rem;
  justify-content: center;
  padding: 0.5rem 0;
}
.face-circle-progress .step-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #cbd5e1;
  transition: background 0.2s ease, transform 0.2s ease;
}
.face-circle-progress .step-dot.active {
  background: #0ea5e9;
  transform: scale(1.25);
}
.face-circle-progress .step-dot.done { background: #22c55e; }
.face-circle-toast {
  text-align: center;
  font-weight: 600;
  font-size: 0.88rem;
  padding: 0.35rem 0.75rem;
  border-radius: 8px;
  margin: 0.25rem auto 0.5rem;
  max-width: 90%;
}
.face-circle-toast[data-state="success"] {
  background: rgba(34,197,94,0.12);
  color: #15803d;
}
.face-circle-toast[data-state="fail"] {
  background: rgba(239,68,68,0.12);
  color: #b91c1c;
}
.face-circle-status.face-status-success { color: #15803d; font-weight: 600; }
.face-circle-status.face-status-fail { color: #b91c1c; font-weight: 600; }
.face-circle-status.face-status-progress { color: #0369a1; }

@media (max-width: 900px) {
  .face-layout { grid-template-columns: 1fr; }
  .face-list { max-height: 280px; }
  .face-app { margin: -1rem -0.5rem; }
}
