/**
 * PhotoSision Portal · Estilos de la lectura automática del comprobante (SPRINT-221C)
 *
 * Traduce la maqueta v3 (Gate Visual aprobado por Norbey el 16/10/2026) a los tokens ya aprobados del portal
 * (tokens.css). Todo va bajo `.lc-root`: no toca ninguna otra pantalla ni el formulario de pago de siempre.
 *
 * ANCHOS (variables para cambiarlos fácil cuando llegue la maqueta de escritorio de Diseño):
 *   --lc-ancho-flujo   ancho máximo del flujo nuevo, centrado (hoy 520px: las mismas reglas de celular en un computador)
 *   --lc-alto-nav      alto de la barra inferior del portal (.pn.nav) por defecto; solo vale mientras lectura-montaje.js no la haya medido
 *   --lc-nav-medida    alto REAL de la barra inferior del portal en este momento (0 si no se ve); lo deja lectura-montaje.js al medir.
 *                      La barra de botones se apoya encima de ella con este valor en TODOS los anchos: no se supone que la barra inferior
 *                      se esconda a partir de 900px (portal.css lo pretende, pero `.pn.nav { display: grid }` pesa más que `.pn { display: none }`
 *                      y hoy se sigue viendo también en computador; SPRINT-FASE1, defecto de la ficha de prueba, 25/10/2026).
 *   Nota: los puntos de corte de @media no admiten variables; el único es 720px (alinear la barra con el flujo en computador).
 *
 * TOKENS PENDIENTES DE APROBACIÓN (Norbey aún no aprueba --on-ac ni --rj; NO se agregan a portal.css ni a tokens.css):
 *   --lc-on-ac  color del texto sobre el botón principal (Noche y Grafito: --ink; Día: blanco, 5,5:1 sobre #B54F00)
 *   --lc-rj     fondo del letrero rojo de «comprobante repetido»
 * Son estilos locales de este módulo con los colores de la maqueta; cuando Norbey apruebe los tokens se cambian aquí por var(--on-ac) y var(--rj).
 */

:root {
  --lc-ancho-flujo: 520px;
  --lc-alto-nav: 62px;
}

.lc-root {
  /* pendiente de aprobación de tokens: --on-ac y --rj (colores de la maqueta v3) */
  --lc-on-ac: var(--ink);
  --lc-rj: #9A2E22;
  width: 100%;
  max-width: var(--lc-ancho-flujo);
  margin-inline: auto;
  font-size: 1rem;
  line-height: 1.45;
  color: var(--tx);
  font-family: var(--font-body);
}

:root[data-mode="dia"] .lc-root {
  /* pendiente de aprobación de tokens: --on-ac y --rj */
  --lc-on-ac: #FFFFFF;
  --lc-rj: #B3382B;
}

.lc-root *,
.lc-root *::before,
.lc-root *::after { box-sizing: border-box; }

/* El botón de ayuda flotante del portal taparía la barra fija de botones del paso 1 */
body:has(.lc-root:not([hidden]) .lc-dock) .sup { display: none; }

.lc-root.lc-arrastrando {
  outline: 2px dashed var(--ac);
  outline-offset: 4px;
  border-radius: 14px;
}

/* ---------- pasos ---------- */
.lc-step { padding: 16px 0 0; display: flex; flex-direction: column; gap: 8px; }
.lc-steptx { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; font-size: .875em; color: var(--t2); }
.lc-steptx b { color: var(--tx); font-weight: 600; }
.lc-bars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.lc-bars i { height: 6px; border-radius: 3px; background: color-mix(in srgb, var(--t2) 35%, var(--bg)); }
.lc-bars i.on { background: var(--ac); }

