/* Reset y configuración base con colores profesionales */
:root {
  --primary: #1a2a3a;
  --primary-dark: #121a24;
  --primary-light: #2a3a4a;
  --secondary: #2c4a6b;
  --secondary-dark: #1c3a5b;
  --secondary-light: #3c5a7b;
  --accent: #3a6ca3;
  --accent-dark: #2a5c93;
  --accent-light: #4a7cb3;
  --neutral-dark: #2d3748;
  --neutral: #4a5568;
  --neutral-light: #718096;
  --neutral-lighter: #e2e8f0;
  --light: #f7fafc;
  --dark: #1a202c;
  --success: #38a169;
  --error: #e53e3e;
  --warning: #d69e2e;
  
  --border-radius: 8px;
  --border-radius-sm: 6px;
  --box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --box-shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --box-shadow-elevated: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

/* CUERPO PRINCIPAL - POSICIONADO UN POCO ARRIBA DEL CENTRO */
body {
  background-color: var(--light);
  color: var(--dark);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 100vh;
  padding-top: 60px;
  background-image: 
    radial-gradient(circle at 15% 50%, rgba(26, 42, 58, 0.03) 0%, transparent 55%),
    radial-gradient(circle at 85% 30%, rgba(44, 74, 107, 0.03) 0%, transparent 55%);
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
}

/* Fondo profesional sutil */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    linear-gradient(135deg, transparent 0%, rgba(26, 42, 58, 0.02) 100%),
    repeating-linear-gradient(45deg, transparent, transparent 2px, rgba(26, 42, 58, 0.01) 2px, rgba(26, 42, 58, 0.01) 4px);
  z-index: -1;
  pointer-events: none;
}

/* CONTENEDOR PRINCIPAL - POSICIONADO ARRIBA DEL CENTRO */
.container {
  width: 100%;
  max-width: 420px;
  padding: 20px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  flex-direction: column;
  margin-top: 40px;
  animation: slideUp 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* TARJETA DE LOGIN - ESTILO PROFESIONAL */
.login-card {
  width: 100%;
  background: white;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--box-shadow-elevated);
  border: 1px solid var(--neutral-lighter);
  transition: var(--transition-slow);
  position: relative;
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.95);
}

.login-card:hover {
  box-shadow: var(--box-shadow-hover);
  transform: translateY(-2px);
  border-color: var(--neutral-light);
}

/* ENCABEZADO DE LA TARJETA - PROFESIONAL Y SOBRIO */
.card-header {
  width: 100%;
  padding: 32px 30px 28px;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  color: white;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.card-header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  z-index: 2;
}

.card-header::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.05) 50%, transparent 70%);
  animation: professionalShine 8s infinite linear;
  z-index: 1;
}

@keyframes professionalShine {
  0% {
    transform: translateX(-100%) translateY(-100%) rotate(45deg);
  }
  100% {
    transform: translateX(100%) translateY(100%) rotate(45deg);
  }
}

.form-title {
  font-size: 1.9rem;
  font-weight: 600;
  margin: 0 0 6px 0;
  color: white;
  letter-spacing: -0.02em;
  position: relative;
  z-index: 2;
}

.form-subtitle {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.92rem;
  letter-spacing: 0.02em;
  margin: 0;
  font-weight: 400;
  position: relative;
  z-index: 2;
}

/* CUERPO DE LA TARJETA */
.card-body {
  padding: 32px 30px 30px;
}

/* FORMULARIO */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

/* GRUPOS DE ENTRADA - ESTILO PROFESIONAL */
.input-group {
  position: relative;
}

/* ETIQUETAS REMOVIDAS - Ya no se muestran */
.input-label {
  display: none; /* Oculta las etiquetas */
}

/* CONTENEDOR DE INPUT CON ICONO */
.input-with-icon {
  position: relative;
  width: 100%;
}

/* ICONO DENTRO DEL INPUT - MEJOR ALINEADO */
.input-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--neutral-light);
  transition: var(--transition);
  z-index: 2;
  font-size: 1.1em;
  width: 20px;
  text-align: center;
}

