/* Overlay area */
#fpe-overlay {
  position: fixed;
  inset: 0;
  background: transparent; /* tidak gelap */
  display: flex;
  justify-content: center;
  align-items: flex-start; /* posisi atas */
  z-index: 999999;
  padding-top: 0; /* ❌ hilangkan jarak dari atas */
  margin-top: 0;
}
#fpe-overlay.fpe-hidden {
  display: none;
}

/* Popup box */
#fpe-modal {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.25);
  width: min(420px, 92%);
  padding: 16px 20px 20px;
  position: relative;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, 'Helvetica Neue', Arial;
  transform: translateY(-40px);
  opacity: 0;
  animation: slideDown 0.5s ease-out forwards; /* animasi muncul */
}

/* Tombol tutup */
#fpe-close {
  position: absolute;
  right: 10px;
  top: 8px;
  border: none;
  background: transparent;
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
}

/* Header */
.fpe-header {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 8px;
}
.fpe-header img {
  width: 48px;
  height: 48px;
  border-radius: 8px;
}
.fpe-title h3 {
  margin: 0 0 6px 0;
  font-size: 18px;
}
.fpe-title p {
  margin: 0;
  color: #333;
  font-size: 14px;
}

/* Tombol Ikuti/Nanti */
.fpe-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 10px;
}
.fpe-btn {
  border: 0;
  border-radius: 8px;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 600;
}
.fpe-primary {
  background: #1677ff;
  color: #fff;
}
.fpe-secondary {
  background: #f2f3f5;
  color: #111;
}

/* Form input */
#fpe-form {
  margin-top: 12px;
  border-top: 1px solid #eee;
  padding-top: 12px;
}
.fpe-form-row {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}
.fpe-form-row input {
  flex: 1;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
}
.fpe-status {
  margin-left: 10px;
  font-size: 13px;
}

/* Sembunyikan elemen dengan class fpe-hidden */
.fpe-hidden {
  display: none !important;
}
#fpe-form.fpe-hidden {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  height: 0 !important;
  overflow: hidden !important;
}

/* Animasi muncul dari atas ke bawah */
@keyframes slideDown {
  from {
    transform: translateY(-40px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Animasi keluar naik ke atas */
@keyframes slideUp {
  from {
    transform: translateY(0);
    opacity: 1;
  }
  to {
    transform: translateY(-40px);
    opacity: 0;
  }
}

/* Popup versi mobile */
@media (max-width: 480px) {
  #fpe-overlay {
    align-items: flex-start !important;
    justify-content: center;
    padding-top: 0 !important;
  }

  #fpe-modal {
    padding: 12px;
    width: 92%;
    border-radius: 0 0 12px 12px;
    animation: slideDown 0.4s ease-out forwards;
  }

  /* 🔧 Ubah di sini supaya tombol berdekatan di mobile */
  .fpe-actions {
    justify-content: flex-end !important; /* dari space-between → flex-end */
    gap: 8px !important; /* beri jarak kecil antar tombol */
  }
}
