* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: #101322;
  color: #e8ebf2;
}

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 20px;
}

.subtitle {
  opacity: 0.9;
}

.card {
  background: #131b32;
  border: 1px solid #28365c;
  border-radius: 12px;
  margin: 16px 0;
  padding: 16px;
}

.row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin: 10px 0;
}

.btn {
  border: 0;
  border-radius: 8px;
  padding: 10px 14px;
  background: #355dff;
  color: #fff;
  cursor: pointer;
}

.btn.secondary {
  background: #4b556d;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.btn.danger {
  background: #d94d5e;
}

video,
canvas {
  width: 420px;
  max-width: 100%;
  border-radius: 8px;
  background: #000;
}

label {
  display: flex;
  gap: 8px;
  align-items: center;
}

pre {
  white-space: pre-wrap;
  word-break: break-word;
  background: #131b32;
  border: 1px solid #28365c;
  border-radius: 8px;
  padding: 10px;
}

.pill {
  border: 1px solid #33446d;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  background: #1b2645;
  color: #dbe6ff;
}

.liveness-page {
  max-width: 560px;
}

.liveness-card h1 {
  margin: 0;
}

.liveness-eyebrow {
  margin: 0 0 8px;
  color: #8eb0ff;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.liveness-camera-frame {
  margin-top: 16px;
  position: relative;
  overflow: hidden;
  border-radius: 18px;
}

.liveness-camera-frame video,
.liveness-camera-frame canvas {
  width: 100%;
  display: block;
  min-height: 340px;
  object-fit: cover;
}

.liveness-camera-frame canvas {
  position: absolute;
  inset: 0;
  background: transparent;
  pointer-events: none;
}

.liveness-frame-mask {
  position: absolute;
  width: 66%;
  aspect-ratio: 1 / 1;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  border: 2px solid rgba(56, 107, 255, 0.7);
  border-radius: 50%;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.26);
  pointer-events: none;
}

.liveness-checklist {
  list-style: none;
  padding: 0;
  margin: 16px 0 10px;
  display: grid;
  gap: 8px;
}

.liveness-check-item {
  background: #0f1528;
  border: 1px solid #33446d;
  border-radius: 10px;
  padding: 10px 12px;
  color: #c6d3f5;
}

.liveness-check-item.done {
  border-color: #2f8f60;
  background: #0f2a1f;
  color: #98e8ba;
}

.liveness-status {
  margin: 8px 0 10px;
  color: #b6c8f8;
  font-size: 14px;
}

.liveness-progress-track {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: #0f1528;
  border: 1px solid #33446d;
  overflow: hidden;
}

.liveness-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #386bff, #5ac8ff);
  transition: width 180ms ease;
}

.liveness-disclaimer-row {
  margin-top: 12px;
  align-items: center;
}

.liveness-disclaimer {
  color: #9fb0dc;
  font-size: 13px;
}

