/* "Install app" popup shown on the landing page (demo only) */
.pwa {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  visibility: hidden;
}
.pwa.open {
  visibility: visible;
}
.pwa-ov {
  position: absolute;
  inset: 0;
  background: rgba(8, 20, 10, 0.55);
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity 0.25s;
}
.pwa.open .pwa-ov {
  opacity: 1;
}
.pwa-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  padding: 1.5rem 1.4rem 1.2rem;
  border-radius: 24px;
  background: #fff;
  color: #0f172a;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.4);
  transform: translateY(18px) scale(0.97);
  opacity: 0;
  transition:
    transform 0.28s ease,
    opacity 0.28s ease;
}
.pwa.open .pwa-card {
  transform: none;
  opacity: 1;
}
.pwa-x {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: #f1f5f9;
  color: #475569;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.pwa-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-right: 34px;
  margin-bottom: 1.1rem;
}
.pwa-icon {
  flex: none;
  width: 64px;
  height: 72px;
  padding: 6px;
  object-fit: contain;
  border-radius: 18px;
  background: #fff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 8px 20px -10px rgba(15, 23, 42, 0.5);
}
.pwa-head h3 {
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.25;
}
.pwa-head p {
  margin: 2px 0 0;
  color: #64748b;
  font-size: 0.82rem;
}
.pwa-list {
  display: grid;
  gap: 0.6rem;
  margin: 0 0 1.2rem;
  padding: 0;
  list-style: none;
}
.pwa-list li {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 0.65rem 0.8rem;
  border-radius: 14px;
  background: #f3fbf4;
  font-size: 0.9rem;
}
.pwa-list svg {
  flex: none;
  color: #1b5e20;
}
.pwa-actions {
  display: flex;
  gap: 10px;
}
.pwa-btn {
  flex: 1;
  min-height: 48px;
  padding: 0.6rem 1rem;
  border-radius: 14px;
  border: 2px solid #2e7d32;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition:
    background 0.15s,
    transform 0.15s;
}
.pwa-btn:hover {
  transform: translateY(-1px);
}
.pwa-btn.primary {
  background: #2e7d32;
  color: #fff;
}
.pwa-btn.primary:hover {
  background: #1b5e20;
}
.pwa-btn.ghost {
  background: transparent;
  color: #2e7d32;
}
.pwa-note {
  margin: 0.9rem 0 0;
  text-align: center;
  color: #94a3b8;
  font-size: 0.74rem;
}
.pwa-bar {
  height: 8px;
  margin: 1.2rem 0 0.8rem;
  border-radius: 99px;
  background: #e2e8f0;
  overflow: hidden;
}
.pwa-bar span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 99px;
  background: linear-gradient(90deg, #1b5e20, #66bb6a);
  animation: pwa-fill 1.6s ease forwards;
}
@keyframes pwa-fill {
  to {
    width: 100%;
  }
}
.pwa-done {
  text-align: center;
}
.pwa-done h3 {
  margin: 0.6rem 0 0.2rem;
  font-size: 1.2rem;
}
.pwa-done p {
  margin: 0 0 1rem;
  color: #64748b;
  font-size: 0.9rem;
}
.pwa-done .pwa-note {
  margin-top: 0.9rem;
}
.pwa-check {
  display: inline-grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #e8f5e9;
  color: #1b5e20;
  animation: pwa-pop 0.35s ease;
}
@keyframes pwa-pop {
  from {
    transform: scale(0.5);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}

/* phones: bottom sheet, like the install sheet of a mobile browser */
@media (max-width: 600px) {
  .pwa {
    align-items: flex-end;
    padding: 0;
  }
  .pwa-card {
    max-width: none;
    border-radius: 24px 24px 0 0;
    padding-bottom: calc(1.2rem + env(safe-area-inset-bottom, 0px));
    transform: translateY(100%);
  }
  .pwa.open .pwa-card {
    transform: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .pwa-ov,
  .pwa-card {
    transition: none;
  }
  .pwa-bar span,
  .pwa-check {
    animation-duration: 0.01s;
  }
}
