/* ============================================================
   IDENTITY VALIDATOR — Styles
   Premium dark theme with glassmorphism
   ============================================================ */

:root {
  /* Colors */
  --primary: #6366f1;
  --primary-light: #818cf8;
  --primary-dark: #4f46e5;
  --primary-glow: rgba(99, 102, 241, 0.3);
  --accent: #8b5cf6;
  --accent-light: #a78bfa;
  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.1);
  --success-border: rgba(16, 185, 129, 0.3);
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.1);
  --danger-border: rgba(239, 68, 68, 0.3);
  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.1);
  --warning-border: rgba(245, 158, 11, 0.3);

  /* Surfaces */
  --bg-primary: #0a0a1a;
  --bg-secondary: #111128;
  --bg-card: rgba(17, 17, 40, 0.7);
  --bg-card-hover: rgba(23, 23, 50, 0.8);
  --bg-glass: rgba(255, 255, 255, 0.04);
  --bg-glass-hover: rgba(255, 255, 255, 0.08);

  /* Text */
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  /* Borders */
  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.15);

  /* Spacing */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 30px var(--primary-glow);

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================================================
   BACKGROUND ORBS
   ============================================================ */
.bg-orbs {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.4;
}

.orb-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--primary) 0%, transparent 70%);
  top: -10%;
  right: -5%;
  animation: orbFloat1 20s ease-in-out infinite;
}

.orb-2 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
  bottom: -5%;
  left: -5%;
  animation: orbFloat2 25s ease-in-out infinite;
}

.orb-3 {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, #06b6d4 0%, transparent 70%);
  top: 50%;
  left: 50%;
  animation: orbFloat3 30s ease-in-out infinite;
}

@keyframes orbFloat1 {

  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }

  33% {
    transform: translate(-80px, 60px) scale(1.1);
  }

  66% {
    transform: translate(40px, -30px) scale(0.9);
  }
}

@keyframes orbFloat2 {

  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }

  33% {
    transform: translate(60px, -40px) scale(1.15);
  }

  66% {
    transform: translate(-30px, 50px) scale(0.85);
  }
}

@keyframes orbFloat3 {

  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }

  50% {
    transform: translate(-60px, -60px) scale(1.2);
  }
}

/* ============================================================
   HEADER
   ============================================================ */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  background: rgba(10, 10, 26, 0.8);
  border-bottom: 1px solid var(--border);
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  display: flex;
  filter: drop-shadow(0 0 10px var(--primary-glow));
}

.logo-text {
  font-size: 1.2rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary-light), var(--accent-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background: var(--bg-glass);
  border: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--warning);
  animation: pulse 2s ease-in-out infinite;
}

.header-status.connected .status-dot {
  background: var(--success);
}

.header-status.error .status-dot {
  background: var(--danger);
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.5;
    transform: scale(0.8);
  }
}

/* ============================================================
   MAIN
   ============================================================ */
.main {
  position: relative;
  z-index: 1;
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 24px 60px;
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  text-align: center;
  padding: 60px 0 40px;
  animation: fadeUp 0.8s ease-out;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: var(--radius-full);
  background: var(--bg-glass);
  border: 1px solid var(--border);
  color: var(--primary-light);
  font-size: 0.82rem;
  font-weight: 500;
  margin-bottom: 24px;
}

.hero-title {
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 18px;
  letter-spacing: -0.03em;
}

.gradient-text {
  background: linear-gradient(135deg, var(--primary-light), var(--accent-light), #06b6d4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-description {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 32px;
  line-height: 1.7;
}

.hero-features {
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
  margin-top: 32px;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 500;
}

.feature-item svg {
  color: var(--primary-light);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  border: none;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-normal);
  box-shadow: 0 4px 15px var(--primary-glow);
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent, rgba(255, 255, 255, 0.15), transparent);
  transform: translateX(-100%);
  transition: transform 0.6s;
}

.btn-primary:hover::before {
  transform: translateX(100%);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px var(--primary-glow);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-glass);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-normal);
}

.btn-secondary:hover {
  background: var(--bg-glass-hover);
  border-color: var(--border-hover);
}

