/* ══════════════════════════════════════════════════════════════════════
   veryficol — Hoja de estilos principal · Tema Fintech Oscuro Premium
   ══════════════════════════════════════════════════════════════════════ */

/* ─── Variables ──────────────────────────────────────────────────────── */
:root {
  /* Paleta oscura */
  --bg:           #0a0a0f;
  --bg-2:         #0f0f18;
  --surface:      rgba(255, 255, 255, 0.04);
  --surface-2:    rgba(255, 255, 255, 0.07);
  --surface-3:    rgba(255, 255, 255, 0.11);
  --border:       rgba(255, 255, 255, 0.09);
  --border-2:     rgba(255, 255, 255, 0.15);

  /* Acentos */
  --blue:         #3b82f6;
  --blue-dim:     rgba(59, 130, 246, 0.18);
  --blue-glow:    0 0 40px rgba(59, 130, 246, 0.25);
  --green:        #22c55e;
  --green-dim:    rgba(34, 197, 94, 0.15);
  --yellow:       #f59e0b;
  --yellow-dim:   rgba(245, 158, 11, 0.15);
  --red:          #ef4444;
  --red-dim:      rgba(239, 68, 68, 0.15);

  /* Texto */
  --text-1:       #f1f5f9;
  --text-2:       #94a3b8;
  --text-3:       #64748b;

  /* Tipografía */
  --font-title:   'Sora', -apple-system, sans-serif;
  --font-body:    'DM Sans', -apple-system, sans-serif;

  /* Radios */
  --r-sm:  8px;
  --r-md:  12px;
  --r-lg:  16px;
  --r-xl:  20px;

  /* Sombras */
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.5), 0 1px 0 var(--border);
  --shadow-glow: 0 0 40px rgba(59, 130, 246, 0.15);

  /* Legados — para compatibilidad con app.js color assignments */
  --verde:         #22c55e;
  --verde-claro:   rgba(34, 197, 94, 0.15);
  --amarillo:      #f59e0b;
  --amarillo-claro: rgba(245, 158, 11, 0.15);
  --rojo:          #ef4444;
  --rojo-claro:    rgba(239, 68, 68, 0.15);
  --azul-medio:    #3b82f6;
  --gris-100:      rgba(255,255,255,0.06);
  --gris-300:      rgba(255,255,255,0.12);
  --gris-500:      #64748b;
  --gris-700:      #94a3b8;
  --gris-900:      #f1f5f9;
  --blanco:        #f1f5f9;
  --fuente:        'DM Sans', -apple-system, sans-serif;
  --radio:         12px;
  --radio-sm:      8px;
  --radio-lg:      16px;
  --sombra-sm:     0 1px 3px rgba(0,0,0,.4);
  --sombra-md:     0 4px 12px rgba(0,0,0,.5);
  --sombra-lg:     0 10px 32px rgba(0,0,0,.6);
}

/* ─── Reset ───────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text-1);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* ─── Partículas de fondo (CSS puro, GPU) ─────────────────────────────── */
.bg-particles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.bg-particles span {
  position: absolute;
  border-radius: 50%;
  will-change: transform;
  opacity: 0;
  animation: particle-float linear infinite;
}

/* Orbes grandes de luz de fondo */
.bg-particles span:nth-child(1)  { width:400px;height:400px;left:10%;top:20%;background:radial-gradient(circle,rgba(59,130,246,.07),transparent 70%);animation:orb-drift 20s ease-in-out infinite alternate;opacity:1; }
.bg-particles span:nth-child(2)  { width:300px;height:300px;right:5%;top:50%;background:radial-gradient(circle,rgba(34,197,94,.05),transparent 70%);animation:orb-drift 25s ease-in-out infinite alternate-reverse;opacity:1; }
.bg-particles span:nth-child(3)  { width:200px;height:200px;left:50%;bottom:10%;background:radial-gradient(circle,rgba(139,92,246,.06),transparent 70%);animation:orb-drift 18s ease-in-out infinite alternate;opacity:1; }

