@font-face {
  font-family: interTight-light;
  src: url(../fonts/InterTight-Light.ttf);
}
@font-face {
  font-family: interTight-semiBold;
  src: url(../fonts/InterTight-SemiBold.ttf);
}

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

/* LOGIN SECTION */
#login {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  /* Imagen de fondo original del copygenerator con respaldo */
  background: 
    url('img/UG_Login.webp'),
    linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  min-height: 100vh;
  position: relative;
  padding: 20px;
  overflow: hidden;
}

.logo-container {
  position: absolute;
  top: 40px;
  left: 140px; /* Changed from 50% to fixed left position */
  transform: none; /* Removed translateX(-50%) */
  z-index: 3;
  margin-left: 50px;
}

.logo-icon img {
  width: 350px; /* Adjusted size to be appropriate for corner placement */
  margin-left: 0; /* Removed margin */
}

.container {
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  margin-top: -5rem;
  position: relative;
  z-index: 2;
}

.container-login {
  margin-top: 50px;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(20px);
  border-radius: 24px;
  padding: 48px;
  width: 100%;
  max-width: 620px;
  text-align: center;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
  position: relative;
  z-index: 3;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.title {
  color: white;
  font-size: 52px;
  font-weight: 700;
  margin-bottom: 12px;
  letter-spacing: -0.5px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.subtitle {
  color: rgba(255, 255, 255, 0.9);
  font-size: 16px;
  margin-bottom: 36px;
  line-height: 1.5;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.container-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* COMPLETELY REVISED FLOATING LABEL STYLES */
/* Remove all previous form-group and label styles and replace with these */

.form-group {
  position: relative;
  margin-bottom: 40px !important; /* More space for the floating label */
  overflow: visible !important; /* Critical to allow the label to appear outside */
}

.form-group input {
  width: 100%;
  padding: 18px 24px;
  background: rgba(255, 255, 255, 0.95);
  border: 2px solid transparent;
  border-radius: 50px;
  color: #333;
  font-size: 16px;
  font-weight: 400;
  transition: all 0.3s ease;
  box-sizing: border-box;
  outline: none;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.form-group label {
  position: absolute !important;
  left: 24px !important;
  top: 18px !important;
  color: #666;
  font-size: 16px;
  pointer-events: none;
  transition: all 0.3s ease;
  z-index: 1;
}

/* Fixed floating label styles */
.form-group input:focus ~ label,
.form-group input:not(:placeholder-shown) ~ label {
  top: -20px !important; /* Moved higher above the input */
  left: 20px !important;
  font-size: 14px !important;
  color: #33d76f !important;
  padding: -40px 12px !important; /* More padding for better visibility */
  border-radius: 20px !important;
  z-index: 10 !important; /* Increased z-index to ensure it's above everything */
  transform: none !important; /* Reset any transforms */
}

/* Keep placeholder transparent */
.form-group input::placeholder {
  color: transparent !important;
}

/* Botón de inicio de sesión */
.login-button {
  width: 60%;
  padding: 18px 32px;
  background-color: #33d76f;
  border: none;
  border-radius: 50px;
  color: white;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin: 2rem auto 0;
  box-shadow: 0 6px 20px rgba(51, 215, 111, 0.4);
  position: relative;
  overflow: hidden;
  overflow: hidden;
}

.login-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(51, 215, 111, 0.5);
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

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

.loading {
  display: none;
}

.spinner {
  border: 2px solid #f3f3f3;
  border-top: 2px solid #33d76f;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  animation: spin 1s linear infinite;
  display: inline-block;
  margin-right: 10px;
}

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

.footer {
  position: fixed !important;
  bottom: 40px !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  gap: 15px;
  width: 100%;
  text-align: center;
  transition: opacity 0.3s ease !important;
}

.footer span {
  font-size: 24px;
  color: white;
  font-weight: 400;
}

.footer-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease !important;
}

.footer-logo img {
  width: 180px;
  height: auto;
  display: block;
}

/* Estilos para mensajes de error y éxito */
.error {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 14px;
  text-align: left;
  backdrop-filter: blur(10px);
}

.success {
  color: #22c55e;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 14px;
  text-align: left;
  backdrop-filter: blur(10px);
}

/* Responsive design */
@media (max-width: 768px) {
  .container-login {
    padding: 32px 24px;
    max-width: 90%;
    margin: 0 20px;
  }
  
  .title {
    font-size: 36px;
  }
  
  .logo-container {
    top: 20px;
    left: 20px;
  }
  
  .logo-icon img {
    width: 120px;
  }
  
  .login-button {
    width: 80%;
  }
  
  .footer {
    bottom: 20px;
    gap: 12px;
  }
  
  .footer span {
    font-size: 20px;
  }
  
  .footer-logo img {
    width: 150px;
  }
}

@media (max-width: 480px) {
  .container-login {
    padding: 24px 16px;
  }
  
  .title {
    font-size: 28px;
  }
  
  .subtitle {
    font-size: 14px;
  }
  
  .login-button {
    width: 100%;
  }
  
  .footer {
    bottom: 15px;
    flex-direction: column;
    gap: 8px;
  }
  
  .footer span {
    font-size: 18px;
  }
  
  .footer-logo img {
    width: 100px;
  }
}

/* ===============================
   ANIMACIONES Y EFECTOS AVANZADOS
   =============================== */

/* Animación de entrada principal */
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Animación de fade in para elementos */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Animación de escala para el logo */
@keyframes logoScale {
  0% {
    opacity: 0;
    transform: translateX(-50%) scale(0.8);
  }
  100% {
    opacity: 1;
    transform: translateX(-50%) scale(1);
  }
}

/* Animación de escritura para el título */
@keyframes typewriter {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

/* Animación de pulso para el botón */
@keyframes pulse {
  0% {
    box-shadow: 0 4px 15px rgba(51, 215, 111, 0.3);
  }
  50% {
    box-shadow: 0 6px 20px rgba(51, 215, 111, 0.5);
  }
  100% {
    box-shadow: 0 4px 15px rgba(51, 215, 111, 0.3);
  }
}

/* Animación de floating para elementos */
@keyframes floating {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* Animación de movimiento de ondas */
@keyframes waveMove {
  0%, 100% {
    transform: translateX(0) scale(1);
    opacity: 0.8;
  }
  25% {
    transform: translateX(10px) scale(1.02);
    opacity: 0.6;
  }
  50% {
    transform: translateX(-5px) scale(0.98);
    opacity: 1;
  }
  75% {
    transform: translateX(8px) scale(1.01);
    opacity: 0.7;
  }
}

/* Aplicar animaciones a los elementos */
.container {
  animation: slideUp 0.6s ease-out;
}

.logo-container {
  animation: logoScale 0.8s ease-out 0.2s both;
}

.title {
  animation: fadeIn 1s ease-out 0.4s both;
  overflow: hidden;
}

.subtitle {
  animation: fadeIn 1s ease-out 0.6s both;
}

.form-group {
  animation: fadeIn 0.8s ease-out 0.8s both;
}

.form-group:nth-child(2) {
  animation: fadeIn 0.8s ease-out 1s both;
}

.login-button {
  animation: fadeIn 0.8s ease-out 1.2s both, pulse 2s ease-in-out infinite 2s;
}

.footer {
  animation: fadeIn 1s ease-out 1.4s both;
}

/* Efectos hover mejorados para inputs */
.form-group input:focus {
  outline: none;
  border-color: #33d76f;
  background: rgba(255, 255, 255, 0.15);
  box-shadow: 0 0 0 3px rgba(51, 215, 111, 0.2), 0 0 20px rgba(51, 215, 111, 0.1);
  transform: translateY(-2px);
}

.form-group input:hover {
  border-color: rgba(51, 215, 111, 0.5);
  background: rgba(255, 255, 255, 0.12);
}

/* DELETE ALL THESE CONFLICTING STYLES THAT APPEAR LATER IN THE FILE */
/* The following styles should be removed or commented out:

.form-group label {
  transition: all 0.3s ease;
}

.form-group input:focus ~ label,
.form-group input:not(:placeholder-shown) ~ label {
  color: #33d76f;
  transform: scale(0.9);
}

.form-group.focused label {
  color: #33d76f;
  transform: scale(0.9) translateY(-2px);
}

*/

/* Animación para labels */
.form-group label {
  transition: all 0.3s ease;
}

.form-group input:focus ~ label,
.form-group input:not(:placeholder-shown) ~ label {
  color: #33d76f;
  transform: scale(0.9);
}

/* Efectos de loading mejorados */
.login-button:disabled {
  cursor: not-allowed;
  opacity: 0.7;
  transform: none !important;
}

.login-button.loading {
  position: relative;
  color: transparent;
}

.login-button.loading::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  top: 50%;
  left: 50%;
  margin-left: -10px;
  margin-top: -10px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  border-top-color: transparent;
  animation: spin 1s linear infinite;
}

/* Efectos de error/success mejorados */
.error {
  animation: slideInFromTop 0.5s ease-out;
  border-left: 4px solid #ef4444;
}

.success {
  animation: slideInFromTop 0.5s ease-out;
  border-left: 4px solid #22c55e;
}

@keyframes slideInFromTop {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Efecto de partículas en el fondo */
#login::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(circle at 20% 80%, rgba(51, 215, 111, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(51, 215, 111, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 40% 40%, rgba(255, 255, 255, 0.05) 0%, transparent 50%);
  animation: floating 6s ease-in-out infinite;
  pointer-events: none;
}

/* Efecto de ondas adicional para simular una imagen de fondo compleja */
#login::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    /* Ondas curvas */
    radial-gradient(ellipse 800px 600px at 50% 0%, rgba(51, 215, 111, 0.05) 0%, transparent 70%),
    radial-gradient(ellipse 600px 400px at 0% 100%, rgba(51, 215, 111, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse 700px 500px at 100% 50%, rgba(255, 255, 255, 0.03) 0%, transparent 50%);
  animation: waveMove 12s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

/* Mejoras responsive con animaciones */
@media (max-width: 768px) {
  .container {
    animation: slideUp 0.4s ease-out;
  }
  
  .title {
    animation: fadeIn 0.6s ease-out 0.2s both;
  }
  
  .form-group {
    animation: fadeIn 0.6s ease-out 0.4s both;
  }
}

/* Disable animations para usuarios que prefieren menos movimiento */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ===============================
   ANIMACIONES ADICIONALES
   =============================== */

/* Animación de partículas flotantes */
@keyframes floatParticle {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
    opacity: 0.3;
  }
  33% {
    transform: translateY(-20px) rotate(120deg);
    opacity: 0.6;
  }
  66% {
    transform: translateY(-10px) rotate(240deg);
    opacity: 0.4;
  }
}

/* Animación de shake para errores */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-10px); }
  20%, 40%, 60%, 80% { transform: translateX(10px); }
}

/* Animación de fadeOut */
@keyframes fadeOut {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-20px);
  }
}

