* {
  box-sizing: border-box;
}

:root {
  --ui-bg: #eef4ff;
  --ui-text: #1b2a4a;
  --ui-subtext: #51648c;
  --ui-card: rgba(255, 255, 255, 0.88);
  --ui-border: rgba(91, 120, 188, 0.2);
  --ui-shadow: 0 16px 48px rgba(36, 62, 122, 0.14);
  --ui-primary: #2f68ff;
  --ui-primary-hover: #2457de;
  --ui-secondary: #e7efff;
  --ui-secondary-text: #36538f;
  --ui-danger: #dc4c64;
  --ui-input-bg: rgba(255, 255, 255, 0.94);
}

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--ui-text);
  background:
    radial-gradient(circle at 0% 0%, rgba(100, 132, 255, 0.24), transparent 40%),
    radial-gradient(circle at 100% 0%, rgba(68, 210, 175, 0.18), transparent 44%),
    linear-gradient(180deg, #f9fcff 0%, var(--ui-bg) 42%, #edf7f5 100%);
  min-height: 100vh;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: url('/assets/face-hero.webp') center 36px / min(760px, 92vw) no-repeat;
  opacity: 0.1;
  pointer-events: none;
  z-index: 0;
}

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px;
  position: relative;
  z-index: 1;
}

.subtitle {
  opacity: 1;
  color: var(--ui-subtext);
}

.card {
  background: var(--ui-card);
  border: 1px solid var(--ui-border);
  border-radius: 20px;
  margin: 18px 0;
  padding: 20px;
  box-shadow: var(--ui-shadow);
  backdrop-filter: blur(6px);
}

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

.btn {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 10px 16px;
  background: linear-gradient(180deg, #4b7fff 0%, var(--ui-primary) 100%);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
  transition: transform 120ms ease, box-shadow 160ms ease, background 160ms ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgba(47, 104, 255, 0.28);
  background: linear-gradient(180deg, #3a72ff 0%, var(--ui-primary-hover) 100%);
}

.btn.secondary {
  background: var(--ui-secondary);
  color: var(--ui-secondary-text);
  border-color: rgba(78, 112, 183, 0.22);
  box-shadow: none;
}

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

.btn.danger {
  background: var(--ui-danger);
  box-shadow: 0 8px 16px rgba(220, 76, 100, 0.24);
}

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

label {
  display: flex;
  gap: 8px;
  align-items: center;
  color: #334b79;
}

pre {
  white-space: pre-wrap;
  word-break: break-word;
  background: rgba(245, 249, 255, 0.95);
  border: 1px solid #d4e1ff;
  border-radius: 12px;
  padding: 10px;
  color: #33476f;
}

.pill {
  border: 1px solid #ccdaf9;
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 600;
  background: #edf3ff;
  color: #355183;
}

.pill.success {
  background: #143625;
  border-color: #255f3f;
  color: #9cf5c1;
}

.btn-spinner {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: rgba(255, 255, 255, 0.95);
  display: none;
  flex: 0 0 auto;
}

.btn.is-loading .btn-spinner {
  display: inline-block;
  animation: phone-auth-spin 0.75s linear infinite;
}

@keyframes phone-auth-spin {
  to {
    transform: rotate(360deg);
  }
}

.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);
}

:root {
  --md-font: Roboto, 'Google Sans', 'Noto Sans', system-ui, -apple-system, Segoe UI, sans-serif;
  --md-bg: #0f1115;
  --md-surface: #171a23;
  --md-surface-2: #202738;
  --md-outline: #3a4353;
  --md-text: #e3e8f3;
  --md-text-muted: #b3bfd4;
  --md-primary: #adc6ff;
  --md-primary-strong: #4f6dff;
  --md-tertiary: #7de2ff;
  --md-danger: #ffb3b8;
  --md-danger-strong: #b3261e;
}

body,
input,
button {
  font-family: var(--md-font);
}

body {
  background: var(--md-bg);
  color: var(--md-text);
}

.container {
  max-width: 1140px;
  padding: 30px;
}

h1,
h2,
h3 {
  font-weight: 500;
  letter-spacing: 0.01em;
}

.subtitle {
  color: var(--md-text-muted);
}

.card {
  background: var(--md-surface);
  border: 1px solid var(--md-outline);
  border-radius: 28px;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.22),
    0 8px 24px rgba(0, 0, 0, 0.3);
  padding: 20px;
}