/* Partículas pequeñas flotantes */
.bg-particles span:nth-child(4)  { width:3px;height:3px;left:15%;top:30%;background:var(--blue);animation:particle-float 12s 0s infinite;box-shadow:0 0 6px var(--blue); }
.bg-particles span:nth-child(5)  { width:2px;height:2px;left:70%;top:15%;background:var(--green);animation:particle-float 15s 2s infinite;box-shadow:0 0 4px var(--green); }
.bg-particles span:nth-child(6)  { width:3px;height:3px;left:40%;top:60%;background:var(--blue);animation:particle-float 10s 4s infinite;box-shadow:0 0 6px var(--blue); }
.bg-particles span:nth-child(7)  { width:2px;height:2px;left:85%;top:40%;background:#a78bfa;animation:particle-float 14s 1s infinite;box-shadow:0 0 4px #a78bfa; }
.bg-particles span:nth-child(8)  { width:3px;height:3px;left:25%;top:75%;background:var(--green);animation:particle-float 11s 6s infinite;box-shadow:0 0 6px var(--green); }
.bg-particles span:nth-child(9)  { width:2px;height:2px;left:60%;top:85%;background:var(--blue);animation:particle-float 16s 3s infinite;box-shadow:0 0 4px var(--blue); }
.bg-particles span:nth-child(10) { width:4px;height:4px;left:90%;top:70%;background:#a78bfa;animation:particle-float 9s 5s infinite;box-shadow:0 0 8px #a78bfa; }
.bg-particles span:nth-child(11) { width:2px;height:2px;left:5%;top:55%;background:var(--green);animation:particle-float 13s 7s infinite;box-shadow:0 0 4px var(--green); }
.bg-particles span:nth-child(12) { width:3px;height:3px;left:50%;top:10%;background:var(--blue);animation:particle-float 17s 2.5s infinite;box-shadow:0 0 6px var(--blue); }

@keyframes orb-drift {
  from { transform: translate(0, 0); }
  to   { transform: translate(30px, 20px); }
}

@keyframes particle-float {
  0%   { opacity: 0; transform: translateY(0) scale(1); }
  10%  { opacity: 0.8; }
  90%  { opacity: 0.6; }
  100% { opacity: 0; transform: translateY(-80px) scale(0.5); }
}

/* ─── Navbar ──────────────────────────────────────────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 200;
  height: 64px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(10, 10, 15, 0.72);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.nav-logo {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--blue), #6366f1);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 16px rgba(59,130,246,.4);
  flex-shrink: 0;
}

.nav-logo svg {
  width: 20px;
  height: 20px;
  fill: white;
}

.nav-titulo {
  font-family: var(--font-title);
  font-size: 20px;
  font-weight: 700;
  color: var(--text-1);
  letter-spacing: -0.5px;
  text-transform: lowercase;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-sesion {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link {
  color: var(--text-1);
  text-decoration: none;
  padding: 8px 16px;
  border-radius: var(--r-sm);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  transition: color .2s, background .2s, border-color .2s;
  cursor: pointer;
  border: 1px solid transparent;
  background: transparent;
  display: inline-flex;
  align-items: center;
}

.nav-link:hover {
  color: #fff;
  background: rgba(255,255,255,0.06);
}

.nav-link.activo {
  color: #fff;
  background: rgba(255,255,255,0.08);
}

/* Accent sutil solo para "Comprar Plan" */
.nav-link-cta {
  border: 1px solid rgba(0, 230, 118, 0.4);
  color: #00E676;
}
.nav-link-cta:hover {
  background: rgba(0, 230, 118, 0.1);
  color: #00E676;
  border-color: rgba(0, 230, 118, 0.6);
}

.nav-usuario-nombre {
  display: none;
  font-size: 13px;
  color: var(--text-2);
  font-weight: 500;
  padding: 0 6px;
}

.nav-btn-dashboard { display: none; }
.nav-btn-logout    { display: none; }

/* Hamburguesa (móvil) */
.nav-toggle {
  display: none;
  background: transparent;
  border: none;
  color: var(--text-1);
  padding: 8px;
  cursor: pointer;
  border-radius: var(--r-sm);
}
.nav-toggle:hover { background: rgba(255,255,255,0.06); }

@media (max-width: 720px) {
  .navbar { padding: 0 16px; }
  .nav-toggle { display: inline-flex; }
  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 12px 16px 16px;
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(255,255,255,0.08);
  }
  .nav-links.open { display: flex; }
  .nav-sesion {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    width: 100%;
  }
  .nav-link { justify-content: center; width: 100%; }
}

/* ─── Layout ──────────────────────────────────────────────────────────── */
.container {
  position: relative;
  z-index: 1;
  max-width: 860px;
  margin: 32px auto;
  padding: 0 20px;
  flex: 1;
}

/* ─── Hero Banner ───────────────────────────────────────────────────── */
.hero-banner {
  position: relative;
  overflow: hidden;
  text-align: center;
  padding: clamp(48px, 10vw, 96px) 20px clamp(40px, 8vw, 80px);
  margin-bottom: 32px;
  border-radius: var(--r-xl);
  background: linear-gradient(160deg, #0d0d1a 0%, #0a0a14 40%, #0f1a12 100%);
  border: 1px solid var(--border);
}

/* Líneas animadas de fondo */
.hero-bg-lines {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.hero-bg-lines span {
  position: absolute;
  width: 1px;
  height: 100%;
  background: linear-gradient(180deg, transparent 0%, rgba(0,230,118,.07) 50%, transparent 100%);
  animation: hero-line-drift 8s ease-in-out infinite alternate;
}
.hero-bg-lines span:nth-child(1) { left: 10%; animation-delay: 0s; }
.hero-bg-lines span:nth-child(2) { left: 20%; animation-delay: 1s; }
.hero-bg-lines span:nth-child(3) { left: 35%; animation-delay: 0.5s; }
.hero-bg-lines span:nth-child(4) { left: 50%; animation-delay: 1.5s; }
.hero-bg-lines span:nth-child(5) { left: 65%; animation-delay: 0.8s; }
.hero-bg-lines span:nth-child(6) { left: 75%; animation-delay: 2s; }
.hero-bg-lines span:nth-child(7) { left: 85%; animation-delay: 0.3s; }
.hero-bg-lines span:nth-child(8) { left: 95%; animation-delay: 1.2s; }

@keyframes hero-line-drift {
  0%   { transform: translateY(-30%); opacity: 0.3; }
  100% { transform: translateY(30%);  opacity: 0.8; }
}

/* Título */
.hero-titulo {
  position: relative;
  font-family: var(--font-title);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  color: #fff;
  line-height: 1.15;
  margin: 0 0 16px;
  animation: hero-fade-up 0.5s ease-out both;
}
.hero-highlight {
  color: #00E676;
  text-shadow: 0 0 20px rgba(0,230,118,.4), 0 0 60px rgba(0,230,118,.15);
}

/* Subtítulo */
.hero-subtitulo {
  position: relative;
  font-family: var(--font-body);
  font-size: clamp(0.95rem, 2.2vw, 1.2rem);
  color: #94a3b8;
  line-height: 1.6;
  margin: 0 auto 28px;
  max-width: 560px;
  animation: hero-fade-up 0.6s ease-out 0.3s both;
}

/* Flecha chevron animada */
.hero-chevron {
  position: relative;
  display: inline-block;
  color: rgba(255, 255, 255, 0.45);
  text-decoration: none;
  margin-top: 8px;
  opacity: 0;
  animation: hero-fade-up 0.5s ease-out 0.9s both, hero-bounce 2s ease-in-out 1.4s infinite;
  transition: color 0.2s;
}
.hero-chevron:hover {
  color: rgba(255, 255, 255, 0.8);
}

/* Scroll suave para el CTA */
html { scroll-behavior: smooth; }

/* Animaciones */
@keyframes hero-fade-up {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes hero-bounce {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(8px); }
}

.seccion { display: none; }
.seccion.activa { display: block; }

/* ─── Cards glassmorphism ─────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.card-header {
  padding: 28px 32px 20px;
  border-bottom: 1px solid var(--border);
}

.card-titulo {
  font-family: var(--font-title);
  font-size: 22px;
  font-weight: 700;
  color: var(--text-1);
  letter-spacing: -0.5px;
}

.card-subtitulo {
  color: var(--text-2);
  font-size: 14px;
  margin-top: 6px;
  line-height: 1.55;
}

/* ─── Formulario ──────────────────────────────────────────────────────── */
.formulario-card form {
  padding: 28px 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.campo-grupo {
  display: flex;
  flex-direction: column;
  gap: 7px;
  animation: fade-up .45s ease both;
  animation-delay: calc(var(--stagger, 0) * 75ms);
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.campo-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: 0.2px;
}

.requerido { color: var(--red); margin-left: 2px; }

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icono {
  position: absolute;
  left: 14px;
  font-size: 16px;
  pointer-events: none;
  z-index: 1;
  opacity: 0.6;
}

.campo-input {
  width: 100%;
  padding: 13px 16px 13px 44px;
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: var(--r-md);
  font-size: 16px;
  font-family: var(--font-body);
  color: var(--text-1);
  transition: border-color .2s, box-shadow .2s, background .2s;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}

.campo-input::placeholder { color: var(--text-3); }

.campo-input:focus {
  border-color: var(--blue);
  background: rgba(59, 130, 246, 0.06);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, .18), var(--blue-glow);
}

.campo-input.invalido {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, .15);
}

.campo-input.valido {
  border-color: var(--green);
}

.campo-select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%2364748b'%3E%3Cpath fill-rule='evenodd' d='M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
  padding-right: 44px;
}

.campo-select option {
  background: #1a1a2e;
  color: var(--text-1);
}

.campo-error {
  font-size: 12px;
  color: var(--red);
  font-weight: 500;
  min-height: 16px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.campo-ayuda {
  font-size: 12px;
  color: var(--text-3);
}

/* Checkbox */
.campo-grupo-checkbox { flex-direction: row; align-items: flex-start; gap: 0; }

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  padding: 14px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: var(--r-md);
  transition: border-color .2s, background .2s;
  width: 100%;
}

.checkbox-label:has(.checkbox-input:checked) {
  background: rgba(34, 197, 94, 0.07);
  border-color: rgba(34, 197, 94, 0.35);
}

.checkbox-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.checkbox-custom {
  width: 22px;
  height: 22px;
  min-width: 22px;
  border: 1.5px solid var(--border-2);
  border-radius: 6px;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s;
  margin-top: 1px;
}

.checkbox-input:checked + .checkbox-custom {
  background: var(--green);
  border-color: var(--green);
  box-shadow: 0 0 12px rgba(34,197,94,.4);
}

.checkbox-input:checked + .checkbox-custom::after {
  content: '✓';
  color: #000;
  font-size: 13px;
  font-weight: 800;
}

.checkbox-texto {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.55;
}

/* Botón verificar */
.btn-verificar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 15px;
  background: linear-gradient(135deg, #1d4ed8, var(--blue));
  color: #fff;
  border: none;
  border-radius: var(--r-md);
  font-size: 16px;
  font-weight: 700;
  font-family: var(--font-body);
  cursor: pointer;
  transition: transform .2s, box-shadow .2s, opacity .2s;
  box-shadow: 0 4px 20px rgba(59, 130, 246, .4), 0 0 0 1px rgba(255,255,255,.08) inset;
  letter-spacing: 0.2px;
  position: relative;
  overflow: hidden;
}

.btn-verificar::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,.12), transparent);
  pointer-events: none;
}