/* Animación de success pulse */
@keyframes successPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

/* Animación del checkmark */
@keyframes checkmarkPop {
  0% {
    transform: translate(-50%, -50%) scale(0) rotate(0deg);
    opacity: 0;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.2) rotate(180deg);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) scale(1) rotate(360deg);
    opacity: 1;
  }
}

/* Efecto ripple para inputs */
.form-group {
  position: relative;
  overflow: hidden;
}

.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(51, 215, 111, 0.3);
  transform: scale(0);
  pointer-events: none;
  transition: transform 0.6s ease-out, opacity 0.6s ease-out;
}

/* Estado de typing */
.form-group.typing input {
  border-color: #33d76f;
  box-shadow: 0 0 10px rgba(51, 215, 111, 0.3);
}

/* Estado focused mejorado */
.form-group.focused label {
  color: #33d76f;
  transform: scale(0.9) translateY(-2px);
}

/* Animación de texto typewriter */
.typewriter {
  overflow: hidden;
  white-space: nowrap;
  animation: typewriter 2s steps(40, end);
}

/* Efectos de hover para toda la página */
.container-login:hover {
  box-shadow: 0 35px 60px rgba(0, 0, 0, 0.6);
  transform: translateY(-5px);
}

/* Animación de entrada para mensajes de error */
.animated-error {
  animation: slideInFromTop 0.5s ease-out, pulse 2s ease-in-out infinite 1s;
}

