/* Reset y variables */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-gradient: linear-gradient(135deg, #8B1538 0%, #4A0E4E 100%);
  --secondary-gradient: linear-gradient(135deg, #8B1538 0%, #6B1E3C 100%);
  --accent-gradient: linear-gradient(135deg, #A91B60 0%, #8B1538 100%);
  
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --text-primary: #2d3748;
  --text-secondary: #718096;
  --border-color: #e2e8f0;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  
  --purple-primary: #8B1538;
  --purple-secondary: #4A0E4E;
  --purple-light: #A91B60;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Contenedor principal */
.login-container {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
  position: relative;
  overflow: hidden;
}

/* Fondo con patrón */
.background-pattern {
  position: absolute;
  inset: 0;
  background: var(--primary-gradient);
  opacity: 0.05;
  background-image: 
    radial-gradient(circle at 25% 25%, rgba(139, 21, 56, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 75% 75%, rgba(74, 14, 78, 0.1) 0%, transparent 50%);
  z-index: 0;
}

/* Contenido del login */
.login-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  background: var(--bg-secondary);
  position: relative;
  z-index: 1;
  box-shadow: var(--shadow-xl);
}

/* Header del login */
.login-header {
  text-align: center;
  margin-bottom: 2rem;
}

.logo {
  width: 80px;
  height: 80px;
  background: var(--primary-gradient);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  box-shadow: var(--shadow-lg);
  animation: logoFloat 3s ease-in-out infinite;
}

@keyframes logoFloat {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-5px); }
}

.logo i {
  font-size: 2.5rem;
  color: white;
}

.login-header h1 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.login-header p {
  color: var(--text-secondary);
  font-size: 1rem;
}

/* Formulario */
.login-form {
  width: 100%;
  max-width: 400px;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.form-group label i {
  color: var(--purple-primary);
  width: 16px;
}

.form-group input {
  width: 100%;
  padding: 0.875rem 1rem;
  border: 2px solid var(--border-color);
  border-radius: 12px;
  font-size: 1rem;
  background: var(--bg-secondary);
  transition: all 0.3s ease;
  outline: none;
}

.form-group input:focus {
  border-color: var(--purple-primary);
  box-shadow: 0 0 0 3px rgba(139, 21, 56, 0.1);
  transform: translateY(-1px);
}

.form-group input::placeholder {
  color: var(--text-secondary);
}

/* Estados de error */
.form-group input.error {
  border-color: #e53e3e;
  box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.1);
}

.error-message {
  display: none;
  color: #e53e3e;
  font-size: 0.8rem;
  margin-top: 0.25rem;
  font-weight: 500;
}

/* Mensaje del formulario */
.form-message {
  display: none;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 1rem;
  text-align: center;
}

.form-message.success {
  background: rgba(56, 161, 105, 0.1);
  color: #38a169;
  border: 1px solid rgba(56, 161, 105, 0.2);
}

.form-message.error {
  background: rgba(229, 62, 62, 0.1);
  color: #e53e3e;
  border: 1px solid rgba(229, 62, 62, 0.2);
}

.form-message.warning {
  background: rgba(214, 158, 46, 0.1);
  color: #d69e2e;
  border: 1px solid rgba(214, 158, 46, 0.2);
}

/* Input de contraseña */
.password-input {
  position: relative;
}

.toggle-password {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 4px;
  transition: color 0.2s ease;
}

.toggle-password:hover {
  color: var(--purple-primary);
}

/* Opciones del formulario */
.form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.checkbox-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.checkbox-container input {
  display: none;
}

.checkmark {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-color);
  border-radius: 4px;
  position: relative;
  transition: all 0.3s ease;
}

.checkbox-container input:checked + .checkmark {
  background: var(--primary-gradient);
  border-color: var(--purple-primary);
}

.checkbox-container input:checked + .checkmark::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 12px;
  font-weight: bold;
}