.btn-verificar:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(59, 130, 246, .55), 0 0 0 1px rgba(255,255,255,.1) inset;
}

.btn-verificar:active:not(:disabled) { transform: translateY(0); }

.btn-verificar:disabled {
  opacity: .45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-icono { font-size: 18px; }

/* Contador */
.contador-consultas {
  margin-top: 16px;
  text-align: center;
  font-size: 13px;
  color: var(--text-3);
}

.contador-numero {
  font-weight: 700;
  color: var(--blue);
  margin-left: 4px;
}

/* Badge Didit */
.didit-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: var(--blue-dim);
  border: 1px solid rgba(59,130,246,.3);
  border-radius: 20px;
  font-size: 12px;
  color: #93c5fd;
  font-weight: 600;
  margin-top: 10px;
}

/* ─── Progreso ────────────────────────────────────────────────────────── */
.progreso-card .card-header { padding-bottom: 16px; }

.barra-progreso-wrapper {
  padding: 0 32px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.barra-progreso {
  flex: 1;
  height: 6px;
  background: var(--surface-3);
  border-radius: 99px;
  overflow: hidden;
  position: relative;
}

.barra-relleno {
  height: 100%;
  background: linear-gradient(90deg, var(--blue), var(--green));
  border-radius: 99px;
  transition: width .5s ease;
  position: relative;
  overflow: hidden;
}

/* Shimmer sobre la barra */
.barra-relleno::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,.35) 50%, transparent 100%);
  animation: shimmer 1.8s ease-in-out infinite;
  will-change: transform;
}

