/* ─── Verification Widget ─────────────────────────────────────────────────── */

.vw-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: vwBgIn 0.2s ease both;
}
@keyframes vwBgIn { from { opacity: 0 } to { opacity: 1 } }

@media (min-width: 600px) {
  .vw-overlay { align-items: center; }
  .vw-modal   { border-radius: 20px !important; }
}

/* ── Modal shell ──────────────────────────────────────────────────────────── */
.vw-modal {
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  background: #111;
  border-radius: 20px 20px 0 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: vwSlideUp 0.32s cubic-bezier(0.16,1,0.3,1) both;
}
@keyframes vwSlideUp { from { transform: translateY(100%); opacity: 0 } to { transform: translateY(0); opacity: 1 } }

.vw-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}
.vw-title {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}
.vw-back, .vw-close {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.07);
  border: none; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; cursor: pointer; transition: background 0.2s;
}
.vw-back:hover, .vw-close:hover { background: rgba(255,255,255,0.14); }

.vw-body {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: none;
}
.vw-body::-webkit-scrollbar { display: none; }

/* ── Intro step ───────────────────────────────────────────────────────────── */
.vw-intro {
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.vw-intro-icon {
  text-align: center;
  font-size: 48px;
  color: var(--c-accent, #b8f53d);
}
.vw-intro-title {
  text-align: center;
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  margin: 0;
}
.vw-intro-desc {
  text-align: center;
  font-size: 13px;
  color: rgba(255,255,255,0.5);
  line-height: 1.6;
  margin: 0;
}
.vw-steps-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.vw-step-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
}
.vw-step-num {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--c-accent, #b8f53d);
  color: #080808;
  font-weight: 800;
  font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.vw-step-item strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 2px;
}
.vw-step-item span {
  font-size: 12px;
  color: rgba(255,255,255,0.4);
}
.vw-privacy-note {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(184,245,61,0.05);
  border: 1px solid rgba(184,245,61,0.12);
  border-radius: 10px;
  font-size: 12px;
  color: rgba(255,255,255,0.5);
}
.vw-privacy-note i { color: var(--c-accent, #b8f53d); flex-shrink: 0; }

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.vw-btn {
  width: 100%;
  padding: 14px;
  border-radius: 13px;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
}
.vw-btn--primary {
  background: var(--c-accent, #b8f53d);
  color: #080808;
}
.vw-btn--primary:hover { filter: brightness(1.08); }
.vw-btn--primary:disabled { opacity: 0.4; cursor: not-allowed; filter: none; }
.vw-btn--ghost {
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.7);
  border: 1px solid rgba(255,255,255,0.1);
}
.vw-btn--ghost:hover { background: rgba(255,255,255,0.1); }

/* ── Camera step ──────────────────────────────────────────────────────────── */
.vw-camera-wrap {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.vw-camera-progress {
  display: flex;
  gap: 8px;
  justify-content: center;
}
.vw-prog-dot {
  width: 32px; height: 4px;
  border-radius: 2px;
  background: rgba(255,255,255,0.12);
  transition: background 0.3s;
}
.vw-prog-dot.active { background: var(--c-accent, #b8f53d); }
.vw-prog-dot.done   { background: rgba(184,245,61,0.4); }

.vw-video-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 3/4;
  max-height: 380px;
  border-radius: 18px;
  overflow: hidden;
  background: #000;
  border: 2px solid rgba(255,255,255,0.08);
}
#vwVideo {
  width: 100%; height: 100%;
  object-fit: cover;
  transform: scaleX(-1); /* mirror */
}
.vw-face-ring {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -54%);
  width: 180px; height: 220px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.2);
  transition: border-color 0.3s, box-shadow 0.3s;
  pointer-events: none;
}
.vw-face-ring.detected {
  border-color: var(--c-accent, #b8f53d);
  box-shadow: 0 0 0 4px rgba(184,245,61,0.15);
}
.vw-face-ring.passed {
  border-color: #b8f53d;
  box-shadow: 0 0 0 6px rgba(34,197,94,0.2);
  animation: vwRingPulse 0.4s ease;
}
@keyframes vwRingPulse {
  0%   { transform: translate(-50%, -54%) scale(1); }
  50%  { transform: translate(-50%, -54%) scale(1.06); }
  100% { transform: translate(-50%, -54%) scale(1); }
}

.vw-challenge-overlay {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
}
.vw-challenge-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 99px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
}
.vw-challenge-badge i { color: var(--c-accent, #b8f53d); }

.vw-camera-status {
  text-align: center;
  font-size: 13px;
  color: rgba(255,255,255,0.5);
  min-height: 20px;
}
.vw-challenge-counter {
  text-align: center;
  font-size: 11px;
  color: rgba(255,255,255,0.25);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* ── ID upload step ───────────────────────────────────────────────────────── */
.vw-id-wrap {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.vw-id-icon {
  text-align: center;
  font-size: 44px;
  color: var(--c-accent, #b8f53d);
}
.vw-id-desc {
  text-align: center;
  font-size: 13px;
  color: rgba(255,255,255,0.5);
  line-height: 1.5;
  margin: 0;
}
.vw-id-desc strong { color: #fff; }

.vw-field { display: flex; flex-direction: column; gap: 6px; }
.vw-label {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255,255,255,0.4);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
.vw-phone-wrap { display: flex; }
.vw-country-code {
  padding: 12px 14px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-right: none;
  border-radius: 10px 0 0 10px;
  color: rgba(255,255,255,0.5);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.vw-input {
  padding: 12px 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  color: #fff;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  width: 100%;
}
.vw-input:focus { border-color: var(--c-accent, #b8f53d); }
.vw-input--phone { border-radius: 0 10px 10px 0; }

.vw-upload {
  padding: 24px;
  border: 2px dashed rgba(255,255,255,0.1);
  border-radius: 14px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.vw-upload:hover {
  border-color: var(--c-accent, #b8f53d);
  background: rgba(184,245,61,0.03);
}
.vw-upload i { font-size: 28px; color: rgba(255,255,255,0.25); }
.vw-upload span { font-size: 13px; color: rgba(255,255,255,0.5); }
.vw-hint { font-size: 11px; color: rgba(255,255,255,0.2); }

.vw-preview-img {
  width: 100%;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.08);
  margin-top: 8px;
}
.vw-error {
  font-size: 11px;
  color: #ef4444;
  min-height: 14px;
}
.vw-error-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.2);
  border-radius: 10px;
  font-size: 12px;
  color: #ef4444;
}
.vw-liveness-done {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(34,197,94,0.08);
  border: 1px solid rgba(34,197,94,0.18);
  border-radius: 10px;
  font-size: 12px;
  color: #b8f53d;
}
.vw-liveness-done i { flex-shrink: 0; }

/* ── Processing / success / error states ──────────────────────────────────── */
.vw-processing {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 52px 24px;
  text-align: center;
}
.vw-spinner {
  width: 52px; height: 52px;
  border: 3px solid rgba(184,245,61,0.15);
  border-top-color: var(--c-accent, #b8f53d);
  border-radius: 50%;
  animation: vwSpin 0.7s linear infinite;
}
@keyframes vwSpin { to { transform: rotate(360deg); } }

.vw-success-icon {
  font-size: 56px;
  color: #b8f53d;
  animation: vwSuccessIn 0.5s cubic-bezier(0.34,1.56,0.64,1) both;
}
@keyframes vwSuccessIn {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
.vw-processing h3 {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  margin: 0;
}
.vw-processing p {
  font-size: 13px;
  color: rgba(255,255,255,0.4);
  line-height: 1.5;
  margin: 0;
}

/* ── Countdown timer ─────────────────────────────────────────── */
.vw-timer {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -70%);
  font-family: var(--ff-display);
  font-size: 72px;
  font-weight: 800;
  color: rgba(255,255,255,0.6);
  z-index: 10;
  pointer-events: none;
  text-shadow: 0 2px 20px rgba(0,0,0,0.5);
  transition: color 0.3s, transform 0.3s;
}

/* ── Countdown ring SVG ─────────────────────────────────────── */
.vw-countdown-circle {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.vw-circle-bg {
  fill: none;
  stroke: rgba(255,255,255,0.08);
  stroke-width: 3;
}

.vw-circle-progress {
  fill: none;
  stroke: var(--c-accent, #b8f53d);
  stroke-width: 3;
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: center;
  transition: stroke 0.3s;
}

.vw-face-ring.recording .vw-circle-progress {
  stroke: var(--c-accent, #b8f53d);
}

.vw-face-ring.passed .vw-circle-progress {
  stroke: #b8f53d;
}

/* ── Video frame states ─────────────────────────────────────── */
.vw-video-frame.is-recording {
  border-color: var(--c-accent, #b8f53d);
  box-shadow: 0 0 20px rgba(184,245,61,0.15);
}

.vw-video-frame.is-done {
  border-color: #b8f53d;
  box-shadow: 0 0 20px rgba(34,197,94,0.15);
}

/* ── Camera actions ─────────────────────────────────────────── */
.vw-camera-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ── Pulse animation for recording dot ──────────────────────── */
@keyframes vwPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}


/* ── Get Ready overlay ──────────────────────────────────────── */
.vw-get-ready-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.5);
  z-index: 15;
  pointer-events: none;
}

.vw-get-ready-number {
  font-family: var(--ff-display);
  font-size: 96px;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 4px 30px rgba(0,0,0,0.5);
  transition: transform 0.15s ease;
  line-height: 1;
}

.vw-get-ready-label {
  font-size: 14px;
  color: rgba(255,255,255,0.6);
  font-weight: 600;
  margin-top: 4px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* ── Recording indicator ────────────────────────────────────── */
.vw-recording-indicator {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(8px);
  border-radius: 99px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  z-index: 12;
  letter-spacing: 0.5px;
}

.vw-recording-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
  animation: vwPulse 1s ease infinite;
}

/* ── Done flash ─────────────────────────────────────────────── */
.vw-done-flash {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  pointer-events: none;
  font-size: 64px;
  color: #b8f53d;
}

@keyframes vwDonePop {
  0%   { transform: scale(0.3); opacity: 0; }
  60%  { transform: scale(1.1); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

/* ── Ring recording/passed states ───────────────────────────── */
.vw-face-ring.recording .vw-circle-progress {
  stroke: var(--c-accent, #b8f53d);
}

.vw-face-ring.passed .vw-circle-progress {
  stroke: #b8f53d;
}

.vw-video-frame.is-recording {
  border-color: var(--c-accent, #b8f53d);
  box-shadow: 0 0 20px rgba(184,245,61,0.15);
}

.vw-video-frame.is-done {
  border-color: #b8f53d;
  box-shadow: 0 0 20px rgba(34,197,94,0.15);
}

/* ── Pulse animation ────────────────────────────────────────── */
@keyframes vwPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* ── Camera status / actions ────────────────────────────────── */
.vw-camera-status {
  text-align: center;
  font-size: 13px;
  color: rgba(255,255,255,0.5);
  min-height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.vw-camera-actions {
  display: flex;
  justify-content: center;
}


/* ── Camera status ──────────────────────────────────────────── */
.vw-camera-status {
  text-align: center;
  font-size: 13px;
  color: rgba(255,255,255,0.5);
  min-height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
/* ── Selfie step ───────────────────────────────────────────── */
.vw-selfie-wrap {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.vw-step-header {
  text-align: center;
}
.vw-step-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 99px;
  background: var(--c-accent-dim, rgba(184,245,61,0.1));
  color: var(--c-accent, #b8f53d);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.vw-step-header h3 {
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  margin: 0 0 4px;
}
.vw-step-header p {
  font-size: 13px;
  color: rgba(255,255,255,0.5);
  line-height: 1.5;
  margin: 0;
}

/* ── Reference image ──────────────────────────────────────── */
.vw-reference {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.vw-reference-img {
  width: 100%;
  max-width: 320px;
  aspect-ratio: 3/2;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.1);
}
.vw-reference-label {
  font-size: 11px;
  color: rgba(255,255,255,0.3);
}
/* ── Selfie camera ────────────────────────────────────────── */
.vw-selfie-camera-wrap {
  position: relative;
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
  background: #000;
  border: 1px solid rgba(255,255,255,0.1);
}
.vw-selfie-camera-wrap video {
  width: 100%;
  height: auto;
  display: block;
  transform: scaleX(-1);
}
.vw-selfie-overlay {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
}
.vw-selfie-capture-btn {
  width: 56px;
  height: 56px;
  padding: 0;
  border-radius: 50%;
  font-size: 20px;
}
.vw-selfie-actions {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
}
.vw-selfie-actions .vw-btn {
  width: auto;
  padding: 10px 20px;
  font-size: 13px;
}
.vw-reference-tips {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px;
  background: rgba(184, 245, 61, 0.04);
  border: 1px solid rgba(184, 245, 61, 0.1);
  border-radius: 12px;
}

.vw-reference-tips p {
  margin: 0;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
  display: flex;
  align-items: center;
  gap: 10px;
}

.vw-reference-tips i {
  color: var(--c-accent, #b8f53d);
  font-size: 12px;
  flex-shrink: 0;
}
