:root {
  /* === VARIABLES DE COLOR === */
  /* MODO OSCURO (Default) */
  --bg-body: #050507;
  --bg-card: rgba(20, 20, 25, 0.75);
  --bg-input: rgba(255, 255, 255, 0.08);
  
  --primary: #8b5cf6;       
  --primary-hover: #7c3aed;
  --primary-glow: rgba(139, 92, 246, 0.3);
  
  --text-main: #ffffff;      
  --text-secondary: #cbd5e1; 
  --text-placeholder: rgba(255, 255, 255, 0.6);
  --border-color: rgba(255, 255, 255, 0.1);
  
  --radius: 20px;
}

/* MODO CLARO */
body.light-mode {
  --bg-body: #f1f5f9;
  --bg-card: rgba(255, 255, 255, 0.9);
  --bg-input: #ffffff;
  
  --primary: #6d28d9;
  --primary-hover: #5b21b6;
  --primary-glow: rgba(109, 40, 217, 0.15);
  
  --text-main: #0f172a;      
  --text-secondary: #475569; 
  --text-placeholder: #94a3b8;
  --border-color: rgba(0,0,0,0.1);
}

body {
  background-color: var(--bg-body);
  color: var(--text-main);
  font-family: 'Inter', sans-serif;
  line-height: 1.7;
  transition: background-color 0.3s ease, color 0.3s ease;
  position: relative;
}

h1, h2, h3, h4, h5 { font-family: 'Outfit', sans-serif; letter-spacing: -0.02em; color: var(--text-main); }

section { padding: 6rem 0; border-bottom: 1px solid var(--border-color); position: relative; z-index: 2; }

/* === ANIMACIÓN DE FONDO "RESPIRANDO" === */
.background-animation {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: linear-gradient(-45deg, #050507, #1a0b2e, #0f172a, #000000);
  background-size: 400% 400%;
  animation: gradientBG 15s ease infinite;
  z-index: 0;
}

body.light-mode .background-animation {
  background: linear-gradient(-45deg, #f1f5f9, #e0e7ff, #f3e8ff, #ffffff);
  background-size: 400% 400%;
}

@keyframes gradientBG {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Navbar Glass */
.navbar {
  background: rgba(5, 5, 7, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  padding: 1.2rem 0;
  z-index: 1000;
}
body.light-mode .navbar { background: rgba(255, 255, 255, 0.85); }

/* Navbar Brand Fix Color */
.navbar-brand {
  color: var(--text-main) !important;
  transition: color 0.3s ease;
}

.nav-link { color: var(--text-secondary) !important; font-weight: 500; margin: 0 0.5rem; transition: color 0.3s; }
.nav-link:hover { color: var(--primary) !important; }
.navbar-toggler-icon-custom { color: var(--text-main); font-size: 1.5rem; }

/* Tarjetas Glass */
.glass-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 2.5rem;
  height: 100%;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}
.glass-card:hover {
  transform: translateY(-5px);
  border-color: var(--primary);
  box-shadow: 0 20px 40px -10px var(--primary-glow);
}

/* Botones */
.btn-primary-glow {
  background: var(--primary);
  color: white !important;
  border: none;
  padding: 0.8rem 1.8rem;
  border-radius: 12px;
  font-weight: 600;
  box-shadow: 0 10px 20px -5px var(--primary-glow);
  transition: 0.3s;
}
.btn-primary-glow:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
}

.btn-outline-glow {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.8rem 1.8rem;
  border-radius: 12px;
  font-weight: 600;
  transition: 0.3s;
}
.btn-outline-glow:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* Inputs */
.form-control {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 1rem;
  border-radius: 12px;
}
.form-control:focus {
  background: var(--bg-input);
  border-color: var(--primary);
  color: var(--text-main);
  box-shadow: 0 0 0 4px var(--primary-glow);
}
.form-control::placeholder {
  color: var(--text-placeholder) !important;
  opacity: 1;
}

/* === FOTO PERFIL (FUNDIDO + INCLINACIÓN DINÁMICA) === */
.profile-img-container { 
  position: relative; 
  padding: 1rem; 
  display: inline-block;
  width: 100%;
  max-width: 410px;
  cursor: pointer; 
}

.profile-img {
  border-radius: 24px;
  border: 1px solid var(--border-color);
  box-shadow: 0 20px 40px rgba(0,0,0,0.5);
  object-fit: cover;
  width: 100%;
  max-width: 380px;
  
  /* Animaciones suaves */
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.6s ease-in-out;
  
  /* ESTADO DEFAULT (Modo Oscuro): Inclinación derecha */
  transform: rotate(2deg);
}

/* ESTADO MODO CLARO: Inclinación izquierda */
body.light-mode .profile-img {
  transform: rotate(-2deg);
}

/* El hover se activa desde el contenedor */
.profile-img-container:hover .profile-img { 
  transform: rotate(0deg) !important; 
}

/* Posicionamiento para superponer imágenes */
.profile-img-dark {
  position: relative;
  z-index: 1;
  opacity: 1;
}

.profile-img-light {
  position: absolute;
  top: 1rem; 
  left: 0;
  right: 0;
  margin: 0 auto;
  z-index: 2;
  opacity: 0;
  pointer-events: none; 
}

/* Visibilidad según el tema */
body.light-mode .profile-img-dark { 
  opacity: 0; 
  pointer-events: none; 
}

body.light-mode .profile-img-light { 
  opacity: 1; 
  pointer-events: auto; 
}

/* Footer & Textos */
footer { border-top: 1px solid var(--border-color); position: relative; z-index: 2; }
.text-dynamic-main { color: var(--text-main) !important; }
.text-dynamic-sec { color: var(--text-secondary) !important; }

/* Recaptcha oculto */
.grecaptcha-badge { visibility: hidden; opacity: 0; }