/* INPUTS CON PADDING PARA EL ICONO */
.login-form input[type="text"],
.login-form input[type="password"] {
  padding: 15px 15px 15px 48px; /* Más padding izquierdo para icono */
  border-radius: var(--border-radius-sm);
  border: 1px solid var(--neutral-lighter);
  font-size: 15px;
  background-color: white;
  transition: var(--transition);
  width: 100%;
  color: var(--neutral-dark);
  -webkit-appearance: none;
  appearance: none;
  font-weight: 400;
  height: 50px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

.login-form input[type="text"]:focus,
.login-form input[type="password"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(58, 108, 163, 0.1);
  outline: none;
  background-color: white;
}

.login-form input[type="text"]:focus + .input-icon,
.login-form input[type="password"]:focus + .input-icon {
  color: var(--accent);
  transform: translateY(-50%) scale(1.1);
}

.login-form input[type="text"]::placeholder,
.login-form input[type="password"]::placeholder {
  color: var(--neutral-light);
  font-weight: 400;
}

/* BOTÓN DE ENVÍO - PROFESIONAL */
.login-form button {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: white;
  border: none;
  border-radius: var(--border-radius-sm);
  font-weight: 500;
  transition: var(--transition);
  width: 100%;
  font-size: 15px;
  letter-spacing: 0.02em;
  min-height: 50px;
  cursor: pointer;
  margin-top: 8px;
  box-shadow: 0 2px 4px rgba(26, 42, 58, 0.2);
  position: relative;
  overflow: hidden;
}

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

.login-form button:hover {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--secondary-dark) 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(26, 42, 58, 0.25);
}

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

.login-form button:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(26, 42, 58, 0.2);
}

.login-form button i {
  margin-right: 10px;
  font-size: 1.1em;
}

/* ENLACE ESTILIZADO - PROFESIONAL */
.styled-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 15px;
  padding: 14px;
  text-align: center;
  background-color: transparent;
  color: var(--neutral);
  font-size: 14px;
  font-weight: 500;
  border: 1px solid var(--neutral-lighter);
  border-radius: var(--border-radius-sm);
  text-decoration: none;
  transition: var(--transition);
  width: 100%;
  min-height: 46px;
  letter-spacing: 0.02em;
}

