/* Variables de color del Sistema de Tiempos - Tema Oscuro */
:root {
  --primary-blue: #818cf8;
  --secondary-blue: #a5b4fc;
  --light-blue: #c7d2fe;
  --extra-light-blue: #1e3a8a;
  --dark-blue: #6366f1;
  --navy-blue: #4f46e5;
  
  /* Colores de fondo - Tema oscuro */
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-white: #1e293b;
  
  /* Colores de texto - Tema oscuro */
  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  
  /* Sombras y efectos - Tema oscuro */
  --shadow-light: rgba(0, 0, 0, 0.3);
  --shadow-medium: rgba(0, 0, 0, 0.4);
  --shadow-strong: rgba(0, 0, 0, 0.5);
  
  /* Bordes - Tema oscuro */
  --border-light: rgba(51, 65, 85, 0.8);
  --border-medium: rgba(71, 85, 105, 0.5);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: linear-gradient(135deg, var(--bg-primary) 0%, #1e293b 100%);
  min-height: 100vh;
  overflow-x: hidden;
}

.login-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
  position: relative;
}

/* ===== PANEL IZQUIERDO - FORMULARIO ===== */
.login-left {
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  position: relative;
  z-index: 2;
}

.login-container {
  width: 100%;
  max-width: 400px;
}

/* Sección de marca/logo */
.brand-section {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 60px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo i {
  font-size: 32px;
  color: var(--primary-blue);
  background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.brand-text {
  font-size: 18px;
  font-weight: 700;
  color: #a5b4fc;
  line-height: 1.2;
  letter-spacing: -0.5px;
  text-shadow: 0 2px 4px rgba(129, 140, 248, 0.2);
}

/* Sección de bienvenida */
.welcome-section {
  margin-bottom: 40px;
}

.welcome-title {
  font-size: 28px;
  font-weight: 800;
  color: #a5b4fc;
  line-height: 1.3;
  letter-spacing: -0.5px;
  text-shadow: 0 2px 8px rgba(129, 140, 248, 0.3);
}

/* Alertas */
.alert {
  padding: 16px 20px;
  border-radius: 12px;
  margin-bottom: 24px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid;
}

.alert-danger {
  background: rgba(127, 29, 29, 0.3);
  border-color: rgba(248, 113, 113, 0.4);
  color: #f87171;
}

.alert-info {
  background: rgba(30, 58, 138, 0.3);
  border-color: rgba(96, 165, 250, 0.4);
  color: #93c5fd;
}

/* Formulario */
.login-form {
  margin-bottom: 32px;
}

.form-group {
  margin-bottom: 20px;
}

.form-control {
  width: 100%;
  padding: 16px 20px;
  border: 2px solid #475569;
  border-radius: 12px;
  font-size: 16px;
  color: #f1f5f9;
  background: #334155;
  transition: all 0.3s ease;
  outline: none;
  font-weight: 500;
}

.form-control::placeholder {
  color: #94a3b8;
  font-weight: 400;
  opacity: 0.8;
}

.form-control:focus {
  border-color: #818cf8;
  box-shadow: 0 0 0 4px rgba(129, 140, 248, 0.2);
  transform: translateY(-1px);
  background: #475569;
  color: #f1f5f9;
}

/* Opciones del formulario */
.form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
}

.remember-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #cbd5e1;
  cursor: pointer;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  transition: color 0.2s ease;
}

.remember-checkbox input[type="checkbox"] {
  display: none;
}

.checkmark {
  width: 18px;
  height: 18px;
  border: 2px solid #475569;
  border-radius: 4px;
  position: relative;
  background: #334155;
  transition: all 0.3s ease;
}

.remember-checkbox input[type="checkbox"]:checked + .checkmark {
  background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
  border-color: var(--primary-blue);
}

.remember-checkbox input[type="checkbox"]:checked + .checkmark::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 12px;
  font-weight: 600;
}

