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

:root {
  --bg-dark: #0a0a0f;
  --bg-card: #111827;
  --bg-card-hover: #1f2937;
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #818cf8;
  --secondary: #ec489a;
  --text-light: #f3f4f6;
  --text-muted: #9ca3af;
  --text-dark: #1f2937;
  
  --error: #ef4444;
  --error-dark: #dc2626;
  --success: #22c55e;
  --success-dark: #16a34a;
  --warning: #f59e0b;
  
  --gradient-primary: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  --gradient-bg: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(236, 72, 153, 0.1) 100%);
  
  --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 10px 15px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 20px 25px rgba(0, 0, 0, 0.3);
  --shadow-xl: 0 25px 50px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.3);
  --shadow-glow-error: 0 0 20px rgba(239, 68, 68, 0.3);
  
  --transition-fast: 0.2s ease;
  --transition-base: 0.3s ease;
  --transition-slow: 0.5s ease;
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-2xl: 32px;
}

body {
  font-family: 'Orbitron', sans-serif;
  background: var(--bg-dark);
  color: var(--text-light);
  min-height: 100vh;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: opacity 0.6s ease;
}

body.fade-in {
  opacity: 1;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url(../Fotos/Fondo.jpg) no-repeat center center fixed;
  background-size: cover;
  filter: brightness(0.3);
  z-index: -2;
}

body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at center, transparent 0%, var(--bg-dark) 100%);
  opacity: 0.6;
  z-index: -1;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}

.side-left, .side-right {
  position: fixed;
  top: 0;
  width: 60px;
  height: 100%;
  background: var(--gradient-primary);
  opacity: 0.15;
  z-index: 1;
  pointer-events: none;
}

.side-left {
  left: 0;
  background: linear-gradient(90deg, var(--primary), transparent);
}

.side-right {
  right: 0;
  background: linear-gradient(270deg, var(--primary), transparent);
}

#loader {
  position: fixed;
  inset: 0;
  background: var(--bg-dark);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.5s ease, visibility 0.5s ease;
  backdrop-filter: blur(10px);
}

#loader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-circle {
  width: 80px;
  height: 80px;
  border: 3px solid rgba(99, 102, 241, 0.2);
  border-top: 3px solid var(--primary);
  border-right: 3px solid var(--secondary);
  border-radius: 50%;
  animation: spin 1s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
}

.loader-progress {
  width: 200px;
  height: 2px;
  background: rgba(99, 102, 241, 0.2);
  margin-top: 20px;
  border-radius: 2px;
  position: relative;
  overflow: hidden;
}

.loader-progress::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 0%;
  height: 100%;
  background: var(--gradient-primary);
  animation: progress 2s ease forwards;
}

@keyframes progress {
  to { width: 100%; }
}

#loader-text {
  margin-top: 1.5rem;
  font-size: 1.5rem;
  font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: pulse 2s ease infinite;
}

.register-container {
  background: rgba(17, 24, 39, 0.95);
  backdrop-filter: blur(20px);
  padding: 3rem 2.5rem;
  width: 100%;
  max-width: 420px;
  border-radius: var(--radius-2xl);
  border: 1px solid rgba(99, 102, 241, 0.2);
  box-shadow: var(--shadow-xl);
  animation: fadeInUp 0.6s ease;
  position: relative;
  z-index: 2;
  transition: all var(--transition-base);
}

.register-container:hover {
  border-color: rgba(99, 102, 241, 0.4);
  box-shadow: var(--shadow-glow);
}

.register-title {
  text-align: center;
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 2rem;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: none;
  letter-spacing: 2px;
}

.register-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.input-group label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.input-group input {
  padding: 0.9rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(99, 102, 241, 0.3);
  background: rgba(2, 6, 23, 0.8);
  color: var(--text-light);
  font-size: 0.95rem;
  font-family: 'Orbitron', sans-serif;
  outline: none;
  transition: all var(--transition-fast);
}

.input-group input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.25);
  background: rgba(2, 6, 23, 1);
}

.input-group input.error {
  border-color: var(--error);
  animation: shake 0.3s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.password-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.password-input-wrapper input {
  width: 100%;
  padding-right: 45px;
}

.toggle-password {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all var(--transition-fast);
  color: var(--text-muted);
  font-size: 1.1rem;
}

.toggle-password:hover {
  background: rgba(99, 102, 241, 0.2);
  color: var(--primary);
}

.password-strength {
  display: flex;
  gap: 5px;
  margin-top: 8px;
}

.strength-bar {
  height: 3px;
  flex: 1;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  transition: all var(--transition-fast);
}

.strength-bar.weak {
  background: var(--error);
  box-shadow: 0 0 8px var(--error);
}

.strength-bar.medium {
  background: var(--warning);
  box-shadow: 0 0 8px var(--warning);
}

.strength-bar.strong {
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
}

.password-hint {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 5px;
}

.error-text {
  font-size: 0.75rem;
  color: var(--error);
  margin-top: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.btn-register {
  margin-top: 0.5rem;
  padding: 1rem;
  border-radius: var(--radius-md);
  border: none;
  background: var(--gradient-primary);
  color: white;
  font-weight: 700;
  font-size: 0.95rem;
  font-family: 'Orbitron', sans-serif;
  cursor: pointer;
  transition: all var(--transition-base);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.btn-register:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

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

.btn-register:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.message {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  text-align: center;
  animation: fadeInUp 0.3s ease;
}

.message.success {
  background: rgba(34, 197, 94, 0.15);
  color: var(--success);
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.message.error {
  background: rgba(239, 68, 68, 0.15);
  color: var(--error);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.message.warning {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.hidden {
  display: none;
}

.login-text {
  margin-top: 2rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  padding-top: 1rem;
  border-top: 1px solid rgba(99, 102, 241, 0.2);
}

.login-text a {
  color: var(--primary);
  font-weight: 600;
  transition: all var(--transition-fast);
  position: relative;
}

.login-text a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gradient-primary);
  transition: width var(--transition-fast);
}

.login-text a:hover {
  color: var(--primary-light);
}

.login-text a:hover::after {
  width: 100%;
}

#access-check {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: var(--bg-dark);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  transition: opacity 0.3s ease;
}

.check-spinner {
  width: 50px;
  height: 50px;
  border: 3px solid rgba(99, 102, 241, 0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.check-text {
  margin-top: 1rem;
  color: var(--text-muted);
  font-size: 0.875rem;
}

body.access-allowed #access-check {
  opacity: 0;
  pointer-events: none;
}

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

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

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

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--secondary);
}

@media (max-width: 480px) {
  .register-container {
    margin: 1rem;
    padding: 2rem 1.5rem;
    max-width: calc(100% - 2rem);
  }
  
  .register-title {
    font-size: 1.8rem;
  }
  
  .input-group input {
    padding: 0.8rem;
  }
  
  .btn-register {
    padding: 0.8rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}