/* ======================================================================
   La entrada (/login) a dos columnas (SPEC_Entrada_y_aterrizaje, 04/12/2026; de GADUCA, gaduca_login.css).
   El formulario nativo de Frappe a la izquierda (su lógica no se toca) y el panel grafito de Importllano a la derecha,
   con el rojo del logo. El armado lo hace public/js/il_login.js; los textos vienen de importllano_core.api.entrada.
   Única hoja con selectores de Frappe fuera de las variables (decisión 2026-12-04-entrada-a-dos-columnas): solo /login.
   ====================================================================== */
body[data-path="login"] {
  --il-entrada-lienzo: #f1f2f5;
  --il-entrada-campo: #f7f8fa;
  --il-entrada-borde: #dfe2e8;
  --il-rojo: var(--il-accent, #d81f26);
  --il-rojo-rgb: var(--il-accent-rgb, 216 31 38);
  --il-grafito: var(--il-primary, #1f2937);
  background:
    radial-gradient(60% 50% at 12% 0%, rgb(var(--il-rojo-rgb) / 0.06), transparent 70%),
    var(--il-entrada-lienzo);
  min-height: 100vh;
}
body[data-path="login"] .page-header-wrapper,
body[data-path="login"] .page-footer,
body[data-path="login"] .web-footer,
body[data-path="login"] .navbar {
  display: none;
}
/* El espacio de la barra de navegación (oculta) no se reserva: la tarjeta queda centrada y sin desplazamiento. */
body[data-path="login"] .page-content-wrapper {
  padding-top: 0 !important;
}
body[data-path="login"] main.container {
  max-width: none;
  width: 100%;
  min-height: 100vh;
  margin: 0;
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}
body[data-path="login"] .page_content {
  width: 100%;
  padding: 0;
}
/* Mientras el guion arma la tarjeta no se ve el formulario suelto; si el guion fallara, aparece igual al segundo. */
body[data-path="login"]:not(.il-entrada-lista) main.container {
  opacity: 0;
  animation: il-entrada-mostrar 0s linear 1s forwards;
}
@keyframes il-entrada-mostrar {
  to { opacity: 1; }
}

/* ---- La tarjeta ---- */
.il-entrada {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  width: min(1120px, 100%);
  min-height: min(660px, calc(100vh - 48px));
  margin: 0 auto;
  background: var(--il-surface, #fff);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgb(17 24 39 / 0.05), 0 32px 72px -32px rgb(17 24 39 / 0.35);
  animation: il-entrada-llegar 420ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
@keyframes il-entrada-llegar {
  from { opacity: 0; transform: translateY(8px); }
}
.il-entrada__form {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(32px, 5vw, 72px);
}

/* ---- El formulario nativo, sin su tarjeta ---- */
.il-entrada .page-card {
  width: 100%;
  max-width: 380px;
  margin: 0 auto;
  padding: 0;
  border: 0;
  box-shadow: none;
  background: transparent;
}
.il-entrada .page-card-head {
  gap: 20px !important;
}
.il-entrada .page-card-head .app-logo {
  height: 40px;
  width: auto;
  max-height: none;
}
.il-entrada .page-card-head h4 {
  font-size: clamp(26px, 2.4vw, 30px);
  font-weight: 650;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--il-ink, #1a1a1a);
}
.il-entrada .page-card-subtitle {
  font-size: 15px;
  color: var(--il-muted, #6b7280);
}
.il-entrada label {
  font-size: 13px;
  font-weight: 500;
  color: #4b5160;
}
.il-entrada .email-field,
.il-entrada .password-field {
  position: relative;
  width: 100%;
}
/* !important: el estilo de entrada de Frappe 16 (alto 34 px, relleno 8 px) tiene más peso que esta hoja. */
.il-entrada .form-control {
  height: 46px !important;
  width: 100%;
  padding-left: 42px !important;
  border: 1px solid var(--il-entrada-borde) !important;
  border-radius: 10px !important;
  background-color: var(--il-entrada-campo);
  background-repeat: no-repeat;
  background-position: 14px 50%;
  background-size: 18px 18px;
  font-size: 15px;
  color: var(--il-ink, #1a1a1a);
  transition: border-color 150ms, background-color 150ms, box-shadow 150ms;
}
.il-entrada .form-control:hover {
  border-color: #c8ccd6;
}
.il-entrada .form-control:focus {
  background-color: #fff;
  border-color: var(--il-grafito) !important;
  box-shadow: 0 0 0 3px rgb(var(--il-primary-rgb, 31 41 55) / 0.14);
}
.il-entrada input[type="email"],
.il-entrada #login_email,
.il-entrada #forgot_email,
.il-entrada #login_with_email_link_email {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237b8090' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='20' height='16' x='2' y='4' rx='2'/%3E%3Cpath d='m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7'/%3E%3C/svg%3E");
}
.il-entrada #login_password {
  padding-right: 42px !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237b8090' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='18' height='11' x='3' y='11' rx='2' ry='2'/%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'/%3E%3C/svg%3E");
}
.il-entrada .toggle-password {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #7b8090;
  cursor: pointer;
}
.il-entrada a[href="#forgot"],
.il-entrada a[href="#login"] {
  color: var(--il-rojo) !important;
  font-weight: 500;
}
.il-entrada .es-button {
  height: 46px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  transition: background-color 150ms, border-color 150ms, transform 150ms;
}
.il-entrada button.es-button[type="submit"],
.il-entrada .btn-primary {
  background: var(--il-grafito) !important;
  border: 1px solid var(--il-grafito) !important;
  color: #fff !important;
}
.il-entrada button.es-button[type="submit"]:hover,
.il-entrada .btn-primary:hover {
  background: var(--il-primary-hover, #111827) !important;
}
.il-entrada button.es-button[type="submit"]:active {
  transform: translateY(1px);
}
.il-entrada .btn-login-option {
  background: #fff;
  border: 1px solid var(--il-entrada-borde);
  color: var(--il-ink, #1a1a1a);
}
.il-entrada .btn-login-option:hover {
  background: var(--il-entrada-campo);
}
.il-entrada .es-button:focus-visible,
.il-entrada a:focus-visible {
  outline: 3px solid rgb(var(--il-rojo-rgb) / 0.35);
  outline-offset: 2px;
}

/* ---- El panel grafito ---- */
.il-entrada__panel {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 56px clamp(28px, 4vw, 56px) 40px;
  color: #fff;
  background:
    radial-gradient(50% 42% at 70% 36%, rgb(var(--il-rojo-rgb) / 0.32), transparent 72%),
    radial-gradient(40% 30% at 10% 100%, rgb(var(--il-rojo-rgb) / 0.14), transparent 70%),
    linear-gradient(160deg, #0f141c 0%, #1a2029 55%, #232a35 100%);
  overflow: hidden;
}
/* Una retícula muy tenue, como juntas de porcelanato. */
.il-entrada__panel::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgb(255 255 255 / 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgb(255 255 255 / 0.035) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(70% 60% at 50% 40%, #000, transparent 85%);
}
.il-entrada__marca {
  position: absolute;
  top: 22px;
  left: 26px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: rgb(255 255 255 / 0.78);
}
.il-entrada__marca img {
  width: 26px;
  height: 26px;
}
.il-escena {
  position: relative;
  width: min(440px, 100%);
  aspect-ratio: 440 / 320;
}
.il-anillo {
  position: absolute;
  left: 50%;
  top: 50%;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: rgb(255 255 255 / 0.04);
  z-index: -1;
}
.il-anillo--1 { width: 112%; aspect-ratio: 1; animation: il-respira 9s ease-in-out infinite; }
.il-anillo--2 { width: 78%; aspect-ratio: 1; background: rgb(255 255 255 / 0.045); animation: il-respira 9s ease-in-out -4.5s infinite; }
@keyframes il-respira {
  50% { transform: translate(-50%, -50%) scale(1.04); }
}
.il-lineas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.il-lineas path {
  fill: none;
  stroke: rgb(255 255 255 / 0.1);
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke 300ms;
}
.il-lineas path.activo { stroke: rgb(255 255 255 / 0.22); }
/* El flujo: un trazo rojo que corre por la línea del área activa, del nodo a la ventana. */
.il-lineas--flujo path {
  stroke: var(--il-rojo);
  stroke-width: 4;
  stroke-dasharray: 18 260;
  stroke-dashoffset: 278;
  opacity: 0;
}
.il-lineas--flujo path.activo {
  opacity: 1;
  animation: il-flujo 1.6s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
@keyframes il-flujo {
  to { stroke-dashoffset: 0; }
}
.il-nodo {
  position: absolute;
  width: 10%;
  cursor: pointer;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fff;
  color: var(--il-grafito);
  box-shadow: 0 0 0 5px rgb(255 255 255 / 0.1), 0 10px 24px -8px rgb(0 0 0 / 0.5);
  transform: translate(-50%, -50%);
  transition: box-shadow 300ms, color 300ms, transform 300ms;
}
.il-nodo svg { width: 46%; height: 46%; pointer-events: none; }
.il-nodo:hover:not(.activo) {
  color: var(--il-rojo);
  transform: translate(-50%, -50%) scale(1.05);
}
.il-nodo.activo {
  color: var(--il-rojo);
  box-shadow: 0 0 0 6px rgb(var(--il-rojo-rgb) / 0.4), 0 12px 28px -8px rgb(0 0 0 / 0.55);
  transform: translate(-50%, -50%) scale(1.1);
}
.il-ventana {
  position: absolute;
  left: 43%;
  top: 17%;
  width: 56%;
  padding: 10px 12px 12px;
  border-radius: 12px;
  background: #fff;
  color: var(--il-ink, #1a1a1a);
  box-shadow: 0 24px 48px -16px rgb(0 0 0 / 0.6);
  animation: il-flota 7s ease-in-out infinite;
}
@keyframes il-flota {
  50% { transform: translateY(-5px); }
}
.il-ventana__barra {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 10px;
}
.il-ventana__barra i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #e2e4ea;
}
.il-ventana__barra i:first-child { background: var(--il-rojo); }
.il-ventana__barra b {
  margin-left: auto;
  width: 34%;
  height: 6px;
  border-radius: 3px;
  background: #eef0f4;
}
.il-ventana__titulo {
  min-height: 1.4em;
  margin: 0 2px 8px;
  font-size: 12.5px;
  font-weight: 650;
  color: var(--il-grafito);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity 200ms;
}
.il-fila {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border: 1px solid #eef0f4;
  border-radius: 8px;
  margin-top: 6px;
}
.il-av {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--c, #fde8e8);
}
.il-fila__texto {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 4px;
}
.il-fila__texto b {
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.1;
  color: #2b313c;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.il-fila__texto i {
  display: block;
  width: 58%;
  height: 5px;
  border-radius: 3px;
  background: #eef0f4;
}
.il-pill {
  flex: none;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 9.5px;
  font-weight: 600;
  color: #146c38;
  background: #e5f5ea;
}
/* Al cambiar de mensaje: las filas entran escalonadas y el estado se enciende fila por fila. */
.il-ventana__filas.entrando .il-fila {
  animation: il-fila-entra 480ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.il-ventana__filas.entrando .il-pill {
  animation: il-pill-enciende 420ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.il-ventana__filas.entrando .il-fila:nth-child(2),
.il-ventana__filas.entrando .il-fila:nth-child(2) .il-pill { animation-delay: 110ms; }
.il-ventana__filas.entrando .il-fila:nth-child(3),
.il-ventana__filas.entrando .il-fila:nth-child(3) .il-pill { animation-delay: 220ms; }
.il-ventana__filas.entrando .il-fila .il-pill { animation-delay: 520ms; }
.il-ventana__filas.entrando .il-fila:nth-child(2) .il-pill { animation-delay: 760ms; }
.il-ventana__filas.entrando .il-fila:nth-child(3) .il-pill { animation-delay: 1000ms; }
@keyframes il-fila-entra {
  from { opacity: 0; transform: translateX(10px); }
}
@keyframes il-pill-enciende {
  from { opacity: 0; transform: scale(0.6); }
}
/* La insignia: un dato de cada área, bajo la ventana, con un punto verde que late («en vivo»). */
.il-insignia {
  position: absolute;
  left: 45%;
  top: 84%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px 7px 10px;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.1);
  border: 1px solid rgb(255 255 255 / 0.16);
  backdrop-filter: blur(6px);
  font-size: 11.5px;
  color: #fff;
  white-space: nowrap;
  animation: il-flota 7s ease-in-out -3.5s infinite;
}
.il-insignia b { font-weight: 600; }
.il-insignia span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 0 rgb(34 197 94 / 0.6);
  animation: il-late-verde 2s ease-out infinite;
}
@keyframes il-late-verde {
  70% { box-shadow: 0 0 0 8px rgb(34 197 94 / 0); }
  100% { box-shadow: 0 0 0 0 rgb(34 197 94 / 0); }
}

/* Una chispa roja que late junto a la ventana: algo pasa en este momento. */
.il-chispa {
  position: absolute;
  left: 97%;
  top: 15%;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--il-rojo);
  box-shadow: 0 0 0 0 rgb(var(--il-rojo-rgb) / 0.6);
  animation: il-late 2s ease-out infinite;
}
@keyframes il-late {
  70% { box-shadow: 0 0 0 12px rgb(var(--il-rojo-rgb) / 0); }
  100% { box-shadow: 0 0 0 0 rgb(var(--il-rojo-rgb) / 0); }
}
.il-entrada__texto {
  text-align: center;
  max-width: 40ch;
  min-height: 5.6em;
  transition: opacity 200ms, transform 200ms;
}
.il-entrada__texto.cambiando,
.il-ventana__titulo.cambiando { opacity: 0; }
.il-entrada__texto.cambiando { transform: translateY(4px); }
.il-entrada__texto h2 {
  margin: 0 0 8px;
  font-size: clamp(19px, 1.7vw, 22px);
  font-weight: 650;
  letter-spacing: -0.01em;
  color: #fff;
}
.il-entrada__texto p {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.55;
  color: rgb(255 255 255 / 0.72);
}
.il-puntos {
  display: flex;
  gap: 8px;
}
.il-puntos button {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.32);
  cursor: pointer;
  transition: width 250ms, background-color 250ms;
}
.il-puntos button[aria-pressed="true"] {
  width: 24px;
  background: var(--il-rojo);
}
.il-puntos button:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

/* ---- Pantalla de carga al entrar: el logo solo, centrado ---- */
body[data-path="login"] > .splash img {
  max-width: 200px !important;
}

/* ---- Tableta y teléfono: solo el formulario ---- */
@media (max-width: 900px) {
  .il-entrada {
    grid-template-columns: 1fr;
    width: min(480px, 100%);
    min-height: 0;
  }
  .il-entrada__panel { display: none; }
}
@media (max-width: 480px) {
  body[data-path="login"] main.container { padding: 16px; align-items: flex-start; }
  .il-entrada { border-radius: 18px; }
  .il-entrada__form { padding: 32px 22px; }
}
@media (prefers-reduced-motion: reduce) {
  .il-entrada,
  .il-entrada * { animation: none !important; transition: none !important; }
  .il-lineas--flujo path.activo { stroke-dasharray: none; opacity: 0.5; }
}

/* ---- Tema oscuro ---- */
[data-theme="dark"] body[data-path="login"] {
  --il-entrada-lienzo: #0b0c0f;
  --il-entrada-campo: #17181d;
  --il-entrada-borde: #2a2c33;
}
[data-theme="dark"] .il-entrada { box-shadow: 0 0 0 1px #24262d; }
[data-theme="dark"] .il-entrada label { color: #b7bac4; }
[data-theme="dark"] .il-entrada .btn-login-option { background: transparent; color: var(--il-ink); }
