/* ════════════════════════════════════════════════════
   PHSICO STUDIOS — login.css
   Panel de Login (cliente) y Code (god) que baja con el menú.
   Diseño: 02_Web/Login.ai — artboards Login/Desk (1440) y Login/Mobile (390).
   Tipografía: la del form de hitos (.label, .fm-t); Illustrator trabaja en pt,
   los tamaños de acá son los del sistema (px).
   Medidas: alto del panel (sin la tira del menú) 80px desktop / 130px mobile;
   todos los estados miden lo mismo, solo cambia el contenido.
════════════════════════════════════════════════════ */

:root { --lg-h: 80px; }
@media (max-width: 768px) { :root { --lg-h: 170px; } }

#lg {
  position: fixed; top: 0; left: 0; right: 0; height: var(--lg-h);
  z-index: 190;                       /* debajo de la tira del menú (200) y del header (300) */
  display: none; pointer-events: none;
  color: var(--middle-1); font-family: "panel-mono", monospace;
}
#lg.on { display: block; }
#lg *, #lg *::before, #lg *::after { box-sizing: border-box; }
#lg ::selection { background: var(--special-1); color: var(--middle-2); }

/* cada estado es una vista del mismo ancho que su diseño */
.lg-view { position: absolute; top: 0; bottom: 0; left: 50%; width: 740px; max-width: calc(100% - 30px); transform: translateX(-50%); pointer-events: none; }
.lg-view > *, .lg-view form { pointer-events: auto; }
.lg-code { width: 380px; }
.lg-a { opacity: 0; }                 /* entran animados; el JS les da opacidad 1 al terminar */

/* ── tag (LOGIN / CODE) + mensaje al lado ── */
.lg-tagrow { position: absolute; top: 25px; left: 5px; right: 0; height: 12px; white-space: nowrap; pointer-events: none; }
.lg-tag { color: var(--middle-0); }
.lg-msg { margin-left: 6px; }
.lg-msg.y { color: var(--special-1); }
.lg-msg.r { color: var(--special-2); }
.lg-msg:empty { margin-left: 0; }
.lg-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* pleca que titila (la del "Hacedor de formas") */
.lg-cur { display: inline-block; width: 2px; height: 0.8em; margin-left: 2px; vertical-align: middle; background: currentColor; animation: lgBlink 0.75s step-end infinite; }
.lg-cur.typing { animation: none; opacity: 1; }
@keyframes lgBlink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

/* ── fila de campos ── */
.lg-row { position: absolute; top: 42px; left: 0; right: 0; height: 30px; display: grid; grid-template-columns: 240px 240px 120px 1fr; }
.lg-code .lg-row { grid-template-columns: 80px repeat(6, 20px) 1fr; }
.lg-c { position: relative; display: flex; align-items: flex-start; min-width: 0; padding: 3px 0 4px; }
.lg-c .lg-l { flex: none; min-width: 56px; padding-right: 6px; margin-top: 4px; white-space: nowrap; color: var(--middle-0); }
.lg-user { padding-left: 5px; }
.lg-pass { padding-left: 9px; }
.lg-f { transition: background-color 0.2s ease-out; }

/* líneas (#808080, 0.5px) */
.lg-rule { position: absolute; background: var(--middle-3); pointer-events: none; }
.lg-rule.h { left: 0; right: 0; height: 0.5px; transform-origin: left center; }
.lg-rule.v { top: 0; bottom: 0; left: 0; width: 0.5px; }
.lg-rule.v.r { left: auto; right: 0; }
.lg-rt { top: 0; } .lg-rb { bottom: 0; }
.lg-mt, .lg-mb { display: none; }
.lg-mt { top: 0; } .lg-mb { bottom: 0; }