@keyframes shimmer {
  from { transform: translateX(-100%); }
  to   { transform: translateX(300%); }
}

.barra-porcentaje {
  font-size: 13px;
  font-weight: 700;
  color: var(--blue);
  min-width: 40px;
  text-align: right;
}

/* Timeline de pasos */
.pasos-lista {
  padding: 4px 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
}

/* Línea conectora vertical */
.pasos-lista::before {
  content: '';
  position: absolute;
  left: 48px;
  top: 12px;
  bottom: 12px;
  width: 2px;
  background: var(--border);
  border-radius: 2px;
}

.paso {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 12px 0;
  position: relative;
  transition: opacity .3s;
}

.paso-icono-wrapper {
  width: 34px;
  height: 34px;
  min-width: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all .35s;
  position: relative;
  z-index: 1;
  border: 1px solid var(--border);
}

.paso-icono-wrapper.pendiente {
  background: var(--surface-2);
}

.paso-icono-wrapper.en-progreso {
  background: var(--blue-dim);
  border-color: rgba(59,130,246,.4);
  animation: paso-pulse .9s ease-in-out infinite alternate;
}

.paso-icono-wrapper.completado {
  background: var(--green-dim);
  border-color: rgba(34,197,94,.4);
}

.paso-icono-wrapper.error {
  background: var(--red-dim);
  border-color: rgba(239,68,68,.35);
}

