/* CSS/help.css — Guía de uso: botón "?" en la barra superior y panel de ayuda.
   Escritorio: panel a la derecha. Teléfono: hoja inferior a todo el ancho, sin scroll horizontal. */

.help-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; }
.help-btn[hidden] { display: none; }
.help-btn svg { width: 20px; height: 20px; }
.help-dot {
    position: absolute; top: 5px; right: 5px; width: 9px; height: 9px; border-radius: 50%;
    background: #f59e0b; border: 2px solid var(--card-bg, #18181a); transform: scale(0); transition: transform 0.2s ease;
}
.help-btn.has-dot .help-dot { transform: scale(1); animation: hp-pulse 2.2s ease-in-out infinite; }

.hp-overlay {
    position: fixed; inset: 0; z-index: 10500; display: flex; justify-content: flex-end; align-items: stretch;
    background: rgba(6, 8, 18, 0.5); opacity: 0; transition: opacity 0.2s ease;
}
.hp-overlay[hidden] { display: none; }
.hp-overlay.is-in { opacity: 1; }
html.hp-open, html.hp-open body { overflow: hidden; }

.hp-panel {
    box-sizing: border-box; display: flex; flex-direction: column; width: min(420px, 100%); height: 100%;
    background: var(--card-bg); color: var(--text-primary); border-left: 1px solid var(--card-border);
    box-shadow: -24px 0 60px -30px rgba(0, 0, 0, 0.6); outline: none; overflow-wrap: anywhere;
    transform: translateX(24px); transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.hp-overlay.is-in .hp-panel { transform: none; }

.hp-head { display: flex; align-items: center; gap: 12px; padding: 16px 16px 12px; border-bottom: 1px solid var(--card-border); flex: none; }
.hp-ico { display: grid; place-items: center; flex: none; width: 42px; height: 42px; border-radius: 13px; color: var(--primary-color); background: color-mix(in srgb, var(--primary-color) 14%, transparent); }
.hp-ico svg { width: 22px; height: 22px; }
.hp-headt { flex: 1; min-width: 0; }
.hp-kicker { display: block; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-secondary); }
.hp-head h2 { margin: 0; font-size: 1.15rem; line-height: 1.25; }
.hp-x { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border: 0; border-radius: 12px; background: transparent; color: var(--text-secondary); cursor: pointer; }
.hp-x:hover { background: color-mix(in srgb, var(--text-primary) 8%, transparent); }
.hp-x svg { width: 20px; height: 20px; }

.hp-body { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 16px; -webkit-overflow-scrolling: touch; }
.hp-what { margin: 0 0 6px; font-size: 1rem; line-height: 1.5; }
.hp-h { margin: 20px 0 10px; font-size: 0.75rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-secondary); }