.btn {
  border: 0;
  border-radius: 999px;
  min-height: 42px;
  padding: 0 20px;
  background: linear-gradient(120deg, var(--md-primary-strong), #6b58ff);
  color: #fff;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: filter 120ms ease, transform 120ms ease;
}

.btn:hover {
  filter: brightness(1.08);
}

.btn:active {
  transform: translateY(1px);
}

.btn.secondary {
  background: linear-gradient(120deg, #242d42, #202738);
  color: var(--md-primary);
  border: 1px solid #5a6f95;
}

.btn.danger {
  background: var(--md-danger-strong);
  color: #fff;
}

input,
select,
textarea {
  border-radius: 12px;
  min-height: 40px;
  background: #121722;
  border: 1px solid #4a5870;
  color: var(--md-text);
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid transparent;
  border-color: var(--md-primary);
  box-shadow: 0 0 0 3px rgba(156, 202, 255, 0.22);
}

pre {
  background: #111621;
  border: 1px solid #344056;
  border-radius: 14px;
  color: #ccd8ee;
}

.pill {
  background: #1a2230;
  border-color: #42516a;
  color: #d1def8;
}

body.liveness-skin {
  background: var(--md-bg);
  color: var(--md-text);
}

body.liveness-skin .liveness-card {
  background: var(--md-surface);
  border: 1px solid var(--md-outline);
  border-radius: 28px;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.22),
    0 8px 24px rgba(0, 0, 0, 0.3);
  padding: 20px;
}

body.liveness-skin .liveness-chip {
  display: inline-flex;
  background: #1d2b45;
  border: 1px solid #42516a;
  color: var(--md-primary);
}

body.liveness-skin .liveness-camera-frame {
  background: #101520;
  border-radius: 18px;
  border: 1px solid #354258;
}

body.liveness-skin .faceid-target::before {
  background: conic-gradient(var(--md-tertiary) var(--faceid-progress), rgba(125, 226, 255, 0.15) 0);
}

body.liveness-skin .liveness-check-item {
  border-radius: 16px;
  background: #141b28;
  border-color: #3c4a62;
  color: #d7e2f8;
}

body.liveness-skin .liveness-check-item.done {
  background: rgba(46, 125, 50, 0.2);
  border-color: rgba(129, 199, 132, 0.45);
  color: #c6f5cd;
}

body:not(.liveness-skin) {
  min-height: 100vh;
  background:
    radial-gradient(circle at 5% -10%, rgba(71, 112, 255, 0.34), transparent 40%),
    radial-gradient(circle at 95% 0%, rgba(0, 190, 255, 0.18), transparent 42%),
    linear-gradient(180deg, #070c18 0%, #090f1f 55%, #060913 100%);
  color: #e9efff;
}

body:not(.liveness-skin) .container {
  max-width: 1120px;
  padding-top: 28px;
  padding-bottom: 34px;
}

body:not(.liveness-skin) h1 {
  margin-bottom: 8px;
  font-size: 34px;
  letter-spacing: -0.01em;
}

body:not(.liveness-skin) .subtitle {
  color: #b4c3e7;
  line-height: 1.5;
}

body:not(.liveness-skin) .card {
  background: linear-gradient(180deg, rgba(19, 28, 52, 0.92), rgba(14, 21, 40, 0.92));
  border: 1px solid rgba(89, 113, 176, 0.45);
  border-radius: 16px;
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.33);
}

body:not(.liveness-skin) .card h2 {
  margin-top: 0;
  color: #d9e6ff;
}

body:not(.liveness-skin) .btn {
  border-radius: 10px;
  background: linear-gradient(180deg, #4d78ff, #3259d2);
  box-shadow: 0 10px 24px rgba(43, 87, 219, 0.34);
  font-weight: 600;
}

body:not(.liveness-skin) .btn.secondary {
  background: linear-gradient(180deg, #253354, #1b2744);
  border: 1px solid rgba(85, 109, 168, 0.5);
  box-shadow: none;
}

body:not(.liveness-skin) .btn.danger {
  background: linear-gradient(180deg, #d94d63, #b7374f);
}

body:not(.liveness-skin) input {
  background: #0b1328;
  border: 1px solid rgba(98, 121, 180, 0.56);
}

body:not(.liveness-skin) pre {
  background: #0a1224;
  border: 1px solid rgba(70, 96, 160, 0.42);
  color: #c8d7fb;
}

/* Material 3 Expressive - final unified override */
body,
body:not(.liveness-skin),
body.liveness-skin {
  background:
    radial-gradient(circle at 12% -10%, rgba(111, 168, 255, 0.18), transparent 42%),
    radial-gradient(circle at 94% 0%, rgba(125, 226, 255, 0.12), transparent 40%),
    #10131b;
  color: #e6ebf7;
}

.container {
  max-width: 1160px;
  padding: 30px;
}

h1 {
  font-size: 2rem;
  line-height: 2.5rem;
  letter-spacing: 0;
}

.card,
body.liveness-skin .liveness-card {
  background: #1a1f2b;
  border: 1px solid #3d465a;
  border-radius: 28px;
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.22),
    0 14px 34px rgba(0, 0, 0, 0.3);
}

.btn {
  border-radius: 999px;
  min-height: 42px;
  background: linear-gradient(120deg, #4f6dff, #6a5cff);
  color: #fff;
}

.btn.secondary {
  background: #252d3f;
  border: 1px solid #5a6f95;
  color: #b8ccff;
}

input,
select,
textarea {
  background: #121826;
  border: 1px solid #54627d;
  border-radius: 14px;
}

body.liveness-skin .liveness-camera-frame {
  border: 1px solid #495772;
  border-radius: 20px;
  background: #121826;
}

body.liveness-skin .liveness-check-item {
  border-radius: 16px;
  background: #171e2c;
  border-color: #45536d;
}

/* Android 16+ Material 3 Expressive system layer */
:root {
  --m3x-primary: #58d5ff;
  --m3x-secondary: #ff62c0;
  --m3x-tertiary: #ffbf47;
  --m3x-error: #ff6b7a;
  --m3x-bg: #0c1018;
  --m3x-surface: #161d2b;
  --m3x-surface-2: #1f2839;
  --m3x-outline: #4a5b77;
  --m3x-text: #ebf1ff;
  --m3x-text-muted: #b8c6e7;
  --m3x-radius-xl: 32px;
  --m3x-radius-lg: 24px;
  --m3x-radius-md: 18px;
  --m3x-spring: cubic-bezier(0.2, 0.9, 0.2, 1.15);
}

body {
  background:
    radial-gradient(circle at 8% -10%, rgba(88, 213, 255, 0.18), transparent 35%),
    radial-gradient(circle at 90% 0%, rgba(255, 98, 192, 0.14), transparent 36%),
    radial-gradient(circle at 70% 95%, rgba(255, 191, 71, 0.13), transparent 30%),
    var(--m3x-bg);
  color: var(--m3x-text);
}

.container {
  max-width: 1180px;
}

h1 {
  font-size: clamp(48px, 7vw, 92px);
  line-height: 0.98;
  font-weight: 760;
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(28px, 3.8vw, 44px);
  line-height: 1.08;
}

.subtitle,
p,
label,
.liveness-status,
.liveness-disclaimer {
  color: var(--m3x-text-muted);
  font-size: 1rem;
}

.card,
.recovery-panel,
body.liveness-skin .liveness-card {
  background: color-mix(in srgb, var(--m3x-surface) 88%, #ffffff 12%);
  border: 1px solid var(--m3x-outline);
  border-radius: var(--m3x-radius-xl);
  box-shadow:
    0 2px 5px rgba(0, 0, 0, 0.22),
    0 18px 42px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(10px);
}

.btn,
.pill,
.liveness-check-item {
  transition: transform 220ms var(--m3x-spring), filter 180ms ease, box-shadow 200ms ease;
}

.btn {
  position: relative;
  overflow: hidden;
  min-height: 46px;
  border-radius: 999px;
  padding: 0 22px;
  background: linear-gradient(120deg, var(--m3x-primary), #5b7bff);
  font-weight: 650;
  letter-spacing: 0.01em;
  box-shadow: 0 10px 24px rgba(88, 213, 255, 0.24);
}

.btn.secondary {
  background: linear-gradient(120deg, #2a3550, var(--m3x-surface-2));
  border: 1px solid #5d7195;
  color: #d2ddfa;
  box-shadow: none;
}

.btn.danger {
  background: linear-gradient(120deg, var(--m3x-error), #d93f57);
}

.btn:hover {
  filter: brightness(1.08);
}

.btn:active {
  transform: scale(0.985);
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.34) 0%, rgba(255, 255, 255, 0) 60%);
  opacity: 0;
  transition: opacity 420ms ease;
}

.btn:active::after {
  opacity: 1;
}

input,
select,
textarea {
  min-height: 46px;
  border-radius: var(--m3x-radius-md);
  background: #121a2a;
  border: 1px solid #5a6d91;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--m3x-primary);
  box-shadow: 0 0 0 4px rgba(88, 213, 255, 0.2);
}

.pill {
  border-radius: 999px;
  padding: 7px 14px;
  background: #222f46;
}

.liveness-progress-track {
  height: 10px;
  border-radius: 999px;
}

body.liveness-skin .liveness-camera-frame {
  border-radius: var(--m3x-radius-lg);
  border: 1px solid #50607f;
  backdrop-filter: blur(8px);
}

body.liveness-skin .liveness-check-item {
  border-radius: var(--m3x-radius-md);
  background: #1b2435;
  border-color: #4f5f7d;
}

/* Global dark neutral override (black/grey/white with restrained accents) */
:root {
  --ui-bg: #0b0b0d;
  --ui-surface: #141418;
  --ui-surface-2: #1d1e24;
  --ui-border: #343743;
  --ui-text: #f2f3f7;
  --ui-text-muted: #b6bbc8;
  --ui-accent: #6ea8ff;
  --ui-accent-2: #8de1d1;
  --ui-danger: #ff6b7a;
}

body,
body:not(.liveness-skin),
body.liveness-skin {
  background:
    radial-gradient(circle at 10% -10%, rgba(110, 168, 255, 0.08), transparent 36%),
    radial-gradient(circle at 90% 100%, rgba(141, 225, 209, 0.06), transparent 34%),
    var(--ui-bg);
  color: var(--ui-text);
}

.subtitle,
p,
label,
.liveness-status,
.liveness-disclaimer {
  color: var(--ui-text-muted);
}

.card,
.recovery-panel,
body.liveness-skin .liveness-card {
  background: var(--ui-surface);
  border: 1px solid var(--ui-border);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
  backdrop-filter: none;
}

pre {
  background: #111318;
  border: 1px solid #2f3340;
  color: #d4d9e8;
}

.btn {
  background: linear-gradient(120deg, #3b4355, #2d3342);
  color: var(--ui-text);
  box-shadow: none;
}

.btn.secondary {
  background: var(--ui-surface-2);
  border-color: #46506a;
  color: #c8d2ea;
}

.btn.danger {
  background: linear-gradient(120deg, #8f2f3b, #7a2430);
}

.btn:not(.secondary):not(.danger) {
  border: 1px solid #4a5c82;
}

input,
select,
textarea {
  background: #12141a;
  border: 1px solid #3f4657;
  color: var(--ui-text);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--ui-accent);
  box-shadow: 0 0 0 3px rgba(110, 168, 255, 0.2);
}

.pill {
  background: #1a1e27;
  border-color: #40485b;
  color: #d2d9ea;
}

body.liveness-skin .liveness-camera-frame {
  background: #101319;
  border-color: #424b60;
}

body.liveness-skin .faceid-target::before {
  background: conic-gradient(var(--ui-accent-2) var(--faceid-progress), rgba(141, 225, 209, 0.15) 0);
}

/* Monochrome hard override */
body,
body:not(.liveness-skin),
body.liveness-skin {
  background: #0b0c0f !important;
  color: #f1f3f6 !important;
}

.card,
.recovery-panel,
body.liveness-skin .liveness-card {
  background: #15171c !important;
  border: 1px solid #323742 !important;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35) !important;
}

.btn,
.btn.secondary {
  background: #2a2f3a !important;
  border: 1px solid #4b5364 !important;
  color: #f1f3f6 !important;
}

.btn:hover,
.btn.secondary:hover {
  background: #323846 !important;
}

.btn.danger {
  background: #5a2c33 !important;
  border-color: #75434a !important;
  color: #ffe6e9 !important;
}

.btn::after {
  display: none !important;
}

input,
select,
textarea {
  background: #11141a !important;
  border: 1px solid #3d4454 !important;
  color: #f1f3f6 !important;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #7f8aa3 !important;
  box-shadow: 0 0 0 3px rgba(127, 138, 163, 0.2) !important;
}

.subtitle,
p,
label,
.liveness-status,
.liveness-disclaimer {
  color: #b6bcc9 !important;
}

body.liveness-skin .liveness-check-item {
  background: #171b24;
  border-color: #3f4759;
  color: #d8deed;
}

/* Sample-style hard override for pages marked with .sample-ui */
body.sample-ui,
body.sample-ui.liveness-skin {
  background:
    radial-gradient(circle at 0% 0%, rgba(100, 132, 255, 0.24), transparent 40%),
    radial-gradient(circle at 100% 0%, rgba(68, 210, 175, 0.18), transparent 44%),
    linear-gradient(180deg, #f9fcff 0%, #eef4ff 42%, #edf7f5 100%) !important;
  color: #1b2a4a !important;
}

body.sample-ui::before {
  content: '';
  position: fixed;
  inset: 0;
  background: url('/assets/face-hero.webp') center 36px / min(760px, 92vw) no-repeat;
  opacity: 0.1;
  pointer-events: none;
  z-index: 0;
}

body.sample-ui .container {
  position: relative;
  z-index: 1;
}

body.sample-ui .card,
body.sample-ui .recovery-panel,
body.sample-ui .liveness-card {
  background: rgba(255, 255, 255, 0.88) !important;
  border: 1px solid rgba(91, 120, 188, 0.2) !important;
  border-radius: 20px !important;
  box-shadow: 0 16px 48px rgba(36, 62, 122, 0.14) !important;
  backdrop-filter: blur(6px);
}

body.sample-ui p,
body.sample-ui .subtitle,
body.sample-ui label,
body.sample-ui .liveness-status,
body.sample-ui .liveness-disclaimer {
  color: #51648c !important;
}

body.sample-ui input,
body.sample-ui select,
body.sample-ui textarea {
  background: rgba(255, 255, 255, 0.94) !important;
  border: 1px solid #c8d7fa !important;
  color: #1b2a4a !important;
  border-radius: 12px !important;
}

body.sample-ui pre {
  background: rgba(245, 249, 255, 0.95) !important;
  border: 1px solid #d4e1ff !important;
  border-radius: 12px !important;
  color: #33476f !important;
}

body.sample-ui .pill {
  border: 1px solid #ccdaf9 !important;
  background: #edf3ff !important;
  color: #355183 !important;
}

body.sample-ui .btn,
body.sample-ui .btn.secondary {
  border-radius: 999px !important;
  padding: 10px 16px !important;
  border: 1px solid transparent !important;
}

body.sample-ui .btn {
  background: linear-gradient(180deg, #4b7fff 0%, #2f68ff 100%) !important;
  color: #fff !important;
  box-shadow: 0 8px 16px rgba(47, 104, 255, 0.28) !important;
}

body.sample-ui .btn.secondary {
  background: #e7efff !important;
  color: #36538f !important;
  border-color: rgba(78, 112, 183, 0.22) !important;
  box-shadow: none !important;
}

body.sample-ui .btn.danger {
  background: #dc4c64 !important;
  color: #fff !important;
}

body.sample-ui.biometric-home,
body.sample-ui.biometric-home.liveness-skin {
  background:
    radial-gradient(circle at 12% -5%, rgba(255, 255, 255, 0.04), transparent 36%),
    radial-gradient(circle at 88% 108%, rgba(255, 255, 255, 0.03), transparent 34%),
    linear-gradient(180deg, #0b0c0f 0%, #0d1016 48%, #0b0d12 100%) !important;
  color: #edf1f7 !important;
}

body.sample-ui.biometric-home::before {
  opacity: 0 !important;
}

body.sample-ui.biometric-home .card {
  background: rgba(20, 23, 30, 0.94) !important;
  border: 1px solid #313745 !important;
  box-shadow: 0 18px 30px rgba(0, 0, 0, 0.4) !important;
}

body.sample-ui.biometric-home p,
body.sample-ui.biometric-home .subtitle,
body.sample-ui.biometric-home li,
body.sample-ui.biometric-home code {
  color: #b7bfce !important;
}

body.sample-ui.biometric-home h1,
body.sample-ui.biometric-home h2 {
  color: #f2f4f8 !important;
}

body.sample-ui.biometric-home .btn,
body.sample-ui.biometric-home .btn.secondary {
  background: #2a2f3a !important;
  border: 1px solid #4b5364 !important;
  color: #eef2f8 !important;
  box-shadow: none !important;
}

body.sample-ui.biometric-home .btn:hover,
body.sample-ui.biometric-home .btn.secondary:hover {
  background: #323846 !important;
}

body.sample-ui.biometric-home .btn.danger {
  background: #5a2c33 !important;
  border-color: #75434a !important;
  color: #ffe6e9 !important;
}

body.sample-ui.biometric-home pre {
  background: #111318 !important;
  border: 1px solid #2f3340 !important;
  color: #d4d9e8 !important;
}

body.sample-ui.biometric-home .pill {
  background: #1a1e27 !important;
  border: 1px solid #40485b !important;
  color: #d2d9ea !important;
}

body.sample-ui.liveness-skin {
  background:
    radial-gradient(circle at 12% -2%, rgba(56, 97, 228, 0.35), transparent 38%),
    radial-gradient(circle at 88% 102%, rgba(68, 173, 146, 0.2), transparent 34%),
    #0b1222 !important;
  color: #e8efff !important;
}

body.sample-ui.liveness-skin .liveness-card {
  background: rgba(14, 24, 44, 0.86) !important;
  border: 1px solid rgba(95, 126, 189, 0.36) !important;
}

body.sample-ui.liveness-skin .liveness-camera-frame {
  border-radius: 24px !important;
  background: #050913 !important;
}

body.sample-ui.liveness-skin .liveness-frame-mask,
body.sample-ui.liveness-skin .faceid-corner,
body.sample-ui.liveness-skin .faceid-scan-line,
body.sample-ui.liveness-skin .faceid-target::before,
body.sample-ui.liveness-skin .faceid-target::after {
  display: none !important;
}

body.sample-ui.liveness-skin .faceid-target {
  width: 270px !important;
  aspect-ratio: 1 / 1 !important;
  border-radius: 50% !important;
  border: none !important;
  box-shadow: none !important;
  position: absolute !important;
  left: 50% !important;
  top: 50% !important;
  transform: translate(-50%, -50%) !important;
}

body.sample-ui.liveness-skin .faceid-ring {
  position: absolute;
  inset: 18px;
  border-radius: 50%;
  border: 3px solid rgba(118, 150, 218, 0.56);
  box-shadow: inset 0 0 0 1px rgba(47, 104, 255, 0.22);
}

body.sample-ui.liveness-skin .faceid-bars {
  position: absolute;
  inset: 0;
}

body.sample-ui.liveness-skin .faceid-bar {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 8px;
  height: 20px;
  border-radius: 999px;
  margin-left: -4px;
  margin-top: -150px;
  background: rgba(58, 82, 131, 0.34);
  transform-origin: 50% 150px;
  opacity: 0.24;
}

body.sample-ui.liveness-skin .faceid-bar:nth-child(1) { transform: rotate(0deg); }
body.sample-ui.liveness-skin .faceid-bar:nth-child(2) { transform: rotate(30deg); }
body.sample-ui.liveness-skin .faceid-bar:nth-child(3) { transform: rotate(60deg); }
body.sample-ui.liveness-skin .faceid-bar:nth-child(4) { transform: rotate(90deg); }
body.sample-ui.liveness-skin .faceid-bar:nth-child(5) { transform: rotate(120deg); }
body.sample-ui.liveness-skin .faceid-bar:nth-child(6) { transform: rotate(150deg); }
body.sample-ui.liveness-skin .faceid-bar:nth-child(7) { transform: rotate(180deg); }
body.sample-ui.liveness-skin .faceid-bar:nth-child(8) { transform: rotate(210deg); }
body.sample-ui.liveness-skin .faceid-bar:nth-child(9) { transform: rotate(240deg); }
body.sample-ui.liveness-skin .faceid-bar:nth-child(10) { transform: rotate(270deg); }
body.sample-ui.liveness-skin .faceid-bar:nth-child(11) { transform: rotate(300deg); }
body.sample-ui.liveness-skin .faceid-bar:nth-child(12) { transform: rotate(330deg); }

body.sample-ui.liveness-skin[data-liveness-step='1'] .faceid-bar:nth-child(-n + 4),
body.sample-ui.liveness-skin[data-liveness-step='2'] .faceid-bar:nth-child(-n + 8),
body.sample-ui.liveness-skin[data-liveness-step='3'] .faceid-bar {
  background: linear-gradient(180deg, #3dff8f, #12b366);
  opacity: 1;
  box-shadow: 0 0 14px rgba(39, 235, 130, 0.62);
  animation: faceid-bar-wave 0.9s ease-in-out infinite;
}

body.sample-ui.liveness-skin .faceid-bar:nth-child(2n) { animation-delay: 0.08s; }
body.sample-ui.liveness-skin .faceid-bar:nth-child(3n) { animation-delay: 0.16s; }
body.sample-ui.liveness-skin .faceid-bar:nth-child(4n) { animation-delay: 0.24s; }

@keyframes faceid-bar-wave {
  0%, 100% {
    opacity: 0.86;
    height: 18px;
    filter: brightness(0.92);
  }
  50% {
    opacity: 1;
    height: 24px;
    filter: brightness(1.15);
  }
}

body.face-mobile-ui {
  background: #000 !important;
  color: #fff !important;
}

body.face-mobile-ui::before {
  display: none !important;
}

body.face-mobile-ui .liveness-card {
  background: #000 !important;
  border: none !important;
  box-shadow: none !important;
  padding-top: 8px;
}

body.face-mobile-ui .liveness-top-row {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 4px;
}

body.face-mobile-ui .liveness-link-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: #0a84ff;
  font-size: 17px;
  font-weight: 500;
  padding: 0;
}

body.face-mobile-ui .liveness-header-row,
body.face-mobile-ui .liveness-chip,
body.face-mobile-ui .liveness-eyebrow,
body.face-mobile-ui .liveness-checklist,
body.face-mobile-ui .liveness-progress-track {
  display: none !important;
}

body.face-mobile-ui .liveness-card h1 {
  color: #fff !important;
  text-align: center;
  font-size: 29px;
  margin: 8px 0 4px;
}

body.face-mobile-ui .subtitle {
  color: #d1d1d6 !important;
  text-align: center;
  max-width: 320px;
  margin: 0 auto 18px;
}

body.face-mobile-ui .liveness-camera-frame {
  background: #000 !important;
  border: none !important;
  min-height: 390px;
}

body.face-mobile-ui .liveness-camera-frame video,
body.face-mobile-ui .liveness-camera-frame canvas {
  border-radius: 50%;
  width: 220px;
  height: 220px;
  object-fit: cover;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  filter: blur(1.8px) saturate(0.8);
}

body.face-mobile-ui .faceid-target {
  width: 320px !important;
  height: 320px !important;
  left: 50% !important;
  top: 50% !important;
  transform: translate(-50%, -50%) !important;
}

body.face-mobile-ui .faceid-ticks {
  position: absolute;
  inset: 0;
}

body.face-mobile-ui .faceid-tick {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 5px;
  height: 16px;
  margin-left: -2.5px;
  margin-top: -160px;
  border-radius: 999px;
  transform-origin: 50% 160px;
  transform: rotate(var(--tick-rot));
  background: rgba(255, 255, 255, 0.35);
}

body.face-mobile-ui .faceid-tick {
  opacity: 0.32;
  height: 14px;
  background: rgba(255, 255, 255, 0.28);
  transition: opacity 120ms linear, height 120ms linear, background 120ms linear, box-shadow 120ms linear;
}

body.face-mobile-ui .faceid-tick.is-complete {
  opacity: 0.86;
}

body.face-mobile-ui[data-faceid-pass='1'] .faceid-tick.is-complete {
  background: #64d2ff;
}

body.face-mobile-ui[data-faceid-pass='2'] .faceid-tick.is-complete {
  background: #2dd65b;
}

body.face-mobile-ui .faceid-tick.is-trail {
  opacity: 0.95;
  height: 18px;
  background: #9be7ff;
}

body.face-mobile-ui[data-faceid-pass='2'] .faceid-tick.is-trail {
  background: #69f0a1;
}

body.face-mobile-ui .faceid-tick.is-head {
  opacity: 1;
  height: 22px;
  background: #fff;
  box-shadow: 0 0 12px rgba(155, 231, 255, 0.95);
}

body.face-mobile-ui .liveness-camera-label {
  display: none !important;
}

body.face-mobile-ui .liveness-status {
  text-align: center;
  color: #f2f2f7 !important;
  margin-top: 14px;
  margin-bottom: 12px;
}

body.face-mobile-ui .faceid-pass-label {
  text-align: center;
  color: #c8d0df;
  font-size: 13px;
  margin-top: 8px;
  margin-bottom: 2px;
}

body.face-mobile-ui .row {
  justify-content: center;
}

body.face-mobile-ui .btn {
  border-radius: 999px !important;
}

body.face-mobile-ui .liveness-disclaimer-row {
  justify-content: space-between;
  max-width: 340px;
  margin: 8px auto 0;
}
