/* ================== login-ubx.css — Login Ubuntux v2, diseño universal «IA Factory» (21-nov-2026) ==================
   Patrón de outbound.metadatape.com y HFC (/opt/hfc/css/login-ia.css): marco dividido, pasos 01/02, campos de línea,
   Figtree + Inter. Acento propio de Ubuntux: naranja Ubuntu. Tema claro por defecto; oscuro con html.ubx-noche.
   Paso 1 propio: «Mantén presionado para cargar» (outbound = bloque, HFC = cable). Panel derecho: oso Rive. */

html, body { margin: 0; padding: 0; }
#pantalla-login.li {
  --bg: #f4f2f0; --surface: #ffffff; --surface-2: #f0ece8; --surface-3: #e6e0da; --border: #dcd4cc;
  --text: #1d1a18; --muted: #6a615a; --dim: #9e948b;
  --accent: #d9480f; --accent-ink: #b73b0b; --on-accent: #ffffff;
  --good: #2f8055; --good-bg: #e1f0e6; --bad: #b8564a; --bad-bg: #f6e0dd;
  --xls: #1d6f42; --xls-2: #e3f1e8;
  --ring: color-mix(in srgb, var(--accent) 55%, transparent);
  color-scheme: light; color: var(--text);
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, Arial, sans-serif; font-size: 14px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: 24px 16px; box-sizing: border-box;
  background:
    radial-gradient(1000px 520px at 0% -10%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 62%),
    radial-gradient(800px 480px at 110% 110%, color-mix(in srgb, #772953 10%, transparent), transparent 60%),
    var(--bg);
}
html.ubx-noche #pantalla-login.li {
  --bg: #120f14; --surface: #1b171d; --surface-2: #241f27; --surface-3: #2d2730; --border: #3a333e;
  --text: #f1ebe7; --muted: #a59a95; --dim: #6f6670;
  --accent: #f26a2e; --accent-ink: #ff8a55; --on-accent: #1a0d06;
  --good: #6fae7d; --good-bg: #1b2b20; --bad: #d4786b; --bad-bg: #351e1b;
  --xls: #3fae6c; --xls-2: #18291f;
  color-scheme: dark;
}
#pantalla-login.li *, #pantalla-login.li *::before, #pantalla-login.li *::after { box-sizing: border-box; }
#pantalla-login.li button { font: inherit; }
#pantalla-login.li .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
#pantalla-login.li [hidden] { display: none !important; }

/* Marco */
.li-marco {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.02fr);
  width: 100%; max-width: 1100px; margin: 0 auto; min-height: clamp(560px, calc(100vh - 110px), 660px); padding: 10px; gap: 10px;
  background: var(--surface); border: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  border-radius: 28px; box-shadow: 0 1px 0 rgb(255 255 255 / .6) inset, 0 30px 70px -38px rgb(29 26 24 / .45);
  font-family: "Figtree", "Inter", "Segoe UI", system-ui, sans-serif;
  animation: li-subir .45s cubic-bezier(.2, .8, .2, 1) both;
}
html.ubx-noche .li-marco { box-shadow: 0 30px 80px -30px rgb(0 0 0 / .7); }
@keyframes li-subir { from { opacity: 0; transform: translateY(12px); } }
.li-col { display: flex; flex-direction: column; padding: 26px 34px 22px 38px; min-width: 0; }
.li-cabecera { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.li-der { display: flex; align-items: center; gap: 8px; }
.li-logo { display: flex; align-items: center; gap: 9px; color: var(--text); font-size: 13.5px; font-weight: 600; letter-spacing: .01em; }
.li-logo svg { display: block; flex: none; }
.li-logo small { font-weight: 400; color: var(--muted); }
.li-cuerpo { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 28px 0; max-width: 430px; width: 100%; }
.li-tema {
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border); background: transparent; color: var(--muted); transition: color .2s, background-color .2s;
}
.li-tema:hover { color: var(--text); background: var(--surface-2); }
.li-tema:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.li-tema svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; }

