/* Feedback di halaman pesan dan halaman pembayaran: tombol melayang + dialog (lembar bawah di ponsel). Warna dan ukuran memakai token situs,
   sehingga tema terang/gelap ikut. Posisi tombol (--fb-b) dihitung feedback.js supaya tidak menutupi bilah total, tombol "kembali ke atas",
   atau papan ketik. Semua gerak dimatikan bila pengguna memilih "kurangi gerak". */

/* ---------- tombol melayang ---------- */
.fb-fab { position: fixed; z-index: 85; right: max(var(--fb-r, 20px), env(safe-area-inset-right)); bottom: calc(var(--fb-b, 18px) + env(safe-area-inset-bottom, 0px)); display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 0 20px 0 16px; border: 0; border-radius: 999px; background: var(--text); color: var(--bg); font: 700 .9375rem/1 var(--font-body); letter-spacing: -.005em; box-shadow: 0 10px 28px -10px rgba(18, 22, 28, .55); cursor: pointer; opacity: 0; transform: translateY(22px) scale(.88); pointer-events: none; transition: opacity .45s var(--ease), transform .45s var(--ease), bottom .38s var(--ease), right .38s var(--ease), box-shadow .2s; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.fb-fab.in { opacity: 1; transform: none; pointer-events: auto; }
.fb-fab .i { width: 22px; height: 22px; flex: none; transition: transform .3s var(--ease); }
.fb-fab:active { transform: scale(.95); }
.fb-fab:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.fb-fab::after { content: ""; position: absolute; inset: -2px; border-radius: inherit; border: 2px solid var(--accent); opacity: 0; pointer-events: none; }
.fb-fab.ping::after { animation: fb-ring 1.8s var(--ease) 2; }
.fb-fab.attn { animation: fb-wiggle .7s var(--ease) 3; }
.fb-fab.attn::after { animation: fb-ring 1.4s var(--ease) infinite; }
@media (hover: hover) { .fb-fab:hover { box-shadow: 0 14px 34px -10px rgba(18, 22, 28, .65); transform: translateY(-2px); } .fb-fab:hover .i { transform: rotate(-8deg) scale(1.08); } }
html.fb-open .fb-fab { visibility: hidden; }
html.fb-kb .fb-fab, html.fb-kb .fb-nudge { opacity: 0; transform: translateY(18px) scale(.9); pointer-events: none; }     /* papan ketik terbuka: tidak menutupi isian */
html.fb-on .foot-bottom { padding-bottom: 82px; }                                                                       /* ujung halaman: tulisan penutup tidak berada di bawah tombol */
@media (max-width: 719px) {
  .fb-fab { width: 52px; padding: 0; }
  .fb-fab-t { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
}
@media (max-height: 520px) and (orientation: landscape) { .fb-fab { min-height: 44px; } .fb-fab.in { transform: scale(.92); transform-origin: right bottom; } }

/* ajakan kecil saat halaman menampilkan kesalahan */
.fb-nudge { position: fixed; z-index: 84; right: max(var(--fb-r, 20px), env(safe-area-inset-right)); bottom: calc(var(--fb-b, 18px) + 64px + env(safe-area-inset-bottom, 0px)); display: inline-flex; align-items: center; gap: 10px; max-width: min(320px, calc(100vw - 36px)); padding: 12px 16px; border: 1px solid var(--line-strong); border-radius: 16px 16px 4px 16px; background: var(--surface); color: var(--text); font: 600 .875rem/1.35 var(--font-body); text-align: left; box-shadow: var(--shadow-lg); cursor: pointer; opacity: 0; transform: translateY(10px) scale(.96); transform-origin: right bottom; transition: opacity .3s var(--ease), transform .3s var(--ease), bottom .38s var(--ease), right .38s var(--ease); touch-action: manipulation; }
.fb-nudge.in { opacity: 1; transform: none; }
.fb-nudge .i { width: 20px; height: 20px; flex: none; color: var(--err); }
.fb-nudge:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }


/* ---------- dialog ---------- */
dialog.fb-dlg { border: 0; padding: 0; background: transparent; color: var(--text); width: min(600px, calc(100vw - 24px)); max-width: none; max-height: none; overflow: visible; }
dialog.fb-dlg::backdrop { background: rgba(18, 22, 28, .6); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
dialog.fb-dlg[open]::backdrop { animation: fb-bd .25s var(--ease); }
dialog.fb-dlg.closing::backdrop { animation: fb-bd-out .19s var(--ease) forwards; }
dialog.fb-dlg.dropping .fb-in { outline: 3px dashed var(--accent); outline-offset: -8px; }
.fb-in { position: relative; display: flex; flex-direction: column; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); max-height: min(92vh, 900px); max-height: min(92dvh, 900px); overflow: hidden; }
dialog.fb-dlg[open] .fb-in { animation: fb-pop .34s var(--ease); }
dialog.fb-dlg.closing .fb-in { animation: fb-out .19s var(--ease) forwards; }
.fb-grab { display: none; }
.fb-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 12px 8px 22px; }
.fb-h-t { display: flex; align-items: center; gap: 12px; min-width: 0; }
.fb-h-ic { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 12px; background: var(--accent-soft); color: var(--accent-text); }
.fb-h-ic .i { width: 22px; height: 22px; }
.fb-h h2 { font: 800 1.3rem/1.15 var(--font-display); letter-spacing: -.02em; margin: 0; }
.fb-body { overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 6px 22px 0; }
.fb-form { display: grid; gap: 18px; }
.fb-lead { color: var(--text-2); font-size: var(--fs-sm); line-height: 1.55; margin: 0; }
.fb-lbl, .fb-f > label { display: block; font: 700 .8125rem/1.3 var(--font-body); color: var(--text); margin-bottom: 6px; }
.fb-hint { color: var(--text-3); font-size: var(--fs-xs); line-height: 1.5; }
.fb-hint a { color: var(--accent-text); text-decoration: underline; text-underline-offset: 2px; padding-block: 12px; margin-block: -12px; }
.fb-err { color: var(--err); font-weight: 600; margin-top: 4px; display: block; }
.fb-err:empty { display: none; }
.fb-f { display: grid; gap: 4px; }
.fb-f .input, .fb-f .textarea { width: 100%; }
.fb-f .textarea { min-height: 110px; resize: vertical; }
.fb-count { justify-self: end; font-size: var(--fs-xs); color: var(--text-3); margin-top: -2px; }
.fb-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* jenis masukan: pil yang mudah disentuh */
.fb-types { display: flex; flex-wrap: wrap; gap: 8px; }
.fb-type { display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 16px 0 13px; border: 1.5px solid var(--line-strong); border-radius: 999px; background: var(--bg); color: var(--text-2); font: 600 .875rem/1.15 var(--font-body); text-align: left; cursor: pointer; transition: border-color .18s, background .18s, color .18s, transform .14s var(--ease), box-shadow .18s; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.fb-type .i { width: 20px; height: 20px; flex: none; transition: transform .25s var(--ease), color .18s; }
.fb-type[aria-checked="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--text); box-shadow: 0 0 0 1px var(--accent) inset; }
.fb-type[aria-checked="true"] .i { color: var(--accent-text); transform: scale(1.12); }
.fb-type:active { transform: scale(.96); }
.fb-type:focus-visible, .fb-sub:focus-visible, .fb-star:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
@media (hover: hover) { .fb-type:hover, .fb-sub:hover { border-color: var(--text-3); } .fb-type[aria-checked="true"]:hover, .fb-sub[aria-checked="true"]:hover { border-color: var(--accent); } }

/* pilihan cepat "apa yang terjadi": terbuka dengan halus */
.fb-subs, .fb-rate { display: grid; grid-template-rows: 0fr; opacity: 0; margin-top: -18px; transition: grid-template-rows .34s var(--ease), opacity .28s var(--ease), margin-top .34s var(--ease); }
.fb-subs.open, .fb-rate.open { grid-template-rows: 1fr; opacity: 1; margin-top: 0; }
.fb-subs-in, .fb-rate-in { min-height: 0; overflow: hidden; padding: 3px; margin: -3px; }
.fb-subrow { display: flex; flex-wrap: wrap; gap: 8px; }
.fb-sub { display: inline-flex; align-items: center; min-height: 42px; padding: 8px 14px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text-2); font: 500 .8438rem/1.3 var(--font-body); text-align: left; cursor: pointer; transition: border-color .18s, background .18s, color .18s, transform .14s var(--ease); touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.fb-sub::before { content: ""; width: 16px; height: 16px; flex: none; margin-right: 9px; border-radius: 50%; border: 1.5px solid var(--line-strong); background: transparent; transition: border-color .18s, background .18s, box-shadow .18s; }
.fb-sub[aria-checked="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--text); font-weight: 600; }
.fb-sub[aria-checked="true"]::before { border-color: var(--accent); background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft) inset; }
.fb-sub:active { transform: scale(.97); }

/* bintang */
.fb-stars { display: flex; gap: 4px; }
.fb-star { width: 48px; height: 48px; display: grid; place-items: center; border: 0; border-radius: 50%; background: transparent; color: var(--line-strong); cursor: pointer; transition: color .15s, transform .2s var(--ease); touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.fb-star .i { width: 30px; height: 30px; }
.fb-star.on { color: var(--accent); transform: scale(1.08); }
.fb-star.on .i { fill: currentColor; }
.fb-star:active { transform: scale(.9); }

/* tangkapan layar */
.fb-shot { display: grid; gap: 6px; }
.fb-shot-box { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px; margin-top: 2px; }
.fb-pick { cursor: pointer; position: relative; }
.fb-pick:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }
.fb-thumb { width: 100%; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; background: var(--bg-alt); display: grid; place-items: center; max-height: 220px; animation: fb-fade .3s var(--ease); }
.fb-thumb img { display: block; max-width: 100%; max-height: 220px; object-fit: contain; }
.fb-thumb-act { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; width: 100%; }
.fb-thumb-act small { flex: 1 1 200px; }

/* isian lain */
.fb-chk { display: flex; align-items: flex-start; gap: 12px; font-size: var(--fs-sm); line-height: 1.5; color: var(--text-2); cursor: pointer; }
.fb-chk input { width: 20px; height: 20px; flex: none; margin: 1px 0 0; accent-color: var(--accent); cursor: pointer; }
.fb-chk i { display: none; }
.fb-bad { margin: 0; padding: 12px 14px; border-radius: var(--r-md); background: var(--err-soft, #fdeceb); color: var(--err); font-weight: 600; font-size: var(--fs-sm); line-height: 1.5; animation: fb-fade .25s var(--ease); }
.fb-bad[hidden] { display: none; }
.fb-act { display: flex; justify-content: flex-end; gap: 10px; position: sticky; bottom: 0; margin: 4px -22px 0; padding: 12px 22px calc(14px + env(safe-area-inset-bottom, 0px)); background: var(--surface); border-top: 1px solid var(--line); }
.fb-send { min-width: 190px; }
.fb-send.loading { opacity: .85; pointer-events: none; }

/* terkirim */
.fb-done { display: grid; justify-items: center; gap: 12px; text-align: center; padding: 10px 0 calc(22px + env(safe-area-inset-bottom, 0px)); }
.fb-done > * { animation: fb-up .5s var(--ease) both; }
.fb-done > :nth-child(2) { animation-delay: .08s; } .fb-done > :nth-child(3) { animation-delay: .14s; } .fb-done > :nth-child(4) { animation-delay: .2s; } .fb-done > :nth-child(5) { animation-delay: .26s; } .fb-done > :nth-child(6) { animation-delay: .32s; }
.fb-done .btn { min-width: 220px; }
.fb-done-t { font: 800 1.5rem/1.15 var(--font-display); letter-spacing: -.02em; margin: 0; outline: 0; }
.fb-ok { position: relative; width: 68px; height: 68px; display: grid; place-items: center; border-radius: 50%; background: var(--ok); color: #fff; animation: fb-ok .55s var(--ease) both !important; }
.fb-ok::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 3px solid var(--ok); animation: fb-ring 1.1s var(--ease) .25s 1 both; }
.fb-ok .i { width: 34px; height: 34px; stroke-width: 3; }

@keyframes fb-pop { from { opacity: 0; transform: translateY(16px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes fb-out { to { opacity: 0; transform: translateY(14px) scale(.97); } }
@keyframes fb-sheet { from { transform: translateY(100%); } to { transform: none; } }
@keyframes fb-sheet-out { to { transform: translateY(100%); } }
@keyframes fb-bd { from { opacity: 0; } to { opacity: 1; } }
@keyframes fb-bd-out { to { opacity: 0; } }
@keyframes fb-fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes fb-up { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes fb-ok { 0% { transform: scale(.4); opacity: 0; } 60% { transform: scale(1.12); opacity: 1; } 100% { transform: scale(1); } }
@keyframes fb-ring { 0% { opacity: .65; transform: scale(1); } 100% { opacity: 0; transform: scale(1.5); } }
@keyframes fb-wiggle { 0%, 100% { transform: none; } 25% { transform: translateY(-6px) rotate(-4deg); } 55% { transform: translateY(-2px) rotate(3deg); } 80% { transform: translateY(-4px) rotate(-2deg); } }

@media (max-width: 639px) {
  dialog.fb-dlg { width: 100%; margin: auto 0 0; }
  .fb-in { border-radius: 24px 24px 0 0; max-height: 94vh; max-height: 94dvh; }
  dialog.fb-dlg[open] .fb-in { animation: fb-sheet .38s var(--ease); }
  dialog.fb-dlg.closing .fb-in { animation: fb-sheet-out .2s var(--ease) forwards; }
  .fb-grab { display: block; width: 44px; height: 5px; border-radius: 3px; background: var(--line-strong); margin: 8px auto 0; }
  .fb-h { padding-top: 10px; }
  .fb-act { gap: 10px; }
  .fb-act .btn { min-height: 52px; }
  .fb-act .btn-secondary { flex: 0 0 30%; padding-inline: 8px; }
  .fb-act .fb-send { flex: 1 1 auto; min-width: 0; }
  .fb-type { flex: 1 1 calc(50% - 8px); min-width: 0; }
  .fb-type[data-type="lain"] { flex-basis: 100%; }
  .fb-sub { flex: 1 1 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .fb-fab, .fb-nudge, .fb-subs, .fb-rate, .fb-type, .fb-sub, .fb-star { transition: none !important; }
  .fb-fab.ping::after, .fb-fab.attn, .fb-fab.attn::after, .fb-ok::after, .fb-done > *, .fb-ok, .fb-thumb, .fb-bad, dialog.fb-dlg[open] .fb-in, dialog.fb-dlg[open]::backdrop { animation: none !important; }
}

/* layar lebar di halaman pesan: tombol Feedback menyatu di kepala kartu Ringkasan (tombol mengambang disembunyikan agar tidak menutupi tombol "Pesan dan lanjut bayar") */
.fb-sum-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.fb-sum-head h2 { margin: 0; }
.fb-sum-btn { display: none; align-items: center; gap: 8px; min-height: 36px; padding: 0 14px 0 12px; border: 1.5px solid var(--line-strong); border-radius: 999px; background: var(--bg); color: var(--text-2); font: 700 .8125rem/1 var(--font-body); cursor: pointer; transition: border-color .18s, color .18s, background .18s, transform .14s var(--ease), box-shadow .18s; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.fb-sum-btn .i { width: 16px; height: 16px; transition: transform .25s var(--ease); }
html.fb-docked .fb-sum-btn { display: inline-flex; }
html.fb-docked .fb-fab, html.fb-docked .fb-nudge { display: none; }
.fb-sum-btn:active { transform: scale(.95); }
.fb-sum-btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.fb-sum-btn.attn { animation: fb-wiggle .7s var(--ease) 3; border-color: var(--err); color: var(--text); }
@media (hover: hover) { .fb-sum-btn:hover { border-color: var(--text); color: var(--text); background: var(--bg-alt); transform: translateY(-1px); } .fb-sum-btn:hover .i { transform: rotate(-8deg) scale(1.1); } }
@media (prefers-reduced-motion: reduce) { .fb-sum-btn, .fb-sum-btn .i { transition: none !important; } .fb-sum-btn.attn { animation: none !important; } }