@keyframes paso-pulse {
  from { box-shadow: 0 0 0 0 rgba(59,130,246,.5); }
  to   { box-shadow: 0 0 0 8px rgba(59,130,246,0); }
}

.paso-contenido {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-top: 7px;
}

.paso-texto {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-2);
}

.paso-estado-texto {
  font-size: 12px;
  color: var(--text-3);
}

.paso.esperando-cliente .paso-icono-wrapper { background: var(--blue-dim) !important; border-color: rgba(59,130,246,.4) !important; }

/* ─── QR / Enlace Didit ───────────────────────────────────────────────── */
.didit-qr-container {
  margin: 4px 32px 20px;
  animation: fade-up .4s ease;
}

.didit-qr-card {
  background: linear-gradient(135deg, rgba(59,130,246,.08), rgba(99,102,241,.06));
  border: 1px solid rgba(59,130,246,.25);
  border-radius: var(--r-lg);
  padding: 24px;
  text-align: center;
}

.didit-qr-titulo {
  font-family: var(--font-title);
  font-size: 17px;
  font-weight: 700;
  color: var(--text-1);
  margin: 0 0 8px;
}

.didit-qr-desc {
  font-size: 14px;
  color: var(--text-2);
  margin: 0 0 18px;
  line-height: 1.55;
}

.didit-qr-imagen {
  display: inline-block;
  background: #ffffff;
  border-radius: 12px;
  padding: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,.4);
  margin-bottom: 20px;
}

.didit-qr-imagen img {
  display: block;
  width: 200px;
  height: 200px;
  border-radius: 6px;
}

.didit-qr-imagen-placeholder {
  width: 200px;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  color: #9ca3af;
}

.didit-url-wrapper {
  margin: 16px auto;
  max-width: 500px;
}

.didit-url-wrapper textarea {
  width: 100%;
  padding: 12px;
  font-size: 13px;
  border: 1px solid rgba(59,130,246,.4);
  border-radius: 8px;
  background: rgba(59,130,246,.08);
  color: #93c5fd;
  min-height: 60px;
  resize: none;
  word-break: break-all;
  box-sizing: border-box;
  font-family: monospace;
  -webkit-user-select: all;
  user-select: all;
}

.didit-qr-nota {
  font-size: 13px;
  color: var(--text-3);
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.didit-qr-nota .spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid var(--border-2);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* ─── Semáforo de resultado ───────────────────────────────────────────── */
.semaforo-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(16px);
  padding: 32px;
  display: flex;
  align-items: center;
  gap: 28px;
  margin-bottom: 20px;
  border-top: 3px solid var(--border-2);
  transition: border-color .4s, box-shadow .4s;
}