/* inputs: misma tipografía que el form de hitos */
.lg-in, .lg-d {
  font: inherit; letter-spacing: inherit; color: var(--middle-1); background: none; border: 0; margin: 0; padding: 0;
  border-radius: 0; outline: 0; -webkit-appearance: none; appearance: none; min-width: 0;
}
.lg-in { flex: 1; width: 100%; height: 22px; font-size: 15px; line-height: 22px; letter-spacing: 1.5px; font-weight: 400; }
.lg-in::placeholder, .lg-d::placeholder { color: var(--middle-0); opacity: 1; }
.lg-in:-webkit-autofill, .lg-d:-webkit-autofill { -webkit-text-fill-color: var(--middle-1); caret-color: var(--middle-1); transition: background-color 600000s 0s, color 600000s 0s; }

/* error: el campo entero en rojo; la tipografía pasa a middle-2 */
.lg-f.err { background: var(--special-2); }
.lg-f.err .lg-l, .lg-f.err .lg-in, .lg-f.err .lg-d { color: var(--middle-2); }
.lg-f.err .lg-in::placeholder, .lg-f.err .lg-d::placeholder { color: var(--middle-2); }

/* foco: contorno amarillo que se dibuja (igual que el form) */
.lg-ring { position: absolute; left: 0; top: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; z-index: 2; visibility: hidden; }
.lg-live .lg-ring { visibility: visible; }     /* el contorno de foco recién se ve cuando terminó la entrada de la vista */
.lg-ring path { fill: none; stroke: var(--special-1); stroke-width: 2; stroke-dasharray: 1.02 1.02; stroke-dashoffset: 1.02; }

