* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  background: #030712;
  color: #f8fafc;
  overflow-x: hidden;
}

body.light-mode {
  background: #f8fafc !important;
  color: #0f172a !important;
}

/* ===== DARK MODE (default) ===== */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: #0f172a;
}

::-webkit-scrollbar-thumb {
  background: #6366f1;
  border-radius: 3px;
}

.glass {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.glass-panel {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.01) 100%);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.text-gradient {
  background: linear-gradient(to right, #3b82f6, #60a5fa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-gradient-white {
  background: linear-gradient(to right, #ffffff, #94a3b8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.glow-indigo {
  box-shadow: 0 0 60px rgba(99, 102, 241, 0.15), 0 0 120px rgba(99, 102, 241, 0.05);
}

.glow-blue {
  box-shadow: 0 0 60px rgba(59, 130, 246, 0.15), 0 0 120px rgba(59, 130, 246, 0.05);
}

.section-dark {
  background: #030712;
}

.section-darker {
  background: #050a15;
}

.qr-pattern {
  background-image: linear-gradient(rgba(99, 102, 241, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99, 102, 241, 0.1) 1px, transparent 1px);
  background-size: 20px 20px;
}

.feature-icon-bg {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(59, 130, 246, 0.1));
  border: 1px solid rgba(99, 102, 241, 0.1);
}

.gradient-border {
  position: relative;
}

.gradient-border::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.3), rgba(59, 130, 246, 0.1), transparent);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.bg-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
}

.progress-bar {
  background: linear-gradient(to right, #6366f1, #a855f7);
  transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

#particles-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.3;
}

.counter-value {
  display: inline-block;
}

/* Loading Screen */
#loading-screen {
  transition: opacity 0.5s ease-out;
}