.semaforo-card.verde  { border-top-color: var(--green); box-shadow: var(--shadow-card), 0 0 40px rgba(34,197,94,.12); }
.semaforo-card.amarillo { border-top-color: var(--yellow); box-shadow: var(--shadow-card), 0 0 40px rgba(245,158,11,.12); }
.semaforo-card.rojo   { border-top-color: var(--red); box-shadow: var(--shadow-card), 0 0 40px rgba(239,68,68,.12); }

.semaforo-luces {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 10px;
  background: rgba(0,0,0,.5);
  border-radius: 36px;
  border: 1px solid rgba(255,255,255,.06);
  box-shadow: inset 0 2px 8px rgba(0,0,0,.6);
}

.semaforo-luz {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  transition: all .4s;
}

.semaforo-luz.rojo     { background: rgba(60,0,0,.8); }
.semaforo-luz.amarillo { background: rgba(60,40,0,.8); }
.semaforo-luz.verde    { background: rgba(0,50,0,.8); }

.semaforo-luz.rojo.activo     { background: #ef4444; box-shadow: 0 0 20px #ef4444, 0 0 40px rgba(239,68,68,.5); animation: glow-pulse 2s ease-in-out infinite; }
.semaforo-luz.amarillo.activo { background: #f59e0b; box-shadow: 0 0 20px #f59e0b, 0 0 40px rgba(245,158,11,.5); animation: glow-pulse 2s ease-in-out infinite; }
.semaforo-luz.verde.activo    { background: #22c55e; box-shadow: 0 0 20px #22c55e, 0 0 40px rgba(34,197,94,.5); animation: glow-pulse 2s ease-in-out infinite; }

@keyframes glow-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: .75; }
}

.semaforo-info { flex: 1; }

.semaforo-resultado {
  font-family: var(--font-title);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-1);
}

.semaforo-descripcion {
  font-size: 14px;
  color: var(--text-2);
  margin-top: 6px;
  margin-bottom: 20px;
}

.score-display { display: flex; flex-direction: column; gap: 8px; }

.score-numero {
  font-family: var(--font-title);
  font-size: 52px;
  font-weight: 800;
  letter-spacing: -3px;
  line-height: 1;
  transition: color .4s, text-shadow .4s;
}

/* Glow según resultado */
.semaforo-card.verde   .score-numero { text-shadow: 0 0 30px rgba(34,197,94,.6); }
.semaforo-card.amarillo .score-numero { text-shadow: 0 0 30px rgba(245,158,11,.6); }
.semaforo-card.rojo    .score-numero { text-shadow: 0 0 30px rgba(239,68,68,.6); }

/* Animación de entrada del score */
.score-numero.animating {
  animation: count-in .6s cubic-bezier(.34,1.56,.64,1) both;
}

@keyframes count-in {
  from { opacity: 0; transform: scale(.6); }
  to   { opacity: 1; transform: scale(1); }
}

.score-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-3);
}

.score-barra {
  height: 6px;
  background: var(--surface-3);
  border-radius: 99px;
  overflow: hidden;
  width: 100%;
  max-width: 280px;
}

.score-barra-relleno {
  height: 100%;
  border-radius: 99px;
  transition: width .9s cubic-bezier(.34,1.56,.64,1), background .4s;
}

.score-escala {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--text-3);
  max-width: 280px;
  font-weight: 500;
}

/* Badge Didit resultado */
.card-didit-resultado {
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--r-lg);
  padding: 16px 20px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  backdrop-filter: blur(12px);
  animation: fade-up .4s ease both;
}

.card-didit-resultado.aprobado { border-color: rgba(34,197,94,.35); background: rgba(34,197,94,.06); }
.card-didit-resultado.rechazado { border-color: rgba(239,68,68,.35); background: rgba(239,68,68,.06); }
.card-didit-resultado.revision  { border-color: rgba(245,158,11,.35); background: rgba(245,158,11,.06); }

.didit-result-icon { font-size: 26px; flex-shrink: 0; }
.didit-result-info { flex: 1; }
.didit-result-titulo { font-weight: 700; font-size: 14px; color: var(--text-1); margin-bottom: 3px; }
.didit-result-detalle { font-size: 13px; color: var(--text-2); }

/* ─── Cards de resultados ─────────────────────────────────────────────── */
.resultados-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.resultado-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  backdrop-filter: blur(12px);
  padding: 20px;
  border-left: 3px solid var(--border-2);
  transition: border-color .3s, box-shadow .3s;
  animation: fade-up .4s ease both;
}