body.liveness-skin {
  min-height: 100vh;
  background:
    radial-gradient(circle at 10% 0%, rgba(77, 224, 183, 0.22), transparent 40%),
    radial-gradient(circle at 95% 0%, rgba(104, 127, 255, 0.22), transparent 42%),
    linear-gradient(180deg, #f5f8ff 0%, #eef3ff 55%, #ebf8f5 100%);
  color: #182033;
}

body.liveness-skin .liveness-page {
  max-width: 640px;
  padding-top: 28px;
  padding-bottom: 28px;
}

body.liveness-skin .liveness-card {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #dce4ff;
  box-shadow: 0 18px 50px rgba(36, 55, 103, 0.13);
  border-radius: 22px;
  padding: 20px;
}

body.liveness-skin .liveness-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

body.liveness-skin .liveness-chip {
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: #0f7d66;
  background: #d9f9ef;
  border: 1px solid #8ce6ca;
}

body.liveness-skin .liveness-eyebrow {
  color: #2649c8;
  margin-bottom: 0;
}

body.liveness-skin .liveness-card h1 {
  margin-top: 8px;
  margin-bottom: 10px;
  color: #111a35;
}

body.liveness-skin .subtitle {
  color: #42506f;
  line-height: 1.45;
}

body.liveness-skin .liveness-camera-frame {
  margin-top: 18px;
}

body.liveness-skin .liveness-camera-frame video,
body.liveness-skin .liveness-camera-frame canvas {
  border-radius: 18px;
}

body.liveness-skin .liveness-camera-frame video {
  border: 1px solid #d8e3ff;
}

body.liveness-skin .liveness-frame-mask {
  width: 68%;
  aspect-ratio: 1 / 1;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  border-color: rgba(76, 115, 255, 0.75);
  border-width: 4px;
  box-shadow: 0 0 0 9999px rgba(19, 29, 54, 0.3);
}

body.liveness-skin .liveness-camera-label {
  position: absolute;
  left: 12px;
  bottom: 12px;
  border-radius: 999px;
  background: rgba(17, 26, 53, 0.76);
  color: #fff;
  font-size: 12px;
  padding: 6px 10px;
}

body.liveness-skin .liveness-checklist {
  grid-template-columns: 1fr;
  margin-top: 18px;
}

body.liveness-skin .liveness-check-item {
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 12px;
  border-color: #d9e2ff;
  background: #f7f9ff;
  color: #223057;
  font-weight: 500;
}

body.liveness-skin .liveness-check-item::before {
  content: '';
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #9db0e7;
  background: #fff;
  flex: 0 0 auto;
}

body.liveness-skin .liveness-check-item.done {
  border-color: #87dcbc;
  background: #ecfff6;
  color: #0f674f;
}

body.liveness-skin .liveness-check-item.done::before {
  border-color: #2aa772;
  background: #2aa772;
  box-shadow: inset 0 0 0 3px #ecfff6;
}

body.liveness-skin .liveness-status {
  margin-top: 12px;
  color: #334872;
  font-weight: 600;
}

body.liveness-skin .liveness-progress-track {
  margin-top: 8px;
  height: 10px;
  border: 0;
  background: #dce5ff;
}

body.liveness-skin .liveness-progress-fill {
  background: linear-gradient(90deg, #4f7bff, #3ed4a5);
}

body.liveness-skin .btn {
  border-radius: 10px;
  padding: 11px 15px;
  font-weight: 600;
  box-shadow: 0 8px 20px rgba(75, 117, 255, 0.25);
}

body.liveness-skin .btn.secondary {
  box-shadow: none;
  background: #edf1fb;
  color: #334872;
  border: 1px solid #cfdbfb;
}

body.liveness-skin .liveness-console {
  margin-top: 14px;
  background: #f8faff;
  border-color: #dbe4ff;
  color: #43537d;
  min-height: 64px;
}

body.liveness-skin .liveness-disclaimer-row {
  margin-top: 6px;
  gap: 8px;
}

body.liveness-skin .pill {
  background: #e9eeff;
  border-color: #cad8ff;
  color: #314581;
}

body.liveness-skin .liveness-disclaimer {
  color: #445377;
}

body.liveness-skin {
  background:
    radial-gradient(circle at 50% -10%, rgba(55, 137, 255, 0.2), transparent 42%),
    radial-gradient(circle at 50% 100%, rgba(0, 181, 255, 0.12), transparent 45%),
    #03060f;
  color: #e8f0ff;
}

body.liveness-skin .liveness-card {
  background: rgba(5, 10, 24, 0.84);
  border: 1px solid rgba(100, 146, 255, 0.28);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.58);
}

body.liveness-skin .liveness-chip {
  color: #95ebff;
  background: rgba(6, 44, 78, 0.45);
  border-color: rgba(82, 201, 255, 0.45);
}

body.liveness-skin .liveness-eyebrow {
  color: #9fbeff;
}

body.liveness-skin .liveness-card h1,
body.liveness-skin .subtitle {
  color: #e8f0ff;
}

body.liveness-skin .subtitle {
  opacity: 0.78;
}

body.liveness-skin .liveness-camera-frame {
  border-radius: 24px;
  border: 1px solid rgba(85, 123, 255, 0.35);
}

body.liveness-skin .liveness-frame-mask {
  border: 0;
  width: 66%;
  box-shadow: 0 0 0 9999px rgba(2, 5, 14, 0.7);
}

body.liveness-skin .faceid-target {
  position: absolute;
  width: 66%;
  aspect-ratio: 1 / 1;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 2px solid rgba(114, 170, 255, 0.7);
  box-shadow: 0 0 30px rgba(61, 126, 255, 0.35);
  pointer-events: none;
}

body.liveness-skin .faceid-corner {
  position: absolute;
  width: 28%;
  height: 28%;
  border: 3px solid #7dd8ff;
  filter: drop-shadow(0 0 6px rgba(125, 216, 255, 0.65));
}

body.liveness-skin .faceid-corner.tl {
  top: -2px;
  left: -2px;
  border-right: 0;
  border-bottom: 0;
  border-top-left-radius: 22px;
}

body.liveness-skin .faceid-corner.tr {
  top: -2px;
  right: -2px;
  border-left: 0;
  border-bottom: 0;
  border-top-right-radius: 22px;
}

body.liveness-skin .faceid-corner.bl {
  bottom: -2px;
  left: -2px;
  border-right: 0;
  border-top: 0;
  border-bottom-left-radius: 22px;
}

body.liveness-skin .faceid-corner.br {
  bottom: -2px;
  right: -2px;
  border-left: 0;
  border-top: 0;
  border-bottom-right-radius: 22px;
}

body.liveness-skin .faceid-scan-line {
  position: absolute;
  left: 10%;
  width: 80%;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(90, 225, 255, 0), rgba(90, 225, 255, 1), rgba(90, 225, 255, 0));
  box-shadow: 0 0 12px rgba(90, 225, 255, 0.95);
  opacity: 0;
}

