/* Sistema Thelsa — entrada general (index.html). Como la muestra de diseño (16-oct-2026, docs/diseno/muestras/2026-10-16_entrada.html):
   entrar con la marca de un lado y el formulario del otro, y escoger módulo en una sola lista. Todo lo de la entrada vive aquí
   (assets/css/* es del programador). Colores con variables de comun/diseno.css, para que el modo oscuro lo resuelva solo;
   el panel de la marca es marino en los dos modos, por eso lleva blanco escrito a mano. */

/* ---------- Entrar, nueva contraseña y primera vez ---------- */
/* boot() las muestra con display:flex; aquí se quita el centrado de la tarjeta de antes (assets/css/overlays.css) */
#loginScreen, #recoverScreen, #activarScreen { min-height: 100vh; min-height: 100dvh; align-items: stretch; justify-content: flex-start;
  background: var(--bg-card); }
.en-marca { flex: 0 0 calc(100% * 5 / 11); min-width: 0; background: var(--barra); color: #fff; padding: 48px 56px; display: flex; flex-direction: column;
  justify-content: space-between; gap: 24px; }
.en-marca-logo { height: 52px; width: auto; align-self: flex-start; display: block; }
.en-marca-nombre { font-weight: 650; font-size: 24px; letter-spacing: -.02em; color: #fff; }
.en-raya { width: 44px; height: 3px; border-radius: 2px; background: #d81b33; margin-bottom: 18px; }
.en-marca h2 { font-size: 30px; font-weight: 650; letter-spacing: -.02em; line-height: 1.15; max-width: 420px; color: #fff; }
.en-marca p { color: rgba(255, 255, 255, .78); font-size: 14px; margin-top: 10px; max-width: 400px; }
.en-pie { color: rgba(255, 255, 255, .7); font-size: 12.5px; }

.en-form { flex: 1 1 0; min-width: 0; display: flex; align-items: center; justify-content: center; padding: 32px; background: var(--bg-card); }
.en-caja { width: 100%; max-width: 380px; }
.en-caja h1 { font-size: 26px; font-weight: 650; letter-spacing: -.015em; color: var(--ink); margin-bottom: 6px; }
.en-bajada { color: var(--ink-soft); margin-bottom: 24px; }
.en-bajada b { color: var(--ink); font-weight: 600; }
.en-campos { display: grid; gap: 14px; }
.en-campo label { display: block; font-size: 13px; font-weight: 550; color: var(--ink-soft); margin-bottom: 6px; }
.en-campo input { height: 40px; padding: 0 12px; font-size: 14px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--bg-card);
  color: var(--ink); transition: border-color var(--t-rapido), box-shadow var(--t-rapido); }
.en-campo input::placeholder { color: var(--ink-faint); }
.en-campo input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--info-bg); }
/* El aviso junto al campo, al momento */
.en-campo.error input { border-color: var(--err) !important; }
.en-msg { display: none; margin-top: 6px; color: var(--err); font-size: 12.5px; }
.en-campo.error .en-msg { display: block; animation: ui-entra var(--t-medio) var(--curva); }
/* "Mostrar" dentro del campo de la contraseña */
.en-con-ojo { position: relative; }
.en-con-ojo input { padding-right: 76px; }
.en-ojo { position: absolute; right: 6px; top: 5px; height: 30px; padding: 0 8px; border: 0; border-radius: var(--r-sm); background: transparent;
  color: var(--ink-faint); font: inherit; font-size: 12.5px; font-weight: 550; cursor: pointer; }
.en-ojo:hover { color: var(--ink); }
.en-boton { width: 100%; min-height: 42px; font-size: 14px; margin-top: 4px; justify-content: center; }
.en-boton:disabled { opacity: 1; cursor: progress; }
.en-giro { width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; flex: none;
  animation: en-gira .7s linear infinite; }
@keyframes en-gira { to { transform: rotate(360deg); } }
/* Las dos ligas como texto, una a cada lado */
.en-ligas { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 16px; font-size: 13px; }
.en-liga { color: var(--brand); text-decoration: none; font-weight: 550; }
.en-liga:hover { text-decoration: underline; }
.en-ayuda { margin-top: 10px; font-size: 12.5px; color: var(--ink-faint); }
/* Lo que contesta el sistema (contraseña equivocada, sin conexión, correo enviado) */
.en-err, .en-ok { margin-top: 16px; padding: 9px 12px; border-radius: var(--r-sm); font-size: 13px; line-height: 1.45;
  animation: ui-entra var(--t-medio) var(--curva); }