.resultado-card:nth-child(1) { animation-delay: .05s; }
.resultado-card:nth-child(2) { animation-delay: .10s; }
.resultado-card:nth-child(3) { animation-delay: .15s; }
.resultado-card:nth-child(4) { animation-delay: .20s; }

.resultado-card.ok    { border-left-color: var(--green); }
.resultado-card.alerta { border-left-color: var(--red); }
.resultado-card.warn  { border-left-color: var(--yellow); }
.resultado-card.nd    { border-left-color: var(--border-2); }

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

.resultado-icono { font-size: 18px; }

.resultado-titulo {
  flex: 1;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-2);
}

.resultado-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 99px;
  background: var(--surface-3);
  color: var(--text-3);
  white-space: nowrap;
}

.resultado-badge.ok     { background: var(--green-dim); color: var(--green); }
.resultado-badge.alerta { background: var(--red-dim); color: var(--red); }
.resultado-badge.warn   { background: var(--yellow-dim); color: var(--yellow); }

.resultado-detalle {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.5;
}

.simit-stats {
  display: flex;
  gap: 24px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.simit-stat { display: flex; flex-direction: column; gap: 2px; }

.simit-stat-valor {
  font-size: 17px;
  font-weight: 800;
  color: var(--red);
}

.simit-stat-label {
  font-size: 11px;
  color: var(--text-3);
  font-weight: 500;
}

/* ─── Desglose del score ──────────────────────────────────────────────── */
.desglose-card {
  margin-bottom: 20px;
  padding: 24px 28px;
}

.desglose-titulo {
  font-family: var(--font-title);
  font-size: 15px;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 18px;
}

.desglose-lista { display: flex; flex-direction: column; gap: 0; }

.desglose-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
}

.desglose-item:last-child { border-bottom: none; }
.desglose-info { flex: 1; }

.desglose-factor {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-1);
}

.desglose-desc {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 2px;
  line-height: 1.45;
}

.desglose-puntos {
  font-size: 13px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 6px;
  min-width: 58px;
  text-align: center;
  white-space: nowrap;
}

.desglose-puntos.negativo { color: var(--red); background: var(--red-dim); }
.desglose-puntos.neutro   { color: var(--text-3); background: var(--surface-3); }
.desglose-puntos.positivo { color: var(--green); background: var(--green-dim); }