.btn-start {
  font-size: 1.1rem;
  padding: 16px 36px;
}

.btn-capture {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 28px;
  border: none;
  border-radius: var(--radius-md);
  background: var(--bg-glass);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-normal);
}

.btn-capture:hover {
  background: var(--bg-glass-hover);
  border-color: var(--primary);
}

.capture-ring {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid var(--danger);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-normal);
}

.capture-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--danger);
  transition: all var(--transition-normal);
}

.btn-capture:hover .capture-ring {
  border-color: #f87171;
}

.btn-capture:hover .capture-dot {
  background: #f87171;
  transform: scale(0.85);
}

.btn-upload {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-normal);
}

.btn-upload:hover {
  border-color: var(--primary);
  color: var(--primary-light);
  background: rgba(99, 102, 241, 0.05);
}

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  margin-top: 16px;
}

.btn-back:hover {
  color: var(--text-secondary);
}

/* ============================================================
   PROGRESS BAR
   ============================================================ */
.progress-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 40px;
  animation: fadeUp 0.5s ease-out;
}

.progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.step-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-glass);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-normal);
  position: relative;
}

.step-number {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: all var(--transition-normal);
}

.step-check {
  display: none;
  color: white;
}

.progress-step.active .step-circle {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-color: var(--primary);
  box-shadow: 0 0 20px var(--primary-glow);
}

.progress-step.active .step-number {
  color: white;
}

.progress-step.completed .step-circle {
  background: var(--success);
  border-color: var(--success);
}

.progress-step.completed .step-number {
  display: none;
}

.progress-step.completed .step-check {
  display: block;
}

.step-label {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: all var(--transition-normal);
}

.progress-step.active .step-label {
  color: var(--primary-light);
}

.progress-step.completed .step-label {
  color: var(--success);
}

.progress-line {
  width: 80px;
  height: 2px;
  background: var(--border);
  margin: 0 12px;
  margin-bottom: 26px;
  transition: all var(--transition-slow);
  position: relative;
}

.progress-line.filled {
  background: var(--success);
}

.progress-line.filled::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--success);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

/* ============================================================
   CAPTURE CARD
   ============================================================ */
.capture-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px;
  animation: fadeUp 0.5s ease-out;
}

.card-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.card-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.selfie-icon {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(139, 92, 246, 0.2));
  color: var(--primary-light);
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.id-icon {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.2), rgba(59, 130, 246, 0.2));
  color: #06b6d4;
  border: 1px solid rgba(6, 182, 212, 0.3);
}

.card-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.card-subtitle {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* ============================================================
   FACE DETECTION STATUS
   ============================================================ */
.detection-status {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
  padding: 12px 16px;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.detection-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color var(--transition-normal);
}

.detection-indicator .detection-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
  transition: all var(--transition-normal);
  animation: pulse 2s ease-in-out infinite;
}

.detection-indicator.detecting .detection-dot {
  background: var(--warning);
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.5);
}

.detection-indicator.face-found .detection-dot {
  background: var(--success);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

.detection-indicator.face-far .detection-dot,
.detection-indicator.face-off .detection-dot {
  background: var(--danger);
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
}

.detection-indicator.face-found {
  color: var(--success);
}

.detection-indicator.face-far,
.detection-indicator.face-off {
  color: var(--danger);
}

.detection-quality {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  overflow: hidden;
}

.detection-metrics {
  font-size: 0.72rem;
  line-height: 1.35;
  color: var(--text-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.quality-fill {
  height: 100%;
  width: 0%;
  border-radius: 2px;
  background: var(--text-muted);
  transition: all 0.4s ease;
}

.quality-fill.low {
  background: var(--danger);
  width: 30%;
}

.quality-fill.medium {
  background: var(--warning);
  width: 60%;
}

.quality-fill.high {
  background: var(--success);
  width: 100%;
}

/* ============================================================
   CAMERA
   ============================================================ */
.camera-container {
  position: relative;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  aspect-ratio: 4/3;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #000;
  border: 3px solid var(--border);
  transition: border-color 0.4s ease, box-shadow 0.4s ease;
}

.camera-container.border-green {
  border-color: var(--success);
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.3), inset 0 0 20px rgba(16, 185, 129, 0.05);
}

.camera-container.border-red {
  border-color: var(--danger);
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.3), inset 0 0 20px rgba(239, 68, 68, 0.05);
}

.camera-container.border-yellow {
  border-color: var(--warning);
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.3), inset 0 0 20px rgba(245, 158, 11, 0.05);
}