/* Pasos */
.li-pasos { display: flex; align-items: center; gap: 6px; margin: 0; padding: 0; list-style: none; counter-reset: paso; }
.li-pasos li {
  counter-increment: paso; display: flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 500; color: var(--dim);
  padding: 4px 10px 4px 5px; border: 1px solid var(--border); border-radius: 999px; transition: color .25s, border-color .25s;
}
.li-pasos li::before {
  content: counter(paso); display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%;
  font-size: 10.5px; background: var(--surface-2); color: var(--muted); transition: inherit;
}
.li-pasos li.on { color: var(--text); border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.li-pasos li.on::before { background: var(--accent); color: var(--on-accent); }
.li-pasos li.hecho { color: var(--good); }
.li-pasos li.hecho::before { content: "✓"; background: var(--good-bg); color: var(--good); }

.li-miga { margin: 0 0 14px; font-size: 12.5px; color: var(--muted); letter-spacing: .01em; }
.li-miga b { color: var(--accent-ink); font-weight: 500; font-variant-numeric: tabular-nums; }

.li-entra { animation: li-entra .42s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes li-entra { from { opacity: 0; transform: translateX(14px); filter: blur(3px); } }

.li-titulo { margin: 0; font-weight: 400; letter-spacing: -.025em; line-height: 1.06; color: var(--text); font-size: 44px; }
.li-sub { margin: 8px 0 28px; font-size: 14px; color: var(--muted); }

/* Campos de línea */
.li-campo { display: block; }
.li-campo + .li-campo { margin-top: 20px; }
.li-campo > span { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 2px; transition: color .2s; }
.li-campo .li-ctl { position: relative; }
.li-campo input {
  width: 100%; height: 40px; padding: 0; border: 0; border-radius: 0; background: transparent; color: var(--text);
  font: inherit; font-size: 15px; letter-spacing: .01em; outline: none; box-shadow: none;
  background-image: linear-gradient(var(--accent), var(--accent)), linear-gradient(var(--border), var(--border));
  background-size: 0% 2px, 100% 1px; background-position: 0 100%, 0 100%; background-repeat: no-repeat;
  transition: background-size .35s cubic-bezier(.2, .8, .2, 1);
}
.li-campo input#inp-pass { padding-right: 40px; }
.li-campo input::placeholder { color: var(--dim); opacity: .8; }
.li-campo input:focus { background-size: 100% 2px, 100% 1px; }
.li-campo input[aria-invalid="true"] { background-image: linear-gradient(var(--bad), var(--bad)), linear-gradient(var(--bad), var(--bad)); }
.li-campo input:disabled { opacity: .6; }
.li-campo:focus-within > span { color: var(--accent-ink); }
.li-ojo {
  position: absolute; right: -6px; top: 50%; transform: translateY(-50%); display: grid; place-items: center;
  width: 34px; height: 34px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); cursor: pointer;
}
.li-ojo:hover { color: var(--text); background: var(--surface-2); }
.li-ojo:focus-visible { outline: 2px solid var(--ring); }
.li-ojo svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.li-mayus { display: block; margin-top: 6px; font-size: 12px; color: var(--accent-ink); }

.li-recordar { display: flex; width: fit-content; align-items: center; gap: 8px; margin-top: 20px; font-size: 13px; color: var(--muted); cursor: pointer; user-select: none; }
.li-recordar input {
  appearance: none; -webkit-appearance: none; margin: 0; width: 16px; height: 16px; flex: none; border-radius: 4px;
  border: 1px solid color-mix(in srgb, var(--text) 35%, var(--border)); background: var(--surface); cursor: pointer;
  display: grid; place-items: center; transition: background-color .15s, border-color .15s;
}
.li-recordar input::after { content: ""; width: 8px; height: 4px; border: 2px solid var(--on-accent); border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px) scale(0); transition: transform .15s; }
.li-recordar input:checked { background: var(--accent); border-color: var(--accent); }
.li-recordar input:checked::after { transform: rotate(-45deg) translate(1px, -1px) scale(1); }
.li-recordar input:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }

#pantalla-login.li .login-err { display: none; margin: 12px 0 0; font-size: 13px; color: var(--bad); gap: 6px; align-items: baseline; }
#pantalla-login.li .login-err.show { display: flex; animation: li-fundido .2s ease-out both; }
#pantalla-login.li .login-err::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--bad); transform: translateY(-1px); }
@keyframes li-fundido { from { opacity: 0; } }