/* ─── Acciones resultado ──────────────────────────────────────────────── */
.acciones-resultado {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.btn-accion {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 22px;
  border: none;
  border-radius: var(--r-md);
  font-size: 14px;
  font-weight: 700;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all .2s;
  text-decoration: none;
}

.btn-pdf {
  background: linear-gradient(135deg, var(--blue), #6366f1);
  color: #fff;
  flex: 1;
  box-shadow: 0 4px 16px rgba(59,130,246,.35);
}

.btn-pdf:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(59,130,246,.5);
}

.btn-pdf:disabled {
  background: var(--surface-3);
  color: var(--text-3);
  cursor: not-allowed;
  box-shadow: none;
}

.btn-nueva {
  background: var(--surface-2);
  color: var(--text-2);
  border: 1px solid var(--border-2);
}

.btn-nueva:hover {
  background: var(--surface-3);
  color: var(--text-1);
}

.nota-legal {
  font-size: 12px;
  color: var(--text-3);
  text-align: center;
  line-height: 1.6;
  margin-bottom: 8px;
}

/* ─── Historial ───────────────────────────────────────────────────────── */
.historial-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.historial-filtros {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.filtro-select, .filtro-input {
  padding: 8px 12px;
  border: 1px solid var(--border-2);
  border-radius: var(--r-sm);
  font-size: 13px;
  font-family: var(--font-body);
  color: var(--text-1);
  background: var(--surface-2);
  outline: none;
}

.filtro-select option { background: #1a1a2e; }

.filtro-select:focus, .filtro-input:focus { border-color: var(--blue); }

.filtro-input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(1) opacity(0.5); }

.btn-filtrar {
  padding: 8px 16px;
  background: var(--blue-dim);
  color: #93c5fd;
  border: 1px solid rgba(59,130,246,.3);
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  transition: background .2s;
}

.btn-filtrar:hover { background: rgba(59,130,246,.28); }

.tabla-wrapper {
  overflow-x: auto;
  padding: 0 24px;
}

.tabla-historial {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.tabla-historial th {
  padding: 12px 10px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-3);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.tabla-historial td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--border);
  color: var(--text-2);
  vertical-align: middle;
}

.tabla-historial tr:hover td { background: var(--surface-2); }
.tabla-vacia { text-align: center; color: var(--text-3); padding: 40px !important; }

.chip-semaforo {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.chip-semaforo.VERDE    { background: var(--green-dim); color: var(--green); }
.chip-semaforo.AMARILLO { background: var(--yellow-dim); color: var(--yellow); }
.chip-semaforo.ROJO     { background: var(--red-dim); color: var(--red); }

.btn-pdf-chico {
  padding: 5px 12px;
  background: var(--blue-dim);
  color: #93c5fd;
  border: 1px solid rgba(59,130,246,.25);
  border-radius: 6px;
  font-size: 11px;
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 600;
  transition: background .2s;
  white-space: nowrap;
}

.btn-pdf-chico:hover { background: rgba(59,130,246,.28); }
.btn-pdf-chico:disabled { opacity: .4; cursor: default; }

.historial-paginacion {
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  border-top: 1px solid var(--border);
}

.btn-pag {
  padding: 8px 18px;
  border: 1px solid var(--border-2);
  background: var(--surface-2);
  border-radius: var(--r-sm);
  font-size: 13px;
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 600;
  color: var(--text-2);
  transition: all .2s;
}

.btn-pag:hover:not(:disabled) { border-color: var(--blue); color: var(--blue); }
.btn-pag:disabled { opacity: .35; cursor: not-allowed; }
.pag-info { font-size: 13px; color: var(--text-3); }

/* ─── Mensaje global ──────────────────────────────────────────────────── */
.mensaje-global {
  position: fixed;
  top: 76px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 999;
  min-width: 320px;
  max-width: 540px;
  animation: slide-down .3s cubic-bezier(.22,1,.36,1);
}

@keyframes slide-down {
  from { opacity: 0; transform: translateX(-50%) translateY(-12px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.mensaje-contenido {
  background: rgba(15, 15, 25, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-2);
  border-radius: var(--r-md);
  box-shadow: 0 16px 40px rgba(0,0,0,.6);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-left: 3px solid var(--red);
}

.mensaje-contenido.exito { border-left-color: var(--green); }
.mensaje-contenido.info  { border-left-color: var(--blue); }

.mensaje-icono { font-size: 18px; }
.mensaje-texto { flex: 1; font-size: 14px; color: var(--text-1); }

.mensaje-cerrar {
  background: none;
  border: none;
  color: var(--text-3);
  cursor: pointer;
  font-size: 16px;
  padding: 4px 6px;
  border-radius: 4px;
  line-height: 1;
  transition: background .2s, color .2s;
}

.mensaje-cerrar:hover { background: var(--surface-3); color: var(--text-1); }

/* ─── Footer ──────────────────────────────────────────────────────────── */
.footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
  background: rgba(10,10,15,.8);
  backdrop-filter: blur(12px);
  color: var(--text-3);
  text-align: center;
  padding: 20px;
  font-size: 12px;
  margin-top: auto;
}

/* ─── Accesibilidad ───────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* ─── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .hero-banner { padding: 40px 16px 36px; margin-bottom: 20px; }
  .container { padding: 0 12px; margin: 16px auto; }
  .card-header { padding: 20px; }
  .formulario-card form { padding: 20px; gap: 16px; }
  .pasos-lista { padding: 4px 20px 20px; }
  .pasos-lista::before { left: 36px; }
  .barra-progreso-wrapper { padding: 0 20px 16px; }
  .didit-qr-container { margin: 4px 16px 16px; }
  .semaforo-card { flex-direction: column; align-items: center; text-align: center; padding: 24px 20px; }
  .semaforo-luces { flex-direction: row; border-radius: 12px; }
  .score-barra, .score-escala { max-width: 100%; }
  .resultados-grid { grid-template-columns: 1fr; }
  .acciones-resultado { flex-direction: column; }
  .historial-header { flex-direction: column; }
  .historial-filtros { flex-direction: column; align-items: stretch; }
  .desglose-card { padding: 20px; }
  .semaforo-resultado { font-size: 18px; }
  .score-numero { font-size: 44px; }
}
