﻿/**
 * =============================================================================
 * LOGINREGISTER/LOGINREGISTER.CSS - Estilos de Login y Registro
 * =============================================================================
 * 
 * Este archivo CSS define toda la apariencia visual de la página de autenticación.
 * Es utilizado por: loginregister/loginregister.html
 * 
 * =============================================================================
 * ESTRUCTURA DEL ARCHIVO:
 * =============================================================================
 * 1. ANIMACIONES        - Keyframes para animaciones
 * 2. VARIABLES CSS      - Colores, fuentes, tamaños
 * 3. RESET Y BODY       - Estilos base
 * 4. MODO OSCURO        - Variables para dark mode
 * 5. TOGGLE DARK MODE   - Interruptor de modo oscuro
 * 6. WRAPPER PRINCIPAL  - Contenedor de la tarjeta
 * 7. TARJETA AUTH       - Tarjeta principal de autenticación
 * 8. HEADER             - Logo y título
 * 9. FORMULARIO         - Campos de entrada y etiquetas
 * 10. BOTONES          - Estilos de botones
 * 11. PANELES          - Cambios entre login/registro
 * 12. SOCIAL LOGIN     - Botones de redes sociales
 * 13. RESPONSIVE       - Ajustes para móviles
 * 
 * =============================================================================
 */

/* =============================================================================
SECCIÓN 1: ANIMACIONES
================================================================================
Definición de keyframes para las animaciones usadas en toda la página.
*/

/* Animación de entrada: opacity y translateY */
@keyframes slideUpFade {
  from {
    opacity: 0; /* Invisible al inicio */
    transform: translateY(30px); /* Desplazado 30px hacia abajo */
  }
  to {
    opacity: 1; /* Visible al final */
    transform: translateY(0); /* En su posición original */
  }
}

/* Animación flotante 3D para fondos */
@keyframes float3D {
  0%, 100% {
    transform: translateY(0) rotateX(0deg) rotateY(0deg); /* Sin movimiento */
  }
  25% {
    transform: translateY(-8px) rotateX(2deg) rotateY(2deg); /* Arriba y rotado */
  }
  50% {
    transform: translateY(0) rotateX(0deg) rotateY(0deg); /* Centro */
  }
  75% {
    transform: translateY(-4px) rotateX(-2deg) rotateY(-2deg); /* Arriba y rotado opuesto */
  }
}

/* Animación de pulso para destaca */
@keyframes pulseGlow {
  0%, 100% {
    box-shadow: 0 0 5px rgba(42, 157, 143, 0.3); /* Sombra pequeña */
  }
  50% {
    box-shadow: 0 0 20px rgba(42, 157, 143, 0.5); /* Sombra grande */
  }
}

/* Animación de brillo para botones */
@keyframes shimmer {
  0% {
    background-position: -200% 0; /* Empieza fuera por la izquierda */
  }
  100% {
    background-position: 200% 0; /* Termina fuera por la derecha */
  }
}


/* =============================================================================
SECCIÓN 2: VARIABLES CSS
================================================================================
Definición de variables CSS para mantener consistencia en colores, tamaños, etc.
*/

