/* =========================================================
   UFY PHONE — PWA: INSTALAR UFY PHONE
   La tarjeta discreta de una sola vez (public/js/ufy-phone/pwa-install.js)
   y el mini tutorial de iPhone, con su dibujo hecho con CSS
   (public/js/ufy-phone/pwa-install-ios.js).
   ========================================================= */

.ufy-pwa-install-card {
  position: fixed;
  left: 50%;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 30000;

  width: min(calc(100% - 32px), 380px);
  box-sizing: border-box;

  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 12px;

  padding: 14px;

  border: 1px solid rgba(222, 205, 255, 0.24);
  border-radius: 20px;

  color: rgba(255, 255, 255, 0.96);

  background:
    linear-gradient(
      145deg,
      rgba(42, 30, 72, 0.95),
      rgba(14, 10, 26, 0.95)
    );

  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5);

  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);

  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  transform: translateX(-50%);
  animation: ufy-pwa-card-in 0.3s ease-out;
}


.ufy-pwa-install-mark {
  width: 44px;
  height: 44px;

  display: grid;
  place-items: center;

  border-radius: 12px;

  color: #111111;
  background: #ffffff;

  font-size: 13px;
  font-weight: 780;
  letter-spacing: 1px;
}


.ufy-pwa-install-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}


.ufy-pwa-install-copy strong {
  font-size: 15px;
  font-weight: 700;
}


.ufy-pwa-install-copy span {
  color: rgba(235, 228, 248, 0.76);
  font-size: 13px;
  line-height: 1.4;
}


.ufy-pwa-install-actions {
  grid-column: 1 / -1;

  display: flex;
  justify-content: flex-end;
  gap: 8px;
}


.ufy-pwa-install-actions button {
  appearance: none;

  min-height: 40px;
  padding: 9px 16px;

  border: 0;
  border-radius: 999px;

  font: inherit;
  font-size: 14px;
  font-weight: 650;

  cursor: pointer;
}


.ufy-pwa-install-actions [data-pwa-card-later] {
  color: rgba(255, 255, 255, 0.86);
  background: rgba(255, 255, 255, 0.1);
}


.ufy-pwa-install-actions [data-pwa-card-install] {
  color: #ffffff;
  background: linear-gradient(135deg, #7442ed, #5130bb);
}


.ufy-pwa-install-actions button:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 3px;
}


@keyframes ufy-pwa-card-in {
  from {
    opacity: 0;
    transform: translate(-50%, 12px);
  }

  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}


/* La hoja de abajo de Ajustes, abierta encima de toda la página (desde la
   tarjeta): fija en la pantalla y por encima del teléfono. */
.us-overlay.ufy-pwa-sheet.is-page-sheet {
  position: fixed;
  z-index: 2147480000;
}


/* ----- Mini tutorial de iPhone ----- */

.ufy-pwa-ios {
  padding-bottom: 6px;
}


.ufy-pwa-ios-figure {
  display: flex;
  justify-content: center;
  margin: 4px 0 18px;
}


.ufy-pwa-ios-phone {
  position: relative;

  width: 132px;
  height: 214px;

  overflow: hidden;

  border: 2px solid rgba(255, 255, 255, 0.35);
  border-radius: 26px;

  background: linear-gradient(180deg, #1d1533, #07050d);

  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}


.ufy-pwa-ios-address {
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;

  height: 18px;

  display: grid;
  place-items: center;

  border-radius: 9px;

  color: rgba(255, 255, 255, 0.78);
  background: rgba(255, 255, 255, 0.14);

  font-size: 9px;
}


.ufy-pwa-ios-app {
  position: absolute;
  top: 66px;
  left: 50%;

  width: 46px;
  height: 46px;

  display: grid;
  place-items: center;

  border-radius: 13px;

  color: #111111;
  background: #ffffff;

  font-size: 12px;
  font-weight: 780;
  letter-spacing: 1px;

  transform: translateX(-50%);
}


.ufy-pwa-ios-toolbar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;

  height: 40px;

  display: flex;
  align-items: center;
  justify-content: space-around;

  border-top: 1px solid rgba(255, 255, 255, 0.12);

  background: rgba(255, 255, 255, 0.08);
}


.ufy-pwa-ios-toolbar i {
  width: 10px;
  height: 10px;

  border-radius: 3px;

  background: rgba(255, 255, 255, 0.35);
}


.ufy-pwa-ios-share {
  position: relative;

  width: 22px;
  height: 22px;

  color: #4da3ff;
}


/* El aro que late encima del botón Compartir. */
.ufy-pwa-ios-share::after {
  content: "";

  position: absolute;
  inset: -6px;

  border: 2px solid #4da3ff;
  border-radius: 50%;

  animation: ufy-pwa-pulse 1.6s ease-out infinite;
}


.ufy-pwa-ios-glyph {
  width: 100%;
  height: 100%;

  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}


.ufy-pwa-ios-steps {
  list-style: none;

  margin: 0;
  padding: 0;

  display: flex;
  flex-direction: column;
  gap: 14px;
}


.ufy-pwa-ios-steps li {
  display: flex;
  align-items: flex-start;
  gap: 12px;

  font-size: calc(14px * var(--us-scale, 1));
  line-height: 1.5;
}


.ufy-pwa-ios-step-icon {
  flex: none;

  width: 30px;
  height: 30px;
  padding: 4px;
  box-sizing: border-box;

  display: grid;
  place-items: center;

  border: 1px solid var(--us-line, #373737);
  border-radius: 9px;

  color: #4da3ff;

  font-size: 15px;
  font-weight: 700;
}


.ufy-pwa-ios-note {
  margin: 16px 0 0;

  color: var(--us-muted, #aaaaaa);

  font-size: calc(13px * var(--us-scale, 1));
  line-height: 1.5;
}


.ufy-pwa-ios-note:first-child {
  margin: 0 0 16px;
}


@keyframes ufy-pwa-pulse {
  from {
    opacity: 0.9;
    transform: scale(0.8);
  }

  to {
    opacity: 0;
    transform: scale(1.5);
  }
}


@media (prefers-reduced-motion: reduce) {
  .ufy-pwa-install-card,
  .ufy-pwa-ios-share::after {
    animation: none;
  }
}