.li-boton {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; margin-top: 18px;
  height: 46px; padding: 0 22px; min-width: 150px; border-radius: 12px; border: 0; cursor: pointer;
  background: var(--text); color: var(--surface); font-size: 14.5px; font-weight: 500;
  box-shadow: 0 10px 22px -12px rgb(29 26 24 / .7); transition: transform .15s ease, background-color .3s;
}
.li-boton svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s cubic-bezier(.2, .8, .2, 1); }
.li-boton:hover:not(:disabled) svg { transform: translateX(3px); }
.li-boton:active:not(:disabled) { transform: translateY(1px); }
.li-boton:focus-visible { outline: 2px solid var(--ring); outline-offset: 3px; }
.li-boton:disabled { cursor: default; opacity: .85; }
.li-boton.ok { background: var(--good); color: #fff; opacity: 1; }
html.ubx-noche .li-boton { background: var(--accent); color: var(--on-accent); }
html.ubx-noche .li-boton.ok { background: var(--good); color: #fff; }
.li-spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: li-gira .7s linear infinite; }
@keyframes li-gira { to { transform: rotate(360deg); } }
.li-nota { display: flex; align-items: center; gap: 6px; margin: 16px 0 0; font-size: 12px; color: var(--muted); }
.li-nota svg { width: 14px; height: 14px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.li-sacude-0 { animation: li-sacude-0 .42s cubic-bezier(.36, .07, .19, .97) both; }
.li-sacude-1 { animation: li-sacude-1 .42s cubic-bezier(.36, .07, .19, .97) both; }
@keyframes li-sacude-0 { 10%, 90% { transform: translateX(-1px) } 20%, 80% { transform: translateX(3px) } 30%, 50%, 70% { transform: translateX(-6px) } 40%, 60% { transform: translateX(6px) } }
@keyframes li-sacude-1 { 10%, 90% { transform: translateX(-1px) } 20%, 80% { transform: translateX(3px) } 30%, 50%, 70% { transform: translateX(-6px) } 40%, 60% { transform: translateX(6px) } }

/* =====================================================================================================
   Paso 1 · «Mantén presionado para cargar»
   ===================================================================================================== */
.vb-cab { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.vb-cab h2 { margin: 0; font-size: 26px; font-weight: 400; letter-spacing: -.025em; line-height: 1.1; color: var(--text); }
.vb-cab p { margin: 2px 0 0; font-size: 13.5px; color: var(--muted); transition: color .2s; }
.vb-candado {
  flex: none; display: grid; place-items: center; width: 50px; height: 50px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  box-shadow: 0 1px 0 rgb(255 255 255 / .7) inset, 0 6px 14px -8px rgb(29 26 24 / .35);
  transition: color .3s, border-color .3s, transform .3s cubic-bezier(.3, 1.6, .5, 1);
}
.vb-candado svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.vb-candado .abierto { display: none; }
.vb-listo .vb-candado { color: var(--good); border-color: color-mix(in srgb, var(--good) 45%, var(--border)); transform: rotate(-8deg) scale(1.05); }
.vb-listo .vb-candado .cerrado { display: none; }
.vb-listo .vb-candado .abierto { display: block; }
.vb-fallo .vb-cab p { color: var(--bad); }
.vb-listo .vb-cab p { color: var(--good); }

.cg-escena { display: block; width: 100%; height: auto; overflow: visible; user-select: none; -webkit-user-select: none; }
.vb-fallo .cg-escena { animation: li-sacude-0 .42s cubic-bezier(.36, .07, .19, .97) both; }

/* hoja Excel */
.cg-hoja { filter: drop-shadow(0 10px 14px rgb(29 26 24 / .12)); }
html.ubx-noche .cg-hoja { filter: drop-shadow(0 10px 16px rgb(0 0 0 / .45)); }
.cg-papel { fill: var(--surface); stroke: var(--border); stroke-width: 1.2; }
.cg-doblez { fill: var(--surface-3); }
.cg-cabeza { fill: var(--xls); }
.cg-x { font: 800 11px "Figtree", Inter, sans-serif; fill: #fff; }
.cg-nombre { font: 600 8.5px "Figtree", Inter, sans-serif; fill: #fff; letter-spacing: .02em; }
.cg-fila { fill: var(--xls-2); transition: opacity .18s, transform .18s; transform-box: fill-box; transform-origin: right center; }
.cg-fila.ida { opacity: .18; transform: scaleX(.6); }
.cg-celda { fill: color-mix(in srgb, var(--xls) 38%, transparent); transition: opacity .18s; }
.cg-fila.ida + .cg-celda, .cg-celda.ida { opacity: .2; }
.cg-etq { font: 600 7.5px "Figtree", Inter, sans-serif; letter-spacing: .1em; fill: var(--dim); }

/* conducto */
.cg-tubo { fill: none; stroke: var(--surface-3); stroke-width: 10; stroke-linecap: round; }
.cg-tubo-l { fill: none; stroke: var(--border); stroke-width: 1; stroke-dasharray: 3 4; }
.cg-pildora { fill: var(--accent); }
.vb-listo .cg-pildora { fill: var(--good); }

/* cilindro de base de datos */
.cg-bd { filter: drop-shadow(0 12px 16px rgb(29 26 24 / .14)); }
html.ubx-noche .cg-bd { filter: drop-shadow(0 12px 18px rgb(0 0 0 / .5)); }
.cg-cuerpo { fill: var(--surface); stroke: var(--border); stroke-width: 1.2; }
.cg-tapa { fill: var(--surface-2); stroke: var(--border); stroke-width: 1.2; }
.cg-boca { fill: var(--surface-3); }
.cg-nivel { fill: color-mix(in srgb, var(--accent) 78%, transparent); transition: fill .3s; }
.cg-ola { fill: color-mix(in srgb, var(--accent) 55%, transparent); transition: fill .3s; }
.cg-aro { fill: none; stroke: color-mix(in srgb, var(--border) 70%, transparent); stroke-width: 1; }
.vb-listo .cg-nivel { fill: color-mix(in srgb, var(--good) 80%, transparent); }
.vb-listo .cg-ola { fill: color-mix(in srgb, var(--good) 55%, transparent); }
.vb-listo .cg-bd { filter: drop-shadow(0 0 14px color-mix(in srgb, var(--good) 55%, transparent)); }
.cg-pct { font: 600 19px "Figtree", Inter, sans-serif; fill: var(--text); font-variant-numeric: tabular-nums; transition: opacity .2s; }
.cg-filas { font: 500 8px "Figtree", Inter, sans-serif; fill: var(--muted); font-variant-numeric: tabular-nums; }
/* copia blanca de los textos, recortada al nivel del líquido */
.cg-sobre .cg-pct, .cg-sobre .cg-filas { fill: #fff; }
.cg-check { fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 30; stroke-dashoffset: 30; }
.vb-listo .cg-check { stroke-dashoffset: 0; transition: stroke-dashoffset .4s .1s ease-out; }
.cg-check-bg { fill: var(--good); opacity: 0; transform-box: fill-box; transform-origin: center; transform: scale(.4); }
.vb-listo .cg-check-bg { opacity: 1; transform: scale(1); transition: opacity .2s, transform .35s cubic-bezier(.3, 1.6, .5, 1); }

/* etapas STG → SP → TBL */
.cg-etapas { display: flex; align-items: center; gap: 0; margin: 10px 0 0; padding: 0; list-style: none; font-size: 12px; font-weight: 600; letter-spacing: .06em; color: var(--dim); }
.cg-etapas li { display: flex; align-items: center; gap: 6px; transition: color .25s; }
.cg-etapas li + li::before { content: ""; width: 38px; height: 2px; margin: 0 10px; border-radius: 2px; background: var(--surface-3); transition: background-color .25s; }
.cg-etapas li i { width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--border); transition: background-color .25s, border-color .25s, box-shadow .25s; }
.cg-etapas li.on { color: var(--text); }
.cg-etapas li.on::before { background: var(--accent); }
.cg-etapas li.on i { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.vb-listo .cg-etapas li { color: var(--good); }
.vb-listo .cg-etapas li::before { background: var(--good); }
.vb-listo .cg-etapas li i { background: var(--good); border-color: var(--good); box-shadow: 0 0 0 3px color-mix(in srgb, var(--good) 22%, transparent); }

/* botón «Mantén presionado» con relleno de progreso */
.cg-boton {
  position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; width: 100%; height: 52px; margin-top: 16px;
  border-radius: 14px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); cursor: pointer;
  font-size: 14.5px; font-weight: 500; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  transition: transform .12s ease, border-color .2s, box-shadow .2s;
}
.cg-boton:hover:not(:disabled) { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.cg-boton:focus-visible { outline: 2px solid var(--ring); outline-offset: 3px; }
.cg-boton.apretado { transform: scale(.985); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent); }
.cg-relleno { position: absolute; inset: 0; transform-origin: left center; transform: scaleX(var(--p, 0)); background: var(--accent); }
.vb-listo .cg-relleno { background: var(--good); }
.cg-txt { position: relative; display: inline-flex; align-items: center; gap: 8px; z-index: 1; }
.cg-txt-claro {
  position: absolute; inset: 0; justify-content: center; color: var(--on-accent);
  clip-path: inset(0 calc((1 - var(--p, 0)) * 100%) 0 0);
}
.cg-txt svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cg-boton.apretado .cg-txt svg { animation: cg-sube .6s ease-in-out infinite; }
@keyframes cg-sube { 50% { transform: translateY(-3px); } }
.vb-listo .cg-boton { color: #fff; border-color: var(--good); cursor: default; }
.vb-listo .cg-boton .cg-txt { color: #fff; }
.vb-listo .cg-txt-claro { clip-path: none; }
.cg-ayuda { margin: 8px 0 0; text-align: center; font-size: 12px; color: var(--dim); transition: opacity .2s; }
.vb-listo .cg-ayuda { opacity: 0; }

/* =====================================================================================================
   Panel del oso (Rive)
   ===================================================================================================== */
.li-oso { position: relative; overflow: hidden; border-radius: 20px; background: #d6e2ea; isolation: isolate; min-height: 100%; }
.li-oso canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.li-chips { position: absolute; left: 16px; top: 16px; right: 16px; z-index: 2; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.li-chips li {
  font-size: 11.5px; font-weight: 500; color: #fff; padding: 4px 10px; border-radius: 999px;
  background: rgb(10 20 40 / .34); border: 1px solid rgb(255 255 255 / .35); backdrop-filter: blur(8px) saturate(140%);
  text-shadow: 0 1px 2px rgb(0 0 0 / .25);
}
.li-firma {
  position: absolute; left: 14px; bottom: 14px; z-index: 2; display: flex; align-items: center; gap: 8px;
  padding: 5px 12px 5px 5px; border-radius: 12px; color: #fff;
  background: rgb(10 16 30 / .5); border: 1px solid rgb(255 255 255 / .18); backdrop-filter: blur(10px) saturate(140%);
}
.li-firma-logo { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: #fff; padding: 2px; }
.li-firma span:last-child { display: flex; flex-direction: column; line-height: 1.2; }
.li-firma b { font-size: 11.5px; font-weight: 500; }
.li-firma small { font-size: 10px; opacity: .78; }

/* Celular: el oso arriba, el formulario abajo */
@media (max-width: 860px) {
  #pantalla-login.li { justify-content: flex-start; padding: 12px; }
  .li-marco { grid-template-columns: 1fr; min-height: 0; border-radius: 24px; }
  .li-oso { order: -1; height: 250px; min-height: 0; border-radius: 16px; }
  .li-chips { display: none; }
  .li-firma { left: 10px; bottom: 10px; }
  .li-col { padding: 18px 14px 20px; }
  .li-cuerpo { max-width: none; padding: 22px 0 8px; }
  .li-titulo { font-size: 36px; }
}
@media (max-width: 420px) {
  .li-pasos li { font-size: 0; padding: 3px; gap: 0; }
  .li-pasos li::before { font-size: 10.5px; }
  .li-logo small { display: none; }
  .cg-etapas li + li::before { width: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  .li-marco, .li-entra, .li-sacude-0, .li-sacude-1, .vb-fallo .cg-escena, .cg-boton.apretado .cg-txt svg { animation: none !important; }
}
