/* Reset y configuración base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box; 
}

/* Variables CSS para consistencia */
:root {
  --color-primary: #2f7e33;
  --color-primary-dark: #d9db21;
  --color-secondary: #64748b;
  --color-success: #10b981;
  --color-background: #f8fafc;
  --color-surface: #ffffff;
  --color-text: #2f7e33;
  --color-text-light: #64748b;
  --color-border: #e2e8f0;
  --color-border-focus: #2f7e33;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --radius: 0.75rem;
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Estilo del cuerpo */
body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: linear-gradient(135deg, #2f7e33 0%, #d9db21 100%);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem;
  line-height: 1.6;
}

/* Contenedor principal del login */
.contenedor-login {
  width: 100%; 
  max-width: 420px;
  perspective: 1000px;
}

.contenedor-login form {
  background: var(--color-surface);
  padding: 2.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: var(--transition);
  transform-style: preserve-3d;
}

.contenedor-login form:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

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

.img-container {
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: center;
  align-items: center;
}

.img-container img {
  width: auto;
  height: 120px;
  max-width: 200px;
  border-radius: 12px;
  object-fit: contain;
  border: none;
  padding: 0.75rem 1rem;
  background: linear-gradient(135deg, #ffffff 0%, #f1f5f9 100%);
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.img-container img:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-md);
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

.titulo-login {
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 0.5rem;
  letter-spacing: -0.025em;
}

.subtitulo-login {
  color: var(--color-text-light);
  font-size: 0.875rem;
  font-weight: 400;
}

/* Grupos de entrada */
.grupo-input {
  position: relative;
  margin-bottom: 1.5rem;
}

.grupo-input input {
  width: 100%;
  padding: 1rem 3rem 0.5rem 0;
  background: transparent;
  border: none;
  border-bottom: 2px solid var(--color-border);
  font-size: 1rem;
  color: var(--color-text);
  transition: var(--transition);
  outline: none;
}

.grupo-input input:focus {
  border-bottom-color: var(--color-border-focus);
  box-shadow: 0 0 0 3px rgba(47, 126, 51, 0.1);
}

.grupo-input input:focus + label,
.grupo-input input:valid + label {
  transform: translateY(-1.5rem) scale(0.875);
  color: var(--color-border-focus);
  font-weight: 500;
}

.grupo-input label {
  position: absolute;
  top: 1rem;
  left: 0;
  font-size: 1rem;
  color: var(--color-text-light);
  transition: var(--transition);
  pointer-events: none;
  transform-origin: left top;
}

/* Efecto de línea en focus */
.grupo-input::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-primary);
  transition: var(--transition);
}

.grupo-input input:focus ~ ::after {
  width: 100%;
}

/* Botón toggle password */
.toggle-password {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  color: var(--color-text-light);
  transition: var(--transition);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toggle-password:hover {
  color: var(--color-primary);
  background: rgba(47, 126, 51, 0.05);
}

.toggle-password:focus {
  outline: none;
  color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(47, 126, 51, 0.2);
}

.eye-icon {
  width: 20px;
  height: 20px;
  transition: var(--transition);
}

.eye-closed {
  display: none;
}

/* Navegación - enlace de recuperación */
nav {
  text-align: right;
  margin-bottom: 2rem;
}

.olvide-contraseña {
  color: var(--color-primary);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: var(--transition);
}

.olvide-contraseña:hover {
  color: var(--color-primary-dark);
  text-decoration: underline;
}

/* Footer del formulario */
footer {
  text-align: center;
}

/* Botón de login */
.boton-login {
  width: 100%;
  padding: 0.875rem 1.5rem;
  background: var(--color-primary);
  border: none;
  border-radius: var(--radius);
  color: white;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.boton-login:hover {
  background: var(--color-primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

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

.boton-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;
}

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

/* Sección de registro */
.registrar {
  text-align: center;
  color: var(--color-text-light);
  font-size: 0.875rem;
}

.registrar a {
  color: var(--color-primary);
  font-weight: 600;
  transition: var(--transition);
}

.registrar a:hover {
  color: var(--color-primary-dark);
  text-decoration: underline;
}

/* Responsive */
@media (max-width: 480px) {
  .contenedor-login form {
    padding: 2rem 1.5rem; 
    margin: 1rem; 
  }

  .titulo-login {
    font-size: 1.5rem;
  }

  .img-container img {
    height: 80px;
    max-width: 180px;
    padding: 0.5rem 0.75rem;
  }

  .toggle-password {
    padding: 0.25rem;
  }

  .eye-icon {
    width: 18px;
    height: 18px;
  }
}

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

.contenedor-login form {
  animation: fadeInUp 0.6s ease-out;
}

/* Mejoras de accesibilidad */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Estados de error (para futuras implementaciones) */
.grupo-input.error input {
  border-bottom-color: #ef4444;
}

.grupo-input.error label {
  color: #ef4444;
}

.grupo-input.error::after {
  background: #ef4444;
}
