:root {
  --bg: #0a0a0a;
  --surface-1: rgba(26, 26, 26, 0.85);
  --surface-2: rgba(10, 10, 10, 0.9);

  --text: #EEF2FF;
  --text-secondary: rgba(238, 242, 255, 0.7);
  --muted: rgba(238, 242, 255, 0.45);

  /* Colores del logo Rayo Bus */
  --accent: #FFD700;
  --accent-hover: #FFC107;
  --accent-2: #FFA000;
  --accent-2-hover: #FF8F00;

  --border: rgba(255, 215, 0, 0.08);
  --border-accent: rgba(255, 215, 0, 0.25);

  --gradient-warm: linear-gradient(135deg, #FFD700 0%, #FFA000 100%);
  --gradient-glow: linear-gradient(135deg, #FFEB3B 0%, #FF8F00 100%);
  --shadow-glow: 0 0 40px rgba(255, 215, 0, 0.2), 0 0 80px rgba(255, 160, 0, 0.1);
}

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

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
  position: relative;
}

.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 2rem 1rem;
  perspective: 1200px;
}

/* Animated mesh gradient background */
.login-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(ellipse at 15% 25%, rgba(255, 215, 0, 0.15) 0%, transparent 55%),
    radial-gradient(ellipse at 85% 75%, rgba(255, 160, 0, 0.12) 0%, transparent 55%),
    radial-gradient(ellipse at 50% 50%, rgba(255, 215, 0, 0.05) 0%, transparent 70%),
    linear-gradient(160deg, #0a0a0a 0%, #1a1a1a 40%, #0a0a0a 100%);
  z-index: 0;
}

/* Subtle noise */
.login-container::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  opacity: 0.4;
  z-index: 1;
  pointer-events: none;
}

/* Floating orbs - Colores del rayo */
.bg-nebula {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.3;
  z-index: 0;
  animation: orbFloat 25s ease-in-out infinite;
}

.bg-nebula:first-of-type {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(255,215,0,0.6) 0%, transparent 70%);
  top: -180px;
  left: -180px;
}

.bg-nebula-purple {
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, rgba(255,160,0,0.5) 0%, transparent 70%);
  bottom: -150px;
  right: -150px;
  animation-delay: -12s;
}

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1) rotate(0deg); }
  33% { transform: translate(40px, -30px) scale(1.08) rotate(2deg); }
  66% { transform: translate(-20px, 20px) scale(0.95) rotate(-1deg); }
}

/* Watermark */
.logo-watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.02;
  z-index: 1;
  pointer-events: none;
}

/* Logo in card */
.logo-header {
  width: 140px;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 8px 24px rgba(255, 215, 0, 0.4)) drop-shadow(0 2px 8px rgba(0,0,0,0.5));
  animation: logoBreath 4s ease-in-out infinite;
}

@keyframes logoBreath {
  0%, 100% {
    transform: scale(1);
    filter: drop-shadow(0 8px 24px rgba(255, 215, 0, 0.4)) drop-shadow(0 2px 8px rgba(0,0,0,0.5));
  }
  50% {
    transform: scale(1.03);
    filter: drop-shadow(0 12px 32px rgba(255, 215, 0, 0.5)) drop-shadow(0 4px 12px rgba(0,0,0,0.6));
  }
}

/* 3D Card */
.login-card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 3rem 2.5rem;
  width: 100%;
  max-width: 430px;
  position: relative;
  z-index: 10;
  box-shadow:
    0 25px 60px rgba(0, 0, 0, 0.5),
    0 8px 24px rgba(0, 0, 0, 0.3),
    0 0 0 1px rgba(255, 160, 0, 0.06) inset,
    0 1px 0 rgba(255, 255, 255, 0.04) inset;
  backdrop-filter: blur(20px) saturate(1.5);
  transform: rotateX(0deg) rotateY(0deg);
  transition: transform 0.4s ease, box-shadow 0.4s ease;
  animation: cardEntrance 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.login-card:hover {
  transform: translateY(-4px) rotateX(1deg);
  box-shadow:
    0 35px 70px rgba(0, 0, 0, 0.5),
    0 15px 35px rgba(0, 0, 0, 0.3),
    0 0 60px rgba(255, 215, 0, 0.12),
    0 0 0 1px rgba(255, 160, 0, 0.12) inset,
    0 1px 0 rgba(255, 255, 255, 0.06) inset;
}

@keyframes cardEntrance {
  from {
    opacity: 0;
    transform: translateY(40px) rotateX(6deg) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) rotateX(0deg) scale(1);
  }
}

/* Gradient line at top of card */
.login-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 10%;
  right: 10%;
  height: 3px;
  background: var(--gradient-warm);
  border-radius: 0 0 3px 3px;
  opacity: 0.8;
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