:root {
  /* Colores primarios - Verde principal de Batuak */
  --primary: #2a9d8f;          /* Verde principal */
  --primary-dark: #21867a;     /* Verde más oscuro para hover */
  --primary-light: #3ab7af;    /* Verde más claro */
  --primary-rgb: 42, 157, 143; /* Verde en formato RGB */

  /* Colores secundarios */
  --secondary: #264653;         /* Azul grisáceo oscuro */
  --secondary-light: #2d5a6b;  /* Azul grisáceo claro */

  /* Colores de acento */
  --accent: #e9c46a;           /* Amarillo dorado */
  --accent-dark: #d4b255;       /* Más oscuro */
  --accent-light: #f0d48a;     /* Más claro */

  /* Fondos */
  --bg: #fafbfc;               /* Fondo principal */
  --bg-alt: #f0f4f8;          /* Fondo alternativo */
  --bg-gradient: linear-gradient(135deg, var(--secondary) 0%, #1a3a47 100%); /* Gradiente de fondo */
  --card-bg: #ffffff;          /* Fondo de tarjetas */

  /* Textos */
  --text: #1f2937;             /* Texto principal oscuro */
  --text-muted: #6b7280;      /* Texto secundario gris */
  --text-light: #9ca3af;      /* Texto claro */

  /* Bordes y sombras */
  --border: #e5e7eb;           /* Borde gris */
  --border-light: #f3f4f6;    /* Borde más claro */
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1); /* Sombra pequeña */
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1); /* Sombra media */
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1); /* Sombra grande */
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1); /* Sombra muy grande */
  --shadow-primary: 0 4px 14px 0 rgba(42, 157, 143, 0.3); /* Sombra verde */

  /* Bordes redondeados */
  --radius: 0.5rem;            /* Pequeño */
  --radius-md: 0.75rem;       /* Mediano */
  --radius-lg: 1rem;          /* Grande */
  --radius-xl: 1.5rem;        /* Extra grande */
  --radius-full: 9999px;       /* Completamente redondeado (pill) */

  /* Transiciones */
  --transition-fast: 0.15s ease;  /* Rápida */
  --transition: 0.3s ease;       /* Normal */
  --transition-slow: 0.5s ease;  /* Lenta */

  /* Fuentes */
  --font-heading: 'Baloo 2', cursive; /* Para títulos */
  --font-body: 'Nunito', sans-serif;  /* Para cuerpo */
}


/* =============================================================================
SECCIÓN 3: RESET Y BODY
================================================================================
Estilos base que se aplican a todo el documento.
*/

*, *::before, *::after {
  margin: 0; /* Eliminar márgenes por defecto */
  padding: 0; /* Eliminar padding por defecto */
  box-sizing: border-box; /* Incluir padding y border en el ancho total */
  font-family: var(--font-body); /* Fuente del cuerpo */
}

body {
  font-family: var(--font-body); /* Fuente principal */
  font-size: 1rem; /* Tamaño base */
  line-height: 1.6; /* Altura de línea */
  color: var(--text); /* Color de texto */
  background: var(--bg-gradient); /* Gradiente de fondo */
  min-height: 100vh; /* Ocupa toda la altura de la pantalla */
  display: flex; /* Flexbox para centrar */
  justify-content: center; /* Centrar horizontalmente */
  align-items: center; /* Centrar verticalmente */
  padding: 2rem; /* Espaciado */
  transition: /* Transiciones suaves */
    background var(--transition),
    color var(--transition);
}


/* =============================================================================
SECCIÓN 4: FONDO DECORATIVO
================================================================================
Fondo animado con gradientes radiales.
*/

/* Elemento ::before del body para el fondo decorativo */
body::before {
  content: ''; /* Contenido vacío */
  position: fixed; /* Posición fija */
  inset: 0; /* Cubrir toda la pantalla */
  background: /* Múltiples gradientes superpuestos */
    radial-gradient(
      ellipse at 20% 80%, /* Elipse en abajo-izquierda */
      rgba(42, 157, 143, 0.15) 0%,
      transparent 50%
    ),
    radial-gradient(
      ellipse at 80% 20%, /* Elipse en arriba-derecha */
      rgba(233, 196, 106, 0.1) 0%,
      transparent 50%
    ),
    radial-gradient(
      ellipse at 50% 50%, /* Elipse en el centro */
      rgba(38, 70, 83, 0.2) 0%,
      transparent 70%
    );
  pointer-events: none; /* Permitir clics a través del fondo */
  z-index: 0; /* Capa inferior */
  animation: float3D 8s ease-in-out infinite; /* Animación flotante */
}


/* =============================================================================
SECCIÓN 5: MODO OSCURO
================================================================================
Variables CSS específicas para el modo oscuro.
*/