.camera-container video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detection-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
}

.camera-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.face-guide {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 200px;
  height: 260px;
  border: 3px solid rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.3);
  transition: border-color 0.4s ease, box-shadow 0.4s ease;
}

.face-guide.guide-green {
  border-color: var(--success);
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.3), 0 0 30px rgba(16, 185, 129, 0.4);
  animation: guideBreathGreen 1.5s ease-in-out infinite;
}

.face-guide.guide-red {
  border-color: var(--danger);
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.3), 0 0 20px rgba(239, 68, 68, 0.3);
  animation: none;
}

.face-guide.guide-yellow {
  border-color: var(--warning);
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.3), 0 0 20px rgba(245, 158, 11, 0.3);
  animation: guideBreathYellow 2s ease-in-out infinite;
}

@keyframes guideBreath {

  0%,
  100% {
    border-color: rgba(255, 255, 255, 0.4);
  }

  50% {
    border-color: rgba(99, 102, 241, 0.8);
  }
}

@keyframes guideBreathGreen {

  0%,
  100% {
    border-color: var(--success);
  }

  50% {
    border-color: rgba(16, 185, 129, 0.6);
  }
}

@keyframes guideBreathYellow {

  0%,
  100% {
    border-color: var(--warning);
  }

  50% {
    border-color: rgba(245, 158, 11, 0.5);
  }
}

/* ============================================================
   AUTO CAPTURE OVERLAY
   ============================================================ */
.auto-capture-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.4);
  z-index: 10;
  gap: 12px;
}

.auto-capture-ring {
  position: relative;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auto-capture-svg {
  position: absolute;
  inset: 0;
  transform: rotate(-90deg);
}

.auto-capture-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.15);
  stroke-width: 4;
}

.auto-capture-progress {
  fill: none;
  stroke: var(--success);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 283;
  stroke-dashoffset: 283;
  transition: stroke-dashoffset 0.1s linear;
  filter: drop-shadow(0 0 6px rgba(16, 185, 129, 0.5));
}

.auto-capture-icon {
  font-size: 1.8rem;
  z-index: 2;
  animation: autoCaptureIconPulse 1s ease-in-out infinite;
}

@keyframes autoCaptureIconPulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.15);
  }
}