.en-err { background: var(--err-bg); color: var(--err); }
.en-err:empty { display: none; }
.en-ok { background: var(--ok-bg); color: var(--ok); }

/* ---------- Escoger módulo ---------- */
.en-main { max-width: 988px; margin: 0 auto; padding: 28px 24px 48px; }   /* 940 de contenido, como la muestra */
.en-titulo { font-size: 26px; font-weight: 650; color: var(--ink); letter-spacing: -.015em; }
.en-sub { color: var(--ink-soft); font-size: 14px; margin: 4px 0 22px; }

/* Un renglón por módulo en una sola superficie, en lugar de tarjetas iguales */
.en-modulos { display: flex; flex-direction: column; background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.en-modulos[hidden] { display: none; }
.en-modulo { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px 16px;
  border-top: 1px solid var(--line-soft); color: var(--ink); text-decoration: none; transition: background var(--t-rapido); }
.en-modulo:first-child { border-top: 0; }
.en-modulo:hover { background: var(--bg-hover); }
.en-modulo:focus-visible { outline-offset: -2px !important; }
.en-modulo .en-ico { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  background: var(--info-bg); color: var(--marca-titulo); }
.en-modulo .en-ico .ico { width: 20px; height: 20px; }
.en-modulo .en-txt { min-width: 0; }
.en-modulo .en-nombre { display: block; font-weight: 600; font-size: 15px; }
.en-modulo .en-desc { display: block; margin-top: 2px; font-size: 13px; color: var(--ink-soft); line-height: 1.4; }
.en-modulo .en-flecha { display: inline-flex; color: var(--ink-faint); transition: transform var(--t-rapido), color var(--t-rapido); }
.en-modulo .en-flecha .ico { width: 16px; height: 16px; }
.en-modulo:hover .en-flecha { transform: translateX(3px); color: var(--brand); }

/* Sin módulos: el aviso en una superficie con su ícono (sin raya de color a la izquierda) */
.en-vacio { align-items: flex-start; gap: 10px; background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 16px 18px; color: var(--ink); font-size: 14px; line-height: 1.55; }
.en-vacio .ico { width: 18px; height: 18px; color: var(--warn); flex: none; margin-top: 2px; }

/* ---------- Teléfono: el logotipo arriba y el formulario a todo lo ancho ---------- */
@media (max-width: 640px) {
  #loginScreen, #recoverScreen, #activarScreen { flex-direction: column; }
  .en-marca { flex: none; padding: 20px; flex-direction: row; align-items: center; }
  .en-marca-txt, .en-pie { display: none; }
  .en-marca-logo { height: 38px; }
  .en-form { flex: 1 0 auto; align-items: flex-start; padding: 28px 20px; }
  .en-caja { max-width: none; }
  .en-campo input { font-size: 16px; }   /* con 16 px el iPhone no hace zoom al enfocar */

  .en-main { padding: 20px 16px 40px; }
  .en-modulo { grid-template-columns: 36px minmax(0, 1fr) auto; gap: 12px; padding: 12px; }
  .en-modulo .en-ico { width: 36px; height: 36px; }
}

/* ---------- Escena viva del panel de la marca (13-nov-2026, entrada/escena.js) ----------
   México con puntos, las sucursales encendiéndose y rutas con un pulso que viaja; luces que se mueven despacio en el fondo.
   El panel sigue siendo marino en claro y en oscuro, por eso los colores van escritos a mano. */
.en-marca { position: relative; overflow: hidden; isolation: isolate;
  background: radial-gradient(90% 70% at 100% 0%, #0b4a8f 0%, rgba(11, 74, 143, 0) 60%), linear-gradient(165deg, #002e5c 0%, #01203f 100%); }
.en-marca > :not(.en-escena) { position: relative; z-index: 1; }
.en-escena { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.en-luz { position: absolute; border-radius: 50%; filter: blur(70px); will-change: transform; }
.en-luz.a { width: 55%; aspect-ratio: 1; top: 4%; right: -14%; background: #1f6fd1; opacity: .5; animation: en-flota-a 19s ease-in-out infinite alternate; }
.en-luz.b { width: 38%; aspect-ratio: 1; bottom: -12%; left: 22%; background: #d81b33; opacity: .2; animation: en-flota-b 23s ease-in-out infinite alternate; }
.en-luz.c { width: 30%; aspect-ratio: 1; top: 38%; left: -10%; background: #2a8cff; opacity: .22; animation: en-flota-c 27s ease-in-out infinite alternate; }
@keyframes en-flota-a { to { transform: translate(-18%, 22%) scale(1.15); } }
@keyframes en-flota-b { to { transform: translate(30%, -26%) scale(.9); } }
@keyframes en-flota-c { to { transform: translate(40%, -30%) scale(1.2); } }
/* Una rejilla muy tenue, más clara al centro, para que el panel tenga profundidad */
.en-rejilla { position: absolute; inset: 0; opacity: .5;
  background-image: linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px);
  background-size: 44px 44px; -webkit-mask-image: radial-gradient(70% 60% at 60% 45%, #000 0%, transparent 75%);
  mask-image: radial-gradient(70% 60% at 60% 45%, #000 0%, transparent 75%); }

/* El mapa: a la derecha y un poco arriba, para que el texto quede sobre el Pacífico */
/* El logotipo arriba, el texto abajo y el mapa en medio, sin taparse */
.en-marca { justify-content: flex-start; }
.en-marca-txt { margin-top: auto; }
.en-mapa { position: absolute; width: min(94%, (100vh - 430px) * 1.52, 900px); right: 3%; top: 206px; overflow: visible;
  animation: en-mapa-llega 1.4s var(--curva) both; }
@keyframes en-mapa-llega { from { opacity: 0; transform: translateY(12px) scale(.97); } }
.en-pais { fill: rgba(255, 255, 255, .025); stroke: rgba(160, 200, 255, .22); stroke-width: 1; stroke-linejoin: round; }
.en-puntos { opacity: .2; }
.en-ruta { fill: none; stroke: rgba(150, 195, 255, .35); stroke-width: 1.1; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1;
  animation: en-traza 1.6s var(--curva) forwards; animation-delay: calc(.5s + var(--i) * 70ms); }
@keyframes en-traza { to { stroke-dashoffset: 0; } }
.en-viaje { opacity: 0; }
.en-pulso { fill: #fff; }
.en-estela { fill: #6fb2ff; opacity: .35; filter: blur(2px); }
/* Las plazas: un punto que respira y, la que toca, se enciende con su nombre */
.en-suc .en-nucleo { fill: #cfe3ff; transform-box: fill-box; transform-origin: center; transition: fill .4s ease, transform .4s var(--curva);
  animation: en-plaza-llega .5s var(--curva) both; animation-delay: calc(.3s + var(--i) * 60ms); }
@keyframes en-plaza-llega { from { transform: scale(0); } }
.en-suc .en-onda { fill: none; stroke: #8cc2ff; stroke-width: 1.2; opacity: 0; transform-box: fill-box; transform-origin: center;
  animation: en-onda 3.2s ease-out infinite; animation-delay: calc(var(--i) * -.47s); }
@keyframes en-onda { 0% { transform: scale(.3); opacity: .55; } 80%, 100% { transform: scale(1.6); opacity: 0; } }
.en-suc.activa .en-nucleo { fill: #fff; transform: scale(1.5); }
.en-suc.activa .en-onda { stroke: #ff5a6e; animation-duration: 1.6s; }
.en-etq { opacity: 0; transform: translateY(4px); transform-box: fill-box; transition: opacity .35s ease, transform .35s var(--curva); }
.en-etq rect { fill: rgba(5, 25, 52, .78); stroke: rgba(255, 255, 255, .28); stroke-width: 1; }
.en-etq text { fill: #fff; font: 600 11.5px Geist, system-ui, sans-serif; letter-spacing: -.01em; }
.en-suc.activa .en-etq { opacity: 1; transform: none; }

/* Luz que sigue al cursor (como el portafolio de Jonas): azul claro sobre el panel de la marca y un tono de la marca sobre el
   formulario; el mapa se mueve apenas con el cursor para dar profundidad. Las coordenadas las pone escena.js (--fx, --fy, --px, --py). */
.en-foco { position: absolute; inset: 0; opacity: 0; transition: opacity .5s ease;
  background: radial-gradient(520px circle at var(--fx, 50%) var(--fy, 40%), rgba(130, 190, 255, .34), rgba(120, 180, 255, .1) 38%, transparent 70%); }
.en-con-foco .en-foco { opacity: 1; }
.en-mapa { translate: var(--px, 0) var(--py, 0); transition: translate .6s cubic-bezier(.2, .7, .2, 1); }
.en-form::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .5s ease;
  background: radial-gradient(600px circle at var(--fx, 50%) var(--fy, 40%), color-mix(in srgb, var(--brand) 16%, transparent), transparent 65%); }
.en-con-foco .en-form::before { opacity: 1; }
.en-caja { position: relative; z-index: 1; }

/* El logotipo y el texto entran con la escena */
/* El logotipo MAX directo sobre el azul, sin cuadro blanco (13-nov-2026): el perro sin fondo con un halo de luz detrás y
   "MAX / THELSA" en blanco, las mismas piezas de la barra azul (branding/max). */
.en-logo { display: flex; align-items: center; gap: 14px; align-self: flex-start; animation: en-cae .7s var(--curva) both; }
.en-logo-perro { position: relative; width: 104px; height: 104px; flex: none; }
.en-logo-perro::before { content: ""; position: absolute; inset: -18%; border-radius: 50%;
  background: radial-gradient(circle, rgba(140, 194, 255, .38) 0%, rgba(140, 194, 255, .12) 45%, rgba(140, 194, 255, 0) 70%);
  animation: en-halo 4.8s ease-in-out infinite; }
@keyframes en-halo { 50% { transform: scale(1.1); opacity: .7; } }
.en-logo-perro img { position: relative; display: block; width: 100%; height: 100%; filter: drop-shadow(0 10px 18px rgba(0, 10, 30, .5));
  transform-origin: 50% 80%; transition: transform .45s var(--curva); }
.en-logo:hover .en-logo-perro img { transform: rotate(-7deg) scale(1.05); }
.en-logo-letras { display: block; height: 60px; width: auto; filter: drop-shadow(0 2px 14px rgba(0, 20, 50, .55));
  animation: en-letras .8s var(--curva) .2s both; }
@keyframes en-letras { from { opacity: 0; transform: translateX(-10px); } }
/* Brillo al pasar el cursor: una franja de luz recorre solo la silueta del perro y de las letras (la máscara es la misma
   imagen), el halo se aviva y salen dos destellos. */
.en-logo-letras-caja { position: relative; display: block; animation: en-letras .8s var(--curva) .2s both; }
.en-logo-letras-caja .en-logo-letras { animation: none; }
.en-brillo { position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background: linear-gradient(105deg, transparent 38%, rgba(140, 194, 255, .9) 46%, #fff 50%, rgba(140, 194, 255, .9) 54%, transparent 62%) 160% 0 / 260% 100% no-repeat;
  -webkit-mask: var(--mascara) center / 100% 100% no-repeat; mask: var(--mascara) center / 100% 100% no-repeat; }
.en-logo-perro .en-brillo { --mascara: url(../branding/max/max-icono-256.png); }
.en-logo-letras-caja .en-brillo { --mascara: url(../branding/max/max-letras-blanco-160.png); }
.en-logo:hover .en-brillo { animation: en-barrido .9s cubic-bezier(.3, .6, .3, 1) both; }
.en-logo:hover .en-logo-letras-caja .en-brillo { animation-delay: .14s; }
@keyframes en-barrido { 0% { opacity: 1; background-position: 160% 0; } 85% { opacity: 1; } 100% { opacity: 0; background-position: -60% 0; } }
.en-logo-perro::before { transition: filter .4s ease; }
.en-logo:hover .en-logo-perro::before { filter: brightness(1.8) saturate(1.2); }
.en-logo-letras { transition: filter .4s ease; }
.en-logo:hover .en-logo-letras { filter: drop-shadow(0 0 10px rgba(140, 194, 255, .75)) drop-shadow(0 2px 14px rgba(0, 20, 50, .55)); }
.en-chispa { position: absolute; width: 18px; height: 18px; fill: #fff; opacity: 0; transform: scale(0) rotate(0deg); pointer-events: none;
  filter: drop-shadow(0 0 6px rgba(140, 194, 255, .95)); }
.en-chispa.a { top: 2%; right: -6%; }
.en-chispa.b { bottom: 18%; left: -8%; width: 12px; height: 12px; }
.en-logo:hover .en-chispa { animation: en-chispa .9s var(--curva) both; }
.en-logo:hover .en-chispa.b { animation-delay: .22s; }
@keyframes en-chispa { 0% { opacity: 0; transform: scale(0) rotate(0deg); } 45% { opacity: 1; transform: scale(1.1) rotate(70deg); }
  100% { opacity: 0; transform: scale(.4) rotate(140deg); } }
@keyframes en-cae { from { opacity: 0; transform: translateY(-14px) scale(.96); } }
.en-marca-txt { animation: en-sube .7s var(--curva) .25s both; }
.en-marca .en-raya { animation: en-raya .8s var(--curva) .5s both; }
@keyframes en-raya { from { width: 0; } }
@keyframes en-sube { from { opacity: 0; transform: translateY(14px); } }
.en-marca h2 { font-size: 34px; text-shadow: 0 2px 24px rgba(0, 20, 50, .5); }
/* "Una sola cuenta para" + el módulo que va cambiando */
.en-marca .en-frase { font-size: 16px; color: rgba(255, 255, 255, .82); margin-top: 12px; max-width: none; display: flex; flex-wrap: wrap;
  align-items: baseline; column-gap: .3em; }
.en-rota { position: relative; display: inline-grid; overflow: hidden; height: 1.5em; vertical-align: bottom; }
.en-rota-pal { grid-area: 1 / 1; color: #fff; font-weight: 650; white-space: nowrap; line-height: 1.5;
  background: linear-gradient(transparent 84%, #d81b33 84%, #d81b33 94%, transparent 94%); }
.en-rota-pal.entra { animation: en-pal-entra .55s var(--curva) both; }
.en-rota-pal.sale { animation: en-pal-sale .45s ease-in both; }
@keyframes en-pal-entra { from { transform: translateY(100%); opacity: 0; } }
@keyframes en-pal-sale { to { transform: translateY(-100%); opacity: 0; } }
.en-dato { display: inline-flex; align-items: center; gap: 8px; margin-top: 18px; padding: 6px 12px 6px 10px; border-radius: 999px; font-size: 12.5px;
  color: rgba(255, 255, 255, .78); background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .14);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.en-dato-punto { width: 7px; height: 7px; border-radius: 50%; background: #ff5a6e; box-shadow: 0 0 0 0 rgba(255, 90, 110, .6); animation: en-late 1.6s ease-out infinite; }
@keyframes en-late { 70%, 100% { box-shadow: 0 0 0 7px rgba(255, 90, 110, 0); } }
.en-dato-sep { opacity: .5; }
.en-dato-plaza { color: #fff; font-weight: 600; }
.en-dato-plaza.cambia { animation: en-sube .4s var(--curva); }

/* El formulario entra en escalera y el botón responde al pasar el cursor */
.en-form { position: relative; overflow: hidden;
  background: radial-gradient(60% 50% at 50% 42%, color-mix(in srgb, var(--brand) 7%, transparent), transparent 70%), var(--bg-card); }
.en-caja > * { animation: en-sube .6s var(--curva) both; }
.en-caja > :nth-child(2) { animation-delay: .06s; }
.en-caja > :nth-child(3) { animation-delay: .12s; }
.en-caja > :nth-child(4) { animation-delay: .18s; }
.en-caja > :nth-child(n+5) { animation-delay: .24s; }
.en-boton { position: relative; overflow: hidden; transition: transform var(--t-rapido) var(--curva), box-shadow var(--t-rapido) ease, background var(--t-rapido); }
.en-boton:not(:disabled):hover { transform: translateY(-1px); box-shadow: 0 10px 24px -12px color-mix(in srgb, var(--marca-boton) 80%, transparent); }
.en-boton:not(:disabled):active { transform: translateY(0); }
.en-boton::after { content: ""; position: absolute; top: 0; bottom: 0; left: -40%; width: 30%; transform: skewX(-20deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .28), transparent); opacity: 0; }
.en-boton:not(:disabled):hover::after { animation: en-brillo .8s ease; }
@keyframes en-brillo { from { left: -40%; opacity: 1; } to { left: 120%; opacity: 1; } }
.en-campo input:focus { box-shadow: 0 0 0 4px var(--info-bg); }

@media (max-width: 1100px) and (min-width: 641px) {
  .en-marca { padding: 40px; }
  .en-mapa { width: min(100%, (100vh - 420px) * 1.52); right: 0; top: 180px; }
  .en-marca h2 { font-size: 30px; }
}
@media (max-width: 640px) {
  .en-mapa, .en-rejilla, .en-dato { display: none; }
  .en-logo { gap: 8px; }
  .en-logo-perro { width: 52px; height: 52px; }
  .en-logo-letras { height: 32px; }
  .en-luz.a { width: 70%; top: -60%; }
  .en-luz.b, .en-luz.c { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .en-escena *, .en-logo, .en-logo-letras, .en-logo-letras-caja, .en-logo-perro::before, .en-brillo, .en-chispa, .en-marca-txt, .en-marca .en-raya, .en-caja > *, .en-dato-plaza, .en-dato-punto { animation: none !important; }
  .en-ruta { stroke-dashoffset: 0; }
  .en-viaje { display: none; }
}
