/* ════════════════════════════════════════════════════════════════════════
 * lk-firmador-inline.css · v3.1.0 · sprint FC-LKFI-V31-GATE-2COL
 * TAG: LKFI-V3-GATE-1780306200
 * v2.0.0 íntegro (sign/preview + stamps FEI/FES) + sección lkfi-gate-* nueva.
 * Namespace .lkfi-*  ·  tokens LUZOkit globales · 3 temas.
 * ════════════════════════════════════════════════════════════════════════ */

/* ─── Container raíz ─────────────────────────────────────────────────── */
.lkfi { width: 100%; }

.lkfi-fcf {
  width: 100%; max-width: 880px; margin: 16px auto;
  background: var(--bg-card, #fff);
  border: 0.5px solid var(--border, #e2e8f0);
  border-radius: 12px; overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  position: relative;
  --lkfi-ease-out: cubic-bezier(.16, 1, .3, 1);
  --lkfi-ease-in-out: cubic-bezier(.4, 0, .2, 1);
}

.lkfi-ic { stroke: currentColor; stroke-width: 1.8; fill: none; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

/* ─── Loading ────────────────────────────────────────────────────────── */
.lkfi-loading { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 60px 20px; gap: 14px; }
.lkfi-spinner { width: 32px; height: 32px; border: 2.5px solid var(--border, #e2e8f0); border-top-color: var(--c-brand, #6d28d9); border-radius: 50%; animation: lkfi-spin 0.7s linear infinite; }
.lkfi-loading-text { font-size: 12.5px; color: var(--tx-muted, #64748b); }
@keyframes lkfi-spin { to { transform: rotate(360deg); } }
.lkfi-spin { width: 13px; height: 13px; border: 1.5px solid rgba(127, 119, 221, 0.30); border-top-color: var(--c-brand, #6d28d9); border-radius: 50%; animation: lkfi-spin 0.7s linear infinite; display: inline-block; }

/* ════════════════════════════════════════════════════════════════════════
 * UI V4 · vista de firma inline (sign / preview)
 * ════════════════════════════════════════════════════════════════════════ */
.lkfi-sign-view { padding: 20px; background: var(--bg-body, #f1f5f9); min-height: 460px; animation: lkfi-sign-fade-up 0.35s var(--lkfi-ease-out, ease); }
@keyframes lkfi-sign-fade-up { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

.lkfi-sign-back-bar { max-width: 560px; margin: 0 auto 14px; display: flex; align-items: center; gap: 8px; }
.lkfi-sign-back { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; background: transparent; border: 0.5px solid var(--border, #e2e8f0); border-radius: 7px; color: var(--tx-muted, #64748b); font-size: 11.5px; font-weight: 500; font-family: inherit; cursor: pointer; transition: background 0.15s, color 0.15s, border-color 0.15s; }
.lkfi-sign-back:hover { background: var(--bg-card, #fff); color: var(--tx-base, #0f172a); border-color: var(--tx-muted, #64748b); }
.lkfi-sign-back .lkfi-ic { width: 12px; height: 12px; }

.lkfi-sign-card { background: var(--bg-card, #fff); border: 0.5px solid var(--border, #e2e8f0); border-radius: 14px; width: 100%; max-width: 560px; margin: 0 auto; overflow: hidden; box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04); animation: lkfi-card-in 0.4s var(--lkfi-ease-out, cubic-bezier(.34, 1.4, .64, 1)); }
@keyframes lkfi-card-in { from { opacity: 0; transform: translateY(8px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }

.lkfi-sign-header { padding: 18px 20px 14px; border-bottom: 0.5px solid var(--border-soft, #eef2f7); position: relative; }
.lkfi-sign-eyebrow { display: inline-flex; align-items: center; gap: 6px; font-size: 9.5px; color: var(--c-brand-soft, #7c3aed); letter-spacing: 0.10em; text-transform: uppercase; font-weight: 500; margin-bottom: 6px; }
.lkfi-sign-eyebrow .lkfi-ic { width: 11px; height: 11px; }
.lkfi-sign-eyebrow--danger { color: var(--red-soft, #dc2626); }
.lkfi-sign-title { font-size: 16px; font-weight: 500; color: var(--tx-base, #0f172a); line-height: 1.3; }
.lkfi-sign-sub { font-size: 11px; color: var(--tx-muted, #64748b); margin-top: 4px; font-family: ui-monospace, "SF Mono", Menlo, monospace; }
.lkfi-sign-sub--danger { color: var(--red-soft, #dc2626); }

.lkfi-sign-summary { margin: 14px 20px; padding: 12px 14px; background: var(--bg-surface, #f8fafc); border: 0.5px solid var(--border-soft, #eef2f7); border-radius: 8px; }
.lkfi-sign-summary-row { display: flex; align-items: center; gap: 8px; font-size: 11.5px; margin-bottom: 6px; }
.lkfi-sign-summary-row:last-child { margin-bottom: 0; }
.lkfi-sign-summary-lbl { font-size: 9.5px; color: var(--tx-subtle, #94a3b8); text-transform: uppercase; letter-spacing: 0.05em; min-width: 80px; }
.lkfi-sign-summary-val { color: var(--tx-base, #0f172a); font-weight: 500; flex: 1; }
.lkfi-sign-summary-val.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; color: var(--c-brand-soft, #7c3aed); font-size: 11px; }
.lkfi-sign-summary-val.hash-trunc { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 10.5px; color: var(--tx-muted, #64748b); }

.lkfi-sign-steps { display: flex; align-items: center; gap: 0; padding: 12px 20px; border-top: 0.5px solid var(--border-soft, #eef2f7); border-bottom: 0.5px solid var(--border-soft, #eef2f7); }
.lkfi-sign-step { display: flex; align-items: center; gap: 7px; flex-shrink: 0; }
.lkfi-sign-step-num { width: 22px; height: 22px; border-radius: 50%; background: var(--bg-surface, #f8fafc); border: 0.5px solid var(--border, #e2e8f0); color: var(--tx-muted, #64748b); display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 600; transition: background 0.3s var(--lkfi-ease-out), border-color 0.3s, color 0.3s; }
.lkfi-sign-step-num .lkfi-ic { width: 12px; height: 12px; stroke-width: 3; }
.lkfi-sign-step-lbl { font-size: 11px; color: var(--tx-muted, #64748b); }
.lkfi-sign-step.done .lkfi-sign-step-num { background: var(--green-base, #16a34a); color: #fff; border-color: var(--green-base, #16a34a); }
.lkfi-sign-step.done .lkfi-sign-step-lbl { color: var(--tx-base, #0f172a); }
.lkfi-sign-step.active .lkfi-sign-step-num { background: var(--c-brand, #6d28d9); color: #fff; border-color: var(--c-brand, #6d28d9); }
.lkfi-sign-step.active .lkfi-sign-step-lbl { color: var(--c-brand-soft, #7c3aed); font-weight: 500; }
.lkfi-sign-step.error .lkfi-sign-step-num { background: var(--red-base, #dc2626); color: #fff; border-color: var(--red-base, #dc2626); }
.lkfi-sign-step.error .lkfi-sign-step-lbl { color: var(--red-soft, #dc2626); }
.lkfi-sign-step-bar { flex: 1; height: 1px; background: var(--border, #e2e8f0); margin: 0 10px; transition: background 0.3s var(--lkfi-ease-out); }
.lkfi-sign-step-bar.done { background: var(--green-base, #16a34a); }

.lkfi-sign-body { padding: 24px 20px 20px; min-height: 200px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.lkfi-sign-review-ic { width: 64px; height: 64px; border-radius: 50%; background: var(--c-brand-muted, rgba(127, 119, 221, 0.18)); color: var(--c-brand-soft, #7c3aed); display: flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.lkfi-sign-review-ic .lkfi-ic { width: 30px; height: 30px; }
.lkfi-sign-passkey-pulse { width: 80px; height: 80px; border-radius: 50%; background: var(--c-brand-muted, rgba(127, 119, 221, 0.18)); border: 1px solid var(--lk-brand-border, rgba(127, 119, 221, 0.30)); display: flex; align-items: center; justify-content: center; color: var(--c-brand-soft, #7c3aed); position: relative; animation: lkfi-pk-pulse 2.2s ease-in-out infinite; margin-bottom: 16px; }
@keyframes lkfi-pk-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(127, 119, 221, 0.4); } 50% { box-shadow: 0 0 0 10px rgba(127, 119, 221, 0); } }
.lkfi-sign-passkey-pulse .lkfi-ic { width: 38px; height: 38px; }
.lkfi-sign-passkey-pulse::after { content: ''; position: absolute; inset: -8px; border-radius: 50%; border: 1px solid var(--c-brand-soft, #7c3aed); opacity: 0; animation: lkfi-pk-halo 2.2s ease-out infinite; }
@keyframes lkfi-pk-halo { 0% { opacity: 0.5; transform: scale(0.9); } 100% { opacity: 0; transform: scale(1.4); } }
.lkfi-sign-spinner-circle { width: 80px; height: 80px; border-radius: 50%; border: 3px solid var(--border, #e2e8f0); border-top-color: var(--c-brand, #6d28d9); animation: lkfi-spin 0.9s linear infinite; margin-bottom: 16px; }
.lkfi-sign-success-check { width: 80px; height: 80px; border-radius: 50%; background: var(--green-base, #16a34a); color: #fff; display: flex; align-items: center; justify-content: center; margin-bottom: 16px; animation: lkfi-check-pop 0.5s cubic-bezier(.34, 1.6, .64, 1); }
@keyframes lkfi-check-pop { from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.lkfi-sign-success-check .lkfi-ic { width: 40px; height: 40px; stroke-width: 2.5; }
.lkfi-sign-error-x { width: 80px; height: 80px; border-radius: 50%; background: var(--red-bg, #fef2f2); border: 1px solid var(--red-bd, #fecaca); color: var(--red-base, #dc2626); display: flex; align-items: center; justify-content: center; margin-bottom: 16px; animation: lkfi-err-shake 0.4s cubic-bezier(.36, .07, .19, .97); }
@keyframes lkfi-err-shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
.lkfi-sign-error-x .lkfi-ic { width: 38px; height: 38px; stroke-width: 2.5; }
.lkfi-sign-waiting-ic { width: 80px; height: 80px; border-radius: 50%; background: var(--blue-bg, #eff6ff); border: 1px solid var(--blue-bd, #bfdbfe); color: var(--blue, #2563eb); display: flex; align-items: center; justify-content: center; margin-bottom: 16px; }
.lkfi-sign-waiting-ic .lkfi-ic { width: 38px; height: 38px; }
.lkfi-sign-body-title { font-size: 14.5px; font-weight: 500; color: var(--tx-base, #0f172a); margin-bottom: 6px; }
.lkfi-sign-body-title--danger { color: var(--red-soft, #dc2626); }
.lkfi-sign-body-sub { font-size: 12px; color: var(--tx-muted, #64748b); max-width: 380px; line-height: 1.55; }
.lkfi-sign-body-sub strong { color: var(--tx-base, #0f172a); font-weight: 500; }

.lkfi-sign-legal { margin: 0 20px 14px; padding: 10px 12px; background: var(--bg-surface, #f8fafc); border: 0.5px solid var(--border-soft, #eef2f7); border-radius: 7px; font-size: 10.5px; color: var(--tx-subtle, #94a3b8); line-height: 1.55; }
.lkfi-sign-legal strong { color: var(--tx-muted, #64748b); }

.lkfi-sign-foot { padding: 14px 20px; display: flex; align-items: center; gap: 10px; border-top: 0.5px solid var(--border-soft, #eef2f7); background: var(--bg-card, #fff); }
.lkfi-sign-foot-info { flex: 1; font-size: 10.5px; color: var(--tx-subtle, #94a3b8); font-family: ui-monospace, "SF Mono", Menlo, monospace; display: inline-flex; align-items: center; gap: 4px; }
.lkfi-sign-foot-info .lkfi-ic { width: 11px; height: 11px; color: var(--green-base, #16a34a); }
.lkfi-sign-foot-info--danger { color: var(--red-soft, #dc2626); }
.lkfi-sign-foot-info--danger .lkfi-ic { color: var(--red-soft, #dc2626); }

.lkfi-sign-btn-ghost { padding: 8px 14px; background: transparent; border: 0.5px solid var(--border, #e2e8f0); border-radius: 7px; color: var(--tx-base, #0f172a); font-size: 12px; font-family: inherit; cursor: pointer; transition: background 0.15s, color 0.15s; display: inline-flex; align-items: center; gap: 6px; }
.lkfi-sign-btn-ghost:hover:not(:disabled) { background: var(--bg-surface, #f8fafc); }
.lkfi-sign-btn-ghost:disabled { opacity: 0.4; cursor: not-allowed; }
.lkfi-sign-btn-ghost .lkfi-ic { width: 13px; height: 13px; }
.lkfi-sign-btn-cta { padding: 8px 14px; background: var(--c-brand, #6d28d9); border: 0.5px solid var(--c-brand, #6d28d9); border-radius: 7px; color: #fff; font-size: 12px; font-weight: 500; font-family: inherit; cursor: pointer; transition: filter 0.15s; display: inline-flex; align-items: center; gap: 6px; }
.lkfi-sign-btn-cta:hover:not(:disabled) { filter: brightness(.92); }
.lkfi-sign-btn-cta:disabled { opacity: 0.4; cursor: not-allowed; }
.lkfi-sign-btn-cta .lkfi-ic { width: 13px; height: 13px; stroke: #fff; }
.lkfi-sign-btn-cta--success { background: var(--green-base, #16a34a); border-color: var(--green-base, #16a34a); }
.lkfi-sign-btn-cta--success:hover:not(:disabled) { filter: brightness(1.05); }

/* ════════════════════════════════════════════════════════════════════════
 * STAMP del paciente + timeline (PRESERVADO v1.0)
 * ════════════════════════════════════════════════════════════════════════ */
.lkfi-stamp { background: var(--blue-bg, #eff6ff); border: 0.5px solid var(--blue-bd, #bfdbfe); border-radius: 10px; padding: 12px 14px; margin: 0 20px 14px; }
.lkfi-stamp-history { background: var(--bg-surface, #f8fafc); border-color: var(--border, #e2e8f0); }
.lkfi-stamp-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.lkfi-stamp-check { width: 18px; height: 18px; border-radius: 50%; background: var(--green, #16a34a); color: #fff; display: flex; align-items: center; justify-content: center; }
.lkfi-stamp-check .lkfi-ic { width: 11px; height: 11px; stroke-width: 2.5; }
.lkfi-stamp-title { font-size: 12px; font-weight: 500; color: var(--tx-base, #0f172a); }
.lkfi-stamp-toggle { display: flex; align-items: center; gap: 5px; background: transparent; border: 0; padding: 6px 0 0 0; font-family: inherit; cursor: pointer; font-size: 11px; color: var(--c-brand-soft, #7c3aed); font-weight: 500; margin-top: 4px; }
.lkfi-stamp-toggle .lkfi-ic { width: 11px; height: 11px; transition: transform 0.2s var(--lkfi-ease-out); }
.lkfi-stamp.is-expanded .lkfi-stamp-toggle .lkfi-ic { transform: rotate(180deg); }
.lkfi-stamp-collapsable { max-height: 0; overflow: hidden; transition: max-height 0.4s var(--lkfi-ease-out); }
.lkfi-stamp.is-expanded .lkfi-stamp-collapsable { max-height: 600px; }

.lkfi-tl-items { display: flex; flex-direction: column; gap: 14px; padding-top: 6px; position: relative; }
.lkfi-tl-item { display: flex; gap: 12px; position: relative; }
.lkfi-tl-item:not(:last-child)::before { content: ''; position: absolute; left: 3.5px; top: 14px; bottom: 0; width: 1px; background: var(--blue-bd, #bfdbfe); }
.lkfi-stamp-history .lkfi-tl-item:not(:last-child)::before { background: var(--border, #e2e8f0); }
.lkfi-tl-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 4px; flex-shrink: 0; z-index: 1; }
.lkfi-tl-dot.done { background: var(--green, #16a34a); box-shadow: 0 0 0 2px var(--blue-bg, #eff6ff); }
.lkfi-stamp-history .lkfi-tl-dot.done { box-shadow: 0 0 0 2px var(--bg-surface, #f8fafc); }
.lkfi-tl-dot.now { background: var(--c-brand, #6d28d9); box-shadow: 0 0 0 2px var(--blue-bg, #eff6ff), 0 0 0 4px var(--bbdr, rgba(109, 40, 217, 0.20)); animation: lkfi-pulse-tl 2s ease infinite; }
.lkfi-tl-dot.pending { background: var(--bg-card, #fff); border: 1px dashed var(--tx-subtle, #94a3b8); box-shadow: 0 0 0 2px var(--blue-bg, #eff6ff); }
@keyframes lkfi-pulse-tl { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.2); } }
.lkfi-tl-time { font-size: 10.5px; color: var(--tx-muted, #64748b); font-variant-numeric: tabular-nums; font-family: ui-monospace, "SF Mono", Menlo, monospace; }
.lkfi-tl-title { font-size: 12px; font-weight: 500; margin-top: 1px; color: var(--tx-base, #0f172a); }
.lkfi-tl-meta { font-size: 11px; color: var(--tx-muted, #64748b); line-height: 1.4; margin-top: 2px; }
.lkfi-tl-item.is-pending .lkfi-tl-title { color: var(--tx-muted, #64748b); font-weight: 400; }
.lkfi-tl-item.is-now .lkfi-tl-title { color: var(--c-brand, #6d28d9); }
.lkfi-tl-empty { font-size: 11.5px; color: var(--tx-subtle, #94a3b8); padding: 8px 0; text-align: center; }

/* ── stamps grid FEI/FES (PRESERVADO v1.0) ─────────────────────────────── */
.lkfi-stamps-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0 20px 14px; }
@media (max-width: 720px) { .lkfi-stamps-grid { grid-template-columns: 1fr; } }
.lkfi-st { border-radius: 10px; overflow: hidden; border-width: 1px; border-style: solid; display: flex; flex-direction: column; animation: lkfi-stamp-in 0.5s var(--lkfi-ease-out) both; }
.lkfi-st.fei { border-color: var(--green-bd, #a7f3d0); animation-delay: 0.1s; }
.lkfi-st.fes { border-color: var(--blue-bd, #bfdbfe); animation-delay: 0.25s; }
@keyframes lkfi-stamp-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.lkfi-st-head { padding: 10px 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.lkfi-st.fei .lkfi-st-head { background: var(--green-bg, #ecfdf5); border-bottom: 0.5px solid var(--green-bd, #a7f3d0); }
.lkfi-st.fes .lkfi-st-head { background: var(--blue-bg, #eff6ff); border-bottom: 0.5px solid var(--blue-bd, #bfdbfe); }
.lkfi-st-head-l { display: flex; align-items: center; gap: 9px; min-width: 0; }
.lkfi-st-ic { width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.lkfi-st.fei .lkfi-st-ic { background: rgba(22, 163, 74, 0.18); color: var(--green, #16a34a); }
.lkfi-st.fes .lkfi-st-ic { background: rgba(37, 99, 235, 0.18); color: var(--blue, #2563eb); }
.lkfi-st-ic .lkfi-ic { width: 16px; height: 16px; }
.lkfi-st-head-tit { font-size: 11.5px; font-weight: 500; }
.lkfi-st.fei .lkfi-st-head-tit { color: var(--green, #16a34a); }
.lkfi-st.fes .lkfi-st-head-tit { color: var(--blue, #2563eb); }
.lkfi-st-folio { font-size: 9.5px; color: var(--tx-muted, #64748b); margin-top: 1px; font-family: ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: 0.03em; }
.lkfi-st-pill { font-size: 9.5px; font-weight: 500; padding: 3px 9px; border-radius: 99px; display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0; color: #fff; }
.lkfi-st.fei .lkfi-st-pill { background: var(--green, #16a34a); }
.lkfi-st.fes .lkfi-st-pill { background: var(--blue, #2563eb); }
.lkfi-st-pill .lkfi-ic { width: 10px; height: 10px; stroke: #fff; stroke-width: 2.5; }
.lkfi-st-fields { display: grid; grid-template-columns: 1fr 1fr; background: var(--bg-card, #fff); flex: 1; }
.lkfi-st-field { padding: 8px 12px; display: flex; flex-direction: column; justify-content: center; }
.lkfi-st.fei .lkfi-st-field { border-bottom: 0.5px solid var(--green-bg, #ecfdf5); }
.lkfi-st.fei .lkfi-st-field:nth-child(odd) { border-right: 0.5px solid var(--green-bg, #ecfdf5); }
.lkfi-st.fes .lkfi-st-field { border-bottom: 0.5px solid var(--blue-bg, #eff6ff); }
.lkfi-st.fes .lkfi-st-field:nth-child(odd) { border-right: 0.5px solid var(--blue-bg, #eff6ff); }
.lkfi-st-field:nth-last-child(-n+2) { border-bottom: 0 !important; }
.lkfi-st-field-lbl { font-size: 9px; font-weight: 500; color: var(--tx-subtle, #94a3b8); text-transform: uppercase; letter-spacing: 0.07em; margin-bottom: 2px; }
.lkfi-st-field-val { font-size: 11px; color: var(--tx-base, #0f172a); line-height: 1.35; }
.lkfi-st-field-val.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 10.5px; }
.lkfi-st.fei .lkfi-st-field-val.auth { color: var(--green, #16a34a); }
.lkfi-st.fes .lkfi-st-field-val.auth { color: var(--blue, #2563eb); }
.lkfi-st-foot { padding: 10px 12px; display: flex; align-items: center; gap: 10px; }
.lkfi-st.fei .lkfi-st-foot { background: var(--green-bg, #ecfdf5); border-top: 0.5px solid var(--green-bd, #a7f3d0); }
.lkfi-st.fes .lkfi-st-foot { background: var(--blue-bg, #eff6ff); border-top: 0.5px solid var(--blue-bd, #bfdbfe); }
.lkfi-st-cod { flex: 1; min-width: 0; }
.lkfi-st-cod-lbl { font-size: 8.5px; font-weight: 500; color: var(--tx-subtle, #94a3b8); text-transform: uppercase; letter-spacing: 0.06em; }
.lkfi-st-cod-val { font-size: 11px; font-weight: 500; font-family: ui-monospace, "SF Mono", Menlo, monospace; margin: 1px 0; }
.lkfi-st.fei .lkfi-st-cod-val { color: var(--green, #16a34a); }
.lkfi-st.fes .lkfi-st-cod-val { color: var(--blue, #2563eb); }
.lkfi-st-cod-url { font-size: 9px; color: var(--tx-muted, #64748b); font-family: ui-monospace, "SF Mono", Menlo, monospace; }
.lkfi-st-luzo { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.lkfi-st-luzo-name { font-size: 10.5px; font-weight: 500; display: flex; align-items: center; gap: 4px; }
.lkfi-st.fei .lkfi-st-luzo-name { color: var(--green, #16a34a); }
.lkfi-st.fes .lkfi-st-luzo-name { color: var(--blue, #2563eb); }
.lkfi-st-luzo-name .lkfi-ic { width: 11px; height: 11px; }
.lkfi-st-luzo-link { font-size: 9px; color: var(--tx-muted, #64748b); }
.lkfi-st-qr { width: 40px; height: 40px; border-radius: 5px; flex-shrink: 0; background: var(--bg-card, #fff); display: flex; align-items: center; justify-content: center; }
.lkfi-st.fei .lkfi-st-qr { border: 0.5px solid var(--green-bd, #a7f3d0); color: var(--green, #16a34a); }
.lkfi-st.fes .lkfi-st-qr { border: 0.5px solid var(--blue-bd, #bfdbfe); color: var(--blue, #2563eb); }
.lkfi-st-qr svg { display: block; }

/* ════════════════════════════════════════════════════════════════════════
 * v3.1 · GATE full-page · contenedor centrado + 2 columnas + riel — NUEVO
 * Solo aplica con .lkfi--gate (mode:'gate'). sign/preview no se ven afectados.
 * ════════════════════════════════════════════════════════════════════════ */
.lkfi--gate { position: absolute; inset: 0; }
.lkfi-gate { position: absolute; inset: 0; display: flex; flex-direction: column; overflow: hidden; background: var(--bg-body, #0a0c10); animation: lkfi-sign-fade-up 0.35s var(--lkfi-ease-out, ease); }
.lkfi-gate-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 26px 0 22px; }
.lkfi-gate-scroll::-webkit-scrollbar { width: 6px; }
.lkfi-gate-scroll::-webkit-scrollbar-thumb { background: var(--border, rgba(255,255,255,0.10)); border-radius: 3px; }
.lkfi-gate-wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 32px; display: flex; flex-direction: column; gap: 18px; }

/* layout 2 columnas */
.lkfi-gate-cols { display: grid; grid-template-columns: 1.62fr 1fr; gap: 20px; align-items: start; }
.lkfi-gate-cols--single { display: flex; flex-direction: column; gap: 16px; }
.lkfi-gate-main { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.lkfi-gate-side { display: flex; flex-direction: column; gap: 16px; }
@media (max-width: 980px) { .lkfi-gate-cols { grid-template-columns: 1fr; } }

/* statecard (firmando / error / confirm / blocked) */
.lkfi-gate-statecard { background: var(--bg-card, #161B22); border: 0.5px solid var(--border, rgba(255,255,255,0.10)); border-radius: 14px; overflow: hidden; box-shadow: 0 1px 2px rgba(0,0,0,0.05); }

/* gate · pac-strip */
.lkfi-gate-pac { display: flex; align-items: center; gap: 14px; padding: 14px 18px; background: var(--bg-card, #161B22); border: 0.5px solid var(--border, rgba(255,255,255,0.10)); border-radius: 14px; box-shadow: 0 1px 2px rgba(0,0,0,0.05); animation: lkfi-sign-fade-up 0.4s var(--lkfi-ease-out) 0.03s backwards; }
.lkfi-gate-pac-av { width: 46px; height: 46px; border-radius: 50%; background: var(--c-brand-muted, rgba(127,119,221,0.18)); color: var(--c-brand-soft, #A78BFA); display: flex; align-items: center; justify-content: center; font: 500 15px/1 inherit; flex-shrink: 0; border: 0.5px solid var(--lk-brand-border, rgba(127,119,221,0.30)); }
.lkfi-gate-pac-info { flex: 1; min-width: 0; }
.lkfi-gate-pac-name { font-size: 16px; font-weight: 500; color: var(--tx-base, #E6EDF3); }
.lkfi-gate-pac-meta { font-size: 12px; color: var(--tx-muted, #8B949E); margin-top: 3px; }
.lkfi-gate-pac-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 500; padding: 6px 13px; border-radius: 9px; flex-shrink: 0; background: var(--green-bg, rgba(29,158,117,0.10)); border: 0.5px solid var(--green-bd, rgba(29,158,117,0.28)); color: var(--green-base, #5DCAA5); }
.lkfi-gate-pac-badge .lkfi-ic { width: 13px; height: 13px; stroke-width: 2.5; }

/* gate · stepper (reusa .lkfi-sign-steps; card-izado) */
.lkfi-sign-steps.lkfi-gate-steps { border: 0.5px solid var(--border, rgba(255,255,255,0.10)); border-radius: 14px; background: var(--bg-card, #161B22); padding: 15px 28px; box-shadow: 0 1px 2px rgba(0,0,0,0.05); }

/* gate · doc-viewer */
.lkfi-gate-doc { border: 0.5px solid var(--border, rgba(255,255,255,0.10)); border-radius: 14px; overflow: hidden; box-shadow: 0 1px 2px rgba(0,0,0,0.05); animation: lkfi-sign-fade-up 0.4s var(--lkfi-ease-out) 0.06s backwards; }
.lkfi-gate-doc-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 15px; background: var(--bg-surface, #1C232E); border-bottom: 0.5px solid var(--border-soft, rgba(255,255,255,0.06)); }
.lkfi-gate-doc-tit { display: inline-flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 500; color: var(--c-brand-soft, #A78BFA); }
.lkfi-gate-doc-tit .lkfi-ic { width: 15px; height: 15px; }
.lkfi-gate-doc-ver { font-size: 9.5px; font-weight: 500; padding: 2px 8px; border-radius: 20px; background: var(--c-brand-muted, rgba(127,119,221,0.18)); border: 0.5px solid var(--lk-brand-border, rgba(127,119,221,0.30)); color: var(--c-brand-soft, #A78BFA); }
.lkfi-gate-doc-act { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--tx-muted, #8B949E); cursor: pointer; transition: color 0.15s; }
.lkfi-gate-doc-act:hover { color: var(--c-brand-soft, #A78BFA); }
.lkfi-gate-doc-act .lkfi-ic { width: 13px; height: 13px; }
.lkfi-gate-doc-body { background: var(--bg-card, #161B22); padding: 18px 20px; max-height: 300px; overflow-y: auto; font-size: 13px; line-height: 1.65; color: var(--tx-muted, #8B949E); }
.lkfi-gate-doc-body h4 { font-size: 12.5px; font-weight: 500; color: var(--tx-base, #E6EDF3); margin: 0 0 6px; }
.lkfi-gate-doc-body h4:not(:first-child) { margin-top: 16px; }
.lkfi-gate-doc-body p { margin: 0 0 4px; }
.lkfi-gate-doc-body strong { color: var(--tx-base, #E6EDF3); font-weight: 500; }
.lkfi-gate-doc-note { font-size: 11px; color: var(--tx-soft, #6E7681); margin-top: 14px; padding-top: 12px; border-top: 0.5px solid var(--border-soft, rgba(255,255,255,0.06)); }

/* gate · FES inline (paciente verificada) */
.lkfi-gate-fes { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 15px; border-radius: 12px; background: var(--blue-bg, rgba(133,183,235,0.10)); border: 0.5px solid var(--blue-bd, rgba(133,183,235,0.28)); animation: lkfi-sign-fade-up 0.4s var(--lkfi-ease-out) 0.09s backwards; }
.lkfi-gate-fes-l { display: flex; align-items: center; gap: 11px; }
.lkfi-gate-fes-ic { width: 30px; height: 30px; border-radius: 9px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: var(--blue-bg, rgba(133,183,235,0.10)); border: 0.5px solid var(--blue-bd, rgba(133,183,235,0.28)); color: var(--blue-base, #85B7EB); }
.lkfi-gate-fes-ic .lkfi-ic { width: 15px; height: 15px; }
.lkfi-gate-fes-tit { font-size: 12.5px; font-weight: 500; color: var(--blue-base, #85B7EB); }
.lkfi-gate-fes-meta { font-size: 11px; color: var(--tx-muted, #8B949E); margin-top: 2px; }
.lkfi-gate-fes-hash { font-size: 10.5px; font-family: ui-monospace, Menlo, monospace; background: var(--bg-card, #161B22); color: var(--blue-base, #85B7EB); padding: 4px 9px; border-radius: 6px; border: 0.5px solid var(--blue-bd, rgba(133,183,235,0.28)); flex-shrink: 0; }

/* gate · declaración Ley 20.584 */
.lkfi-gate-decl { background: var(--c-brand-muted, rgba(127,119,221,0.18)); border: 0.5px solid var(--lk-brand-border, rgba(127,119,221,0.30)); border-radius: 14px; padding: 20px; box-shadow: 0 1px 2px rgba(0,0,0,0.05); animation: lkfi-sign-fade-up 0.4s var(--lkfi-ease-out) 0.06s backwards; }
.lkfi-gate-decl-head { display: flex; align-items: center; gap: 9px; margin-bottom: 14px; font-size: 10px; font-weight: 500; letter-spacing: 0.07em; text-transform: uppercase; color: var(--c-brand-soft, #A78BFA); }
.lkfi-gate-decl-head .lkfi-ic { width: 15px; height: 15px; flex-shrink: 0; }
.lkfi-gate-decl-check { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; outline: none; padding: 14px; border-radius: 11px; background: var(--bg-card, #161B22); border: 0.5px solid var(--lk-brand-border, rgba(127,119,221,0.30)); transition: filter 0.15s; }
.lkfi-gate-decl-check:hover { filter: brightness(1.02); }
.lkfi-gate-decl-check:focus-visible { outline: 2px solid var(--c-brand-soft, #A78BFA); outline-offset: 3px; }
.lkfi-gate-decl-box { width: 20px; height: 20px; border-radius: 5px; flex-shrink: 0; margin-top: 1px; background: var(--bg-surface, #1C232E); border: 1.5px solid var(--tx-soft, #6E7681); display: flex; align-items: center; justify-content: center; transition: background 0.15s, border-color 0.15s; }
.lkfi-gate-decl-box .lkfi-ic { width: 12px; height: 12px; stroke: #fff; stroke-width: 3; opacity: 0; transition: opacity 0.15s; }
.lkfi-gate-decl-check.checked .lkfi-gate-decl-box { background: var(--c-brand, #6d28d9); border-color: var(--c-brand, #6d28d9); }
.lkfi-gate-decl-check.checked .lkfi-gate-decl-box .lkfi-ic { opacity: 1; }
.lkfi-gate-decl-txt { font-size: 13px; color: var(--tx-base, #E6EDF3); line-height: 1.6; }
.lkfi-gate-decl-note { margin-top: 14px; font-size: 11px; color: var(--tx-muted, #8B949E); line-height: 1.55; }
.lkfi-gate-decl-note strong { color: var(--tx-base, #E6EDF3); font-weight: 500; }

/* gate · riel de contexto */
.lkfi-gate-scard { background: var(--bg-card, #161B22); border: 0.5px solid var(--border, rgba(255,255,255,0.10)); border-radius: 14px; padding: 15px 16px; box-shadow: 0 1px 2px rgba(0,0,0,0.05); animation: lkfi-sign-fade-up 0.4s var(--lkfi-ease-out) 0.08s backwards; }
.lkfi-gate-sh { font-size: 10px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--tx-subtle, #94a3b8); margin-bottom: 11px; display: flex; align-items: center; gap: 7px; }
.lkfi-gate-sh .lkfi-ic { width: 13px; height: 13px; color: var(--c-brand-soft, #A78BFA); }
.lkfi-gate-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 11.5px; padding: 5px 0; }
.lkfi-gate-row + .lkfi-gate-row { border-top: 0.5px solid var(--border-soft, rgba(255,255,255,0.05)); }
.lkfi-gate-row-k { color: var(--tx-subtle, #94a3b8); font-size: 11px; }
.lkfi-gate-row-v { color: var(--tx-base, #E6EDF3); font-weight: 500; text-align: right; }
.lkfi-gate-row-v.mono { font-family: ui-monospace, Menlo, monospace; font-size: 11px; color: var(--c-brand-soft, #A78BFA); }
.lkfi-gate-prof { display: flex; align-items: center; gap: 11px; }
.lkfi-gate-prof-av { width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font: 500 12px/1 inherit; background: var(--green-bg, rgba(29,158,117,0.10)); color: var(--green-base, #5DCAA5); border: 0.5px solid var(--green-bd, rgba(29,158,117,0.28)); }
.lkfi-gate-prof-nm { font-size: 13px; font-weight: 500; color: var(--tx-base, #E6EDF3); }
.lkfi-gate-prof-mt { font-size: 11px; color: var(--tx-muted, #8B949E); margin-top: 1px; }
.lkfi-gate-prof-meth { margin-top: 11px; display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--tx-muted, #8B949E); background: var(--bg-surface, #1C232E); border: 0.5px solid var(--border-soft, rgba(255,255,255,0.06)); border-radius: 9px; padding: 9px 11px; }
.lkfi-gate-prof-meth .lkfi-ic { width: 14px; height: 14px; color: var(--c-brand-soft, #A78BFA); }
.lkfi-gate-will { display: flex; flex-direction: column; gap: 11px; }
.lkfi-gate-will-it { display: flex; gap: 10px; align-items: flex-start; font-size: 11.5px; color: var(--tx-muted, #8B949E); line-height: 1.45; }
.lkfi-gate-will-d { width: 18px; height: 18px; border-radius: 6px; flex-shrink: 0; margin-top: 1px; display: flex; align-items: center; justify-content: center; background: var(--c-brand-muted, rgba(127,119,221,0.18)); color: var(--c-brand-soft, #A78BFA); }
.lkfi-gate-will-d .lkfi-ic { width: 11px; height: 11px; stroke-width: 2.4; }
.lkfi-gate-will-it strong { color: var(--tx-base, #E6EDF3); font-weight: 500; }
.lkfi-gate-legal { margin-top: 13px; padding-top: 12px; border-top: 0.5px solid var(--border-soft, rgba(255,255,255,0.05)); font-size: 10.5px; color: var(--tx-subtle, #94a3b8); line-height: 1.55; }
.lkfi-gate-legal strong { color: var(--tx-muted, #8B949E); }

/* gate · foot pinneado glass + centrado al contenedor */
.lkfi-gate-foot-bar { flex-shrink: 0; background: color-mix(in srgb, var(--bg-card, #161B22) 82%, transparent); backdrop-filter: blur(18px) saturate(140%); -webkit-backdrop-filter: blur(18px) saturate(140%); border-top: 0.5px solid var(--border, rgba(255,255,255,0.10)); box-shadow: 0 -10px 30px -16px rgba(0,0,0,0.5); }
.lkfi-gate-foot-in { max-width: 1180px; margin: 0 auto; padding: 14px 32px; display: flex; align-items: center; gap: 10px; }

/* gate · estados centrados dentro de statecard */
.lkfi-gate-statecard .lkfi-sign-body { padding: 34px 22px; min-height: 0; }
.lkfi-gate-main .lkfi-sign-legal, .lkfi-gate-cols--single .lkfi-sign-legal { margin: 0; }
.lkfi-gate-cols--single .lkfi-stamps-grid { margin: 0; }

/* ─── Dark / midnight ────────────────────────────────────────────────── */
[data-theme="dark"] .lkfi-fcf, [data-theme="midnight"] .lkfi-fcf { box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4); }
[data-theme="dark"] .lkfi-sign-card, [data-theme="midnight"] .lkfi-sign-card { box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4); }

/* ─── Reduced motion ─────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .lkfi-spinner, .lkfi-spin, .lkfi-sign-spinner-circle, .lkfi-tl-dot.now { animation: none; }
  .lkfi-sign-passkey-pulse, .lkfi-sign-passkey-pulse::after { animation: none; }
  .lkfi-sign-success-check, .lkfi-sign-error-x { animation: none; }
  .lkfi-sign-view, .lkfi-sign-card, .lkfi-gate, .lkfi-gate-pac, .lkfi-gate-doc, .lkfi-gate-fes, .lkfi-gate-decl, .lkfi-gate-scard, .lkfi-gate-statecard, .lkfi-sign-steps.lkfi-gate-steps { animation: none; }
  .lkfi-sign-step, .lkfi-sign-step-num, .lkfi-sign-step-bar, .lkfi-sign-btn-ghost, .lkfi-sign-btn-cta, .lkfi-stamp-collapsable, .lkfi-st { transition: none; animation: none; }
}