.auto-capture-text {
  color: white;
  font-size: 0.85rem;
  font-weight: 600;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

/* ============================================================
   ID CARD TIPS
   ============================================================ */
.id-card-tips {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.tip-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.tip-icon {
  font-size: 0.9rem;
}

/* ============================================================
   IMAGE QUALITY WARNINGS
   ============================================================ */
.quality-warnings {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
  transition: all 0.3s ease;
}

.quality-warning-item {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  font-weight: 500;
  animation: warnSlideIn 0.3s ease-out;
}

.quality-warning-item.active {
  display: flex;
}

.quality-warning-item.warn-shadow {
  background: rgba(255, 152, 0, 0.12);
  border: 1px solid rgba(255, 152, 0, 0.3);
  color: #ffb74d;
}

.quality-warning-item.warn-bright {
  background: rgba(255, 235, 59, 0.12);
  border: 1px solid rgba(255, 235, 59, 0.3);
  color: #fff176;
}

.quality-warning-item.warn-blur {
  background: rgba(239, 83, 80, 0.12);
  border: 1px solid rgba(239, 83, 80, 0.3);
  color: #ef5350;
}

.quality-warning-item.warn-contrast {
  background: rgba(171, 71, 188, 0.12);
  border: 1px solid rgba(171, 71, 188, 0.3);
  color: #ce93d8;
}

.warn-icon {
  font-size: 1rem;
  flex-shrink: 0;
}

.warn-text {
  flex: 1;
}

@keyframes warnSlideIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Quality OK badge */
.quality-ok {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  font-weight: 600;
  background: rgba(76, 175, 80, 0.12);
  border: 1px solid rgba(76, 175, 80, 0.3);
  color: var(--success);
  animation: warnSlideIn 0.3s ease-out;
}

.quality-ok.active {
  display: flex;
}

/* ============================================================
   ID CARD MASK OVERLAY (Chilean ID guide)
   ============================================================ */
.id-card-mask {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-guide-enhanced {
  position: relative;
  width: 85%;
  height: 65%;
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.4);
}

.card-corner-enhanced {
  position: absolute;
  width: 30px;
  height: 30px;
  border-style: solid;
  border-width: 0;
  transition: border-color 0.3s ease;
}

.card-corner-enhanced.tl {
  top: -2px;
  left: -2px;
  border-top-width: 4px;
  border-left-width: 4px;
  border-color: var(--primary-light);
  border-radius: 8px 0 0 0;
}

.card-corner-enhanced.tr {
  top: -2px;
  right: -2px;
  border-top-width: 4px;
  border-right-width: 4px;
  border-color: var(--primary-light);
  border-radius: 0 8px 0 0;
}

.card-corner-enhanced.bl {
  bottom: -2px;
  left: -2px;
  border-bottom-width: 4px;
  border-left-width: 4px;
  border-color: var(--primary-light);
  border-radius: 0 0 0 8px;
}

.card-corner-enhanced.br {
  bottom: -2px;
  right: -2px;
  border-bottom-width: 4px;
  border-right-width: 4px;
  border-color: var(--primary-light);
  border-radius: 0 0 8px 0;
}

/* Photo zone — positioned where Chilean ID photo sits (left side, upper half) */
.id-photo-zone {
  position: absolute;
  top: 18%;
  left: 5%;
  width: 28%;
  height: 60%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.id-photo-zone-border {
  position: absolute;
  inset: 0;
  border: 2px dashed rgba(99, 102, 241, 0.6);
  border-radius: 6px;
  animation: photoZonePulse 2.5s ease-in-out infinite;
}

@keyframes photoZonePulse {

  0%,
  100% {
    border-color: rgba(99, 102, 241, 0.4);
    opacity: 0.7;
  }

  50% {
    border-color: rgba(99, 102, 241, 0.9);
    opacity: 1;
  }
}

.id-photo-zone-label {
  position: absolute;
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--primary-light);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
  padding: 2px 8px;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 4px;
}

/* Data zone — text lines on the right side of Chilean ID */
.id-qr-zone {
  position: absolute;
  top: 8%;
  left: 4%;
  width: 52%;
  height: 40%;
  display: none;
  align-items: flex-start;
  justify-content: flex-start;
}

.id-qr-zone-border {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 3px dashed rgba(16, 185, 129, 0.75);
  border-radius: 8px;
  box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.18), 0 0 24px rgba(16, 185, 129, 0.25);
  animation: qrZonePulse 1.8s ease-in-out infinite;
}

.card-guide-enhanced.qr-scanning .id-qr-zone-border {
  border-color: rgba(245, 158, 11, 0.95);
  box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.25), 0 0 26px rgba(245, 158, 11, 0.38);
}

.card-guide-enhanced.qr-found .id-qr-zone-border {
  border-color: rgba(16, 185, 129, 1);
  box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.35), 0 0 32px rgba(16, 185, 129, 0.55);
  animation: none;
}

.id-qr-zone::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  border: 1px solid rgba(16, 185, 129, 0.22);
  border-radius: 10px;
  background: rgba(16, 185, 129, 0.06);
}

@keyframes qrZonePulse {
  0%,
  100% {
    border-color: rgba(16, 185, 129, 0.45);
    opacity: 0.75;
  }

  50% {
    border-color: rgba(16, 185, 129, 1);
    opacity: 1;
  }
}

.id-qr-zone-label {
  position: absolute;
  bottom: -22px;
  left: 0;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--success);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
  padding: 2px 8px;
  background: rgba(0, 0, 0, 0.68);
  border-radius: 4px;
}

.card-guide-enhanced.back-side .id-photo-zone,
.card-guide-enhanced.back-side .id-data-zone,
.card-guide-enhanced.back-side .id-header-zone {
  display: none;
}