.styled-link:hover {
  background-color: var(--light);
  color: var(--primary);
  border-color: var(--primary);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.styled-link i {
  font-size: 0.9em;
  transition: var(--transition);
}

.styled-link:hover i {
  transform: translateX(-3px);
}

/* MENSAJE DE ERROR - SIMPLIFICADO */
.error-message {
  background-color: rgba(229, 62, 62, 0.05);
  color: var(--error);
  padding: 14px 18px;
  border-radius: var(--border-radius-sm);
  border-left: 4px solid var(--error);
  font-size: 0.9rem;
  margin-top: 20px;
  display: none;
  font-weight: 500;
  align-items: center;
  animation: fadeIn 0.3s ease;
}

.error-message i {
  margin-right: 10px;
  font-size: 1em;
}

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

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

.shake-animation {
  animation: professionalShake 0.4s ease-in-out;
}

/* ========== MEDIA QUERIES ========== */

/* PC - POSICIONADO ARRIBA DEL CENTRO */
@media (min-width: 769px) {
  body {
    padding-top: 80px;
    align-items: flex-start;
  }
  
  .container {
    margin-top: 60px;
    max-width: 440px;
  }
}

/* TABLETS (hasta 768px) */
@media (max-width: 768px) {
  body {
    padding-top: 40px;
    align-items: flex-start;
  }
  
  .container {
    max-width: 400px;
    margin-top: 30px;
    padding: 15px;
  }
  
  .login-card {
    border-radius: 10px;
  }
  
  .card-header {
    padding: 28px 25px 24px;
  }
  
  .card-body {
    padding: 28px 25px 26px;
  }
  
  .login-form {
    gap: 20px;
  }
  
  .form-title {
    font-size: 1.8rem;
  }
}

/* MÓVILES (hasta 600px) */
@media (max-width: 600px) {
  body {
    padding-top: 30px;
    align-items: flex-start;
    background-image: none;
    background-color: var(--light);
  }
  
  .container {
    max-width: 360px;
    margin-top: 20px;
    padding: 10px;
  }
  
  .card-header {
    padding: 24px 20px 20px;
  }
  
  .card-body {
    padding: 24px 20px 22px;
  }
  
  .login-form {
    gap: 18px;
  }
  
  .login-form input[type="text"],
  .login-form input[type="password"] {
    padding: 14px 14px 14px 46px;
    height: 48px;
  }
  
  .input-icon {
    left: 14px;
  }
  
  .login-form button {
    padding: 15px;
    height: 48px;
  }
  
  .styled-link {
    padding: 13px;
    height: 46px;
  }
  
  .form-title {
    font-size: 1.7rem;
  }
  
  .form-subtitle {
    font-size: 0.9rem;
  }
}

/* MÓVILES MUY PEQUEÑOS (hasta 375px) */
@media (max-width: 375px) {
  body {
    padding-top: 20px;
  }
  
  .container {
    max-width: 320px;
    margin-top: 15px;
    padding: 8px;
  }
  
  .card-body {
    padding: 22px 18px 20px;
  }
  
  .card-header {
    padding: 22px 18px 18px;
  }
  
  .form-title {
    font-size: 1.6rem;
    margin-bottom: 4px;
  }
  
  .form-subtitle {
    font-size: 0.85rem;
  }
  
  .login-form {
    gap: 16px;
  }
  
  .login-form input[type="text"],
  .login-form input[type="password"] {
    padding: 13px 13px 13px 44px;
    height: 46px;
    font-size: 14px;
  }
  
  .input-icon {
    left: 12px;
  }
  
  .login-form button {
    padding: 14px;
    height: 46px;
    font-size: 14px;
  }
  
  .styled-link {
    padding: 12px;
    height: 44px;
    font-size: 13px;
  }
}

/* LANDSCAPE EN MÓVILES */
@media (max-height: 650px) and (orientation: landscape) {
  body {
    padding-top: 20px;
    align-items: flex-start;
  }
  
  .container {
    max-width: 360px;
    margin-top: 10px;
  }
  
  .card-header {
    padding: 20px 18px 16px;
  }
  
  .card-body {
    padding: 20px 18px 18px;
  }
  
  .login-form {
    gap: 16px;
  }
  
  .login-form input[type="text"],
  .login-form input[type="password"],
  .login-form button,
  .styled-link {
    height: 44px;
    padding: 12px 12px 12px 44px;
  }
  
  .login-form button,
  .styled-link {
    padding: 12px;
  }
  
  .input-icon {
    left: 12px;
  }
}

/* DESKTOP GRANDE */
@media (min-width: 1200px) {
  body {
    padding-top: 100px;
  }
  
  .container {
    max-width: 460px;
    margin-top: 80px;
  }
  
  .card-body {
    padding: 36px 32px 32px;
  }
}

/* MEJORAS PARA TÁCTIL */
@media (hover: none) and (pointer: coarse) {
  .login-form button,
  .styled-link {
    min-height: 48px;
  }
  
  .login-card:hover {
    transform: none;
    box-shadow: var(--box-shadow-elevated);
  }
  
  .login-card:active {
    transform: scale(0.99);
    box-shadow: var(--box-shadow);
  }
}

/* ACCESIBILIDAD - MEJORES ESTADOS DE FOCO */
.login-form input[type="text"]:focus-visible,
.login-form input[type="password"]:focus-visible,
.login-form button:focus-visible,
.styled-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* VALIDACIÓN VISUAL */
.login-form input:valid:not(:placeholder-shown) {
  border-color: var(--success);
}

.login-form input:invalid:not(:placeholder-shown) {
  border-color: var(--error);
}