/* Botón de login */
.btn-login {
  width: 100%;
  background: linear-gradient(135deg, #818cf8 0%, #a5b4fc 100%);
  color: #ffffff;
  border: none;
  padding: 18px 24px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  position: relative;
  overflow: hidden;
}

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

.btn-login:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(129, 140, 248, 0.5);
  background: linear-gradient(135deg, #a5b4fc 0%, #c7d2fe 100%);
}

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

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

.btn-login:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

/* Footer del login */
.login-footer {
  text-align: center;
  font-size: 14px;
  color: #cbd5e1;
  line-height: 1.6;
}

.register-link {
  color: #a5b4fc;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  border-bottom: 1px solid transparent;
}

.register-link:hover {
  color: #c7d2fe;
  border-bottom-color: #c7d2fe;
}

/* ===== PANEL DERECHO - ILUSTRACIÓN ===== */
.login-right {
  background: linear-gradient(135deg, #1e3a8a 0%, #0f172a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  position: relative;
  overflow: hidden;
}

.illustration-container {
  width: 100%;
  max-width: 500px;
  height: 400px;
  position: relative;
}

.illustration {
  width: 100%;
  height: 100%;
  position: relative;
}

/* Figura principal */
.main-figure {
  position: absolute;
  top: 20%;
  left: 30%;
  z-index: 3;
}

.person {
  position: relative;
  animation: floatPerson 4s ease-in-out infinite;
}

.person-head {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--light-blue), var(--secondary-blue));
  border-radius: 50%;
  margin: 0 auto 8px;
  position: relative;
  box-shadow: 0 2px 8px rgba(129, 140, 248, 0.3);
}

.person-head::before {
  content: '';
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 15px;
  background: var(--dark-blue);
  border-radius: 8px;
}

.person-body {
  width: 60px;
  height: 80px;
  background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
  border-radius: 8px 8px 4px 4px;
  margin: 0 auto;
  position: relative;
  box-shadow: 0 4px 12px rgba(129, 140, 248, 0.3);
}

.person-arms {
  position: absolute;
  top: 20px;
  left: -15px;
  right: -15px;
  height: 8px;
  background: var(--secondary-blue);
  border-radius: 4px;
}

.clock-large {
  position: absolute;
  top: -30px;
  right: -40px;
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #334155, #475569);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
  border: 2px solid rgba(129, 140, 248, 0.3);
  animation: clockSpin 8s linear infinite;
}

.clock-large i {
  font-size: 24px;
  color: var(--primary-blue);
}

/* Figuras secundarias */
.secondary-figures {
  position: absolute;
  width: 100%;
  height: 100%;
}

.person-2 {
  position: absolute;
  top: 60%;
  left: 10%;
  transform: scale(0.7);
}

.person-3 {
  position: absolute;
  top: 40%;
  right: 15%;
  transform: scale(0.8);
}

.person-4 {
  position: absolute;
  bottom: 20%;
  right: 30%;
  transform: scale(0.6);
}

.person-2 .person-head { background: var(--secondary-blue); }
.person-3 .person-head { background: var(--light-blue); }
.person-4 .person-head { background: var(--primary-blue); }

.person-2 .person-body { background: var(--light-blue); }
.person-3 .person-body { background: var(--secondary-blue); }
.person-4 .person-body { background: var(--dark-blue); }

/* Caja de regalo central */
.gift-box {
  position: absolute;
  bottom: 25%;
  left: 35%;
  z-index: 2;
}