/* Animations */
@keyframes fadeInUp {
  0% {
    opacity: 0;
    transform: translateY(30px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes pulse-glow {
  0%,
  100% {
    opacity: 0.4;
  }
  50% {
    opacity: 0.7;
  }
}

.animate-fade-in-up {
  animation: fadeInUp 0.8s ease-out forwards;
}

.animate-float {
  animation: float 6s ease-in-out infinite;
}

.animate-pulse-glow {
  animation: pulse-glow 4s ease-in-out infinite;
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-left.active {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(40px);
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-right.active {
  opacity: 1;
  transform: translateX(0);
}

.reveal-bottom {
  opacity: 0;
  transform: translateY(40px);
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-bottom.active {
  opacity: 1;
  transform: translateY(0);
}

/* Card hover */
.card-hover {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-hover:hover {
  transform: translateY(-4px);
  border-color: rgba(99, 102, 241, 0.3);
  box-shadow: 0 15px 30px -10px rgba(99, 102, 241, 0.15), 0 0 10px rgba(99, 102, 241, 0.05);
}

/* Nav */
#navbar {
  transition: background 0.3s, box-shadow 0.3s;
  border-bottom: 1px solid transparent;
  background: transparent;
}

#navbar.scrolled {
  background: rgba(3, 7, 18, 0.85);
  backdrop-filter: blur(16px);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
  border-bottom-color: rgba(255, 255, 255, 0.05);
}

body.light-mode #navbar.scrolled {
  background: rgba(248, 250, 252, 0.85);
  border-bottom-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.05);
}

.nav-link {
  position: relative;
  transition: color 0.2s;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(to right, #6366f1, #a855f7);
  transition: width 0.3s;
  border-radius: 1px;
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

/* Tabs */
.tab-btn {
  transition: all 0.3s;
}

.tab-btn.active {
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
  border-color: rgba(99, 102, 241, 0.3);
}

/* Roles */
.role-card {
  transition: all 0.4s;
  cursor: pointer;
}

.role-card:hover,
.role-card.active {
  border-color: rgba(99, 102, 241, 0.5);
  background: rgba(99, 102, 241, 0.08);
}

.role-card.active .role-icon {
  color: #818cf8;
  transform: scale(1.1);
}

.role-icon {
  transition: all 0.3s;
}

/* Wizard */
.wizard-step {
  transition: all 0.4s;
}

.wizard-step.active {
  border-color: #6366f1;
  background: rgba(99, 102, 241, 0.08);
}

.wizard-step.completed {
  border-color: #22c55e;
  background: rgba(34, 197, 94, 0.05);
}

/* Mobile menu */
.mobile-menu {
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-menu.open {
  transform: translateX(0);
}

/* Tooltip */
.tooltip-container {
  position: relative;
}

.tooltip-container .tooltip-text {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: #1e293b;
  color: #f1f5f9;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  white-space: nowrap;
  transition: all 0.2s;
  z-index: 50;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.tooltip-container:hover .tooltip-text {
  visibility: visible;
  opacity: 1;
  transform: translateX(-50%) translateY(-6px);
}

/* Toast / Modal */
.toast {
  transform: translateX(120%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast.show {
  transform: translateX(0);
}

.modal-overlay {
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  transform: scale(0.95) translateY(10px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.open .modal-content {
  transform: scale(1) translateY(0);
}

/* ============================================
   LIGHT MODE — OVERRIDES COMPLETOS
   ============================================ */
body.light-mode {
  background: #f8fafc !important;
  color: #0f172a !important;
}

/* Texto: blanco → oscuro (general) */
.light-mode .text-white {
  color: #0f172a;
}

/* Botones: texto blanco en botones */
.light-mode a.bg-blue-900 .text-white,
.light-mode a.bg-blue-800 .text-white,
.light-mode button.bg-blue-900 .text-white,
.light-mode button.bg-blue-800 .text-white,
.light-mode .bg-blue-900 .text-white,
.light-mode .bg-blue-800 .text-white {
  color: #fff !important;
}

.light-mode .text-slate-300 {
  color: #334155;
}

.light-mode .text-slate-400 {
  color: #475569;
}

.light-mode .text-slate-500 {
  color: #64748b;
}

/* Links nav con hover oscuro */
.light-mode .text-slate-300 {
  color: #475569;
}

.light-mode .text-slate-300:hover {
  color: #0f172a;
}

/* Gradientes: título degradado azul que contrasta con blanco */
.light-mode .text-gradient,
.light-mode .text-gradient-white {
  -webkit-text-fill-color: transparent !important;
  background: linear-gradient(to right, #1e3a8a, #3b82f6);
  -webkit-background-clip: text;
  background-clip: text;
}

/* Blanco sobre fondos de color (botones, badges, iconos) */
.light-mode .bg-blue-900 .text-white,
.light-mode .bg-blue-800 .text-white,
.light-mode .bg-green-500\/20 .text-green-400,
.light-mode .bg-blue-800\/20 .text-indigo-400,
.light-mode .bg-red-500\/20 .text-red-400,
.light-mode .bg-amber-500\/20 .text-amber-400,
.light-mode .bg-purple-500\/20 .text-blue-400,
.light-mode .bg-cyan-500\/20 .text-cyan-400,
.light-mode .bg-rose-500\/20 .text-rose-400 {
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
}

/* Tags -400 con mejor contraste */
.light-mode .text-indigo-400 {
  color: #4f46e5;
}

.light-mode .text-blue-400 {
  color: #2563eb;
}

.light-mode .text-emerald-400 {
  color: #059669;
}

.light-mode .text-amber-400 {
  color: #d97706;
}

.light-mode .text-cyan-400 {
  color: #0891b2;
}

.light-mode .text-rose-400 {
  color: #e11d48;
}

.light-mode .text-green-400 {
  color: #16a34a;
}

/* Botones: azul principal con texto blanco */
.light-mode .bg-blue-500,
.light-mode .bg-blue-600 {
  background: #2563eb !important;
}

.light-mode .bg-blue-500:hover,
.light-mode .bg-blue-600:hover {
  background: #1d4ed8 !important;
}

/* Texto blanco SIEMPRE blanco en botones */
.light-mode a.bg-blue-900,
.light-mode button.bg-blue-900,
.light-mode a.bg-blue-800,
.light-mode button.bg-blue-800,
.light-mode [class*="bg-blue"].text-white,
.light-mode .bg-blue-900 *,
.light-mode .bg-blue-800 * {
  color: #fff !important;
}

/* Fondos semitransparentes */
.light-mode .bg-white\/5 {
  background: rgba(0, 0, 0, 0.04);
}

.light-mode .bg-white\/10 {
  background: rgba(0, 0, 0, 0.06);
}

.light-mode .bg-white\/20 {
  background: rgba(0, 0, 0, 0.08);
}

/* Bordes */
.light-mode .border-white\/5 {
  border-color: rgba(0, 0, 0, 0.06);
}

.light-mode .border-white\/10 {
  border-color: rgba(0, 0, 0, 0.08);
}

.light-mode .border-white\/20 {
  border-color: rgba(0, 0, 0, 0.12);
}

.light-mode .border-dark {
  border-color: #f8fafc !important;
}

/* Secciones */
.light-mode .section-dark {
  background: #f8fafc;
}

.light-mode .section-darker {
  background: #f1f5f9;
}

/* Glass */
.light-mode .glass {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.05);
}

.light-mode .glass-panel {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.6) 100%);
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.light-mode .feature-icon-bg {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(59, 130, 246, 0.05));
}

.light-mode .card-hover:hover {
  box-shadow: 0 15px 30px -10px rgba(99, 102, 241, 0.1), 0 0 10px rgba(99, 102, 241, 0.03);
}

/* Scrollbar */
.light-mode ::-webkit-scrollbar-track {
  background: #e2e8f0;
}

/* Formularios */
.light-mode input,
.light-mode textarea {
  color: #0f172a;
}

.light-mode input::placeholder,
.light-mode textarea::placeholder {
  color: #94a3b8;
}

.light-mode select {
  color: #334155;
}

/* Tooltip */
.light-mode .tooltip-text {
  background: #f1f5f9;
  color: #334155;
  border-color: rgba(0, 0, 0, 0.1);
}

/* Blobs: más sutiles */
.light-mode .bg-blob {
  opacity: 0.3;
}

/* Partículas */
.light-mode #particles-canvas {
  opacity: 0.15;
}

/* KBD */
.light-mode kbd {
  background: rgba(0, 0, 0, 0.06) !important;
  border-color: rgba(0, 0, 0, 0.1) !important;
  color: #64748b !important;
}

/* Mobile nav links - mejor contraste */
.light-mode .mobile-nav-link:hover {
  background: rgba(59, 130, 246, 0.08) !important;
}

.light-mode .mobile-nav-link.text-slate-300 {
  color: #475569;
}

.light-mode .mobile-nav-link.text-slate-300:hover {
  color: #0f172a;
}

/* Hover states con buen contraste */
.light-mode .nav-link:hover {
  color: #0f172a;
}

.light-mode a:hover.text-white {
  color: #0f172a;
}

.light-mode .glass:hover {
  background: rgba(59, 130, 246, 0.06);
}

.light-mode .card-hover:hover {
  transform: translateY(-4px);
  border-color: rgba(59, 130, 246, 0.3);
  box-shadow: 0 15px 30px -10px rgba(59, 130, 246, 0.15);
}

/* Icon hover states */
.light-mode .text-slate-400:hover {
  color: #334155;
}

/* Badge/badges con fondo oscuro para contraste */
.light-mode .bg-blue-800\/10 {
  border-color: rgba(59, 130, 246, 0.2);
}

.light-mode .bg-green-500\/10 {
  border-color: rgba(34, 197, 94, 0.2);
}

.light-mode .bg-amber-500\/10 {
  border-color: rgba(245, 158, 11, 0.2);
}

.light-mode .bg-cyan-500\/10 {
  border-color: rgba(6, 182, 212, 0.2);
}
