/* ======================== */
/* FF Face Capture — Premium Verification UI */
/* ======================== */

/* Full-screen overlay */
.face-capture-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: #000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  animation: fcFadeIn 0.3s ease;
}

@keyframes fcFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Close / back button */
.fc-close-btn {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 10;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(8px);
  color: white;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 200ms;
}
.fc-close-btn:hover { background: rgba(255,255,255,0.25); }

/* Video container */
.fc-video-container {
  position: relative;
  width: 100%;
  max-width: 400px;
  aspect-ratio: 3/4;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 0 60px rgba(34,197,94,0.1);
}

.fc-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1); /* Mirror front camera */
}

/* Face oval guide */
.fc-oval-guide {
  position: absolute;
  top: 10%;
  left: 15%;
  width: 70%;
  height: 65%;
  border: 3px dashed rgba(255,255,255,0.35);
  border-radius: 50%;
  pointer-events: none;
  transition: border-color 0.5s, box-shadow 0.5s;
}

.fc-oval-guide.detected {
  border-color: rgba(34,197,94,0.7);
  border-style: solid;
  box-shadow: 0 0 30px rgba(34,197,94,0.15), inset 0 0 30px rgba(34,197,94,0.05);
}

.fc-oval-guide.error {
  border-color: rgba(239,68,68,0.7);
  border-style: solid;
  box-shadow: 0 0 30px rgba(239,68,68,0.15);
  animation: fcShake 0.4s ease;
}

@keyframes fcShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  50% { transform: translateX(4px); }
  75% { transform: translateX(-2px); }
}

/* Progress ring overlay */
.fc-progress-ring {
  position: absolute;
  top: 8%;
  left: 13%;
  width: 74%;
  height: 69%;
  pointer-events: none;
}

.fc-progress-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.fc-progress-track {
  fill: none;
  stroke: rgba(255,255,255,0.1);
  stroke-width: 4;
}

.fc-progress-bar {
  fill: none;
  stroke: url(#fc-gradient);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 314;
  stroke-dashoffset: 314;
  transition: stroke-dashoffset 0.5s ease;
}

/* Challenge prompt area */
.fc-prompt-area {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 20px;
  background: linear-gradient(transparent, rgba(0,0,0,0.85));
  pointer-events: none;
}

.fc-prompt-card {
  background: rgba(255,255,255,0.12);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 16px;
  padding: 16px 20px;
  text-align: center;
  animation: fcSlideUp 0.35s var(--ease-spring, cubic-bezier(0.34,1.56,0.64,1));
}

@keyframes fcSlideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.fc-prompt-icon {
  font-size: 32px;
  margin-bottom: 6px;
}

.fc-prompt-text {
  color: white;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
}

.fc-prompt-sub {
  color: rgba(255,255,255,0.6);
  font-size: 12px;
  margin-top: 4px;
}

/* Challenge progress dots */
.fc-challenge-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
}

.fc-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  transition: all 0.3s ease;
}

.fc-dot.active {
  background: rgba(255,255,255,0.5);
  transform: scale(1.2);
}

.fc-dot.done {
  background: #22C55E;
  box-shadow: 0 0 8px rgba(34,197,94,0.5);
}

.fc-dot.failed {
  background: #EF4444;
}

/* Top status bar */
.fc-status-bar {
  position: absolute;
  top: 16px;
  right: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 10;
}

.fc-status-pill {
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(8px);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  color: white;
  display: flex;
  align-items: center;
  gap: 6px;
}

.fc-status-pill .fc-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #EF4444;
  animation: fcPulse 1.5s ease infinite;
}

@keyframes fcPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.3); }
}

/* Model loading overlay */
.fc-loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 20;
  border-radius: 24px;
}

.fc-loading-ring {
  width: 64px;
  height: 64px;
  border: 3px solid rgba(255,255,255,0.1);
  border-top-color: #22C55E;
  border-radius: 50%;
  animation: fcSpin 0.8s linear infinite;
  margin-bottom: 16px;
}

@keyframes fcSpin {
  to { transform: rotate(360deg); }
}

.fc-loading-text {
  color: white;
  font-size: 14px;
  font-weight: 600;
}

.fc-loading-sub {
  color: rgba(255,255,255,0.5);
  font-size: 12px;
  margin-top: 4px;
}

.fc-loading-progress {
  width: 200px;
  height: 4px;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  margin-top: 16px;
  overflow: hidden;
}

.fc-loading-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #22C55E, #10B981);
  border-radius: 2px;
  transition: width 0.3s ease;
  width: 0%;
}

/* Result screens */
.fc-result-overlay {
  position: absolute;
  inset: 0;
  z-index: 25;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 24px;
  animation: fcFadeIn 0.3s ease;
}

.fc-result-overlay.success {
  background: linear-gradient(135deg, rgba(34,197,94,0.9), rgba(16,185,129,0.9));
}