.forgot-password {
  color: var(--purple-primary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s ease;
}

.forgot-password:hover {
  color: var(--purple-light);
  text-decoration: underline;
}

/* Botón de login */
.login-btn {
  width: 100%;
  padding: 1rem;
  background: var(--primary-gradient);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
  box-shadow: var(--shadow);
  margin-bottom: 2rem;
}

.login-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.login-btn:active {
  transform: translateY(0);
}

/* Footer del login */
.login-footer {
  text-align: center;
  width: 100%;
}

.security-info {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.security-info i {
  color: #38a169;
}

.support-info {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.support-link {
  color: var(--purple-primary);
  text-decoration: none;
  font-weight: 500;
}

.support-link:hover {
  text-decoration: underline;
}

/* Panel de información */
.info-panel {
  background: var(--primary-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  position: relative;
  overflow: hidden;
}

.info-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: 
    radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
}

.info-content {
  position: relative;
  z-index: 1;
  text-align: center;
  color: white;
  max-width: 400px;
}

.info-icon {
  width: 100px;
  height: 100px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 2rem;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.info-icon i {
  font-size: 3rem;
  color: white;
}

.info-content h2 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.info-content p {
  font-size: 1.1rem;
  opacity: 0.9;
  line-height: 1.6;
  margin-bottom: 2rem;
}

.features {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.feature {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: transform 0.3s ease;
}

.feature:hover {
  transform: translateX(5px);
}

.feature i {
  font-size: 1.5rem;
  color: white;
  width: 24px;
}

.feature span {
  font-weight: 500;
}

/* Footer de la página */
.login-page-footer {
  background: var(--text-primary);
  color: white;
  text-align: center;
  padding: 1rem 0;
}

.footer-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
}

.footer-content p {
  font-size: 0.9rem;
  opacity: 0.8;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .login-container {
    grid-template-columns: 1fr;
  }
  
  .info-panel {
    order: -1;
    min-height: 300px;
  }
  
  .info-content {
    max-width: 600px;
  }
  
  .features {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .feature {
    flex: 1;
    min-width: 200px;
  }
}

@media (max-width: 768px) {
  .login-content {
    padding: 1.5rem;
  }
  
  .login-header h1 {
    font-size: 1.75rem;
  }
  
  .logo {
    width: 70px;
    height: 70px;
  }
  
  .logo i {
    font-size: 2rem;
  }
  
  .info-content h2 {
    font-size: 2rem;
  }
  
  .info-content p {
    font-size: 1rem;
  }
  
  .info-icon {
    width: 80px;
    height: 80px;
  }
  
  .info-icon i {
    font-size: 2.5rem;
  }
  
  .features {
    flex-direction: column;
  }
  
  .form-options {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
}

@media (max-width: 480px) {
  .login-content {
    padding: 1rem;
  }
  
  .login-header {
    margin-bottom: 1.5rem;
  }
  
  .login-header h1 {
    font-size: 1.5rem;
  }
  
  .login-header p {
    font-size: 0.9rem;
  }
  
  .logo {
    width: 60px;
    height: 60px;
    margin-bottom: 1rem;
  }
  
  .logo i {
    font-size: 1.75rem;
  }
  
  .login-form {
    max-width: 100%;
  }
  
  .form-group {
    margin-bottom: 1.25rem;
  }
  
  .form-group input {
    padding: 0.75rem;
    font-size: 0.95rem;
  }
  
  .login-btn {
    padding: 0.875rem;
    font-size: 0.95rem;
  }
  
  .info-panel {
    padding: 1.5rem 1rem;
    min-height: 250px;
  }
  
  .info-content h2 {
    font-size: 1.75rem;
  }
  
  .info-content p {
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
  }
  
  .info-icon {
    width: 70px;
    height: 70px;
    margin-bottom: 1.5rem;
  }
  
  .info-icon i {
    font-size: 2rem;
  }
  
  .feature {
    padding: 0.75rem;
    font-size: 0.9rem;
  }
  
  .feature i {
    font-size: 1.25rem;
  }
  
  .footer-content {
    padding: 0 1rem;
  }
  
  .footer-content p {
    font-size: 0.8rem;
  }
}

/* Animaciones adicionales */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.login-form {
  animation: fadeInUp 0.6s ease;
}

.info-content {
  animation: fadeInUp 0.8s ease;
}

/* Estados de carga */
.login-btn.loading {
  pointer-events: none;
  opacity: 0.7;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}