/* Reset y configuración base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 50%, #06b6d4 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  position: relative;
  overflow-x: hidden;
}

/* Efectos de fondo animados */
body::before {
  content: '';
  position: absolute;
  width: 400px;
  height: 400px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  top: -200px;
  left: -200px;
  animation: float 20s infinite ease-in-out;
  pointer-events: none;
}

body::after {
  content: '';
  position: absolute;
  width: 300px;
  height: 300px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  bottom: -150px;
  right: -150px;
  animation: float 15s infinite ease-in-out reverse;
  pointer-events: none;
}

@keyframes float {
  0%, 100% { 
    transform: translate(0, 0) scale(1); 
  }
  50% { 
    transform: translate(50px, 50px) scale(1.1); 
  }
}

/* Contenedor del login */
.login-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  display: flex;
  align-items: center;
  min-height: 100vh;
}

/* Tarjeta de login */
.login-card {
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  border-radius: 24px;
  padding: 48px 40px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.2);
  animation: slideUp 0.6s ease-out;
  width: 100%;
  margin: auto 0;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Logo y encabezado */
.logo-container {
  text-align: center;
  margin-bottom: 36px;
}

.logo-container img {
  width: 100px;
  height: 100px;
  object-fit: contain;
  margin-bottom: 16px;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.1));
}

.logo-container h5 {
  font-size: 24px;
  font-weight: 700;
  color: #1a202c;
  margin: 0;
  letter-spacing: -0.5px;
}

.logo-container p {
  font-size: 14px;
  color: #718096;
  margin-top: 4px;
}

/* Formulario */
.form-label {
  font-size: 14px;
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 8px;
  display: block;
}

.form-control {
  height: 52px;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 16px;
  transition: all 0.3s ease;
  background: #f7fafc;
}

.form-control:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
  background: #ffffff;
  outline: none;
}

/* Input group para contraseña */
.input-group {
  position: relative;
}

.input-group .form-control {
  padding-right: 52px;
}

/* Botón toggle password */
.toggle-password {
  position: absolute;
  right: 2px;
  top: 2px;
  bottom: 2px;
  width: 48px;
  background: transparent;
  border: none;
  border-radius: 10px;
  color: #718096;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  -webkit-tap-highlight-color: transparent;
}

.toggle-password:hover {
  background: #e2e8f0;
  color: #2d3748;
}

.toggle-password:active {
  background: #cbd5e0;
}

.toggle-password i {
  font-size: 18px;
}

/* Botón de login */
.btn-login {
  height: 52px;
  background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 50%, #06b6d4 100%);
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  color: white;
  width: 100%;
  margin-top: 24px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(30, 58, 138, 0.4);
  -webkit-tap-highlight-color: transparent;
}

.btn-login:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
}

.btn-login:active {
  transform: scale(0.98);
}

/* Footer */
.footer-text {
  text-align: center;
  margin-top: 32px;
  font-size: 13px;
  color: #718096;
}

.footer-text a {
  color: #3b82f6;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s ease;
  -webkit-tap-highlight-color: transparent;
}

.footer-text a:hover {
  color: #1e3a8a;
}

/* Espaciado */
.mb-3 {
  margin-bottom: 20px;
}

/* Tablet */
@media (max-width: 768px) {
  body {
    padding: 16px;
  }

  .login-card {
    padding: 40px 32px;
  }
}

/* Mobile - 480px */
@media (max-width: 480px) {
  body {
    padding: 24px 16px;
    align-items: center;
  }

  .login-container {
    min-height: auto;
    max-height: none;
    display: block;
    padding: 0;
  }

  .login-card {
    padding: 36px 24px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
    margin: 0;
    min-height: auto;
    display: block;
    border: 1px solid rgba(255, 255, 255, 0.2);
  }

  .logo-container {
    margin-bottom: 32px;
  }

  .logo-container img {
    width: 85px;
    height: 85px;
    margin-bottom: 14px;
  }

  .logo-container h5 {
    font-size: 22px;
  }

  .logo-container p {
    font-size: 14px;
  }

  .form-label {
    font-size: 14px;
    margin-bottom: 8px;
  }

  .form-control {
    height: 50px;
    font-size: 16px;
    padding: 13px 16px;
    border-radius: 11px;
  }

  .input-group .form-control {
    padding-right: 48px;
  }

  .toggle-password {
    width: 46px;
    right: 2px;
  }

  .toggle-password i {
    font-size: 18px;
  }

  .btn-login {
    height: 50px;
    font-size: 16px;
    margin-top: 24px;
    border-radius: 11px;
  }

  .footer-text {
    margin-top: 28px;
    font-size: 12px;
  }

  .mb-3 {
    margin-bottom: 18px;
  }
}

/* Mobile pequeño - 360px */
@media (max-width: 360px) {
  body {
    padding: 20px 12px;
  }

  .login-card {
    padding: 32px 20px;
    border-radius: 18px;
  }

  .logo-container {
    margin-bottom: 28px;
  }

  .logo-container img {
    width: 75px;
    height: 75px;
    margin-bottom: 12px;
  }

  .logo-container h5 {
    font-size: 20px;
  }

  .logo-container p {
    font-size: 13px;
  }

  .form-control {
    height: 48px;
    font-size: 15px;
    padding: 12px 14px;
  }

  .btn-login {
    height: 48px;
    font-size: 15px;
  }

  .footer-text {
    font-size: 11px;
    margin-top: 24px;
  }

  .mb-3 {
    margin-bottom: 16px;
  }
}

/* Modo landscape en móviles */
@media (max-height: 650px) and (orientation: landscape) {
  body {
    padding: 12px 16px;
    align-items: center;
  }

  .login-card {
    margin: 12px 0;
    padding: 28px 32px;
    border-radius: 16px;
  }

  .logo-container {
    margin-bottom: 20px;
  }

  .logo-container img {
    width: 65px;
    height: 65px;
    margin-bottom: 10px;
  }

  .logo-container h5 {
    font-size: 19px;
  }

  .logo-container p {
    font-size: 13px;
  }

  .form-label {
    font-size: 13px;
    margin-bottom: 6px;
  }

  .form-control {
    height: 46px;
    font-size: 15px;
  }

  .btn-login {
    height: 46px;
    margin-top: 18px;
    font-size: 15px;
  }

  .footer-text {
    margin-top: 18px;
    font-size: 11px;
  }

  .mb-3 {
    margin-bottom: 14px;
  }
}

/* Mejoras para dispositivos táctiles */
@media (hover: none) and (pointer: coarse) {
  .toggle-password:hover {
    background: transparent;
  }

  .toggle-password:active {
    background: #e2e8f0;
  }

  .btn-login:hover {
    transform: none;
  }

  .btn-login:active {
    transform: scale(0.98);
  }
}