.dark-mode {
  --bg: #0f172a;          /* Fondo oscuro */
  --bg-alt: #1e293b;      /* Fondo alternativo oscuro */
  --card-bg: #1e293b;     /* Fondo de tarjeta oscuro */
  --text: #f1f5f9;       /* Texto claro */
  --text-muted: #94a3b8;  /* Texto secundario gris claro */
  --border: #334155;      /* Borde oscuro */
  --border-light: #475569; /* Borde claro oscuro */
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.3); /* Sombra oscura */
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
}


/* =============================================================================
SECCIÓN 6: TOGGLE MODO OSCURO
================================================================================
Interruptor para cambiar entre modo claro y oscuro.
*/

/* Contenedor del toggle */
.dark-mode-toggle {
  position: fixed; /* Fijo en la pantalla */
  bottom: 2rem; /* Desde abajo */
  right: 2rem; /* Desde la derecha */
  z-index: 1000; /* Por encima de todo */
}

/* Ocultar el checkbox original */
.dark-mode-toggle input {
  display: none;
}

/* Etiqueta/toggle propiamente dicho */
.toggle-label {
  width: 56px; /* Ancho */
  height: 28px; /* Alto */
  background: var(--secondary); /* Fondo gris azulado */
  border-radius: var(--radius-full); /* Pills */
  display: flex; /* Flexbox */
  align-items: center; /* Centrar verticalmente */
  justify-content: space-between; /* Espacio entre iconos */
  padding: 0 6px; /* Espacio interno */
  box-shadow: var(--shadow-lg); /* Sombra */
  transition: background var(--transition); /* Transición */
  position: relative; /* Para posicionamiento de iconos */
  cursor: pointer; /* Cursor de mano */
}

/* Iconos del toggle */
.toggle-label i {
  font-size: 0.85rem; /* Tamaño pequeño */
  color: var(--accent); /* Amarillo para sol */
  transition: opacity var(--transition-fast);
  z-index: 1; /* Por encima */
}

.toggle-label i.fa-sun {
  opacity: 1; /* Sol visible por defecto */
}

.toggle-label i.fa-moon {
  color: white;
  opacity: 0; /* Luna invisible por defecto */
}

/* Cuando está marcado (modo oscuro) */
.dark-mode-toggle input:checked + .toggle-label {
  background: var(--primary); /* Verde cuando activo */
}

.dark-mode-toggle input:checked + .toggle-label i.fa-sun {
  opacity: 0.3; /* Sol menos visible */
}

.dark-mode-toggle input:checked + .toggle-label i.fa-moon {
  opacity: 1; /* Luna visible */
}

/* Focus visible para accesibilidad */
.dark-mode-toggle input:focus-visible + .toggle-label {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}


/* =============================================================================
SECCIÓN 7: WRAPPER PRINCIPAL
================================================================================
Contenedor que envuelve toda la tarjeta de autenticación.
*/

.auth-wrapper {
  width: 100%;
  max-width: 480px; /* Ancho máximo */
  position: relative;
  z-index: 1; /* Por encima del fondo decorativo */
}


/* =============================================================================
SECCIÓN 8: TARJETA DE AUTENTICACIÓN
================================================================================
La tarjeta principal que contiene el formulario.
*/

.auth-card {
  background: var(--card-bg); /* Fondo de tarjeta */
  border-radius: var(--radius-xl); /* Bordes muy redondeados */
  box-shadow: var(--shadow-xl); /* Sombra grande */
  padding: 3rem; /* Relleno interno */
  position: relative;
  overflow: hidden; /* Ocultar contenido que sobresale */
  transition: all var(--transition-slow);
  
  /* Animación de entrada */
  opacity: 0;
  transform: translateY(30px);
  animation: slideUpFade 0.6s ease-out forwards;
}

/* Borde decorativo superior */
.auth-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px; /* Barra verde en la parte superior */
  background: linear-gradient(90deg, var(--primary), var(--accent));
}


/* =============================================================================
SECCIÓN 9: HEADER
================================================================================
Logo y título de la página.
*/

.auth-header {
  text-align: center;
  margin-bottom: 2rem;
}

/* Contenedor del logo y texto */
.auth-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

