/* ============================================================================
   el Faro — esqueleto del launcher + panel (paso 01) + tubería de contenido
   (pasos 02+). Prefijo vxf-. Archivo INDEPENDIENTE: se carga en TODA página
   (con o sin chrome vx-design), así que cada var(--vx-*) trae fallback. Cuando
   vx-design.css está presente, sus tokens reales ganan por cascada; cuando no,
   el fallback mantiene el Faro hermoso.
   Plan: docs/plans/el-faro/00_INDEX.md (§3.5).
   ============================================================================ */

/* --- El botón flotante '?' --- */
.vxf-launcher{
  position:fixed; top:14px; right:16px;
  z-index:calc(var(--vx-z-sheet, 80) - 1);   /* sobre el chrome, bajo el panel y los toasts */
  width:44px; height:44px; border-radius:999px; border:none; cursor:pointer;
  display:inline-flex; align-items:center; justify-content:center;
  font-family:var(--vx-font, 'Inter', system-ui, sans-serif); font-weight:800; font-size:20px;
  color:#fff; background:linear-gradient(120deg, var(--vx-accent, #2563eb), #1e40af);
  box-shadow:0 8px 24px rgba(15,23,42,.28);
  transition:transform .12s ease, box-shadow .12s ease;
}
.vxf-launcher:hover{ transform:translateY(-1px); box-shadow:0 12px 30px rgba(15,23,42,.34); }
.vxf-launcher:active{ transform:translateY(0); }
.vxf-launcher:focus-visible{ outline:3px solid var(--vx-accent, #2563eb); outline-offset:2px; }

/* --- Backdrop + panel (escritorio: gaveta derecha) --- */
.vxf-backdrop{
  position:fixed; inset:0; background:rgba(15,23,42,.42);
  z-index:var(--vx-z-sheet, 80); opacity:0; visibility:hidden;
  transition:opacity .2s ease, visibility .2s ease;
}
.vxf-panel{
  position:fixed; top:0; right:0; height:100dvh; width:min(440px, 94vw);
  z-index:calc(var(--vx-z-sheet, 80) + 1);   /* por encima del backdrop, aún por debajo de la capa de toasts (90) */
  background:var(--vx-card, #ffffff); color:var(--vx-ink, #0f172a);
  box-shadow:-16px 0 40px rgba(15,23,42,.22);
  transform:translateX(100%); transition:transform .24s cubic-bezier(.22,1,.36,1);
  display:flex; flex-direction:column; font-family:var(--vx-font, 'Inter', system-ui, sans-serif);
}
.vxf-open .vxf-backdrop{ opacity:1; visibility:visible; }
.vxf-open .vxf-panel{ transform:translateX(0); }

/* --- Cabecera del panel: marca + título + cerrar --- */
.vxf-head{ display:flex; align-items:center; gap:10px; padding:16px 16px 10px;
  border-bottom:1px solid var(--vx-line, #e2e8f0);
  background:linear-gradient(120deg, #0b1220, #1e3a8a 78%, #2563eb); color:#fff; }
.vxf-head b{ font-size:16px; font-weight:800; }
.vxf-head .vxf-brand{ font-size:20px; }               /* el faro — decorativo */
.vxf-head .vxf-sub{ font-size:11.5px; color:rgba(255,255,255,.82); font-weight:600; }
.vxf-close{ margin-left:auto; width:34px; height:34px; border-radius:9px;
  border:1px solid rgba(255,255,255,.28); background:rgba(255,255,255,.12); cursor:pointer;
  font-size:16px; line-height:1; color:#fff; }
.vxf-close:hover{ background:rgba(255,255,255,.22); }
.vxf-close:focus-visible{ outline:3px solid #fff; outline-offset:1px; }

/* --- Buscador --- */
.vxf-search{ padding:12px 16px 8px; position:relative; }
.vxf-search input{ width:100%; box-sizing:border-box; padding:10px 12px 10px 34px; border-radius:10px;
  border:1px solid var(--vx-line, #e2e8f0); font-size:14px; font-family:inherit;
  background:var(--vx-surface-2, #f8fafc); color:var(--vx-ink, #0f172a); }
.vxf-search input::placeholder{ color:var(--vx-mut, #94a3b8); }
.vxf-search input:focus{ outline:2px solid var(--vx-accent, #2563eb); outline-offset:1px; border-color:var(--vx-accent, #2563eb); }
.vxf-search .vxf-search-ic{ position:absolute; left:26px; top:22px; color:var(--vx-mut, #94a3b8); pointer-events:none; }

/* --- Pestañas --- */
.vxf-tabs{ display:flex; gap:4px; padding:4px 12px 0; border-bottom:1px solid var(--vx-line, #e2e8f0); }
.vxf-tab{ appearance:none; border:none; background:transparent; cursor:pointer;
  padding:10px 11px; font-size:12.5px; font-weight:700; color:var(--vx-mut, #64748b);
  border-bottom:2px solid transparent; font-family:inherit; white-space:nowrap; }
.vxf-tab[aria-selected="true"]{ color:var(--vx-accent, #2563eb); border-bottom-color:var(--vx-accent, #2563eb); }
.vxf-tab:hover{ color:var(--vx-ink, #0f172a); }
.vxf-tab:focus-visible{ outline:2px solid var(--vx-accent, #2563eb); outline-offset:-2px; border-radius:6px 6px 0 0; }

/* --- Cuerpo scrolleable + panel por pestaña --- */
.vxf-body{ flex:1 1 auto; overflow-y:auto; padding:16px; }
.vxf-tabpanel{ display:none; }
.vxf-tabpanel.vxf-active{ display:block; }

/* --- El "próximamente" con cariño (placeholder vacío-seguro) --- */
.vxf-soon{ text-align:center; color:var(--vx-mut, #64748b); padding:40px 16px; }
.vxf-soon .vxf-soon-ic{ font-size:34px; display:block; margin-bottom:10px; opacity:.7; }
.vxf-soon h3{ font-size:15px; font-weight:800; color:var(--vx-ink, #0f172a); margin:0 0 6px; }
.vxf-soon p{ font-size:13px; line-height:1.5; margin:0; }

/* --- estado de carga / error del contenido (paso 02) --- */
.vxf-loading{ text-align:center; color:var(--vx-mut, #64748b); padding:32px 16px; font-size:13px; }
.vxf-cta{ display:inline-block; margin-top:10px; padding:8px 14px; border-radius:9px; font-weight:700;
  font-size:13px; text-decoration:none; color:#fff;
  background:linear-gradient(120deg, var(--vx-accent, #2563eb), var(--vx-accent-d, #1d4ed8)); }
.vxf-cta:hover{ filter:brightness(1.06); }

/* --- Contenido de ayuda inyectado (fragmentos) — tipografía cómoda --- */
.vxf-content{ font-size:13.5px; line-height:1.6; color:var(--vx-ink, #0f172a); }
.vxf-content h2{ font-size:16px; font-weight:800; margin:2px 0 8px; }
.vxf-content h3{ font-size:14px; font-weight:800; margin:16px 0 6px; }
.vxf-content p{ margin:0 0 10px; }
.vxf-content ul, .vxf-content ol{ margin:0 0 10px; padding-left:20px; }
.vxf-content li{ margin:3px 0; }
.vxf-content code{ background:var(--vx-surface-2, #f1f5f9); padding:1px 6px; border-radius:6px;
  font-family:var(--vx-num, ui-monospace, monospace); font-size:12.5px; }
.vxf-content a{ color:var(--vx-accent, #2563eb); font-weight:700; text-decoration:none; }
.vxf-content a:hover{ text-decoration:underline; }

/* callouts (mismo vocabulario que la semilla manual-importar-facturas.html) */
.vxf-callout{ border-radius:10px; padding:10px 12px; margin:10px 0; font-size:13px; line-height:1.5;
  border:1px solid transparent; }
.vxf-callout.info{ background:#eff6ff; border-color:#bfdbfe; color:#1e40af; }
.vxf-callout.ok{ background:#ecfdf5; border-color:#a7f3d0; color:#065f46; }
.vxf-callout.warn{ background:#fff7ed; border-color:#fed7aa; color:#7c2d12; }
.vxf-callout.bad{ background:#fef2f2; border-color:#fecaca; color:#991b1b; }
.vxf-callout b{ font-weight:800; }

/* "En 10 segundos" resumen destacado */
.vxf-tldr{ background:var(--vx-surface-2, #f7f9fc); border:1px solid var(--vx-line, #e8edf3);
  border-radius:11px; padding:12px 14px; margin:0 0 14px; }
.vxf-tldr b{ display:block; font-size:11px; text-transform:uppercase; letter-spacing:.05em;
  color:var(--vx-mut, #64748b); margin-bottom:4px; }

/* recorrido numerado */
.vxf-steps{ list-style:none; padding:0; margin:0 0 12px; counter-reset:vxfs; }
.vxf-steps li{ position:relative; padding:6px 0 6px 34px; counter-increment:vxfs; }
.vxf-steps li::before{ content:counter(vxfs); position:absolute; left:0; top:5px; width:24px; height:24px;
  border-radius:999px; background:var(--vx-accent, #2563eb); color:#fff; font-weight:800; font-size:12px;
  display:flex; align-items:center; justify-content:center; }

/* enlaces relacionados al pie del fragmento */
.vxf-related{ margin-top:14px; padding-top:12px; border-top:1px solid var(--vx-line, #e8edf3); }
.vxf-related b{ font-size:11px; text-transform:uppercase; letter-spacing:.04em; color:var(--vx-mut, #64748b); }
.vxf-related a{ display:inline-block; margin:4px 8px 0 0; }

/* chip (clave SAT, valor por defecto) */
.vxf-chip{ display:inline-block; background:var(--vx-surface-2, #eef2f7); color:var(--vx-ink, #0f172a);
  border:1px solid var(--vx-line, #e2e8f0); border-radius:999px; padding:1px 9px; font-size:12px;
  font-weight:700; white-space:nowrap; }

/* estado vacío / fallback amable (nunca un error crudo) */
.vxf-empty{ text-align:center; color:var(--vx-mut, #64748b); padding:34px 16px; }
.vxf-empty-ico{ font-size:32px; display:block; margin-bottom:8px; opacity:.75; }
.vxf-empty p{ margin:4px 0; font-size:13.5px; }
.vxf-empty-sub{ font-size:12.5px; }
.vxf-empty a{ color:var(--vx-accent, #2563eb); font-weight:700; }

/* ── Guía estrella (stepper) ── */
.vxf-guia > p{ margin:0 0 12px; }
.vxf-guia-step{ position:relative; padding:0 0 14px 40px; margin:0 0 4px; }
.vxf-guia-step::before{ content:attr(data-n); position:absolute; left:0; top:0; width:28px; height:28px;
  border-radius:999px; background:linear-gradient(120deg, var(--vx-accent, #2563eb), var(--vx-accent-d, #1d4ed8));
  color:#fff; font-weight:800; font-size:13px; display:flex; align-items:center; justify-content:center; }
.vxf-guia-step h3{ margin:2px 0 6px; font-size:14.5px; font-weight:800; }
.vxf-guia-step .vxf-ojo{ font-size:12.5px; color:#7c2d12; background:#fff7ed; border:1px solid #fed7aa;
  border-radius:8px; padding:6px 10px; margin:8px 0 0; }

/* ── Botón coach "muéstrame en la pantalla" ── */
.vxf-coach{ display:inline-flex; align-items:center; gap:6px; margin-top:8px; padding:6px 12px;
  border-radius:8px; border:1px solid var(--vx-accent, #2563eb); background:transparent; cursor:pointer;
  color:var(--vx-accent, #2563eb); font-weight:700; font-size:12.5px; font-family:inherit; }
.vxf-coach:hover{ background:var(--vx-accent, #2563eb); color:#fff; }
.vxf-coach:focus-visible{ outline:2px solid var(--vx-accent, #2563eb); outline-offset:2px; }

/* Spotlight: oscurece todo y recorta un halo sobre el elemento real */
.vxf-spot-overlay{ position:fixed; inset:0; z-index:calc(var(--vx-z-toast, 90) + 5);
  pointer-events:none; }
.vxf-spot-ring{ position:absolute; border-radius:12px; box-shadow:0 0 0 3px var(--vx-accent, #2563eb),
  0 0 0 9999px rgba(15,23,42,.55); transition:all .25s ease; pointer-events:none; }
.vxf-spot-tip{ position:absolute; background:#0b1220; color:#fff; padding:8px 12px; border-radius:9px;
  font-size:12.5px; font-weight:700; max-width:260px; box-shadow:0 10px 30px rgba(15,23,42,.4);
  pointer-events:auto; }
.vxf-spot-tip button{ margin-left:8px; background:rgba(255,255,255,.18); color:#fff; border:none;
  border-radius:6px; padding:3px 8px; cursor:pointer; font-size:12px; font-weight:700; }

/* ── Recorrido guiado (tour secuencial campo por campo) ── */
.vxf-tour-launch{ margin:14px 0 6px; padding:12px 14px; border-radius:12px;
  border:1px solid var(--vx-line, #e8edf3); background:var(--vx-accent-soft, #eff4ff); }
.vxf-tour-launch small{ display:block; margin-top:6px; color:var(--vx-mut, #64748b); font-size:12px; line-height:1.45; }
.vxf-tour-start{ display:inline-flex; align-items:center; gap:8px; padding:10px 16px; border:none;
  border-radius:10px; background:var(--vx-accent, #2563eb); color:#fff; font-weight:800; font-size:13.5px;
  font-family:inherit; cursor:pointer; box-shadow:0 6px 16px rgba(37,99,235,.28); }
.vxf-tour-start:hover{ filter:brightness(1.06); }
.vxf-tour-start:focus-visible{ outline:2px solid var(--vx-accent, #2563eb); outline-offset:2px; }

.vxf-tour-overlay{ position:fixed; inset:0; z-index:calc(var(--vx-z-toast, 90) + 6); pointer-events:none; }
.vxf-tour-overlay .vxf-spot-ring{ position:absolute; border-radius:12px;
  box-shadow:0 0 0 3px var(--vx-accent, #2563eb), 0 0 0 9999px rgba(15,23,42,.6); transition:all .25s ease; }
.vxf-tour-card{ position:fixed; left:50%; bottom:22px; transform:translateX(-50%); pointer-events:auto;
  width:min(440px, 92vw); background:#fff; color:var(--vx-ink, #0f172a); border-radius:16px;
  border:1px solid var(--vx-line, #e8edf3); box-shadow:0 20px 60px rgba(15,23,42,.34); padding:16px 18px;
  font-family:inherit; }
.vxf-tour-card--top{ bottom:auto; top:22px; }
.vxf-tour-top{ display:flex; align-items:center; justify-content:space-between; gap:10px; }
.vxf-tour-paso{ font-size:11px; font-weight:800; text-transform:uppercase; letter-spacing:.05em;
  color:var(--vx-accent, #2563eb); }
.vxf-tour-x{ background:transparent; border:none; color:var(--vx-mut, #64748b); font-weight:700;
  font-size:12.5px; cursor:pointer; font-family:inherit; padding:2px 4px; }
.vxf-tour-x:hover{ color:var(--vx-ink, #0f172a); }
.vxf-tour-tit{ margin:6px 0 8px; font-size:17px; font-weight:800; line-height:1.25; }
.vxf-tour-body{ font-size:13.5px; line-height:1.6; max-height:42vh; overflow:auto; }
.vxf-tour-body ul{ margin:6px 0; padding-left:18px; } .vxf-tour-body li{ margin:3px 0; }
.vxf-tour-campo{ font-weight:800; color:var(--vx-accent, #2563eb); margin:0 0 6px; }
.vxf-tour-cont{ margin:0 0 4px; color:var(--vx-mut, #64748b); }
.vxf-tour-body .vxf-ojo{ margin-top:8px; padding:8px 10px; border-radius:8px;
  background:var(--vx-warn-soft, #fff7ed); font-size:12.5px; line-height:1.5; }
.vxf-tour-dots{ display:flex; gap:6px; justify-content:center; margin:14px 0 12px; flex-wrap:wrap; }
.vxf-tour-dot{ width:7px; height:7px; border-radius:50%; background:var(--vx-line, #e8edf3); }
.vxf-tour-dot.on{ background:var(--vx-accent, #2563eb); transform:scale(1.25); }
.vxf-tour-dot.done{ background:var(--vx-accent, #2563eb); opacity:.45; }
.vxf-tour-nav{ display:flex; gap:10px; }
.vxf-tour-prev, .vxf-tour-next{ flex:1; padding:10px 14px; border-radius:10px; font-weight:800;
  font-size:13.5px; font-family:inherit; cursor:pointer; }
.vxf-tour-prev{ background:transparent; border:1px solid var(--vx-line, #e8edf3); color:var(--vx-ink, #0f172a); }
.vxf-tour-prev[disabled]{ opacity:.4; cursor:default; }
.vxf-tour-next{ background:var(--vx-accent, #2563eb); border:1px solid var(--vx-accent, #2563eb); color:#fff; }
.vxf-tour-next:hover{ filter:brightness(1.06); }
.vxf-tour-prev:focus-visible, .vxf-tour-next:focus-visible, .vxf-tour-x:focus-visible{
  outline:2px solid var(--vx-accent, #2563eb); outline-offset:2px; }
@media (max-width:480px){ .vxf-tour-card{ width:94vw; bottom:12px; } .vxf-tour-card--top{ top:12px; } }
@media (prefers-reduced-motion: reduce){ .vxf-tour-overlay .vxf-spot-ring{ transition:none; } }

/* Toast del Faro (cuando el botón coach no vive en esta pantalla) */
.vxf-toast{ position:fixed; left:50%; bottom:24px; transform:translateX(-50%);
  z-index:calc(var(--vx-z-toast, 90) + 6); background:#0b1220; color:#fff; padding:11px 16px;
  border-radius:10px; font-size:13px; font-weight:600; box-shadow:0 12px 34px rgba(15,23,42,.4);
  max-width:min(420px, 90vw); text-align:center; opacity:0; transition:opacity .2s ease; }
.vxf-toast.vxf-toast-on{ opacity:1; }

/* ── Glosario flotante (término subrayado + tooltip) ── */
.vxf-term{ border-bottom:1px dotted currentColor; cursor:help; }
.vxf-tip{ position:fixed; z-index:calc(var(--vx-z-toast, 90) + 8); max-width:280px;
  background:#0b1220; color:#fff; padding:10px 12px; border-radius:10px; font-size:12.5px; line-height:1.5;
  box-shadow:0 12px 34px rgba(15,23,42,.4); font-weight:500; }
.vxf-tip b{ display:block; font-size:13px; margin-bottom:3px; }
.vxf-tip .vxf-tip-mas{ display:block; margin-top:6px; color:#93c5fd; font-size:12px; font-weight:700; }

/* ── Lista de guías ("Cómo hago…") ── */
.vxf-guias-list{ list-style:none; padding:0; margin:0; }
.vxf-guias-list li{ margin:0 0 8px; }
.vxf-guia-card{ display:flex; align-items:center; gap:12px; width:100%; text-align:left; cursor:pointer;
  padding:12px 14px; border-radius:12px; border:1px solid var(--vx-line, #e2e8f0);
  background:var(--vx-surface-2, #f7f9fc); font-family:inherit; }
.vxf-guia-card:hover{ box-shadow:var(--vx-shadow, 0 6px 16px rgba(16,24,40,.1)); transform:translateY(-1px); }
.vxf-guia-card .ic{ font-size:24px; }
.vxf-guia-card b{ display:block; font-size:14px; color:var(--vx-ink, #0f172a); }
.vxf-guia-card small{ color:var(--vx-mut, #64748b); font-size:12px; }
.vxf-back{ background:none; border:none; color:var(--vx-accent, #2563eb); font-weight:700; cursor:pointer;
  font-size:13px; padding:0 0 10px; font-family:inherit; }

/* ── Resultados de búsqueda ── */
.vxf-results{ list-style:none; padding:0; margin:0; }
.vxf-results li{ margin:0 0 6px; }
.vxf-result{ display:block; width:100%; text-align:left; cursor:pointer; padding:10px 12px; border-radius:10px;
  border:1px solid var(--vx-line, #e2e8f0); background:#fff; font-family:inherit; }
.vxf-result:hover, .vxf-result.vxf-sel{ background:var(--vx-surface-2, #f1f5f9); border-color:var(--vx-accent, #2563eb); }
.vxf-result b{ display:block; font-size:13.5px; color:var(--vx-ink, #0f172a); }
.vxf-result small{ color:var(--vx-mut, #64748b); font-size:11.5px; }
.vxf-result .vxf-badge{ float:right; font-size:10px; font-weight:800; text-transform:uppercase;
  color:var(--vx-accent, #2563eb); }

/* ── Las tres puertas del landing ── */
.vxf-doorways{ display:grid; grid-template-columns:repeat(3, 1fr); gap:12px; margin:0 0 18px; }
.vxf-door{ display:flex; align-items:center; gap:12px; text-align:left; cursor:pointer;
  padding:14px 16px; border-radius:14px; border:1px solid var(--vx-line, #e2e8f0);
  background:var(--vx-card, #fff); text-decoration:none; color:var(--vx-ink, #0f172a);
  font-family:var(--vx-font, 'Inter', system-ui, sans-serif);
  box-shadow:var(--vx-shadow, 0 1px 2px rgba(16,24,40,.05)); transition:transform .12s ease, box-shadow .12s ease; }
.vxf-door:hover{ transform:translateY(-2px); box-shadow:var(--vx-shadow-lg, 0 12px 30px rgba(16,24,40,.14)); }
.vxf-door--primary{ background:linear-gradient(120deg, var(--vx-accent, #2563eb), var(--vx-accent-d, #1d4ed8)); color:#fff; border-color:transparent; }
.vxf-door--primary small{ color:rgba(255,255,255,.85) !important; }
.vxf-door-ic{ font-size:26px; flex:0 0 auto; }
.vxf-door-tx b{ display:block; font-size:14.5px; font-weight:800; }
.vxf-door-tx small{ display:block; font-size:12px; color:var(--vx-mut, #64748b); margin-top:1px; }
@media (max-width:820px){ .vxf-doorways{ grid-template-columns:1fr; } }

/* --- Sin scroll del body cuando el panel está abierto --- */
body.vxf-lock{ overflow:hidden; }

/* ── MÓVIL: bottom-sheet + re-anclaje del launcher (evita bottom-nav + FAB verde) ── */
@media (max-width:820px){
  /* el launcher se va a abajo-IZQUIERDA, elevado sobre la bottom-nav; la derecha queda libre
     para .vx-fab-timbrar (right:14px, vx-design.css:255). */
  .vxf-launcher{
    top:auto; right:auto; left:14px;
    bottom:calc(var(--vx-bottomnav-h, 60px) + env(safe-area-inset-bottom, 0px) + 12px);
  }
  /* el panel sube desde abajo y cubre casi todo el alto */
  .vxf-panel{
    top:auto; bottom:0; right:0; left:0; width:100%; height:min(90dvh, 90vh);
    border-radius:18px 18px 0 0; transform:translateY(100%);
    box-shadow:0 -16px 40px rgba(15,23,42,.24);
  }
  .vxf-open .vxf-panel{ transform:translateY(0); }
  .vxf-head::before{
    content:""; position:absolute; top:8px; left:50%; transform:translateX(-50%);
    width:40px; height:4px; border-radius:999px; background:rgba(255,255,255,.5);
  }
  .vxf-head{ position:relative; padding-top:22px; }   /* aire para el "grabber" */
}

/* Respetar quien pidió menos movimiento */
@media (prefers-reduced-motion:reduce){
  .vxf-panel, .vxf-backdrop, .vxf-launcher{ transition:none; }
}