.fc-result-overlay.failure {
  background: linear-gradient(135deg, rgba(239,68,68,0.9), rgba(220,38,38,0.9));
}

.fc-result-overlay.pending {
  background: linear-gradient(135deg, rgba(245,158,11,0.9), rgba(234,88,12,0.9));
}

.fc-result-icon {
  font-size: 72px;
  margin-bottom: 16px;
  animation: fcBounceIn 0.5s var(--ease-spring, cubic-bezier(0.34,1.56,0.64,1));
}

@keyframes fcBounceIn {
  from { transform: scale(0); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.fc-result-title {
  color: white;
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 8px;
}

.fc-result-desc {
  color: rgba(255,255,255,0.85);
  font-size: 14px;
  text-align: center;
  max-width: 260px;
  line-height: 1.5;
}

.fc-result-score {
  margin-top: 16px;
  background: rgba(255,255,255,0.2);
  border-radius: 12px;
  padding: 8px 20px;
  color: white;
  font-size: 13px;
  font-weight: 700;
}

.fc-result-actions {
  margin-top: 24px;
  display: flex;
  gap: 12px;
}

.fc-result-btn {
  padding: 12px 28px;
  border-radius: 12px;
  border: none;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 100ms, opacity 100ms;
}

.fc-result-btn:active { transform: scale(0.96); }

.fc-result-btn.primary {
  background: white;
  color: #111;
}

.fc-result-btn.secondary {
  background: rgba(255,255,255,0.2);
  color: white;
  border: 1px solid rgba(255,255,255,0.3);
}

/* Bottom info text */
.fc-bottom-info {
  margin-top: 20px;
  text-align: center;
  max-width: 350px;
}

.fc-privacy-text {
  color: rgba(255,255,255,0.4);
  font-size: 11px;
  line-height: 1.5;
}

.fc-privacy-text a {
  color: rgba(255,255,255,0.6);
  text-decoration: underline;
}

/* Intro screen (shown before camera activates) */
.fc-intro-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  text-align: center;
  max-width: 380px;
}

.fc-intro-icon {
  font-size: 72px;
  margin-bottom: 24px;
}

.fc-intro-title {
  color: white;
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 12px;
}

.fc-intro-desc {
  color: rgba(255,255,255,0.6);
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 32px;
}

.fc-intro-features {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  margin-bottom: 32px;
}

.fc-intro-feature {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 12px 16px;
  text-align: left;
}

.fc-intro-feature-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.fc-intro-feature-text {
  color: rgba(255,255,255,0.8);
  font-size: 13px;
  line-height: 1.4;
}

.fc-start-btn {
  width: 100%;
  padding: 16px;
  border-radius: 14px;
  border: none;
  background: linear-gradient(135deg, #22C55E, #10B981);
  color: white;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 100ms, box-shadow 200ms;
  box-shadow: 0 4px 20px rgba(34,197,94,0.3);
}

.fc-start-btn:hover {
  box-shadow: 0 6px 28px rgba(34,197,94,0.4);
}

.fc-start-btn:active { transform: scale(0.97); }

.fc-skip-btn {
  margin-top: 16px;
  background: none;
  border: none;
  color: rgba(255,255,255,0.4);
  font-size: 13px;
  cursor: pointer;
  padding: 8px 16px;
}

.fc-skip-btn:hover { color: rgba(255,255,255,0.6); }

/* Verification badge (used across app) */
.verification-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
  margin-left: 4px;
  vertical-align: middle;
  flex-shrink: 0;
  position: relative;
}

.verification-badge.verified {
  background: #22C55E;
  color: white;
  box-shadow: 0 0 6px rgba(34,197,94,0.3);
}

.verification-badge.unverified {
  background: #EF4444;
  color: white;
}

.verification-badge.pending {
  background: #F59E0B;
  color: white;
  animation: fcPulse 2s ease infinite;
}

.verification-badge.expired {
  background: #9CA3AF;
  color: white;
}

/* Badge tooltip */
.verification-badge[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 10px;
  background: rgba(0,0,0,0.85);
  color: white;
  font-size: 11px;
  font-weight: 500;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 150ms;
  margin-bottom: 4px;
}

.verification-badge[data-tooltip]:hover::after {
  opacity: 1;
}

/* Large badge for profile view */
.verification-badge-lg {
  width: 24px;
  height: 24px;
  font-size: 13px;
}

/* Responsive */
@media (max-width: 420px) {
  .fc-video-container {
    max-width: 100%;
    border-radius: 0;
    aspect-ratio: auto;
    height: 100%;
  }

  .fc-oval-guide {
    top: 15%;
    left: 12%;
    width: 76%;
    height: 50%;
  }

  .fc-prompt-card {
    border-radius: 12px;
    padding: 12px 16px;
  }
}
