/*
 * PWA install + notification prompts.
 *
 * Plain CSS rather than a scss/ partial, and loaded separately (like
 * skeleton.css): these elements only ever exist when pwa.js injects them, so
 * folding them into index.min.css would add bytes to every page for a widget
 * most page views never render.
 *
 * Everything is namespaced under .lb-pwa- and uses its own tokens, so nothing
 * here depends on Bootstrap being present or on the site's SCSS variables.
 */

.lb-pwa-card,
.lb-pwa-toast {
  --lb-pwa-brand: #0A7DFF;
  --lb-pwa-surface: #ffffff;
  --lb-pwa-text: #16212f;
  --lb-pwa-muted: #5d6d80;
  --lb-pwa-line: #e4ebf3;
  font-family: Outfit, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  /* Above Bootstrap's modal backdrop (1050) but below the toast layer of any
     SweetAlert dialog (1060+), so a Swal always wins. */
  z-index: 1055;
}

/* ---------------------------------------------------------------- card ---- */

.lb-pwa-card {
  position: fixed;
  left: 12px;
  right: 12px;
  /* env() keeps the card off the iOS home indicator and the Android gesture
     bar; the fallback applies everywhere else. */
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  max-width: 420px;
  margin: 0 auto;
  padding: 18px 18px 16px;
  background: var(--lb-pwa-surface);
  color: var(--lb-pwa-text);
  border: 1px solid var(--lb-pwa-line);
  border-radius: 16px;
  box-shadow: 0 16px 44px rgba(11, 32, 60, .18);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .28s ease, transform .28s cubic-bezier(.2, .8, .3, 1);
  will-change: opacity, transform;
}

.lb-pwa-card.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.lb-pwa-card__body {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.lb-pwa-card__icon {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  border-radius: 12px;
}

.lb-pwa-card__text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-right: 18px; /* clears the close button */
}

.lb-pwa-card__title {
  font-size: 15.5px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -.01em;
}

.lb-pwa-card__desc {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--lb-pwa-muted);
}

.lb-pwa-card__actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.lb-pwa-btn {
  flex: 1;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition: filter .15s ease, background-color .15s ease;
}

.lb-pwa-btn--primary {
  background: var(--lb-pwa-brand);
  color: #fff;
}

.lb-pwa-btn--primary:hover { filter: brightness(1.06); }

.lb-pwa-btn--ghost {
  background: transparent;
  color: var(--lb-pwa-muted);
  border-color: var(--lb-pwa-line);
}

.lb-pwa-btn--ghost:hover { background: #f4f7fb; }

.lb-pwa-close {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #9aa8b8;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.lb-pwa-close:hover { background: #f1f5fa; color: var(--lb-pwa-text); }

/* iOS "add to home screen" walkthrough */
.lb-pwa-steps {
  margin: 14px 0 0;
  padding-left: 20px;
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--lb-pwa-muted);
}

.lb-pwa-steps strong { color: var(--lb-pwa-text); }

/* --------------------------------------------------------------- toast ---- */

.lb-pwa-toast {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  max-width: 420px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px 13px 16px;
  background: #16212f;
  color: #f2f6fb;
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(11, 32, 60, .28);
  font-size: 13.5px;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .25s ease, transform .25s ease;
}

.lb-pwa-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.lb-pwa-toast__msg { flex: 1; line-height: 1.45; }

.lb-pwa-toast__action {
  flex: 0 0 auto;
  padding: 7px 12px;
  border: 0;
  border-radius: 8px;
  background: var(--lb-pwa-brand);
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

/* ------------------------------------------------------------ contexts ---- */

@media (min-width: 576px) {
  .lb-pwa-card,
  .lb-pwa-toast {
    left: auto;
    right: 20px;
    bottom: 20px;
    margin: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lb-pwa-card,
  .lb-pwa-toast { transition: opacity .01ms; transform: none; }
}

@media (prefers-color-scheme: dark) {
  .lb-pwa-card {
    --lb-pwa-surface: #18212c;
    --lb-pwa-text: #e9eff7;
    --lb-pwa-muted: #9dadc0;
    --lb-pwa-line: #2a3644;
    box-shadow: 0 16px 44px rgba(0, 0, 0, .5);
  }
  .lb-pwa-btn--ghost:hover { background: #212c3a; }
  .lb-pwa-close:hover { background: #212c3a; color: var(--lb-pwa-text); }
}
