/* ==================================================================
   ZX Abogados · Portal de clientes · instalar la app
   Guía de instalación (iPhone, WeChat, menú del navegador), aviso de
   "app instalada" y botones de instalar. La usan el acceso y la app.
   ================================================================== */
body.pwa-abierta { overflow: hidden; }
.pwa-guia { position: fixed; inset: 0; z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(19, 23, 29, 0.72); backdrop-filter: blur(3px); animation: pwa-entrar 0.2s ease both; font-family: var(--zx-ui); color: var(--zx-texto); }
dialog.pwa-guia { width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; border: 0; overflow: auto; }
dialog.pwa-guia:not([open]) { display: none; }
dialog.pwa-guia::backdrop { background: transparent; }
html[lang^="zh"] .pwa-guia { font-family: var(--zx-cjk); }
.pwa-caja { position: relative; width: min(440px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; padding: 22px 20px 18px; border-radius: 18px; background: #fff; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5); }
.pwa-caja::before { content: ""; position: absolute; left: 20px; right: 20px; top: 0; height: 3px; border-radius: 0 0 3px 3px; background: var(--zx-sello); }
.pwa-x { position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 10px; background: transparent; color: var(--zx-gris); cursor: pointer; }
.pwa-x:hover { background: var(--zx-marfil); color: var(--zx-tinta); }
.pwa-guia svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.pwa-cab { display: flex; align-items: center; gap: 12px; margin: 4px 40px 14px 0; }
.pwa-cab img { width: 56px; height: 56px; border-radius: 14px; box-shadow: 0 8px 20px rgba(192, 12, 12, 0.35); }
.pwa-cab div { display: grid; line-height: 1.25; }
.pwa-cab b { font-family: var(--zx-display); font-size: 19px; }
.pwa-cab small { font-size: 12.5px; color: var(--zx-gris); }
.pwa-caja h2 { margin: 0 0 6px; font-family: var(--zx-display); font-size: 24px; line-height: 1.1; }
html[lang^="zh"] .pwa-caja h2 { font-family: var(--zx-cjk); font-size: 21px; }
.pwa-intro { margin: 0 0 12px; font-size: 14.5px; color: var(--zx-tinta-3); }
.pwa-pasos { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; }
.pwa-pasos li { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--zx-niebla); border: 1px solid var(--zx-filete-suave); font-size: 14.5px; line-height: 1.45; }
.pwa-num { flex: none; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--zx-tinta); color: #fff; font-size: 13px; font-weight: 800; }
.pwa-ico { flex: none; display: grid; place-items: center; width: 30px; height: 30px; margin-top: -3px; border-radius: 8px; background: #fff; color: #0a84ff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }
.pwa-ventaja { margin: 0 0 14px; font-size: 13px; color: var(--zx-gris); }
.pwa-botones { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.pwa-pri, .pwa-sec { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 12px; font: inherit; font-weight: 700; cursor: pointer; }
.pwa-pri { border: 0; background: var(--zx-sello); color: #fff; }
.pwa-pri:hover { background: var(--zx-sello-hover); }
.pwa-sec { border: 1px solid var(--zx-filete); background: #fff; color: var(--zx-tinta); }
/* Flecha hacia el botón del navegador que hay que tocar. */
.pwa-flecha { position: fixed; z-index: 2001; display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%; background: var(--zx-sello); color: #fff; box-shadow: 0 0 0 6px rgba(192, 12, 12, 0.25), 0 10px 30px rgba(0, 0, 0, 0.4); pointer-events: none; }
.pwa-flecha svg { width: 28px; height: 28px; stroke-width: 2.4; }
.flecha-arriba .pwa-flecha { top: max(10px, env(safe-area-inset-top)); right: 14px; animation: pwa-arriba 1.1s ease-in-out infinite; }
.flecha-abajo .pwa-flecha { bottom: max(14px, env(safe-area-inset-bottom)); left: 50%; margin-left: -27px; animation: pwa-abajo 1.1s ease-in-out infinite; }
.flecha-abajo .pwa-flecha svg { transform: rotate(180deg); }
.flecha-arriba { align-items: flex-end; padding-top: 80px; }
.flecha-abajo { align-items: flex-start; padding-bottom: 90px; }
@keyframes pwa-entrar { from { opacity: 0; } to { opacity: 1; } }
@keyframes pwa-arriba { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes pwa-abajo { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(8px); } }
/* "App instalada" */
.pwa-listo { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 2002; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; width: min(440px, calc(100% - 24px)); padding: 12px 16px; border-radius: 12px; background: #1b2027; color: #fff; font: 600 14.5px/1.4 var(--zx-ui); box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4); animation: pwa-entrar 0.2s ease both; }
.pwa-listo svg { flex: none; width: 20px; height: 20px; fill: none; stroke: #5ee3a8; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
@media (min-width: 700px) {
  .flecha-abajo, .flecha-arriba { align-items: center; padding: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .pwa-flecha, .pwa-guia, .pwa-listo { animation: none; }
}