/* Header */
.login-header {
  text-align: center;
  margin-bottom: 2.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.login-title {
  font-family: 'Oxanium', sans-serif;
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text);
  background: linear-gradient(135deg, #FFFFFF 0%, #FFD700 50%, #FFA000 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: titleShimmer 6s ease-in-out infinite;
  line-height: 1.2;
}

@keyframes titleShimmer {
  0%, 100% { background-position: 0% center; }
  50% { background-position: 100% center; }
}

.login-subtitle {
  font-family: 'Inter', sans-serif;
  color: var(--muted);
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-top: 0.25rem;
}

/* Form */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

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

.form-group label {
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.form-group input {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.9rem 1.1rem;
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2) inset;
}

.form-group input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow:
    0 2px 8px rgba(0,0,0,0.2) inset,
    0 0 0 3px rgba(255, 215, 0, 0.15),
    0 0 20px rgba(255, 215, 0, 0.08);
}

.form-group input::placeholder {
  color: rgba(238, 242, 255, 0.2);
}

.form-group small {
  color: var(--text-secondary);
}

/* 3D Button */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.95rem 1.5rem;
  border: none;
  border-radius: 14px;
  font-family: 'Oxanium', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: var(--gradient-warm);
  color: #000;
  margin-top: 0.5rem;
  box-shadow:
    0 4px 15px rgba(255, 215, 0, 0.4),
    0 2px 4px rgba(0, 0, 0, 0.2),
    0 -1px 0 rgba(255,255,255,0.2) inset;
  font-weight: 700;
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  transition: left 0.5s ease;
}

.btn-primary:hover::before {
  left: 100%;
}

.btn-primary:hover {
  box-shadow:
    0 8px 25px rgba(255, 215, 0, 0.5),
    0 4px 10px rgba(0, 0, 0, 0.3),
    0 -1px 0 rgba(255,255,255,0.3) inset,
    0 0 30px rgba(255, 215, 0, 0.3);
  transform: translateY(-2px);
}

.btn-primary:active {
  transform: translateY(1px);
  box-shadow:
    0 2px 8px rgba(255, 215, 0, 0.35),
    0 1px 2px rgba(0, 0, 0, 0.2);
}

.btn svg {
  transition: transform 0.3s ease;
}

.btn-primary:hover svg {
  transform: translateX(4px);
}

/* Alerts */
.alert {
  padding: 0.875rem 1rem;
  border-radius: 12px;
  margin-bottom: 1rem;
  font-size: 0.85rem;
  font-family: 'Inter', sans-serif;
  backdrop-filter: blur(8px);
}

.alert-error {
  background: rgba(255, 85, 85, 0.12);
  border: 1px solid rgba(255, 85, 85, 0.3);
  color: #FF7B6B;
}

.alert-success {
  background: rgba(255, 215, 0, 0.12);
  border: 1px solid rgba(255, 215, 0, 0.3);
  color: #FFD700;
}

/* Register / Login link */
.register-link {
  margin-top: 1.5rem;
  text-align: center;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.register-link p {
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  color: var(--muted);
}

.register-link a {
  color: var(--accent-2);
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  position: relative;
}

.register-link a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gradient-warm);
  transition: width 0.3s ease;
  border-radius: 2px;
}

.register-link a:hover {
  color: var(--accent-2-hover);
  text-shadow: 0 0 12px rgba(255, 160, 0, 0.4);
}

.register-link a:hover::after {
  width: 100%;
}

/* Responsive */
@media (max-width: 768px) {
  .login-card {
    padding: 2.5rem 2rem;
    max-width: 90%;
    border-radius: 20px;
  }
  .login-title { font-size: 1.6rem; }
  .bg-nebula:first-of-type { width: 400px; height: 400px; }
  .bg-nebula-purple { width: 350px; height: 350px; }
}

@media (max-width: 480px) {
  .login-container { padding: 1rem 0.5rem; }
  .login-card {
    padding: 2rem 1.5rem;
    max-width: 100%;
    border-radius: 18px;
  }
  .login-header { margin-bottom: 2rem; }
  .logo-header { width: 120px; }
  .login-title { font-size: 1.4rem; letter-spacing: 0.04em; }
  .login-subtitle { font-size: 0.8rem; }
  .login-form { gap: 1.25rem; }
  .form-group input { padding: 0.8rem 0.9rem; font-size: 0.9rem; }
  .btn { padding: 0.8rem 1.25rem; font-size: 0.9rem; }
  .bg-nebula:first-of-type { width: 300px; height: 300px; top: -120px; left: -120px; }
  .bg-nebula-purple { width: 250px; height: 250px; bottom: -80px; right: -80px; }
}

@media (max-width: 360px) {
  .login-card { padding: 1.5rem 1.25rem; }
  .logo-header { width: 100px; }
  .login-title { font-size: 1.2rem; }
}