.hp-steps { list-style: none; counter-reset: hp; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.hp-steps li { counter-increment: hp; display: flex; gap: 12px; align-items: flex-start; font-size: 0.93rem; line-height: 1.45; }
.hp-steps li::before {
    content: counter(hp); flex: none; display: grid; place-items: center; width: 26px; height: 26px; margin-top: 1px;
    border-radius: 50%; font-size: 0.8rem; font-weight: 800; color: #fff; background: var(--primary-color);
}

.hp-tip { display: flex; gap: 10px; align-items: flex-start; margin-top: 18px; padding: 12px 14px; border-radius: 14px; background: color-mix(in srgb, #f59e0b 12%, transparent); border: 1px solid color-mix(in srgb, #f59e0b 30%, transparent); }
.hp-tip svg { flex: none; width: 18px; height: 18px; margin-top: 2px; color: #f59e0b; }
.hp-tip p { margin: 0; font-size: 0.88rem; line-height: 1.45; }

.hp-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.hp-chip { padding: 8px 13px; border-radius: 99px; border: 1px solid var(--card-border); background: transparent; color: var(--text-primary); font: inherit; font-size: 0.84rem; cursor: pointer; }
.hp-chip:hover { border-color: var(--primary-color); }
.hp-chip.is-on { background: var(--primary-color); border-color: var(--primary-color); color: #fff; }

.hp-foot { flex: none; padding: 10px 16px calc(12px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--card-border); text-align: center; }
.hp-link { background: none; border: 0; padding: 8px; font: inherit; font-size: 0.85rem; color: var(--primary-color); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

.hp-x:focus-visible, .hp-chip:focus-visible, .hp-link:focus-visible, .help-btn:focus-visible { outline: 2px solid var(--primary-color); outline-offset: 2px; }

@keyframes hp-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.55); } 50% { box-shadow: 0 0 0 6px rgba(245, 158, 11, 0); } }

@media (max-width: 768px) {
    .hp-overlay { align-items: flex-end; justify-content: center; }
    .hp-panel {
        width: 100%; height: auto; max-height: 86dvh; border-left: 0; border-top: 1px solid var(--card-border);
        border-radius: 22px 22px 0 0; box-shadow: 0 -20px 60px -30px rgba(0, 0, 0, 0.6); transform: translateY(24px);
    }
}
@media (prefers-reduced-motion: reduce) {
    .hp-overlay, .hp-panel { transition: none; }
    .help-dot { transition: none; }
    .help-btn.has-dot .help-dot { animation: none; }
}

/* ---- Centro de ayuda: buscador, pestañas, pasos marcables, preguntas, tarjetas y glosario ---- */
.hp-searchwrap { position: relative; flex: none; padding: 12px 16px 0; }
.hp-searchwrap svg { position: absolute; left: 28px; top: 50%; margin-top: 6px; transform: translateY(-50%); width: 17px; height: 17px; color: var(--text-secondary); pointer-events: none; }
.hp-search {
    box-sizing: border-box; width: 100%; padding: 11px 14px 11px 38px; border-radius: 12px; border: 1px solid var(--card-border);
    background: color-mix(in srgb, var(--text-primary) 5%, transparent); color: var(--text-primary); font: inherit; font-size: 16px;
}
.hp-search:focus { outline: 2px solid var(--primary-color); outline-offset: 1px; }

.hp-tabs { flex: none; display: flex; gap: 6px; padding: 10px 16px 0; border-bottom: 1px solid var(--card-border); }
.hp-tab { flex: 1; padding: 10px 6px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--text-secondary); font: inherit; font-size: 0.85rem; font-weight: 600; cursor: pointer; }
.hp-tab.is-on { color: var(--primary-color); border-bottom-color: var(--primary-color); }
.hp-head { border-bottom: 0; }

.hp-prog { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; }
.hp-track { flex: 1; height: 6px; border-radius: 99px; background: color-mix(in srgb, var(--text-primary) 10%, transparent); overflow: hidden; }
.hp-fill { display: block; height: 100%; border-radius: 99px; background: var(--primary-color); transition: width 0.25s ease; }
.hp-proglbl { font-size: 0.75rem; color: var(--text-secondary); text-align: right; }

.hp-steps li { display: block; }
.hp-steps li::before { content: none; }
.hp-step {
    display: flex; gap: 12px; align-items: flex-start; width: 100%; padding: 10px 12px; text-align: left; font: inherit; font-size: 0.93rem; line-height: 1.45;
    color: var(--text-primary); background: color-mix(in srgb, var(--text-primary) 4%, transparent); border: 1px solid var(--card-border); border-radius: 14px; cursor: pointer;
}
.hp-step:hover { border-color: var(--primary-color); }
.hp-num { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; font-size: 0.8rem; font-weight: 800; color: #fff; background: var(--primary-color); }
.hp-steptxt { min-width: 0; }
.hp-steps li.is-done .hp-num { background: #16a34a; font-size: 0; }
.hp-steps li.is-done .hp-num::after { content: "✓"; font-size: 0.85rem; }
.hp-steps li.is-done .hp-steptxt { color: var(--text-secondary); text-decoration: line-through; }

.hp-cta {
    display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin-top: 16px; padding: 13px; border: 0; border-radius: 14px;
    background: var(--primary-color); color: #fff; font: inherit; font-weight: 700; cursor: pointer;
}
.hp-cta svg { width: 18px; height: 18px; }

.hp-faq { display: flex; flex-direction: column; gap: 8px; }
.hp-q { border: 1px solid var(--card-border); border-radius: 14px; padding: 0 14px; }
.hp-q summary { padding: 12px 0; font-size: 0.92rem; font-weight: 600; cursor: pointer; }
.hp-q p { margin: 0 0 12px; font-size: 0.88rem; line-height: 1.5; color: var(--text-secondary); }
.hp-inline { display: block; margin: -4px 0 8px; padding: 4px 0; }

.hp-pager { display: flex; gap: 8px; margin-top: 20px; }
.hp-pg { flex: 1; min-width: 0; padding: 10px; border: 1px solid var(--card-border); border-radius: 12px; background: none; color: var(--text-primary); font: inherit; font-size: 0.82rem; cursor: pointer; }
.hp-pg:hover { border-color: var(--primary-color); }

.hp-cards { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.hp-card { display: flex; gap: 12px; align-items: center; width: 100%; padding: 12px; text-align: left; font: inherit; color: var(--text-primary); background: none; border: 1px solid var(--card-border); border-radius: 14px; cursor: pointer; }
.hp-card:hover { border-color: var(--primary-color); }
.hp-cardico { display: grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: 11px; color: var(--primary-color); background: color-mix(in srgb, var(--primary-color) 14%, transparent); }
.hp-cardico svg { width: 20px; height: 20px; }
.hp-cardtx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.hp-cardtx strong { font-size: 0.95rem; }
.hp-cardtx span { font-size: 0.82rem; line-height: 1.4; color: var(--text-secondary); }
.hp-ok { flex: none; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: #16a34a; color: #fff; }
.hp-ok svg { width: 14px; height: 14px; }

.hp-gloss { margin: 12px 0 0; }
.hp-gloss dt { margin-top: 14px; font-weight: 700; font-size: 0.93rem; }
.hp-gloss dd { margin: 3px 0 0; font-size: 0.88rem; line-height: 1.5; color: var(--text-secondary); }
.hp-empty { margin: 24px 0; text-align: center; color: var(--text-secondary); line-height: 1.5; }

.hp-tab:focus-visible, .hp-step:focus-visible, .hp-card:focus-visible, .hp-cta:focus-visible, .hp-pg:focus-visible, .hp-q summary:focus-visible { outline: 2px solid var(--primary-color); outline-offset: 2px; }

@media (max-width: 768px) {
    .hp-panel { height: 86dvh; }   /* altura fija en el teléfono: al buscar o cambiar de pestaña la hoja no salta */
}
@media (prefers-reduced-motion: reduce) { .hp-fill { transition: none; } }