.card-guide-enhanced.back-side .id-qr-zone {
  display: flex;
}

.id-data-zone {
  position: absolute;
  top: 22%;
  left: 38%;
  width: 55%;
  height: 50%;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  padding: 4px 0;
}

.id-data-line {
  height: 2px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 1px;
  width: 100%;
}

.id-data-line.short {
  width: 60%;
}

.id-data-line.medium {
  width: 80%;
}

/* Header zone — "CÉDULA DE IDENTIDAD" text at top */
.id-header-zone {
  position: absolute;
  top: 4%;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  text-align: center;
}

.id-header-zone span {
  font-size: 0.55rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.25);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.camera-instructions {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 18px;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(10px);
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.9);
  white-space: nowrap;
  z-index: 6;
  transition: all 0.3s ease;
}

.camera-instructions.instruction-green {
  background: rgba(16, 185, 129, 0.85);
  color: white;
}

.camera-instructions.instruction-red {
  background: rgba(239, 68, 68, 0.85);
  color: white;
}

.camera-instructions.instruction-yellow {
  background: rgba(245, 158, 11, 0.85);
  color: white;
}

/* ============================================================
   PREVIEW
   ============================================================ */
.preview-container {
  position: relative;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 2px solid var(--success);
}

.preview-container img {
  width: 100%;
  display: block;
}

.preview-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
}

.preview-badge.success {
  background: rgba(16, 185, 129, 0.9);
  color: white;
}

/* ============================================================
   ACTIONS (Sticky on mobile)
   ============================================================ */
.capture-actions-sticky {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 24px;
  flex-wrap: wrap;
  position: sticky;
  bottom: 0;
  z-index: 20;
  padding: 16px 0;
  background: linear-gradient(to top, var(--bg-card) 60%, transparent);
}

/* ============================================================
   PROCESSING
   ============================================================ */
.processing-animation {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 30px 0;
}

.processing-face {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--border);
  position: relative;
}

.processing-face img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.face-left {
  animation: faceSlideLeft 2s ease-in-out infinite;
}

.face-right {
  animation: faceSlideRight 2s ease-in-out infinite;
}

@keyframes faceSlideLeft {

  0%,
  100% {
    transform: translateX(0);
  }

  50% {
    transform: translateX(10px);
  }
}

@keyframes faceSlideRight {

  0%,
  100% {
    transform: translateX(0);
  }

  50% {
    transform: translateX(-10px);
  }
}

.processing-connector {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.connector-line {
  display: flex;
  align-items: center;
  gap: 6px;
}

.connector-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary-light);
  animation: dotPulse 1.5s ease-in-out infinite;
}

.connector-dot.d2 {
  animation-delay: 0.3s;
}

.connector-dot.d3 {
  animation-delay: 0.6s;
}

@keyframes dotPulse {

  0%,
  100% {
    opacity: 0.3;
    transform: scale(0.8);
  }

  50% {
    opacity: 1;
    transform: scale(1.2);
  }
}

.processing-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--primary-light);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.processing-title {
  text-align: center;
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.processing-subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 24px;
}

.processing-steps {
  max-width: 320px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.proc-step {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: all var(--transition-normal);
}

.proc-step.active {
  color: var(--text-primary);
}

.proc-step.completed {
  color: var(--success);
}

.proc-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
  transition: all var(--transition-normal);
}

.proc-step.active .proc-dot {
  background: var(--primary-light);
  box-shadow: 0 0 10px var(--primary-glow);
  animation: pulse 1.5s ease-in-out infinite;
}

.proc-step.completed .proc-dot {
  background: var(--success);
}

/* ============================================================
   RESULTS
   ============================================================ */
.result-header {
  text-align: center;
  padding: 30px 0 20px;
}

.result-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  animation: resultPop 0.5s ease-out;
}

.result-icon.success {
  background: var(--success-bg);
  border: 2px solid var(--success-border);
  color: var(--success);
}

.result-icon.error {
  background: var(--danger-bg);
  border: 2px solid var(--danger-border);
  color: var(--danger);
}