.gift-base {
  width: 80px;
  height: 60px;
  background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
  border-radius: 8px;
  position: relative;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.gift-ribbon {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 8px;
  height: 60px;
  background: var(--dark-blue);
}

.gift-ribbon::before {
  content: '';
  position: absolute;
  top: 0;
  left: -30px;
  width: 68px;
  height: 8px;
  background: var(--dark-blue);
}

.gift-bow {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #334155, #475569);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  border: 2px solid rgba(129, 140, 248, 0.3);
}

.gift-bow i {
  font-size: 18px;
  color: var(--primary-blue);
}

/* Elementos flotantes */
.floating-elements {
  position: absolute;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.balloon {
  position: absolute;
  width: 20px;
  height: 28px;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  animation: floatBalloon 6s ease-in-out infinite;
}

.balloon-1 {
  background: var(--light-blue);
  top: 15%;
  right: 20%;
  animation-delay: 0s;
}

.balloon-2 {
  background: var(--secondary-blue);
  top: 25%;
  right: 10%;
  animation-delay: 2s;
}

.balloon-3 {
  background: var(--primary-blue);
  top: 35%;
  right: 25%;
  animation-delay: 4s;
}

.star {
  position: absolute;
  font-size: 16px;
  color: var(--light-blue);
  animation: twinkle 3s ease-in-out infinite;
}

.star-1 {
  top: 20%;
  left: 15%;
  animation-delay: 0s;
}

.star-2 {
  top: 45%;
  left: 5%;
  animation-delay: 1s;
}

.star-3 {
  bottom: 30%;
  left: 20%;
  animation-delay: 2s;
}

.confetti {
  position: absolute;
  width: 8px;
  height: 8px;
  background: var(--secondary-blue);
  border-radius: 2px;
  animation: fallConfetti 4s linear infinite;
}

.confetti-1 {
  top: 10%;
  left: 60%;
  animation-delay: 0s;
}

.confetti-2 {
  top: 0%;
  left: 70%;
  animation-delay: 1.5s;
  background: var(--light-blue);
}

.confetti-3 {
  top: 5%;
  left: 80%;
  animation-delay: 3s;
  background: var(--primary-blue);
}

/* ===== ANIMACIONES ===== */
@keyframes floatPerson {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

@keyframes clockSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes floatBalloon {
  0%, 100% { transform: translateY(0px) rotate(-2deg); }
  50% { transform: translateY(-15px) rotate(2deg); }
}

@keyframes twinkle {
  0%, 100% { opacity: 0.3; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.2); }
}

@keyframes fallConfetti {
  0% { transform: translateY(0px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(400px) rotate(360deg); opacity: 0; }
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 1024px) {
  .login-wrapper {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }
  
  .login-right {
    order: 1;
    min-height: 300px;
    padding: 20px;
  }
  
  .login-left {
    order: 2;
    padding: 30px;
  }
  
  .illustration-container {
    max-width: 400px;
    height: 250px;
  }
}

@media (max-width: 768px) {
  .login-left {
    padding: 24px 20px;
  }
  
  .brand-section {
    margin-bottom: 40px;
  }
  
  .brand-logo i {
    font-size: 28px;
  }
  
  .brand-text {
    font-size: 16px;
  }
  
  .welcome-title {
    font-size: 24px;
  }
  
  .form-control {
    padding: 14px 18px;
    font-size: 16px; /* Evita zoom en iOS */
  }
  
  .btn-login {
    padding: 16px 20px;
    font-size: 15px;
  }
  
  .illustration-container {
    height: 200px;
  }
  
  .main-figure {
    transform: scale(0.8);
  }
  
  .gift-box {
    transform: scale(0.8);
  }
}

@media (max-width: 480px) {
  .login-left {
    padding: 20px 16px;
  }
  
  .brand-section {
    flex-direction: column;
    gap: 20px;
    margin-bottom: 32px;
  }
  
  .welcome-title {
    font-size: 20px;
  }
  
  .form-control {
    padding: 12px 16px;
    border-radius: 10px;
  }
  
  .btn-login {
    padding: 14px 18px;
    border-radius: 10px;
    font-size: 14px;
  }
  
  .login-right {
    min-height: 180px;
    padding: 16px;
  }
  
  .illustration-container {
    height: 150px;
  }
  
  .main-figure {
    transform: scale(0.6);
  }
  
  .secondary-figures .person {
    display: none;
  }
  
  .floating-elements .balloon,
  .floating-elements .confetti {
    transform: scale(0.7);
  }
}

@media (max-width: 360px) {
  .welcome-title {
    font-size: 18px;
  }
  
  .form-control {
    padding: 10px 14px;
    font-size: 15px;
  }
  
  .btn-login {
    padding: 12px 16px;
    font-size: 13px;
  }
}

/* Toast responsive */
@media (max-width: 768px) {
  #toast-container {
    top: 16px !important;
    right: 16px !important;
    left: 16px !important;
    max-width: none !important;
  }
  
  .login-toast {
    margin-bottom: 8px !important;
    padding: 14px 16px !important;
    font-size: 13px !important;
  }
}
