/* ==========================================
   CONFIGURACIÓN BASE Y RESET
   ========================================== */
:root {
  --color-brand-50: #f0f3ff;
  --color-brand-500: #6366f1;
  --color-brand-600: #4f46e5;
  --color-brand-700: #4338ca;
  --color-brand-900: #312e81;
}

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

/* Fondo con degradado fluido en cualquier pantalla */
.gradient-bg {
  background: linear-gradient(135deg, #3b82f6 0%, #4f46e5 50%, #9333ea 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ==========================================
   ESTRUCTURA RESPONSIVA (MOBILE FIRST)
   ========================================== */

/* Contenedor Principal en Celulares */
.login-container {
  width: 100%;
  max-width: 28rem; /* Ancho máximo ideal para celulares */
  display: flex;
  flex-direction: column;
  border-radius: 1.25rem;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.3);
  background: #ffffff;
}

/* Tarjeta de Formulario en Celulares */
.login-card {
  width: 100%;
  padding: 2.25rem 1.5rem; /* Relleno cómodo para pantallas pequeñas */
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Panel Derecho en Celulares (Oculto por defecto para que no estorbe) */
.info-card {
  display: none;
}

/* ─── CAMBIO A PANTALLAS GRANDES (Computadoras / Tablets horizontales) ─── */
@media (min-width: 1024px) {
  .login-container {
    max-width: 56rem; /* Se expande a max-w-4xl */
    flex-direction: row; /* Se colocan uno al lado del otro */
  }

  .login-card {
    width: 50%;
    padding: 3.5rem 3rem; /* Más aire y elegancia en escritorio */
  }

  .info-card {
    display: flex; /* Reaparece el panel informativo */
    width: 50%;
    background: linear-gradient(135deg, #4338ca 0%, #312e81 100%);
    padding: 3.5rem 3rem;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    position: relative;
  }
}

/* ==========================================
   INPUTS Y ELEMENTOS DE FORMULARIO
   ========================================== */
.form-control {
  width: 100%;
  margin-bottom: 1.25rem;
}

.input-highlight {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  height: 3.25rem; /* Un poco más alto para facilitar el toque táctil en móviles */
  border-radius: 0.75rem;
  padding: 0 1rem;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  background: #eff6ff !important;
  border: 1px solid #dbeafe !important;
}

.input-highlight:focus-within {
  border-color: #3b82f6 !important;
  background: #ffffff !important;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15) !important;
}

.input-highlight input {
  flex-grow: 1;
  font-size: 0.95rem; /* Texto legible en móviles para evitar el zoom automático en iOS */
  background: transparent !important;
  border: none !important;
  outline: none !important;
  color: #1e293b !important;
  height: 100%;
  width: 100%;
}

.input-highlight input::placeholder {
  color: #94a3b8 !important;
}

.input-icon {
  width: 1.25rem;
  height: 1.25rem;
  color: #4f46e5;
  flex-shrink: 0;
}

/* ==========================================
   BOTONES Y COMPONENTES
   ========================================== */
.btn-brand {
  width: 100%;
  height: 3.25rem;
  border-radius: 0.75rem;
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: none;
  background: #4f46e5;
  color: #ffffff;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.5rem;
}

.btn-brand:hover:not(:disabled) {
  background: #4338ca;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.btn-brand:active:not(:disabled) {
  transform: scale(0.98);
}

.btn-brand:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-eye {
  background: transparent;
  border: none;
  cursor: pointer;
  color: #94a3b8;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.btn-eye:hover {
  color: #4f46e5;
}

/* Loader Overlay */
.loader-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.custom-spinner {
  width: 2.5rem;
  height: 2.5rem;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

[x-cloak] {
  display: none !important;
}