.result-icon.warning {
  background: var(--warning-bg);
  border: 2px solid var(--warning-border);
  color: var(--warning);
}

@keyframes resultPop {
  0% {
    transform: scale(0);
    opacity: 0;
  }

  50% {
    transform: scale(1.2);
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.result-title {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.result-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
}

.result-images {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin: 30px 0;
}

.result-img-wrapper {
  text-align: center;
}

.result-img-wrapper img {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: var(--radius-md);
  border: 2px solid var(--border);
}

.result-img-label {
  display: block;
  margin-top: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.result-vs {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.result-similarity {
  font-size: 2rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary-light), var(--accent-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.result-vs span {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.result-details {
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  margin: 20px 0;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.detail-value {
  font-size: 0.9rem;
  font-weight: 600;
}

.detail-value.success {
  color: var(--success);
}

.detail-value.danger {
  color: var(--danger);
}

.detail-value.warning {
  color: var(--warning);
}

.result-actions {
  text-align: center;
  margin-top: 24px;
}

/* ============================================================
   API SECTION
   ============================================================ */
.api-section {
  margin-top: 80px;
  padding-top: 40px;
  border-top: 1px solid var(--border);
}

.section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.section-title svg {
  color: var(--primary-light);
}

.section-description {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-bottom: 32px;
}

.api-cards {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.api-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: all var(--transition-normal);
}

.api-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
}

.api-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.api-method {
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.api-method.post {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.api-method.get {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.api-card-header code {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.95rem;
  color: var(--text-primary);
  font-weight: 600;
}

.api-card-description {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 16px;
}

.code-block {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-top: 12px;
  overflow: hidden;
}

.code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border);
  font-size: 0.78rem;
  color: var(--text-muted);
}

.btn-copy {
  padding: 3px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.72rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-copy:hover {
  border-color: var(--primary);
  color: var(--primary-light);
}

.code-block pre {
  padding: 14px;
  overflow-x: auto;
}

.code-block code {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 40px 24px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer-note {
  margin-top: 8px;
  font-size: 0.78rem;
  color: var(--text-muted);
  opacity: 0.7;
}

/* ============================================================
   UTILITIES
   ============================================================ */
.hidden {
  display: none !important;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 640px) {
  .main {
    padding: 20px 16px 40px;
  }

  .hero {
    padding: 40px 0 30px;
  }

  .hero-title {
    font-size: 2rem;
  }

  .hero-description {
    font-size: 1rem;
  }

  .hero-features {
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }

  .capture-card {
    padding: 16px;
    border-radius: var(--radius-lg);
  }

  .card-header {
    flex-direction: column;
    text-align: center;
  }

  .capture-actions-sticky {
    flex-direction: column;
    padding: 12px 0;
  }

  .capture-actions-sticky button {
    width: 100%;
    justify-content: center;
  }

  .result-images {
    flex-direction: column;
    gap: 16px;
  }

  .processing-animation {
    gap: 12px;
  }

  .processing-face {
    width: 80px;
    height: 80px;
  }

  .progress-line {
    width: 40px;
  }

  /* Selfie camera stays portrait on mobile */
  .camera-container {
    aspect-ratio: 3/4;
  }

  /* ID card camera in landscape ratio on mobile for better card fit */
  .camera-container.id-camera {
    aspect-ratio: 4/3;
    max-height: 280px;
  }

  .face-guide {
    width: 160px;
    height: 200px;
  }

  .detection-status {
    padding: 10px 12px;
  }

  .detection-indicator {
    font-size: 0.82rem;
  }

  .id-card-tips {
    flex-direction: row;
    gap: 6px;
    justify-content: center;
  }

  .tip-item {
    padding: 4px 8px;
    font-size: 0.7rem;
  }

  .id-header-zone span {
    font-size: 0.45rem;
  }

  .id-photo-zone-label {
    font-size: 0.55rem;
  }

  .camera-instructions {
    font-size: 0.72rem;
    padding: 6px 12px;
  }

  .auto-capture-ring {
    width: 60px;
    height: 60px;
  }

  .auto-capture-icon {
    font-size: 1.4rem;
  }

  .auto-capture-text {
    font-size: 0.75rem;
  }

  .card-guide-enhanced {
    width: 90%;
    height: 75%;
  }
}

/* ============================================================
   PUNTOTAG BRAND REFRESH
   ============================================================ */
:root {
  --primary: #282878;
  --primary-light: #34348f;
  --primary-dark: #1f1f63;
  --primary-glow: rgba(40, 40, 120, 0.18);
  --accent: #ff7900;
  --accent-light: #ff9a2f;
  --success: #169b62;
  --success-bg: rgba(22, 155, 98, 0.10);
  --success-border: rgba(22, 155, 98, 0.28);
  --danger: #d92d20;
  --danger-bg: rgba(217, 45, 32, 0.10);
  --danger-border: rgba(217, 45, 32, 0.26);
  --warning: #ff7900;
  --warning-bg: rgba(255, 121, 0, 0.12);
  --warning-border: rgba(255, 121, 0, 0.28);
  --bg-primary: #ffffff;
  --bg-secondary: #f5f7fb;
  --bg-card: #ffffff;
  --bg-card-hover: #ffffff;
  --bg-glass: #f7f9fc;
  --bg-glass-hover: #eef2f8;
  --text-primary: #20234a;
  --text-secondary: #586070;
  --text-muted: #7d8594;
  --border: #dfe5ee;
  --border-hover: #c8d2df;
  --shadow-sm: 0 2px 8px rgba(40, 40, 120, 0.08);
  --shadow-md: 0 8px 22px rgba(40, 40, 120, 0.10);
  --shadow-lg: 0 18px 44px rgba(40, 40, 120, 0.14);
  --shadow-glow: 0 0 0 4px rgba(255, 121, 0, 0.12);
}

body {
  background:
    linear-gradient(180deg, #ffffff 0%, #f8fafc 54%, #eef3fb 100%);
  color: var(--text-primary);
}

.bg-orbs { display: none; }

.header {
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid #e4e9f1;
  box-shadow: 0 2px 18px rgba(40, 40, 120, 0.06);
}

.header-content { padding: 10px 24px; }
.logo { gap: 12px; }
.logo-icon, .logo-text { display: none; }
.logo-mark {
  width: 44px;
  height: 44px;
  object-fit: contain;
}
.logo-wordmark {
  width: 150px;
  height: auto;
  max-height: 48px;
  object-fit: contain;
}
.header-status {
  background: #ffffff;
  border: 1px solid #e3e8f0;
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}
.status-dot { background: var(--accent); }

.main {
  max-width: 940px;
  padding-top: 28px;
}
.hero {
  padding: 28px 0 34px;
}
.hero-brand {
  display: block;
  width: min(220px, 60vw);
  height: auto;
  margin: 0 auto 18px;
}
.hero-badge {
  background: #fff7ef;
  border: 1px solid rgba(255, 121, 0, 0.26);
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 18px;
}
.hero-title {
  color: var(--primary);
  letter-spacing: 0;
}
.gradient-text {
  background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 92%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-description {
  color: var(--text-secondary);
  max-width: 560px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #ff8f1f);
  color: #ffffff;
  border-radius: 10px;
  box-shadow: 0 10px 24px rgba(255, 121, 0, 0.24);
}
.btn-primary:hover { box-shadow: 0 14px 28px rgba(255, 121, 0, 0.30); }
.btn-secondary, .btn-capture {
  background: #ffffff;
  border: 1px solid #d8e0ea;
  color: var(--primary);
}
.btn-secondary:hover, .btn-capture:hover {
  background: #fff7ef;
  border-color: var(--accent);
}
.capture-ring { border-color: var(--accent); }
.capture-dot { background: var(--accent); }
.btn-capture:hover .capture-ring { border-color: var(--primary); }
.btn-capture:hover .capture-dot { background: var(--primary); }
.btn-back { color: var(--primary); }

.progress-bar { margin-bottom: 28px; }
.step-circle {
  background: #ffffff;
  border-color: #dbe3ee;
  box-shadow: var(--shadow-sm);
}
.progress-step.active .step-circle {
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(40, 40, 120, 0.12);
}
.progress-step.completed .step-circle {
  background: var(--accent);
  border-color: var(--accent);
}
.progress-step.active .step-label { color: var(--primary); }
.progress-step.completed .step-label { color: var(--accent); }
.progress-line { background: #dfe5ee; }
.progress-line.filled, .progress-line.filled::after { background: var(--accent); }

.capture-card {
  background: #ffffff;
  border: 1px solid #e1e7ef;
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.card-title { color: var(--primary); }
.card-subtitle { color: var(--text-secondary); }
.selfie-icon, .id-icon {
  background: #fff7ef;
  color: var(--accent);
  border: 1px solid rgba(255, 121, 0, 0.24);
}
.detection-status, .tip-item, .result-details, .detail-row {
  background: #f8fafc;
  border-color: #e1e7ef;
}
.detection-quality { background: #e6ecf3; }
.camera-container {
  background: #0a0a0a;
  border-color: #dbe3ee;
  box-shadow: var(--shadow-md);
}
.camera-container.border-green {
  border-color: var(--success);
  box-shadow: 0 0 0 4px rgba(22, 155, 98, 0.14);
}
.camera-container.border-red {
  border-color: var(--danger);
  box-shadow: 0 0 0 4px rgba(217, 45, 32, 0.12);
}
.camera-container.border-yellow {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(255, 121, 0, 0.14);
}
.card-guide-enhanced {
  border-color: rgba(255, 255, 255, 0.84);
}
.card-corner-enhanced { border-color: var(--danger); }
.id-photo-zone-border, .id-qr-zone-border {
  border-color: var(--accent);
}
.id-photo-zone-label, .id-qr-zone-label, .id-header-zone span {
  background: var(--accent);
  color: #ffffff;
}
.camera-instructions {
  background: rgba(255, 255, 255, 0.92);
  color: var(--primary);
}
.camera-instructions.instruction-green {
  background: rgba(22, 155, 98, 0.92);
  color: #ffffff;
}
.camera-instructions.instruction-red {
  background: rgba(217, 45, 32, 0.92);
  color: #ffffff;
}
.camera-instructions.instruction-yellow {
  background: rgba(255, 121, 0, 0.94);
  color: #ffffff;
}
.auto-capture-progress {
  stroke: var(--success);
  filter: drop-shadow(0 0 6px rgba(22, 155, 98, 0.55));
}
.preview-container, .processing-face, .result-img-wrapper img {
  background: #ffffff;
  border-color: #e1e7ef;
}
.preview-badge.success { background: var(--success); }
.result-icon.success { background: var(--success-bg); color: var(--success); }
.result-icon.error { background: var(--danger-bg); color: var(--danger); }
.result-icon.warning { background: var(--warning-bg); color: var(--warning); }
.result-title { color: var(--primary); }
.result-similarity { color: var(--accent); }
.footer {
  color: var(--text-secondary);
  border-top: 1px solid #e1e7ef;
}

@media (max-width: 640px) {
  .header-content { padding: 8px 14px; }
  .logo-mark { width: 38px; height: 38px; }
  .logo-wordmark { width: 122px; }
  .hero-brand { width: min(190px, 62vw); }
  .hero { padding-top: 18px; }
  .capture-card { padding: 22px 16px; }
}



/* Selfie capture adjustments */
#selfieStep .selfie-icon {
  display: none;
}

#selfieStep .card-header {
  gap: 0;
}

#selfieStep .camera-container {
  max-width: 340px;
  aspect-ratio: 3/4;
}

#selfieStep .face-guide {
  width: 176px;
  height: 228px;
}

.logo-flow-text {
  display: none;
  align-items: baseline;
  font-size: 1.26rem;
  line-height: 1;
  font-weight: 700;
  letter-spacing: 0;
}

.validation-flow-active .logo-flow-text {
  display: inline-flex;
}

.logo-flow-punto { color: var(--primary); }
.logo-flow-tag { color: var(--accent); }

@media (max-width: 640px) {
  #selfieStep .camera-container {
    max-width: 260px;
  }

  #selfieStep .face-guide {
    width: 136px;
    height: 174px;
  }

  .logo-flow-text {
    font-size: 1.05rem;
  }
}
