*, *::before, *::after { box-sizing: border-box; }

body, html {
  height: 100%;
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', 'Inter', 'Arial', sans-serif;
  background: #f1f5f9;
}

/* ── Centrar el card en pantalla ── */
.login-bg {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  position: relative;
}

/* ── Card de dos columnas ── */
.login-card {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  width: min(900px, 100%);
  min-height: 520px;
  border-radius: 16px;
  overflow: hidden;
  border: 0.5px solid #e2e8f0;
  box-shadow: 0 4px 32px rgba(15, 23, 42, 0.08);
  position: relative;
  z-index: 1;
}

/* ── Canvas: fondo absoluto de toda la pantalla ── */
#loginCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* ── Panel visual izquierdo ── */
.login-visual {
  position: relative;
  overflow: hidden;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-visual-text {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 2rem;
}

.login-visual-sub {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #94a3b8;
  margin: 0 0 12px;
}

.login-visual-title {
  font-size: 22px;
  font-weight: 500;
  color: #1e293b;
  margin: 0 0 8px;
  line-height: 1.3;
}

.login-visual-desc {
  font-size: 13px;
  color: #94a3b8;
  margin: 0;
}

/* ── Panel formulario derecho ── */
.login-form-panel {
  background: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 3rem 2.5rem;
  border-left: 0.5px solid #e2e8f0;
}

.login-heading {
  font-size: 1.35rem;
  font-weight: 500;
  color: #0f172a;
  margin: 0 0 4px;
  letter-spacing: 0;
}

.login-subheading {
  font-size: 0.82rem;
  color: #94a3b8;
  margin: 0 0 2rem;
}

/* ── Campos del formulario ── */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.login-field label {
  font-size: 0.78rem;
  color: #64748b;
  font-weight: 500;
}

.login-field input {
  padding: 0.75em 1em;
  font-size: 0.95rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  outline: none;
  color: #0f172a;
  font-family: inherit;
  transition: border-color 0.18s, box-shadow 0.18s;
}

.login-field input:focus {
  border-color: #123B63;
  box-shadow: 0 0 0 3px rgba(18, 59, 99, 0.1);
  background: #fff;
}

/* ── Botón ── */
.login-btn {
  width: 100%;
  padding: 0.8em;
  margin-top: 0.5rem;
  font-size: 0.95rem;
  font-weight: 500;
  font-family: inherit;
  background: #123B63;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.18s, transform 0.12s;
  letter-spacing: 0.3px;
}

.login-btn:hover { background: #0B1F3A; }
.login-btn:active { transform: scale(0.98); }

/* ── Error de autenticación ── */
.login-error {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 0.7em 1em;
  font-size: 0.85rem;
  margin-bottom: 1.2rem;
  text-align: center;
}

/* ── Texto pie ── */
.login-footer {
  margin-top: 1.8rem;
  font-size: 0.75rem;
  color: #94a3b8;
  text-align: center;
  line-height: 1.5;
}

/* ── Responsive: móvil — sparkles visibles detrás del card ── */
@media (max-width: 680px) {
  .login-card {
    grid-template-columns: 1fr;
    min-height: unset;
    background: transparent;
    box-shadow: none;
    border: none;
  }

  .login-visual {
    display: none;
  }

  .login-form-panel {
    padding: 2.5rem 1.5rem;
    border-left: none;
    border-radius: 16px;
    border: 0.5px solid rgba(226, 232, 240, 0.6);
    box-shadow: 0 4px 32px rgba(15, 23, 42, 0.08);
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }
}