/*
 * Estilos de la pantalla de acceso (index.php de la raíz, rediseño de la fase 3): «Puesto de taller» (31-10-26): tarjeta negra fija
 * a la izquierda (logo apilado centrado, reloj, semáforo), aviso solo si hay error y formulario a la derecha con fichas de usuarios del equipo;
 * campos de 52 px y botón en píldora con el color de marca del taller. No carga el shell: usa solo los
 * tokens --z-* (css/zuricar-tokens.css) y los de marca que emite php/plantillas/header.html.php, así que
 * respeta la marca del taller (color y logo) y el tema claro/oscuro.
 *
 * Carpeta: /css/
 * Fichero: login.css
 * Creado: 27-10-26
 */

body.zl-login {
  margin: 0;
  min-height: 100vh;
  background: var(--z-fondo);
  color: var(--z-texto);
  font-family: var(--z-font-body);
  font-size: var(--z-text-md);
  line-height: var(--z-leading-normal);
}
body.zl-login *,
body.zl-login *::before,
body.zl-login *::after { box-sizing: border-box; }
body.zl-login *:focus-visible { outline: 0; box-shadow: var(--z-shadow-foco); }

body.zl-login .zl-pagina {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 12px 16px;
}
body.zl-login .zl-puesto {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  width: 100%;
  max-width: 980px;
  min-height: 560px;
  background: var(--z-superficie);
  border: 1px solid var(--z-borde);
  border-radius: var(--z-radius-xl);
  box-shadow: var(--z-shadow-md);
  overflow: hidden;
}

