/* =====================================================================
   FinPal PWA — lời mời cài đặt.
   Banners chỉ tồn tại khi trình duyệt phát beforeinstallprompt và người dùng
   chưa từng bỏ qua, nên mặc định trang không bị nhiễu.
   ===================================================================== */

.fp-install {
  position: fixed;
  z-index: 900;                 /* dưới panel chat (940) nhưng trên app shell */
  top: calc(10px + env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  width: min(calc(100vw - 24px), 440px);

  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 9px 9px 11px;

  background: #FFFCF8;
  border: 1px solid rgba(182, 57, 21, .14);
  border-radius: 18px;
  box-shadow:
    0 18px 36px -18px rgba(86, 47, 32, .42),
    0 2px 6px -3px rgba(16, 35, 31, .12);
  font-family: inherit;
  animation: fp-install-in .28s cubic-bezier(.2, .85, .25, 1);
}
@keyframes fp-install-in {
  from { opacity: 0; transform: translate(-50%, -12px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

.fp-install__ic {
  width: 38px;
  height: 38px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(140deg, #FFF3EE, #EAF7F0);
  color: #B93815;
}
.fp-install__ic svg { width: 21px; height: 21px; }

.fp-install__txt { display: grid; gap: 1px; min-width: 0; flex: 1; }
.fp-install__txt strong {
  font-size: 13.5px;
  font-weight: 700;
  color: #10231F;
  white-space: nowrap;
}
.fp-install__txt small {
  font-size: 11.5px;
  line-height: 1.35;
  color: #75665F;
}

.fp-install__go {
  flex: none;
  min-height: 38px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: #D63B22;
  color: #fff;
  font: inherit;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 12px -8px rgba(214, 59, 34, .8);
}
.fp-install__go:hover { background: #C0331C; }
.fp-install__go:active { transform: scale(.96); }

.fp-install__x {
  flex: none;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #75665F;
  font: inherit;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.fp-install__x:hover { background: rgba(16, 35, 31, .06); }
.fp-install__x:focus-visible,
.fp-install__go:focus-visible { outline: 2px solid #D63B22; outline-offset: 2px; }

@media (max-width: 520px) {
  .fp-install {
    top: calc(6px + env(safe-area-inset-top));
    width: calc(100vw - 20px);
    padding: 8px 8px 8px 10px;
    gap: 8px;
  }
  .fp-install__ic { width: 36px; height: 36px; }
  .fp-install__go { min-height: 44px; padding: 0 16px; font-size: 13px; }
  .fp-install__x { width: 44px; height: 44px; }
  .fp-install__txt small { font-size: 12px; }
}

@media (hover: none) {
  .fp-install__go:hover { background: #D63B22; }
  .fp-install__x:hover { background: transparent; }
}

@media (prefers-reduced-motion: reduce) {
  .fp-install { animation: none; }
  .fp-install__go:active { transform: none; }
}
