/* ============================================================
   BASE — reset y variables
============================================================ */

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

:root {
  --blue: #3b82f6;
  --blue-dark: #1d4ed8;
  --blue-deeper: #1e3a8a;
  --blue-light: #eff6ff;
  --charcoal: #1e293b;
  --text: #1e293b;
  --text2: #475569;
  --muted: #94a3b8;
  --border: #e2e8f0;
  --white: #ffffff;
  --green: #10b981;
  --red: #ef4444;
  --shadow: 0 4px 16px rgba(30,58,138,0.08);
  --shadow-lg: 0 12px 40px rgba(30,58,138,0.14);
}

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  color: var(--text);
  overflow: hidden; /* evita scroll en la pantalla de login */
}


/* ============================================================
   LOGIN WRAPPER — divide la pantalla en 2 columnas
   Izquierda: fondo azul con presentación
   Derecha: fondo blanco con formulario
============================================================ */

.login-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}


/* ============================================================
   COLUMNA IZQUIERDA — presentación visual
============================================================ */

.login-left {
  background: linear-gradient(145deg, var(--blue-deeper) 0%, var(--blue) 100%);
  padding: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

/* Fondo decorativo de puntos */
.login-bg-dots {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,0.15) 1px, transparent 1px);
  background-size: 28px 28px;
}

/* Mancha de color difuso */
.login-blob {
  position: absolute;
  bottom: -100px; right: -80px;
  width: 350px; height: 350px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
}

.login-left-content {
  position: relative;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Logo */
.login-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.login-logo-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.login-logo-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.login-logo-name {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--white);
  letter-spacing: -0.02em;
}

.login-logo-tag {
  font-size: 0.65rem;
  font-weight: 600;
  color: rgba(255,255,255,0.6);
  letter-spacing: 0.04em;
}

/* Título y subtítulo */
.login-left-title {
  font-size: clamp(1.6rem, 2.5vw, 2.2rem);
  font-weight: 800;
  color: var(--white);
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.login-left-sub {
  font-size: 0.92rem;
  color: rgba(255,255,255,0.7);
  line-height: 1.7;
}

/* Módulos disponibles */
.login-modules {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.login-module {
  padding: 0.4rem 0.85rem;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(255,255,255,0.85);
}

/* Nota de roles */
.login-roles-note {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.5);
  font-weight: 500;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255,255,255,0.1);
}


/* ============================================================
   COLUMNA DERECHA — formulario de login
============================================================ */

.login-right {
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
}

.login-form-wrapper {
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* Encabezado del formulario */
.login-form-header {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.login-form-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--charcoal);
  letter-spacing: -0.03em;
}

.login-form-sub {
  font-size: 0.88rem;
  color: var(--text2);
}

/* Formulario */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  position: relative; /* necesario para el botón de mostrar contraseña */
}

.form-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--charcoal);
}

.form-input {
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.9rem;
  color: var(--text);
  transition: border-color 0.2s;
  outline: none;
  width: 100%;
}

.form-input:focus {
  border-color: var(--blue);
}

/* Botón para mostrar/ocultar contraseña */
.form-toggle-pass {
  position: absolute;
  right: 0.75rem;
  bottom: 0.65rem;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  color: var(--muted);
  transition: color 0.2s;
}

.form-toggle-pass:hover {
  color: var(--charcoal);
}

/* Link olvidé contraseña */
.form-forgot {
  text-align: right;
  margin-top: -0.5rem;
}

.form-forgot-link {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--blue);
  text-decoration: none;
  transition: color 0.2s;
}

.form-forgot-link:hover {
  color: var(--blue-dark);
}

/* Botón de ingreso */
.btn-login {
  padding: 0.85rem;
  border-radius: 10px;
  background: var(--blue);
  border: none;
  color: white;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 20px rgba(59,130,246,0.4);
  width: 100%;
}

.btn-login:hover {
  background: var(--blue-dark);
  transform: translateY(-1px);
  box-shadow: 0 8px 30px rgba(59,130,246,0.45);
}

/* Mensaje de error — oculto por defecto */
.login-error {
  display: none; /* JS lo muestra con display:block cuando hay error */
  padding: 0.75rem 1rem;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  font-size: 0.82rem;
  color: var(--red);
  font-weight: 500;
}

/* Footer del formulario */
.login-form-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.login-form-footer p {
  font-size: 0.78rem;
  color: var(--text2);
}

.login-form-footer a {
  color: var(--blue);
  text-decoration: none;
  font-weight: 600;
}

.login-back {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted) !important;
  transition: color 0.2s;
}

.login-back:hover {
  color: var(--charcoal) !important;
}

/* ============================================================
   RESPONSIVE — MEDIA QUERIES
============================================================ */

/* ── TABLET (≤768px) ── */
@media (max-width: 768px) {

  body {
    overflow: auto;
  }

  .login-wrapper {
    grid-template-columns: 1fr;
  }

  /* Ocultar columna izquierda en móvil */
  .login-left {
    display: none;
  }

  .login-right {
    padding: 2rem 1.25rem;
    min-height: 100vh;
  }

  .login-form-wrapper {
    max-width: 100%;
  }

  /* Mostrar logo arriba del formulario en móvil */
  .login-right::before {
    content: '';
    display: block;
  }
}

/* ── MÓVIL PEQUEÑO (≤480px) ── */
@media (max-width: 480px) {

  .login-right {
    padding: 1.5rem 1rem;
    align-items: flex-start;
    padding-top: 3rem;
  }

  .login-form-title {
    font-size: 1.4rem;
  }
}