/* ============================================
   LOGIN MODERNO - DISEÑO UX PROFESIONAL
   Diseño: Senior Frontend & UX Engineer
   ============================================ */

/* Reset y variables CSS */
:root {
  --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #4facfe 100%);
  --success-color: #10b981;
  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --bg-white: #ffffff;
  --bg-gray: #f9fafb;
  --border-color: #e5e7eb;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.5;
  color: var(--text-primary);
  background: #0f172a;
  position: relative;
}

/* Fondo animado con gradientes */
.login-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);
  overflow: hidden;
  z-index: 0;
}

.gradient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.4;
  animation: float 20s infinite ease-in-out;
  transition: transform 0.3s ease-out;
}

.orb-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, #667eea 0%, transparent 70%);
  top: -250px;
  left: -250px;
  animation-delay: 0s;
}

.orb-2 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, #764ba2 0%, transparent 70%);
  bottom: -200px;
  right: -200px;
  animation-delay: 7s;
}

.orb-3 {
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, #f093fb 0%, transparent 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation-delay: 3s;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0) translateX(0) scale(1);
  }
  25% {
    transform: translateY(-30px) translateX(30px) scale(1.1);
  }
  50% {
    transform: translateY(-60px) translateX(-30px) scale(0.9);
  }
  75% {
    transform: translateY(-30px) translateX(-60px) scale(1.05);
  }
}

/* Contenedor principal */
.login-container {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem;
  gap: 4rem;
}

/* Card de login */
.login-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-radius: 24px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25),
              0 0 0 1px rgba(255, 255, 255, 0.1);
  width: 100%;
  max-width: 450px;
  padding: 3rem;
  opacity: 0;
  transform: translateY(20px);
  transition: all var(--transition-slow);
}

.login-card.fade-in {
  opacity: 1;
  transform: translateY(0);
}

/* Header del login */
.login-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.logo-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.logo-circle {
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-white);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  animation: pulse 3s infinite ease-in-out;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 20px 25px -5px rgba(102, 126, 234, 0.3);
  }
}

.brand-name {
  font-size: 2rem;
  font-weight: 800;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
}

.welcome-text h2 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}

.welcome-text p {
  font-size: 1rem;
  color: var(--text-secondary);
  font-weight: 400;
}

/* Formulario */
.login-form {
  margin-bottom: 2rem;
}

.microsoft-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 1rem 1.5rem;
  background: var(--bg-white);
  border: 2px solid var(--border-color);
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

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

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

.microsoft-btn:hover {
  border-color: #667eea;
  box-shadow: 0 8px 16px -4px rgba(102, 126, 234, 0.3);
  transform: translateY(-2px);
}

.microsoft-btn:active {
  transform: translateY(0);
}

.btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-text {
  flex: 1;
  text-align: center;
}

.btn-arrow {
  display: flex;
  align-items: center;
  color: var(--text-muted);
  transition: transform var(--transition-base);
}

.microsoft-btn:hover .btn-arrow {
  transform: translateX(4px);
  color: #667eea;
}

/* Información adicional */
.login-info {
  margin-top: 2rem;
  padding: 1.5rem;
  background: var(--bg-gray);
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

.info-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1rem;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.info-item:last-child {
  margin-bottom: 0;
}

.info-item svg {
  flex-shrink: 0;
  color: #667eea;
  margin-top: 2px;
}

/* Ayuda */
.login-help {
  margin-top: 1.5rem;
  text-align: center;
}

.help-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.875rem;
  text-decoration: none;
  transition: color var(--transition-fast);
}

.help-link:hover {
  color: #667eea;
}

.help-link svg {
  width: 14px;
  height: 14px;
}

/* Footer del card */
.login-footer {
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
}

.security-badges {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  background: rgba(16, 185, 129, 0.1);
  color: var(--success-color);
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 20px;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge svg {
  width: 12px;
  height: 12px;
}

.copyright {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  line-height: 1.6;
}

.copyright svg {
  flex-shrink: 0;
}

/* Decoración lateral */
.side-decoration {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-width: 320px;
}

.feature-card {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  padding: 1.5rem;
  color: white;
  opacity: 0;
  transform: translateX(20px);
  transition: all var(--transition-slow);
}

.feature-card.fade-in {
  opacity: 1;
  transform: translateX(0);
}

.feature-card:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
}

.feature-icon {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  margin-bottom: 1rem;
}

.feature-card h3 {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: white;
}

.feature-card p {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.6;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .side-decoration {
    display: none;
  }
  
  .login-container {
    gap: 0;
  }
}

@media (max-width: 640px) {
  .login-container {
    padding: 1rem;
  }
  
  .login-card {
    padding: 2rem 1.5rem;
  }
  
  .logo-circle {
    width: 50px;
    height: 50px;
  }
  
  .brand-name {
    font-size: 1.5rem;
  }
  
  .welcome-text h2 {
    font-size: 1.5rem;
  }
  
  .microsoft-btn {
    padding: 0.875rem 1.25rem;
    font-size: 0.9375rem;
  }
  
  .login-info {
    padding: 1rem;
  }
  
  .info-item {
    font-size: 0.8125rem;
  }
}

/* Animaciones adicionales */
@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Estados de carga */
.microsoft-btn.loading {
  pointer-events: none;
  opacity: 0.6;
}

.microsoft-btn.loading .btn-text::after {
  content: '';
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-left: 8px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

/* Accesibilidad */
.microsoft-btn:focus-visible {
  outline: 2px solid #667eea;
  outline-offset: 2px;
}

.help-link:focus-visible {
  outline: 2px solid #667eea;
  outline-offset: 2px;
  border-radius: 4px;
}

/* Modo reducido de movimiento */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
