/* [Pulso-Supabase] 🧭 Guía (ver guia.js): recorrido, ayuda "?", "✓ Guardado", deshacer y accesibilidad. */

/* ── recorrido guiado: foco que resalta + tarjeta ── */
.cf-guia { position: fixed; inset: 0; z-index: 2147482000; }
.cf-guia-foco { position: fixed; border-radius: 14px; box-shadow: 0 0 0 9999px rgba(6, 4, 14, .66), 0 0 0 2px #e879f9, 0 0 24px 4px rgba(232, 121, 249, .45); pointer-events: none; transition: left .3s cubic-bezier(.2, .8, .2, 1), top .3s cubic-bezier(.2, .8, .2, 1), width .3s, height .3s; }
.cf-guia-centro .cf-guia-foco { box-shadow: 0 0 0 9999px rgba(6, 4, 14, .66); }
.cf-guia-card { position: fixed; width: min(360px, calc(100vw - 24px)); padding: 18px 18px 14px; border-radius: 18px; background: var(--surface, #181c2e); color: var(--t1, #fff);
  border: 1px solid color-mix(in srgb, #a855f7 45%, transparent); box-shadow: 0 18px 50px -10px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 255, 255, .04); transition: left .3s cubic-bezier(.2, .8, .2, 1), top .3s cubic-bezier(.2, .8, .2, 1); }
.cf-guia-t { display: block; font-size: 17px; margin: 8px 30px 6px 0; }
.cf-guia-d { margin: 0 0 14px; font-size: 14px; line-height: 1.5; color: var(--t2, #cbd5e1); }
.cf-guia-d b { color: var(--t1, #fff); }
.cf-guia-d kbd { padding: 1px 6px; border-radius: 6px; border: 1px solid var(--border, #444); font: inherit; font-size: 12px; }
.cf-guia-acc { display: flex; align-items: center; gap: 8px; }
.cf-guia-acc .cf-btn-primary { margin-left: auto; }
.cf-guia-n { font-size: 12px; color: var(--t2, #94a3b8); font-weight: 700; }
.cf-guia-pasos { display: flex; gap: 4px; }
.cf-guia-pasos i { height: 4px; flex: 1; border-radius: 9px; background: color-mix(in srgb, var(--t2, #94a3b8) 25%, transparent); transition: background .3s; }
.cf-guia-pasos i.ya { background: color-mix(in srgb, #a855f7 55%, transparent); }
.cf-guia-pasos i.on { background: linear-gradient(90deg, #f43f5e, #a855f7); }
.cf-guia-x { position: absolute; top: 18px; right: 12px; width: 28px; height: 28px; border-radius: 50%; border: 0; background: transparent; color: var(--t2, #94a3b8); font-size: 15px; cursor: pointer; }
.cf-guia-x:hover { background: color-mix(in srgb, var(--t2, #94a3b8) 15%, transparent); }
html.cf-mov .cf-guia-card { animation: cf-guia-in .28s cubic-bezier(.2, .8, .2, 1); }
@keyframes cf-guia-in { from { opacity: 0; transform: translateY(8px) scale(.98); } }

/* ── botón "?" junto al título de cada módulo + hoja de ayuda ── */
.cf-ayu-btn { display: inline-grid; place-items: center; width: 22px; height: 22px; margin-left: 8px; vertical-align: 3px; border-radius: 50%; border: 1.5px solid color-mix(in srgb, #a855f7 60%, transparent);
  background: color-mix(in srgb, #a855f7 12%, transparent); color: #c084fc; font: 800 13px/1 system-ui, sans-serif; cursor: pointer; padding: 0; transition: background .15s, transform .15s; }
.cf-ayu-btn:hover { background: linear-gradient(135deg, #f43f5e, #a855f7); color: #fff; border-color: transparent; transform: scale(1.08); }
@media (pointer: coarse) { .cf-ayu-btn { width: 26px; height: 26px; } }
.cf-ayu { width: min(460px, calc(100vw - 32px)); max-height: min(86vh, 760px); overflow-y: auto; }
.cf-ayu-head { flex-direction: row !important; align-items: center; gap: 10px; margin: 0 40px 10px 0; }
.cf-ayu-head b { font-size: 18px; }
.cf-ayu-ico { flex: 0 0 auto; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: linear-gradient(135deg, #f43f5e, #a855f7); color: #fff; font-weight: 900; font-size: 17px; }
.cf-ayu-l { margin: 0 0 12px; padding-left: 20px; display: grid; gap: 8px; font-size: 14px; line-height: 1.5; color: var(--t2); }
.cf-ayu-l b { color: var(--t1); }
.cf-ayu-l li::marker { color: #c084fc; }
.cf-ayu-dic { padding: 10px 12px; border-radius: 14px; background: color-mix(in srgb, #a855f7 8%, transparent); border: 1px solid color-mix(in srgb, #a855f7 22%, transparent); margin-bottom: 12px; }
.cf-ayu-dic p { margin: 6px 0 0; font-size: 13px; line-height: 1.45; color: var(--t2); }
.cf-ayu-dic p b { color: var(--t1); }
.cf-ayu-acc { display: flex; flex-wrap: wrap; gap: 8px; }

/* ── ✓ Guardado (arriba al centro, discreto) ── */
.cf-guardado { position: fixed; left: 50%; top: calc(env(safe-area-inset-top, 0px) + 10px); z-index: 2147481000; display: inline-flex; align-items: center; gap: 6px; padding: 6px 13px 6px 10px; border-radius: 99px;
  background: var(--surface, #181c2e); color: var(--t1, #fff); font-size: 12.5px; font-weight: 800; border: 1px solid var(--border, #333); box-shadow: 0 8px 24px -8px rgba(0, 0, 0, .5);
  transform: translate(-50%, -160%); opacity: 0; pointer-events: none; transition: transform .25s cubic-bezier(.2, .8, .2, 1), opacity .25s; }
.cf-guardado.cf-show { transform: translate(-50%, 0); opacity: 1; }
.cf-guardado svg { width: 16px; height: 16px; fill: none; stroke: #22c55e; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.cf-guardado.cf-ok { border-color: color-mix(in srgb, #22c55e 45%, transparent); }
.cf-guardado.cf-guardando i { width: 12px; height: 12px; border-radius: 50%; border: 2px solid color-mix(in srgb, #a855f7 30%, transparent); border-top-color: #a855f7; animation: cf-gu-gira .7s linear infinite; }
@keyframes cf-gu-gira { to { transform: rotate(360deg); } }
html.cf-mov .cf-guardado.cf-ok svg path { stroke-dasharray: 24; animation: cf-gu-check .35s ease-out; }
@keyframes cf-gu-check { from { stroke-dashoffset: 24; } }

/* ── ↩️ deshacer (abajo al centro, 5 s con barra que se acaba) ── */
.cf-deshacer { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 18px); z-index: 210; display: flex; align-items: center; gap: 14px; max-width: calc(100vw - 24px); overflow: hidden;
  padding: 10px 10px 10px 16px; border-radius: 16px; background: #1e1630; color: #fff; font-size: 14px; font-weight: 700; box-shadow: 0 14px 34px -8px rgba(0, 0, 0, .6); border: 1px solid rgba(168, 85, 247, .35);
  transform: translate(-50%, 160%); opacity: 0; visibility: hidden; transition: transform .25s cubic-bezier(.2, .8, .2, 1), opacity .25s, visibility .25s; }
.cf-deshacer.cf-show { transform: translate(-50%, 0); opacity: 1; visibility: visible; }
.cf-deshacer-t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.cf-deshacer-b { flex: 0 0 auto; padding: 8px 14px; border-radius: 11px; border: 0; background: linear-gradient(135deg, #f43f5e, #a855f7); color: #fff; font: inherit; font-weight: 800; cursor: pointer; }
.cf-deshacer-b:hover { filter: brightness(1.1); }
.cf-deshacer-barra { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: linear-gradient(90deg, #f43f5e, #a855f7); transform-origin: left; }
.cf-deshacer.cf-show .cf-deshacer-barra { animation: cf-desh-barra 5s linear forwards; }
@keyframes cf-desh-barra { to { transform: scaleX(0); } }
@media (max-width: 760px) { .cf-deshacer { width: calc(100vw - 24px); justify-content: space-between; } }

/* ── ♿ foco visible con teclado (no aparece al tocar con el dedo o el mouse) ── */
:is(button, a, input, select, textarea, [tabindex]):focus-visible { outline: 2.5px solid #e879f9; outline-offset: 2px; }
.cf-card:focus-visible, .cf-kb-sel { outline-offset: 3px; }
@media (prefers-contrast: more) {   /* el equipo pide más contraste: textos secundarios más fuertes */
  :root { --t2: #3c4456; }
  :root[data-theme="dark"] { --t2: #cfd5e6; }
}
@media (prefers-contrast: more) and (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --t2: #cfd5e6; } }

@media (prefers-reduced-motion: reduce) {
  .cf-guia-foco, .cf-guia-card, .cf-guardado, .cf-deshacer { transition: none !important; animation: none !important; }
  .cf-deshacer.cf-show .cf-deshacer-barra { animation-duration: 5s !important; }
}