/* ---- Tarjeta negra fija (siempre oscura, también en tema claro): todo centrado ---- */
body.zl-login .zl-izq {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 24px 28px;
  background: var(--z-cab-fondo, #0B0C0E);
  color: var(--z-cab-texto, #F2F2F2);
  text-align: center;
}
body.zl-login .zl-marca { display: flex; justify-content: center; }
body.zl-login .zl-logo { display: block; width: 100%; max-width: 232px; height: auto; }
body.zl-login .zl-marca-placa { display: inline-block; padding: 12px 16px; border-radius: var(--z-radius-lg); background: #FFFFFF; }
body.zl-login .zl-logo-propio { width: auto; max-width: 220px; max-height: 120px; }
body.zl-login .zl-hora[hidden] { display: none; }
body.zl-login .zl-reloj { font-family: var(--z-font-display); font-weight: 700; font-size: 44px; line-height: 1; letter-spacing: var(--z-tracking-display); color: var(--z-marca, #EF8018); }
body.zl-login .zl-d { display: inline-block; width: .87em; text-align: center; }
body.zl-login .zl-fecha { margin-top: 6px; font-size: var(--z-text-sm); color: var(--z-cab-texto-suave, #B4B5B7); }
body.zl-login .zl-fecha::first-letter { text-transform: uppercase; }
body.zl-login .zl-semaforo { display: flex; flex-direction: column; align-items: stretch; gap: 8px; width: 100%; }
body.zl-login .zl-semaforo:empty { display: none; }
body.zl-login .zl-sem { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 10px 12px; border-radius: var(--z-radius-md); background: var(--z-cab-elevado, #1B1E23); font-size: var(--z-text-sm); color: var(--z-cab-texto, #F2F2F2); }
body.zl-login .zl-sem i { flex: none; width: 10px; height: 10px; border-radius: 50%; background: #B4B5B7; }
body.zl-login .zl-sem--ok i { background: #2ECC71; }
body.zl-login .zl-sem--aviso i { background: #FFC107; }

/* ---- Derecha: formulario centrado; el aviso solo aparece si hay algo que decir ---- */
body.zl-login .zl-der { display: flex; flex-direction: column; justify-content: center; min-width: 0; }
body.zl-login .zl-aviso {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin: 0 0 var(--z-space-5);
  padding: 14px 16px;
  border: 1px solid transparent;
  border-left-width: 4px;
  border-radius: var(--z-radius-lg);
  overflow-wrap: anywhere;
}
body.zl-login .zl-aviso-ico { display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 50%; font-size: 14px; line-height: 1; color: #fff; }
body.zl-login .zl-aviso-tx { min-width: 0; font-size: var(--z-text-sm); color: var(--z-texto); }
body.zl-login .zl-aviso-tx b { display: block; margin-bottom: 2px; font-weight: var(--z-weight-semibold); font-size: var(--z-text-base); }
body.zl-login .zl-aviso--error { background: var(--z-error-suave); border-color: var(--z-error-solido); }
body.zl-login .zl-aviso--error .zl-aviso-ico { background: var(--z-error-solido); }
body.zl-login .zl-aviso--aviso { background: var(--z-aviso-suave); border-color: var(--z-aviso-solido); }
body.zl-login .zl-aviso--aviso .zl-aviso-ico { background: var(--z-aviso-solido); color: #0B0C0E; }

body.zl-login .zl-form { width: 100%; max-width: 560px; margin: auto; padding: 18px 36px; }
body.zl-login h1 {
  margin: 0;
  font-family: var(--z-font-body);
  font-size: var(--z-text-xl);
  font-weight: var(--z-weight-regular, 400);
  line-height: var(--z-leading-tight);
  color: var(--z-texto);
}
body.zl-login h1 strong { font-weight: 700; }
body.zl-login .zl-sub { margin: 2px 0 var(--z-space-3); color: var(--z-texto-suave); font-size: var(--z-text-sm); }

/* ---- Fichas de usuarios de este equipo ---- */
body.zl-login .zl-fichas[hidden] { display: none; }
body.zl-login .zl-fichas { margin: 0 0 var(--z-space-3); }
body.zl-login .zl-fichas-titulo { margin: 0 0 8px; font-size: var(--z-text-xs); font-weight: var(--z-weight-semibold); text-transform: uppercase; letter-spacing: .08em; color: var(--z-texto-suave); }
body.zl-login .zl-fichas-lista { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
body.zl-login .zl-ficha { display: flex; flex-direction: column; border: 2px solid var(--z-borde); border-radius: var(--z-radius-lg); background: var(--z-superficie); min-width: 0; }
body.zl-login .zl-ficha:has(.zl-ficha-usar[aria-pressed="true"]) { border-color: var(--z-marca); background: var(--z-marca-suave); }
body.zl-login .zl-ficha-usar,
body.zl-login .zl-ficha-otro {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  min-height: 0; padding: 8px 8px 2px;
  border: 0; background: transparent; color: var(--z-texto);
  font-family: var(--z-font-body); font-size: var(--z-text-sm); cursor: pointer; text-align: center;
  border-radius: var(--z-radius-lg);
}
body.zl-login .zl-ficha-usar b,
body.zl-login .zl-ficha-otro b { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: var(--z-weight-semibold); }
body.zl-login .zl-ficha-otro { border: 2px dashed var(--z-borde-fuerte); padding-bottom: 8px; justify-content: center; }
body.zl-login .zl-ficha-otro:hover { background: var(--z-superficie-alta); }
body.zl-login .zl-avatar { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--z-marca-suave); color: var(--z-marca-texto); font-weight: var(--z-weight-semibold); }
body.zl-login .zl-ficha-otro .zl-avatar { background: var(--z-superficie-alta); color: var(--z-texto); }
body.zl-login .zl-ficha-quitar { min-height: 28px; margin: 0 4px 4px; border: 0; border-radius: var(--z-radius-md); background: transparent; color: var(--z-texto-suave); font-family: var(--z-font-body); font-size: var(--z-text-sm); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
body.zl-login .zl-ficha-quitar:hover { color: var(--z-error); background: var(--z-error-suave); }
body.zl-login .zl-ayuda { margin: 8px 0 0; font-size: var(--z-text-xs); color: var(--z-texto-suave); }

/* ---- Campos ---- */
body.zl-login .zl-campo { margin-bottom: var(--z-space-3); }
body.zl-login .zl-campo label { display: block; margin: 0 0 6px; font-size: var(--z-text-sm); font-weight: var(--z-weight-medium); color: var(--z-texto); }
body.zl-login .zl-input { position: relative; }
body.zl-login .zl-input > .fa { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--z-texto-suave); pointer-events: none; }
body.zl-login .zl-input input {
  width: 100%;
  height: 44px;
  padding: 0 56px 0 44px;
  border: 1.5px solid var(--z-borde-fuerte);
  border-radius: var(--z-radius-lg);
  background: var(--z-superficie);
  color: var(--z-texto);
  font-family: var(--z-font-body);
  font-size: var(--z-text-md);
  box-shadow: none;
  text-overflow: ellipsis;
  transition: border-color var(--z-duration-fast), box-shadow var(--z-duration-fast);
}
body.zl-login .zl-input input::placeholder { color: var(--z-texto-suave); opacity: .8; }
body.zl-login .zl-input input:focus { outline: 0; border-color: var(--z-foco); box-shadow: var(--z-shadow-foco); }
body.zl-login .zl-input input[aria-invalid="true"] { border-color: var(--z-error); }
body.zl-login .zl-ver {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: var(--z-radius-md);
  background: transparent;
  color: var(--z-texto-suave);
  cursor: pointer;
}
body.zl-login .zl-ver:hover { background: var(--z-superficie-alta); color: var(--z-texto); }
body.zl-login .zl-err { display: flex; gap: 6px; margin-top: 6px; font-size: var(--z-text-sm); font-weight: var(--z-weight-medium); color: var(--z-error); }
body.zl-login .zl-err:empty { display: none; }
body.zl-login .zl-err .fa { margin-top: 3px; }
body.zl-login .zl-mayus { display: flex; gap: 6px; margin-top: 6px; font-size: var(--z-text-sm); font-weight: var(--z-weight-medium); color: var(--z-aviso); }
body.zl-login .zl-mayus[hidden] { display: none; }
body.zl-login .zl-mayus .fa { margin-top: 3px; }

body.zl-login .zl-recordar { display: flex; align-items: flex-start; gap: 12px; margin: 0 0 var(--z-space-2); font-size: var(--z-text-sm); font-weight: var(--z-weight-regular); color: var(--z-texto); cursor: pointer; }
body.zl-login .zl-recordar input { flex: none; width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--z-marca); cursor: pointer; }
body.zl-login .zl-recordar small { display: block; font-style: italic; font-size: var(--z-text-xs); color: var(--z-texto-suave); }

/* ---- Botón principal ---- */
body.zl-login .zl-boton {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 46px;
  margin-top: var(--z-space-3);
  border: 0;
  border-radius: var(--z-radius-pill);
  background: var(--z-marca);
  color: var(--z-sobre-marca);
  font-family: var(--z-font-display);
  font-size: var(--z-text-base);
  font-weight: 700;
  letter-spacing: var(--z-tracking-display);
  cursor: pointer;
  transition: background var(--z-duration-fast), box-shadow var(--z-duration-fast);
}
body.zl-login .zl-boton:hover { background: var(--z-marca-hover); }
body.zl-login .zl-boton:disabled { opacity: .7; cursor: wait; }
body.zl-login .zl-pie { margin: var(--z-space-3) 0 0; text-align: center; font-size: var(--z-text-xs); color: var(--z-texto-suave); }

/* ---- Pantallas estrechas: la tarjeta negra pasa a una cabecera compacta centrada ---- */
@media (max-width: 820px) {
  body.zl-login .zl-pagina { align-items: flex-start; padding: 0; }
  body.zl-login .zl-puesto { grid-template-columns: 1fr; min-height: 100vh; border: 0; border-radius: 0; box-shadow: none; }
  body.zl-login .zl-izq { flex-direction: column; gap: 10px; padding: 18px; }
  body.zl-login .zl-logo { max-width: 120px; }
  body.zl-login .zl-logo-propio { max-width: 140px; max-height: 64px; }
  body.zl-login .zl-marca-placa { padding: 6px 10px; }
  body.zl-login .zl-hora { display: none; }
  body.zl-login .zl-semaforo { width: auto; }
  body.zl-login .zl-form { padding: 20px 18px 28px; }
}
@media (max-width: 480px) {
  body.zl-login .zl-sem { padding: 6px 10px; font-size: var(--z-text-xs); }
}
@media (prefers-reduced-motion: reduce) {
  body.zl-login * { transition: none !important; }
}