/* Save? */
button.lg-c { font: inherit; letter-spacing: inherit; color: inherit; background: none; border: 0; margin: 0; border-radius: 0; text-align: left; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.lg-save { padding-left: 10px; }
.lg-save .lg-l { min-width: 0; padding-right: 10px; }
.lg-chk { margin: 6px 11px 0 auto; flex: none; width: 12px; height: 12px; border: 0.5px solid var(--middle-3); position: relative; transition: border-color 0.2s ease-out, border-width 0.2s ease-out; }
.lg-chk svg { position: absolute; left: -0.5px; top: -0.5px; width: 12px; height: 12px; overflow: visible; }
.lg-chk polyline { fill: none; stroke: var(--special-1); stroke-width: 1; stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 0.22s ease-out; }
.lg-save[aria-checked="true"] .lg-chk { border: 1px solid var(--special-1); }
.lg-save[aria-checked="true"] .lg-chk svg { left: -1px; top: -1px; }
.lg-save[aria-checked="true"] .lg-chk polyline { stroke-dashoffset: 0; }
.lg-save:focus-visible { outline: 1px solid var(--middle-1); outline-offset: -3px; }

/* ── botones (mismo sistema que SAVE del form: [ ] cerrados, la flecha aparece en hover) ── */
.lg-go { padding: 5px 10px 5px 0; justify-content: flex-end; }
.lg-btn {
  display: inline-block; box-sizing: border-box; height: 20px; padding: 4px 6px; background: var(--special-1); color: var(--middle-0);
  font-family: inherit; border: 0; margin: 0; border-radius: 0; white-space: pre; text-align: left; vertical-align: top; cursor: pointer;
  text-decoration: none; transition: color 0.2s ease-out, background-color 0.2s ease-out; -webkit-appearance: none; appearance: none;
  -webkit-tap-highlight-color: transparent;
}
.lg-btn .br { letter-spacing: 1px; }
.lg-btn .ch { display: inline-block; max-width: 0; opacity: 0; overflow: hidden; vertical-align: top; transition: max-width 0.25s ease-out, opacity 0.2s ease-out; }
.lg-btn:hover, .lg-btn:focus-visible { color: var(--middle-2); outline: none; }
.lg-btn:hover .ch, .lg-btn:focus-visible .ch { max-width: 1.2em; opacity: 1; }
@media (hover: none) { .lg-btn .ch { max-width: 1.2em; opacity: 1; } }      /* sin hover (touch) la flecha ya está */
.lg-btn[disabled] { background: var(--middle-2); color: var(--middle-0); cursor: default; pointer-events: none; }
.lg-btn.busy { color: var(--middle-2); pointer-events: none; }
.lg-btn.busy .ch { max-width: 0; opacity: 0; }

/* botón AGAIN del código (desktop: a la derecha de la fila) */
.lg-gowrap { position: absolute; top: 5px; right: 7px; }

/* ── mensajes grandes (Sí, ya sé… / Ups…) ── */
.lg-grp { position: absolute; top: 38px; left: 0; right: 0; display: flex; align-items: center; justify-content: center; gap: 18px; pointer-events: none; }
.lg-grp > * { pointer-events: auto; }
.lg-grp > .lg-btn { position: relative; top: 1px; }
.lg-big { font-size: 20px; line-height: 24px; letter-spacing: 1.5px; font-weight: 400; color: var(--middle-1); white-space: nowrap; }
.lg-big .y { color: var(--special-1); }
.lg-big .lg-cur { height: 0.75em; background: var(--middle-1); }

/* ── mobile ── */
@media (max-width: 768px) {
  .lg-view { width: 275px; }
  .lg-code { width: 275px; }
  .lg-tagrow { left: 0; top: 40px; text-align: center; }
  .lg-code .lg-tagrow { top: 60px; }

  /* login: tres filas apiladas (usuario, contraseña) y abajo Save? + Continue centrados */
  .lg-login .lg-row { top: 56px; height: auto; grid-template-columns: 1fr auto auto 1fr; grid-template-rows: 30px 30px auto; }
  .lg-user, .lg-pass { grid-column: 1 / -1; padding-left: 5px; padding-top: 5px; padding-bottom: 2px; }   /* tag + placeholder centrados en el alto del campo */
  .lg-user { grid-row: 1; } .lg-pass { grid-row: 2; }
  .lg-login .lg-rt, .lg-login .lg-rb, .lg-login .lg-rule.v { display: none; }
  .lg-mt, .lg-mb { display: block; }
  .lg-in { font-size: 14px; line-height: 21px; letter-spacing: 0.8px; height: 21px; }
  .lg-c .lg-l { margin-top: 3px; }
  .lg-login .lg-save { grid-row: 3; grid-column: 2; margin-top: 6px; height: 20px; padding: 0; align-items: flex-start; }
  .lg-login .lg-save .lg-l { margin-top: 0; padding-right: 9px; }
  .lg-chk { margin: 2px 0 0 0; }
  .lg-go { grid-row: 3; grid-column: 3; margin-top: 8px; padding: 0 0 0 20px; }

  /* código: la fila lleva INSERT + 6 casillas de 30px con números de 20px; AGAIN va debajo, centrado */
  .lg-code .lg-row { top: 76px; grid-template-columns: 88px repeat(6, 30px) 1fr; }
  .lg-gowrap { top: 36px; left: 0; right: 0; display: flex; justify-content: center; }

  /* mensajes grandes: centrados en varias líneas */
  .lg-grp { top: 40px; flex-direction: column; gap: 10px; }
  .lg-ups .lg-grp { top: 60px; }
  .lg-big { line-height: 22px; white-space: pre; text-align: center; }
}

/* desktop: la columna de INSERT > se ajusta al texto y deja 20px antes de la línea */
@media (min-width: 769px) {
  .lg-code .lg-row { grid-template-columns: auto repeat(6, 20px) 1fr; }
  .lg-insert .lg-l { padding-right: 20px; }
}

/* código: casillas */
.lg-dc { align-items: center; padding: 0; }
.lg-dc .lg-d { width: 100%; height: 22px; text-align: center; font-size: 15px; line-height: 22px; letter-spacing: 0; }
.lg-insert { padding-left: 5px; }
@media (max-width: 768px) {
  .lg-dc .lg-d { height: 24px; font-size: 20px; line-height: 24px; }
}

/* Páginas de proyecto (fondo blanco): con el Login abierto, lo que asoma detrás de la página al deslizarse es negro, igual que en el home (6 nov 2026) */
html.proj.lg-open, html.proj.lg-open body { background: var(--black); }