.lc-main { padding: 16px 0; display: flex; flex-direction: column; gap: 16px; }
.lc-h { font-family: var(--font-title); font-weight: 600; font-size: 1.4em; line-height: 1.2; margin: 0; }
.lc-h.c, .lc-p.c { text-align: center; }
.lc-p { margin: 0; }
.lc-mt { margin-top: 8px; }
.lc-small { margin: 0; font-size: .875em; color: var(--t2); }
.lc-center { display: flex; flex-direction: column; align-items: center; gap: 16px; padding-top: 8px; }
.lc-help { margin: 0; font-size: .875em; color: var(--t2); }
.lc-help.c { text-align: center; }
.lc-soltar { font-style: normal; }

.lc-root [tabindex="-1"]:focus { outline: none; }

/* ---------- botones ---------- */
.lc-act { padding: 16px 0; border-top: 1px solid var(--ln); display: flex; flex-direction: column; gap: 12px; background: var(--bg); }
.lc-btn {
  min-height: 56px; border-radius: 12px; border: 1px solid transparent; font: 600 1.0625em/1.2 var(--font-body);
  display: flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 16px; text-align: center; cursor: pointer;
  width: 100%; color: var(--tx); text-decoration: none; background: transparent;
}
.lc-btn.p { background: var(--ac); color: var(--lc-on-ac); /* pendiente de aprobación de tokens: --on-ac */ }
.lc-btn.g { background: transparent; color: var(--tx); border-color: var(--fb); }
.lc-btn.t { background: transparent; color: var(--tx); border-color: var(--fb); border-style: dashed; }
.lc-btn.q { background: transparent; color: var(--accent-t); text-decoration: underline; text-underline-offset: 3px; min-height: 48px; font-weight: 600; }
.lc-btn.off { opacity: .62; }
.lc-btn[aria-busy="true"] { cursor: progress; }
.lc-btn:focus-visible, .lc-link:focus-visible, .lc-enl:focus-visible, .lc-wa:focus-visible,
.lc-gd > summary:focus-visible, .lc-more > summary:focus-visible, .lc-input:focus-visible + .lc-bx {
  outline: 3px solid var(--accent-t); outline-offset: 2px;
}
.lc-link {
  min-height: 48px; display: inline-flex; align-items: center; gap: 8px; color: var(--accent-t); font: 600 .9375em var(--font-body);
  text-decoration: underline; text-underline-offset: 3px; background: none; border: 0; padding: 0; cursor: pointer; text-align: left;
}
.lc-enl { color: var(--accent-t); text-decoration: underline; text-underline-offset: 3px; }
.lc-wa { min-height: 48px; display: flex; align-items: center; gap: 8px; color: var(--accent-t); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.lc-lbl { display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; }
.lc-sub { font-size: .8125em; font-weight: 500; color: var(--t2); }

/* ---------- barra fija de botones del paso 1 ----------
   Es position: fixed (no sticky): el portal pone overflow-x: hidden en html y en body, y con eso un sticky no se queda
   pegado a la ventana. lectura-montaje.js mide el flujo y deja en .lc-root tres variables: --lc-dock-izq y --lc-dock-ancho
   (dónde alinear la barra en computador) y --lc-alto-dock (el espacio que se reserva bajo el contenido). */
.lc-pantalla:has(.lc-dock) { padding-bottom: calc(var(--lc-alto-dock, 200px) + 16px); }
.lc-dock {
  position: fixed; left: 0; width: 100%; z-index: 25;
  bottom: var(--lc-nav-medida, calc(var(--lc-alto-nav) + env(safe-area-inset-bottom, 0px)));
  border-top: 1px solid var(--ln); background: var(--bg); padding: 12px 20px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  box-shadow: 0 -10px 14px -10px rgba(0, 0, 0, .45);
}
:root[data-mode="dia"] .lc-dock { box-shadow: 0 -10px 14px -10px rgba(27, 23, 19, .25); }
.lc-dock .lc-btn { padding: 6px 8px; font-size: 1em; gap: 6px; min-width: 0; }
.lc-dock .lc-btn.t { grid-column: 1 / -1; min-height: 64px; }
.lc-dock.lc-dock-ancho { grid-template-columns: 1fr; }
.lc-flujo[data-z="1.6"] .lc-dock { grid-template-columns: 1fr; }
/* Pie de página: mientras la barra de botones está a la vista, el pie reserva su alto para que sus enlaces no queden debajo de ella al final de la página. */
body:has(.lc-root:not([hidden]) .lc-dock) .foot.short { padding-bottom: calc(110px + var(--lc-alto-dock-pie, 0px)); }
@media (min-width: 720px) {
  /* computador: la barra se alinea con el flujo (520 px centrado en su columna), no con toda la ventana */
  .lc-dock { left: var(--lc-dock-izq, 0); width: var(--lc-dock-ancho, 100%); padding-inline: 0; border-inline: 1px solid var(--ln); border-radius: 14px 14px 0 0; padding-inline: 12px; }
}

/* ---------- guía y aviso ---------- */
.lc-guiacard { border: 1px solid var(--ln); background: var(--sf); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.lc-gc2 { flex-direction: row; align-items: center; gap: 12px; padding: 12px; }
.lc-guia { width: 64px; height: auto; max-height: 96px; color: var(--t2); flex: none; }
.lc-ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: .9375em; }
.lc-ul li { display: flex; gap: 8px; align-items: flex-start; }
.lc-ul li .ic { color: var(--ok); margin-top: 2px; }
.lc-gd[open] > .lc-small { margin-top: 8px; }
.lc-gd > summary, .lc-more > summary {
  min-height: 48px; display: flex; align-items: center; color: var(--accent-t); font-weight: 600; text-decoration: underline;
  text-underline-offset: 3px; cursor: pointer; list-style: none; font-size: .9375em;
}
.lc-gd > summary::-webkit-details-marker, .lc-more > summary::-webkit-details-marker { display: none; }
.lc-flujo[data-z="1"] .lc-gd > summary { display: none; }
.lc-flujo[data-z="1.3"] .lc-gc2 .lc-guia, .lc-flujo[data-z="1.6"] .lc-gc2 .lc-guia { display: none; }
.lc-more .s-o { display: none; }
.lc-more[open] .s-c { display: none; }
.lc-more[open] .s-o { display: inline; }
.lc-flujo[data-z="1"] .lc-more > summary, .lc-flujo[data-z="1.3"] .lc-more > summary { display: none; }
.lc-flujo[data-z="1.3"] .lc-h, .lc-flujo[data-z="1.6"] .lc-h { font-size: 1.15em; }

.lc-aviso { border: 1px solid var(--ln); background: var(--sf); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.lc-aviso h3 { margin: 0; font-family: var(--font-title); font-weight: 600; font-size: 1.0625em; line-height: 1.25; }
.lc-aviso > p.lc-small, .lc-more p.lc-small { color: var(--tx); }
.lc-hr { border: 0; border-top: 1px solid var(--ln); margin: 0; }

.lc-chk { display: flex; gap: 12px; align-items: flex-start; min-height: 48px; font-weight: 500; cursor: pointer; position: relative; }
.lc-input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.lc-bx { width: 28px; height: 28px; border-radius: 6px; border: 2px solid var(--fb); background: var(--el); display: grid; place-items: center; flex: none; }
.lc-bx.on { background: var(--ac); border-color: var(--ac); color: var(--lc-on-ac); }
.lc-chk.err .lc-bx { border-color: var(--err); box-shadow: 0 0 0 3px color-mix(in srgb, var(--err) 30%, transparent); }
.lc-err { display: flex; gap: 8px; align-items: flex-start; color: var(--err); font-weight: 600; font-size: .9375em; }

/* ---------- notas, miniaturas y datos leídos ---------- */
.lc-nota { display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--fb); background: var(--sf); border-radius: 12px; padding: 12px 16px; }
.lc-nota .ic { color: var(--t2); margin-top: 1px; }
.lc-nota.am { border-color: var(--warn); background: color-mix(in srgb, var(--warn) 10%, var(--bg)); }
.lc-nota.am .ic { color: var(--warn); }
.lc-nota b { font-weight: 600; }
.lc-nota p { margin: 4px 0 0; font-size: .9375em; }
.lc-th { width: 72px; height: 96px; border-radius: 10px; border: 1px solid var(--ln); display: flex; align-items: center; justify-content: center; color: var(--t2); flex: none; background: var(--el); }
.lc-th-img { object-fit: cover; }
.lc-pdf { width: 72px; height: 96px; border-radius: 10px; border: 1px solid var(--ln); background: var(--el); display: flex; flex-direction: column; gap: 4px; align-items: center; justify-content: center; color: var(--t2); font-size: 12px; font-weight: 700; flex: none; }
.lc-readrow { display: flex; gap: 16px; align-items: center; }
.lc-card { border: 1px solid var(--ln); background: var(--sf); border-radius: 14px; padding: 0 16px; }
.lc-card.dim { opacity: .55; }
.lc-dl { margin: 0; }
.lc-r { padding: 12px 0; border-bottom: 1px solid var(--ln); }
.lc-r:last-child { border-bottom: 0; }
.lc-r dt { font-size: .875em; color: var(--t2); margin: 0; }
.lc-r dd { margin: 2px 0 0; font-family: var(--font-title); font-weight: 600; font-size: 1.2em; line-height: 1.25; overflow-wrap: anywhere; }
.lc-r dd.ref { font-family: var(--font-body); font-size: 1.1em; line-height: 1.35; letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.lc-r dd.mon { font-size: 1.5em; }
.lc-r dd.ok { display: flex; align-items: center; gap: 8px; color: var(--ok); font: 600 1.0625em var(--font-body); }

/* ---------- espera ---------- */
.lc-ind { width: 100%; height: 8px; border-radius: 4px; background: var(--ln); overflow: hidden; position: relative; }
.lc-ind i { position: absolute; top: 0; bottom: 0; left: 0; width: 38%; background: var(--ac); border-radius: 4px; animation: lc-mover 1.5s ease-in-out infinite; }
@keyframes lc-mover { 0% { transform: translateX(-100%); } 100% { transform: translateX(280%); } }
@media (prefers-reduced-motion: reduce) { .lc-ind i { animation: none; width: 100%; opacity: .55; } }

/* ---------- letrero rojo e iconos de estado ---------- */
.lc-rojo { /* pendiente de aprobación de tokens: --rj */ background: var(--lc-rj); color: #fff; border-radius: 14px; padding: 16px; display: flex; gap: 12px; align-items: flex-start; }
.lc-rojo .ic2 { width: 44px; height: 44px; border-radius: 50%; background: #fff; color: var(--lc-rj); display: grid; place-items: center; flex: none; }
.lc-rojo h2 { margin: 0; font-family: var(--font-title); font-weight: 600; font-size: 1.2em; line-height: 1.25; }
.lc-ico2 { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.lc-ico2.warn { background: color-mix(in srgb, var(--warn) 18%, var(--bg)); color: var(--warn); }
.lc-ico2.ok { background: color-mix(in srgb, var(--ok) 18%, var(--bg)); color: var(--ok); }

/* ---------- aviso completo ---------- */
.lc-sheet { padding: 16px 0; display: flex; flex-direction: column; gap: 12px; }
.lc-sheet h2 { margin: 0; font-family: var(--font-title); font-weight: 600; font-size: 1.25em; line-height: 1.25; }
.lc-sheet h3 { margin: 8px 0 0; font-family: var(--font-title); font-weight: 600; font-size: 1.0625em; line-height: 1.25; }
.lc-sheet p { margin: 0; }
.lc-ver { font-size: .8125em; color: var(--t2); }
.lc-root .ic { flex: none; }