/* Mejora del efecto de loading del botón */
.login-button.loading {
  animation: pulse 1.5s ease-in-out infinite;
}

/* Efecto de glow en focus */
.form-group input:focus {
  position: relative;
}

.form-group input:focus::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(45deg, #33d76f, #22c55e, #16a34a);
  border-radius: 12px;
  z-index: -1;
  animation: rotate 2s linear infinite;
}

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

/* Animación del footer */
.footer {
  animation: fadeIn 1s ease-out 1.4s both;
}

.footer-logo {
  animation: fadeIn 1s ease-out 1.6s both;
}

/* Transiciones suaves para todos los elementos interactivos */
* {
  transition: all 0.3s ease;
}

/* Excluir transiciones de transform para el footer */
.footer, .footer-logo {
  transition: opacity 0.3s ease !important;
}

/* Efectos de hover mejorados */
.form-group:hover input {
  border-color: rgba(51, 215, 111, 0.6);
}

.form-group:hover label {
  color: rgba(51, 215, 111, 0.8);
}

/* Autofill styles for white inputs */
.form-group input:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 30px rgba(255, 255, 255, 0.95) inset !important;
  -webkit-text-fill-color: #333 !important;
}

.form-group input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 30px rgba(255, 255, 255, 1) inset !important;
  -webkit-text-fill-color: #333 !important;
}

/* Focused state for white inputs */
.form-group.focused input {
  background: rgba(255, 255, 255, 1);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}

/* Additional effects for white inputs */
.form-group input:active {
  transform: translateY(-1px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Smooth transitions for all form elements */
.form-group {
  transition: all 0.3s ease;
}

/* Enhanced hover effects for the form container */
.form-group:hover input {
  box-shadow: 0 5px 18px rgba(0, 0, 0, 0.12);
}
.form-group.focused input {
  background: rgba(255, 255, 255, 1);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}

/* Additional effects for white inputs */
.form-group input:active {
  transform: translateY(-1px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Smooth transitions for all form elements */
.form-group {
  transition: all 0.3s ease;
}

/* Enhanced hover effects for the form container */
.form-group:hover input {
  box-shadow: 0 5px 18px rgba(0, 0, 0, 0.12);
}

/* Enhanced hover effects for the form container */
.form-group:hover input {
  box-shadow: 0 5px 18px rgba(0, 0, 0, 0.12);
}
