/* Invitation compacte d'installation PWA BPlusConnect */
#pwa-install-banner {
  position: fixed;
  left: 18px;
  bottom: 18px;
  z-index: 99999;
  width: min(370px, calc(100vw - 36px));
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 18px;
  background: #0f172a;
  color: #fff;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.4);
  animation: pwa-slide-in 0.28s ease-out;
  overflow: hidden;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

@keyframes pwa-slide-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pwa-attention {
  0%, 100% { transform: translateX(0); }
  35% { transform: translateX(5px); }
  70% { transform: translateX(-3px); }
}

#pwa-install-banner.pwa-install-attention {
  animation: pwa-attention 0.35s ease;
}

.pwa-install-content {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 42px 13px 13px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.pwa-install-content:hover,
.pwa-install-content:focus-visible {
  background: rgba(255, 255, 255, 0.06);
  outline: none;
}

.pwa-install-icon {
  position: relative;
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
}

.pwa-install-icon img {
  display: block;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  object-fit: contain;
  background: #ffffff;
  padding: 4px;
  box-shadow: 0 5px 16px rgba(0, 0, 0, 0.22);
}

.pwa-install-download {
  position: absolute;
  right: -5px;
  bottom: -4px;
  display: grid;
  place-items: center;
  width: 21px;
  height: 21px;
  border: 2px solid #0f172a;
  border-radius: 999px;
  background: #f59e0b;
  color: #111827;
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
}

.pwa-install-text {
  min-width: 0;
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 2px;
}

.pwa-install-text strong {
  font-size: 13px;
  font-weight: 750;
  line-height: 1.25;
}

.pwa-install-text > span:not(.pwa-install-platforms) {
  color: #cbd5e1;
  font-size: 11px;
  line-height: 1.35;
}

.pwa-install-platforms {
  display: flex;
  gap: 5px;
  margin-top: 4px;
}

.pwa-install-platforms span {
  padding: 2px 7px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 999px;
  color: #cbd5e1;
  font-size: 9px;
  font-weight: 700;
  line-height: 1.2;
}

.pwa-install-platforms span.pwa-platform-active {
  background: rgba(37, 99, 235, 0.45);
  border-color: #3b82f6;
  color: #93c5fd;
}

.pwa-install-close {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  font-size: 21px;
  line-height: 1;
  cursor: pointer;
}

.pwa-install-close:hover,
.pwa-install-close:focus-visible {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  outline: none;
}

@media (max-width: 520px) {
  #pwa-install-banner {
    left: 12px;
    bottom: 12px;
    width: min(350px, calc(100vw - 24px));
    border-radius: 16px;
  }

  .pwa-install-content {
    padding: 11px 39px 11px 11px;
  }

  .pwa-install-icon,
  .pwa-install-icon img {
    width: 46px;
    height: 46px;
  }

  .pwa-install-icon {
    flex-basis: 46px;
  }
}

/* Modal Guide PWA */
.pwa-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: pwa-fade-in 0.2s ease-out;
}

@keyframes pwa-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.pwa-modal-box {
  width: 100%;
  max-width: 520px;
  background: #0f172a;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 20px;
  color: #f8fafc;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  animation: pwa-scale-up 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes pwa-scale-up {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.pwa-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.pwa-modal-title-group {
  display: flex;
  align-items: center;
  gap: 14px;
}

.pwa-modal-app-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.pwa-modal-title-group h4 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
}

.pwa-modal-title-group p {
  margin: 2px 0 0;
  font-size: 11px;
  color: #94a3b8;
}

.pwa-modal-close {
  background: rgba(255, 255, 255, 0.08);
  border: 0;
  color: #94a3b8;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  font-size: 22px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.pwa-modal-close:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.pwa-modal-tabs {
  display: flex;
  padding: 10px 16px 0;
  gap: 8px;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  overflow-x: auto;
}

.pwa-tab-btn {
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 600;
  padding: 8px 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.pwa-tab-btn:hover {
  color: #e2e8f0;
}

.pwa-tab-btn.active {
  color: #60a5fa;
  border-bottom-color: #3b82f6;
}

.pwa-modal-body {
  padding: 20px;
  min-height: 160px;
}

.pwa-tab-content {
  display: none;
  flex-direction: column;
  gap: 12px;
}

.pwa-tab-content.active {
  display: flex;
}

.pwa-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 12px;
  line-height: 1.45;
  color: #cbd5e1;
}

.pwa-step strong {
  color: #f8fafc;
}

.pwa-step-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #1e40af;
  color: #bfdbfe;
  font-size: 11px;
  font-weight: 700;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.pwa-modal-footer {
  padding: 14px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: flex-end;
  background: rgba(0, 0, 0, 0.15);
}

.pwa-btn-dismiss {
  padding: 8px 18px;
  border-radius: 10px;
  background: #2563eb;
  color: #fff;
  border: 0;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.pwa-btn-dismiss:hover {
  background: #1d4ed8;
}