/* Enlace del logo */
.auth-brand a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

/* Imagen del logo */
.auth-logo {
  width: 56px;
  height: 56px;
  border-radius: var(--radius);
  overflow: hidden;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-primary);
  transition: transform var(--transition);
}

.auth-logo:hover {
  transform: scale(1.05) rotate(3deg);
}

.auth-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Texto del logo */
.auth-brand-text {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--secondary);
  transition: color var(--transition-fast);
}

.dark-mode .auth-brand-text {
  color: var(--text);
}

.auth-brand:hover .auth-brand-text {
  color: var(--primary);
}

/* Título del formulario */
.auth-title {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  color: var(--text);
  margin-bottom: 0.5rem;
  animation: slideUpFade 0.5s ease-out 0.2s both;
}

/* Subtítulo */
.auth-subtitle {
  color: var(--text-muted);
  font-size: 1rem;
  animation: slideUpFade 0.5s ease-out 0.3s both;
}


/* =============================================================================
SECCIÓN 10: FORMULARIO
================================================================================
Campos de entrada, etiquetas y opciones del formulario.
*/

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Grupo de campo */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Etiqueta del campo */
.form-group label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
}

/* Contenedor del input con icono */
.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

/* Icono dentro del input */
.input-icon {
  position: absolute;
  left: 1rem;
  color: var(--text-muted);
  font-size: 0.95rem;
  transition: color var(--transition-fast);
  pointer-events: none;
}

/* Campo de entrada */
.form-input {
  width: 100%;
  padding: 1rem 1rem 1rem 2.75rem; /* Izquierda más grande para icono */
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
  transition: all var(--transition-fast);
  
  /* Animación de entrada escalonada */
  opacity: 0;
  transform: translateY(20px);
  animation: slideUpFade 0.5s ease-out forwards;
}

/* Delays escalonados para cada input */
.form-group:nth-child(1) .form-input { animation-delay: 0.35s; }
.form-group:nth-child(2) .form-input { animation-delay: 0.4s; }
.form-group:nth-child(3) .form-input { animation-delay: 0.45s; }
.form-group:nth-child(4) .form-input { animation-delay: 0.5s; }

/* Focus del input */
.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.15);
  background: var(--card-bg);
}

.form-input::placeholder {
  color: var(--text-light);
}

/* Icono cambia de color cuando el input tiene foco */
.input-wrapper:focus-within .input-icon {
  color: var(--primary);
}

/* Opciones del formulario (recordarme, olvidé contraseña) */
.form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
  margin-top: -0.5rem;
  animation: slideUpFade 0.5s ease-out 0.55s both;
}

/* Checkbox recordar */
.remember-me {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  cursor: pointer;
}

.remember-me input {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
}

/* Enlace de olvidar contraseña */
.forgot-password {
  color: var(--primary);
  font-weight: 600;
  transition: color var(--transition-fast);
}

.forgot-password:hover {
  color: var(--primary-dark);
}

/* Términos y condiciones */
.terms {
  font-size: 0.875rem;
  color: var(--text-muted);
  animation: slideUpFade 0.5s ease-out 0.6s both;
}

.terms label {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  cursor: pointer;
  line-height: 1.4;
}

.terms input {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  margin-top: 2px;
  cursor: pointer;
  flex-shrink: 0;
}

.terms a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
  transition: color var(--transition-fast);
}

.terms a:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}


/* =============================================================================
SECCIÓN 11: BOTONES
================================================================================
Estilos para los botones de acción.
*/

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem 1.5rem;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
  white-space: nowrap;
  margin-top: 0.5rem;
  position: relative;
  overflow: hidden;
}

/* Botón primario (verde) */
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
  border-color: var(--primary);
  box-shadow: var(--shadow-primary);
  
  /* Animación de entrada */
  opacity: 0;
  transform: translateY(20px);
  animation: slideUpFade 0.5s ease-out 0.65s forwards;
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

/* Efecto shimmer al hover */
.btn-primary:hover::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  animation: shimmer 2s infinite;
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-block {
  width: 100%; /* Botón ocupa todo el ancho */
}

