/* PWA install modal styles added for browser install and iOS Add to Home Screen guidance. */
.pwa-install-button {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 9998;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  color: #ffffff;
  background: #4D7DE6;
  box-shadow: 0 12px 30px rgba(77, 125, 230, 0.32);
  font: 700 14px/1.2 Arial, Helvetica, sans-serif;
  cursor: pointer;
}

.pwa-install-button.is-visible {
  display: inline-flex;
}

.pwa-nav-install-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  color: #ffffff !important;
  background: #4D7DE6;
  font: 700 14px/1.2 Arial, Helvetica, sans-serif;
  text-decoration: none !important;
  cursor: pointer;
  white-space: nowrap;
}

.pwa-nav-install-button:hover,
.pwa-nav-install-button:focus {
  color: #ffffff !important;
  background: #3868d4;
}

.pwa-nav-install-button--inline {
  margin: 0 0 0 10px;
  min-height: 36px;
  padding: 0 13px;
  vertical-align: middle;
}

.pwa-mobile-install-section {
  display: none;
}

.pwa-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(2, 6, 23, 0.68);
}

.pwa-modal.is-visible {
  display: flex;
}

.pwa-modal__panel {
  width: min(100%, 430px);
  max-height: min(720px, calc(100vh - 36px));
  overflow-y: auto;
  border-radius: 18px;
  background: #ffffff;
  color: #111827;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
}

.pwa-modal__header,
.pwa-modal__body,
.pwa-modal__footer {
  padding: 22px;
}

.pwa-modal__header {
  padding-bottom: 8px;
}

.pwa-modal__title {
  margin: 0 0 8px;
  font-size: 24px;
  font-weight: 800;
  color: #0f172a;
}

.pwa-modal__text {
  margin: 0;
  color: #475569;
  line-height: 1.5;
}

.pwa-modal__steps {
  display: grid;
  gap: 12px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

.pwa-modal__step {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 12px;
  align-items: start;
  padding: 14px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
}

.pwa-modal__step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: #ffffff;
  background: #4D7DE6;
  font-weight: 800;
}

.pwa-modal__step-title {
  margin: 0 0 3px;
  color: #0f172a;
  font-size: 15px;
  font-weight: 800;
}

.pwa-modal__step-text {
  margin: 0;
  color: #64748b;
  font-size: 14px;
  line-height: 1.45;
}

.pwa-modal__ios,
.pwa-modal__manual {
  display: none;
  margin-top: 16px;
  padding: 14px;
  border-radius: 12px;
  color: #1e3a8a;
  background: #eff6ff;
  font-size: 14px;
  line-height: 1.45;
}

.pwa-modal__manual {
  color: #334155;
  background: #f8fafc;
}

.pwa-modal__ios.is-visible,
.pwa-modal__manual.is-visible {
  display: block;
}

.pwa-modal__footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding-top: 8px;
}

.pwa-modal__action,
.pwa-modal__secondary {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 10px;
  font-weight: 800;
  cursor: pointer;
}

.pwa-modal__action {
  border: 0;
  color: #ffffff;
  background: #4D7DE6;
}

.pwa-modal__action[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

.pwa-modal__secondary {
  border: 1px solid #cbd5e1;
  color: #334155;
  background: #ffffff;
}

@media (max-width: 480px) {
  .pwa-install-button {
    right: 14px;
    bottom: 86px;
  }

  .pwa-modal {
    align-items: flex-end;
    padding: 0;
  }

  .pwa-modal__panel {
    width: 100%;
    max-height: 92vh;
    border-radius: 18px 18px 0 0;
  }

  .pwa-modal__footer {
    flex-direction: column-reverse;
  }

  .pwa-modal__action,
  .pwa-modal__secondary {
    width: 100%;
  }
}

@media (max-width: 959px) {
  .pwa-install-button.is-visible {
    display: none;
  }

  .pwa-mobile-install-section {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;
    z-index: 9997;
    display: flex !important;
    justify-content: center;
    padding: 10px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.92);
    box-shadow: 0 16px 38px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }

  .pwa-mobile-install-section .pwa-nav-install-button {
    width: 100%;
    min-height: 48px;
    font-size: 15px;
  }

  body {
    padding-bottom: 86px;
  }
}
