* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; overflow-x: hidden; }
button, a, input, label, .login-submit, .pw-toggle {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
body.login-split {
  min-height: 100vh;
  min-height: 100dvh;
  background: #fff;
  font-family: "Source Sans 3", Inter, system-ui, sans-serif;
  color: #0B2644;
  overflow-x: hidden;
  width: 100%;
  font-size: 16px;
}
/* Mobile/tablet first: formulario a ancho completo. El panel de marca solo en escritorio. */
.login-mobile-brand {
  display: flex;
  width: 100%;
  justify-content: center;
  margin: 0 0 18px;
  padding-top: env(safe-area-inset-top, 0px);
}
.login-mobile-brand img {
  display: block;
  height: 72px;
  width: auto;
  max-width: 220px;
  object-fit: contain;
}
.login-shell {
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  overflow-x: hidden;
}
.login-visual {
  display: none;
  flex: none;
  max-width: none;
  min-width: 0;
  min-height: 0;
  background: linear-gradient(155deg, #0B2644 0%, #1D5FB5 50%, #0B2644 100%);
  color: #fff;
  flex-direction: column;
  justify-content: space-between;
  padding: 40px 40px 28px;
  position: relative;
  overflow: hidden;
  font-family: Inter, system-ui, Roboto, "Segoe UI", sans-serif;
}
.login-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(520px 420px at 85% 10%, rgba(255,255,255,.12), transparent 60%),
    radial-gradient(420px 360px at 5% 95%, rgba(255,255,255,.10), transparent 60%),
    repeating-linear-gradient(90deg, transparent, transparent 35px, rgba(255,255,255,.03) 35px, rgba(255,255,255,.03) 36px);
  pointer-events: none;
}
.login-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
  opacity: 0.3;
}
.login-visual > * { position: relative; }
.login-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  position: relative;
}
.login-logo-lfq {
  display: block;
  height: 130px;
  width: auto;
  max-width: 85%;
  object-fit: contain;
  object-position: center;
  background: transparent;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.15));
  flex-shrink: 0;
}
.login-copy { max-width: 400px; margin: 32px 0; }
.login-copy h1 {
  margin: 0 0 16px;
  font-family: Inter, system-ui, Roboto, "Segoe UI", sans-serif;
  font-weight: 700;
  font-size: 32px;
  line-height: 1.2;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.login-copy p {
  margin: 0 0 26px;
  font-size: 15px;
  line-height: 1.6;
  color: rgba(255,255,255,.9);
}
.login-checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.login-checks li {
  display: flex; align-items: flex-start; gap: 12px;
  font-size: 14.5px; line-height: 1.5; color: rgba(255,255,255,.95);
  padding: 4px 0;
}
.login-checks svg {
  flex: 0 0 20px; width: 20px; height: 20px; margin-top: 2px;
  background: rgba(255,255,255,.15);
  border-radius: 4px;
  padding: 2px;
}
.login-foot {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: rgba(255,255,255,.65);
  padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,.1);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.login-foot-wk {
  height: 18px;
  width: auto;
  opacity: 0.8;
  transition: opacity 0.3s ease;
}
.login-foot-wk:hover {
  opacity: 1;
}
.login-panel {
  flex: 1 1 auto;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  padding: 20px 20px 28px;
  padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px));
  position: relative;
}
.login-panel::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 200px;
  height: 200px;
  background: linear-gradient(135deg, rgba(29,95,181,.03) 0%, transparent 70%);
  pointer-events: none;
}
.login-box { width: 100%; max-width: 100%; margin: 0; position: relative; }
.login-box.wide,
.login-box.larger { max-width: 100%; }
.login-kicker {
  margin: 0 0 8px;
  font-family: "IBM Plex Sans", sans-serif;
  font-weight: 600; font-size: 12px;
  letter-spacing: .09em; text-transform: uppercase; color: #8793A1;
}
.login-box h2 {
  margin: 0 0 8px;
  font-family: "IBM Plex Sans", sans-serif;
  font-weight: 700; font-size: 24px; line-height: 1.2; color: #0B2644;
}
.login-lead { margin: 0 0 20px; font-size: 15px; line-height: 1.45; color: #5B6B7C; }
.login-form { display: flex; flex-direction: column; gap: 18px; }
.login-form label.field { display: flex; flex-direction: column; gap: 8px; font-size: 14px; font-weight: 600; color: #0B2644; }
.login-form input[type="email"],
.login-form input[type="text"],
.login-form input[type="password"] {
  height: 52px; min-height: 52px; border-radius: 12px; border: 1.5px solid #DDE4EC;
  background: #F8FAFC; padding: 0 16px; font-size: 16px; color: #0B2644;
  font-family: "Source Sans 3", Inter, system-ui, sans-serif;
  transition: all 0.2s ease;
  width: 100%;
}
.login-form input:hover {
  border-color: #CBD5E1;
  background: #F3F6FA;
}
.login-form input:focus {
  outline: none; border-color: #1D5FB5;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(29,95,181,.12), 0 2px 8px rgba(29,95,181,.08);
}
.pw-wrap { position: relative; }
.pw-wrap input { width: 100%; padding-right: 48px; }
.pw-toggle {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; border: 0; background: transparent; color: #5B6B7C; cursor: pointer;
  display: grid; place-items: center;
  border-radius: 6px;
  transition: all 0.2s ease;
}
.pw-toggle:hover {
  background: rgba(29,95,181,.08);
  color: #1D5FB5;
}
.row-between { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.row-between a { font-size: 12.5px; font-weight: 500; color: #1D5FB5; text-decoration: none; transition: color 0.2s ease; }
.row-between a:hover { color: #0B2644; text-decoration: underline; }
.remember { display: flex; align-items: center; gap: 10px; font-size: 13px; color: #5B6B7C; font-weight: 500; cursor: pointer; }
.remember input { width: 17px; height: 17px; accent-color: #1D5FB5; cursor: pointer; }
.login-submit {
  height: 52px; min-height: 52px; border: none; border-radius: 12px;
  background: linear-gradient(135deg, #1D5FB5 0%, #0B2644 100%);
  color: #fff; font-size: 16px; font-weight: 700;
  cursor: pointer; margin-top: 6px; font-family: "Source Sans 3", Inter, system-ui, sans-serif;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(29,95,181,.25);
  width: 100%;
  touch-action: manipulation;
}
.login-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(29,95,181,.35);
}
.login-submit:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(29,95,181,.25);
}
.auth-err, .auth-ok {
  border-radius: 12px; padding: 12px 14px; margin-bottom: 8px;
  font-size: 13px; line-height: 1.45; font-weight: 600;
}
.auth-err { background: #FBE5E8; color: #C1273A; }
.auth-ok { background: #EAF2FD; color: #1D5FB5; }
.auth-success {
  background: #EAF2FD;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  margin-bottom: 20px;
}
.auth-success p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: #1D5FB5;
}
.password-strength {
  margin: 8px 0 12px;
}
.strength-bar {
  height: 6px;
  background: #E2E8F0;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 6px;
}
.strength-fill {
  height: 100%;
  width: 0%;
  background: #CBD5E1;
  border-radius: 3px;
  transition: all 0.3s ease;
}
.strength-fill.weak { background: #EF4444; width: 33%; }
.strength-fill.medium { background: #F59E0B; width: 66%; }
.strength-fill.strong { background: #10B981; width: 100%; }
.strength-text {
  margin: 0;
  font-size: 12px;
  color: #64748B;
  font-weight: 500;
}
.password-requirements {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}
.req-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: #64748B;
  transition: color 0.2s ease;
}
.req-item svg {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  transition: all 0.2s ease;
}
.req-item.met {
  color: #10B981;
}
.req-item.met svg {
  stroke: #10B981;
  fill: #10B981;
}
.req-item.met svg circle {
  display: none;
}
.req-item.met svg path {
  display: block;
  stroke: #fff;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.req-item svg path {
  display: none;
}
.setup-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.setup-grid h3 {
  grid-column: 1 / -1; margin: 8px 0 0;
  font-family: "IBM Plex Sans", sans-serif; font-size: 13px;
  letter-spacing: .08em; text-transform: uppercase; color: #8793A1;
}
.setup-grid { grid-template-columns: 1fr; }
.login-form { gap: 16px; width: 100%; }
.row-between a { font-size: 14px; }
.remember { font-size: 14px; }
.auth-err, .auth-ok { font-size: 14px; }

/* Escritorio ancho: marca a la izquierda + formulario centrado */
@media (min-width: 1024px) {
  .login-mobile-brand { display: none; }
  .login-shell {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: stretch;
  }
  .login-visual {
    display: flex;
    flex: 0 0 min(42vw, 520px);
    max-width: 520px;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 40px 40px 28px;
    overflow: visible;
  }
  .login-panel {
    flex: 1 1 auto;
    width: auto;
    align-items: center;
    justify-content: center;
    padding: 48px 40px;
  }
  .login-box { max-width: 380px; width: 100%; }
  .login-box.wide { max-width: 560px; }
  .login-box.larger { max-width: 500px; }
  .login-kicker { font-size: 11px; margin-bottom: 12px; }
  .login-box h2 { font-size: 28px; margin-bottom: 12px; }
  .login-lead { font-size: 14px; margin-bottom: 26px; line-height: 1.6; }
  .login-form { gap: 18px; }
  .row-between a { font-size: 12.5px; }
  .remember { font-size: 13px; }
  .auth-err, .auth-ok { font-size: 13px; }
  .setup-grid { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 1024px) and (max-height: 560px) {
  .login-shell { flex-direction: column; }
  .login-visual {
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    width: 100%;
    max-width: none;
    flex: none;
    min-height: 0;
    height: auto;
    padding: 10px 16px;
  }
  .login-brand { width: auto; justify-content: flex-start; }
  .login-logo-lfq { height: 48px; max-width: 120px; }
  .login-copy { margin: 0; max-width: none; }
  .login-copy h1 { font-size: 18px; margin: 0; line-height: 1.2; }
  .login-copy p,
  .login-checks,
  .login-foot { display: none; }
  .login-panel { width: 100%; padding: 12px 16px 16px; align-items: flex-start; justify-content: flex-start; }
}