/* Focus visible */
.btn:focus-visible,
.form-input:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}


/* =============================================================================
SECCIÓN 12: PANELES
================================================================================
Estilos para cambiar entre paneles (login, registro, etc.).
*/

.auth-switch {
  margin-top: 1.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.95rem;
  animation: slideUpFade 0.5s ease-out 0.7s both;
}

.auth-switch a {
  color: var(--primary);
  font-weight: 700;
  cursor: pointer;
  transition: color var(--transition-fast);
  text-decoration: none;
}

.auth-switch a:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

/* Panel (login, registro, etc.) */
.auth-panel {
  display: none;
  animation: fadeIn 0.4s ease;
}

.auth-panel.active {
  display: block;
}

/* Animación de entrada/salida de paneles */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(-20px);
  }
}


/* =============================================================================
SECCIÓN 13: SOCIAL LOGIN
================================================================================
Botones para iniciar sesión con redes sociales.
*/

/* Decorador divisor */
.auth-decoration {
  text-align: center;
  margin: 1.5rem 0;
  position: relative;
}

.auth-decoration::before,
.auth-decoration::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 30%;
  height: 1px;
  background: var(--border);
}

.auth-decoration::before { left: 0; }
.auth-decoration::after { right: 0; }

.auth-decoration span {
  color: var(--text-muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Contenedor de botones sociales */
.social-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.5rem 0;
}

.social-divider::before,
.social-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.social-divider span {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Botones sociales */
.social-buttons {
  display: flex;
  gap: 1rem;
}

.social-btn {
  flex: 1;
  padding: 0.75rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
  color: var(--text);
  font-size: 1.25rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  
  /* Animación */
  opacity: 0;
  transform: translateY(20px);
  animation: slideUpFade 0.5s ease-out forwards;
}

.social-buttons .social-btn:nth-child(1) { animation-delay: 0.5s; }
.social-buttons .social-btn:nth-child(2) { animation-delay: 0.55s; }

.social-btn:hover {
  border-color: var(--primary);
  background: rgba(var(--primary-rgb), 0.05);
  color: var(--primary);
  transform: translateY(-3px);
}

.social-btn:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}


/* =============================================================================
SECCIÓN 14: RESPONSIVE
================================================================================
Ajustes para tablets y móviles.
*/

@media (max-width: 768px) {
  body {
    padding: 1rem;
  }

  .auth-wrapper {
    max-width: 100%;
  }

  .auth-card {
    padding: 2rem;
  }

  .auth-title {
    font-size: 1.5rem;
  }

  .form-options {
    flex-direction: column;
    gap: 0.75rem;
    align-items: flex-start;
  }

  .dark-mode-toggle {
    bottom: 1rem;
    right: 1rem;
  }
}

@media (max-width: 480px) {
  .auth-card {
    padding: 1.5rem;
    border-radius: var(--radius-lg);
  }

  .auth-brand {
    margin-bottom: 1.5rem;
  }

  .auth-logo {
    width: 48px;
    height: 48px;
  }

  .auth-brand-text {
    font-size: 1.5rem;
  }

  .auth-title {
    font-size: 1.35rem;
  }

  .form-input {
    padding: 0.875rem 1rem 0.875rem 2.5rem;
    font-size: 0.95rem;
  }

  .btn {
    padding: 0.875rem 1.25rem;
  }
}


/* =============================================================================
SECCIÓN 15: PRINT Y REDUCED MOTION
================================================================================
Ajustes especiales para impresión y reducción de movimiento.
*/

@media print {
  .dark-mode-toggle {
    display: none;
  }

  body {
    background: white;
  }

  .auth-card {
    box-shadow: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  body::before {
    animation: none;
  }

  .auth-card,
  .form-input,
  .btn-primary,
  .social-btn,
  .auth-title,
  .auth-subtitle,
  .form-options,
  .terms,
  .auth-switch {
    opacity: 1;
    transform: none;
  }

  .btn-primary::before {
    display: none;
  }
}

