/* ============================================================
   KBK Active — PWA Install Prompt
   Bottom-sheet on mobile, centered card on desktop.
   ============================================================ */

.pwa-install {
  position: fixed;
  inset: 0;
  z-index: 9990;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  font-family: 'Inter', 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

.pwa-install[hidden] {
  display: none;
}

.pwa-install-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 14, 26, 0.55);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.35s ease;
}

.pwa-install.open .pwa-install-backdrop {
  opacity: 1;
}

.pwa-install-sheet {
  position: relative;
  width: 100%;
  max-width: 460px;
  margin: 0 1rem 1.5rem;
  background: #ffffff;
  border-radius: 22px;
  box-shadow: 0 24px 70px -12px rgba(6, 14, 26, 0.45), 0 10px 24px -8px rgba(6, 14, 26, 0.25);
  border: 1px solid rgba(10, 22, 40, 0.08);
  padding: 2rem 1.75rem 1.5rem;
  text-align: center;
  transform: translateY(32px) scale(0.98);
  opacity: 0;
  transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.35s ease;
  overflow: hidden;
}

.pwa-install.open .pwa-install-sheet {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.pwa-install-sheet::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #b89230, #158585, #b89230);
}

[data-theme="dark"] .pwa-install-sheet {
  background: #1e293b;
  border-color: rgba(255, 255, 255, 0.08);
}

.pwa-install-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: var(--color-neutral-100, #e8e8ec);
  color: var(--color-neutral-600, #4a4a52);
  font-size: 0.9rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

[dir="rtl"] .pwa-install-close {
  right: auto;
  left: 14px;
}

.pwa-install-close:hover {
  transform: rotate(90deg);
  background: var(--color-neutral-200, #d1d1d8);
}

.pwa-install-icon {
  width: 88px;
  height: 88px;
  border-radius: 22px;
  box-shadow: 0 14px 30px -8px rgba(10, 22, 40, 0.45);
  margin: 0 auto 1.1rem;
  display: block;
}

.pwa-install-sheet h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  color: var(--color-primary-800, #142b48);
  letter-spacing: -0.02em;
}

[data-theme="dark"] .pwa-install-sheet h2 {
  color: #eaf1f9;
}

.pwa-install-sheet p {
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--color-neutral-500, #6b6b75);
  margin: 0 0 1.5rem;
}

[data-theme="dark"] .pwa-install-sheet p {
  color: #94a3b8;
}

.pwa-install-features {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.pwa-install-feature {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--color-primary-700, #0f1f36);
  background: var(--color-primary-50, #eaf1f9);
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
}

[data-theme="dark"] .pwa-install-feature {
  color: #c5d9ed;
  background: rgba(74, 122, 181, 0.18);
}

.pwa-install-feature svg {
  width: 14px;
  height: 14px;
  stroke: #158585;
}

.pwa-install-cta {
  display: block;
  width: 100%;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.98rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #1a3a5c 0%, #142b48 55%, #117070 130%);
  border-radius: 12px;
  padding: 0.9rem 1.5rem;
  box-shadow: 0 14px 28px -10px rgba(20, 43, 72, 0.55);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.pwa-install-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 34px -12px rgba(20, 43, 72, 0.6);
}

.pwa-install-cta:active {
  transform: translateY(0) scale(0.98);
}

.pwa-install-later {
  display: block;
  width: 100%;
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-neutral-400, #8f8f99);
  padding: 0.75rem 1rem 0.25rem;
}

.pwa-install-later:hover {
  color: var(--color-neutral-600, #4a4a52);
}

/* iOS A2HS steps */
.pwa-ios-steps {
  text-align: left;
  font-size: 0.86rem;
  color: var(--color-neutral-600, #4a4a52);
  line-height: 1.7;
  margin: 0 0 1.25rem;
}

[dir="rtl"] .pwa-ios-steps {
  text-align: right;
}

[data-theme="dark"] .pwa-ios-steps {
  color: #94a3b8;
}

.pwa-ios-steps ol {
  margin: 0;
  padding-inline-start: 1.25rem;
}

.pwa-ios-steps li {
  margin-bottom: 0.4rem;
}

.pwa-ios-share {
  display: inline-block;
  vertical-align: middle;
  margin-inline: 0.15rem;
}

/* Desktop: centered dialog instead of bottom sheet */
@media (min-width: 768px) {
  .pwa-install {
    align-items: center;
  }

  .pwa-install-sheet {
    margin: 0 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pwa-install-sheet,
  .pwa-install-backdrop {
    transition: none;
  }
}