body.liveness-skin.faceid-scanning .faceid-scan-line {
  opacity: 1;
  animation: faceidScanSweep 1.8s linear infinite;
}

body.liveness-skin.faceid-complete .faceid-target {
  border-color: rgba(55, 221, 171, 0.88);
  box-shadow: 0 0 32px rgba(55, 221, 171, 0.42);
}

body.liveness-skin .liveness-check-item {
  background: rgba(10, 18, 40, 0.85);
  border-color: rgba(110, 145, 255, 0.28);
  color: #d8e8ff;
}

body.liveness-skin .liveness-check-item.done {
  background: rgba(6, 60, 52, 0.65);
  border-color: rgba(68, 218, 181, 0.72);
  color: #b8ffee;
}

body.liveness-skin .liveness-status,
body.liveness-skin .liveness-disclaimer {
  color: #b7caf6;
}

body.liveness-skin .liveness-progress-track {
  background: rgba(45, 67, 122, 0.5);
}

body.liveness-skin .liveness-progress-fill {
  background: linear-gradient(90deg, #67b6ff, #54f0cc);
}

body.liveness-skin .btn.secondary {
  background: rgba(31, 43, 80, 0.85);
  border-color: rgba(102, 129, 198, 0.4);
  color: #d5e4ff;
}

body.liveness-skin .liveness-console {
  background: rgba(8, 14, 30, 0.92);
  border-color: rgba(88, 117, 188, 0.36);
  color: #a8bce8;
}

@keyframes faceidScanSweep {
  0% {
    top: 16%;
  }
  50% {
    top: 50%;
  }
  100% {
    top: 84%;
  }
}

body.liveness-skin {
  --faceid-progress: 0%;
  background: #000;
  color: #f4f6ff;
}

body.liveness-skin .liveness-page {
  min-height: 100vh;
  max-width: 460px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 24px;
  padding-bottom: 24px;
}

body.liveness-skin .liveness-card {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
}

body.liveness-skin .liveness-header-row {
  justify-content: center;
}

body.liveness-skin .liveness-chip {
  display: none;
}

body.liveness-skin .liveness-eyebrow {
  color: #8aa9ff;
}

body.liveness-skin .liveness-card h1,
body.liveness-skin .subtitle {
  text-align: center;
}

body.liveness-skin .subtitle {
  color: #aab8d6;
  max-width: 360px;
  margin-left: auto;
  margin-right: auto;
}

body.liveness-skin .liveness-camera-frame {
  margin: 20px auto 0;
  border: 0;
  width: min(100%, 390px);
  border-radius: 24px;
  background: #04070f;
}

body.liveness-skin .liveness-camera-frame video,
body.liveness-skin .liveness-camera-frame canvas {
  min-height: 390px;
}

body.liveness-skin .liveness-frame-mask {
  width: 72%;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.72);
}

body.liveness-skin .faceid-target {
  width: 72%;
  border: 0;
  box-shadow: none;
  overflow: visible;
}

body.liveness-skin .faceid-target::before {
  content: '';
  position: absolute;
  inset: -7px;
  border-radius: 50%;
  background: conic-gradient(#55e8ff var(--faceid-progress), rgba(78, 108, 170, 0.2) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 9px), #000 calc(100% - 8px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 9px), #000 calc(100% - 8px));
}

body.liveness-skin .faceid-target::after {
  content: '';
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  border: 1px dashed rgba(128, 158, 224, 0.45);
}

body.liveness-skin .faceid-corner {
  width: 24%;
  height: 24%;
  border-color: #6fe1ff;
  border-width: 2px;
}

body.liveness-skin .faceid-scan-line {
  left: 14%;
  width: 72%;
}

body.liveness-skin .liveness-camera-label {
  left: 50%;
  transform: translateX(-50%);
  bottom: 18px;
  background: rgba(0, 0, 0, 0.62);
  color: #c2d5ff;
}

body.liveness-skin .liveness-checklist {
  margin-top: 16px;
  gap: 6px;
}

body.liveness-skin .liveness-check-item {
  background: transparent;
  border-color: rgba(103, 133, 199, 0.4);
}

body.liveness-skin .liveness-status {
  text-align: center;
}

body.liveness-skin .liveness-progress-track {
  display: none;
}

body.liveness-skin .row {
  justify-content: center;
}

body.liveness-skin .btn.secondary {
  background: rgba(28, 34, 57, 0.95);
}

body.liveness-skin .liveness-console {
  background: rgba(10, 13, 22, 0.95);
}

body.liveness-skin .liveness-disclaimer-row {
  justify-content: center;
  text-align: center;
}

body.liveness-skin .pill {
  background: rgba(21, 31, 57, 0.9);
}

body.liveness-skin.faceid-complete .faceid-target::before {
  background: conic-gradient(#44d9a5 100%, rgba(68, 217, 165, 0.25) 0);
}
