/* PWA pengunjung derawan.id — banner Pasang, lembar petunjuk, onboarding (mode app), halaman offline.
   Mockup: kanvas "Derawan Backoffice PWA", baris pengunjung (V-banner, V-onb1..3, V-offline). */
@font-face { font-family: "PWA Lilita"; font-weight: 400; font-display: swap; src: url("../../brand/fonts/lilita-one-latin-400-normal.9a95c766f3e1.woff2") format("woff2"); }
@font-face { font-family: "PWA Nunito"; font-weight: 600; font-display: swap; src: url("../../brand/fonts/nunito-latin-600-normal.b770df7528a1.woff2") format("woff2"); }
@font-face { font-family: "PWA Nunito"; font-weight: 800; font-display: swap; src: url("../../brand/fonts/nunito-latin-800-normal.a28521c77f4a.woff2") format("woff2"); }

.pwa-ui, .pwa-ui * { box-sizing: border-box; }
.pwa-ui { --p-ink: #0B2E5C; --p-muted: #52738C; --p-tint: #0C6FB0; --p-sun: #FFC52E; --p-line: #E3EBF1; --p-soft: #F1F6FA;
  font-family: "PWA Nunito", Nunito, system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--p-ink); -webkit-font-smoothing: antialiased; }
.pwa-ui [hidden] { display: none !important; }

/* ---------- tombol ---------- */
.pwa-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 0 20px; border: 0; border-radius: 14px;
  font: 800 16px/1.1 "PWA Nunito", Nunito, system-ui, sans-serif; text-decoration: none; cursor: pointer; }
.pwa-btn-dark { color: #FFFFFF; background: #0B2E5C; }
.pwa-btn-sun { color: #0B2E5C; background: #FFC52E; }
.pwa-btn-light { color: #0B2E5C; background: #FFFFFF; }
.pwa-btn-wa { color: #0B2E5C; background: #2FC47A; }
.pwa-btn:focus-visible, .pwa-link:focus-visible, .pwa-x:focus-visible { outline: 3px solid #FFC52E; outline-offset: 2px; }
.pwa-link { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 6px; border: 0; background: none; color: #0C6FB0;
  font: 700 15px/1 "PWA Nunito", Nunito, system-ui, sans-serif; text-decoration: none; cursor: pointer; }

/* ---------- banner Pasang (di atas bilah tab bawah) ---------- */
.pwa-banner { position: fixed; z-index: 65; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); width: min(420px, calc(100% - 20px));
  transform: translateX(-50%); display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 18px; background: #FFFFFF;
  box-shadow: 0 18px 36px -12px rgba(4, 21, 46, .55); animation: pwa-banner-in .5s cubic-bezier(.2, .9, .3, 1) both; }
@media (min-width: 761px) { .pwa-banner { left: 20px; bottom: 20px; transform: none; } }
.pwa-banner img { flex: none; width: 44px; height: 44px; border-radius: 12px; background: #EAF8FF; padding: 5px; animation: pwa-pulse 2s ease-in-out 1s infinite; }
.pwa-banner-copy { flex: 1; min-width: 0; }
.pwa-banner-copy strong { display: block; font-size: 14.5px; font-weight: 800; }
.pwa-banner-copy span { display: block; font-size: 12.5px; line-height: 1.3; color: #52738C; }
.pwa-banner-go { flex: none; min-height: 36px; padding: 0 14px; border: 0; border-radius: 999px; background: #0B2E5C; color: #FFFFFF;
  font: 800 13px/1 "PWA Nunito", Nunito, system-ui, sans-serif; cursor: pointer; }
.pwa-x { flex: none; width: 36px; height: 36px; border: 0; border-radius: 50%; display: grid; place-items: center; background: #F1F6FA; color: #52738C; cursor: pointer; }
.pwa-banner.is-out { animation: pwa-banner-out .3s ease-in both; }
@keyframes pwa-banner-in { from { opacity: 0; transform: translate(-50%, 140%); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes pwa-banner-out { to { opacity: 0; transform: translate(-50%, 140%); } }
@media (min-width: 761px) {
  @keyframes pwa-banner-in { from { opacity: 0; transform: translateY(140%); } to { opacity: 1; transform: none; } }
  @keyframes pwa-banner-out { to { opacity: 0; transform: translateY(140%); } }
}
@keyframes pwa-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }

/* ---------- lembar petunjuk (iPhone / browser dalam app / menu browser) ---------- */
.pwa-sheet-wrap { position: fixed; inset: 0; z-index: 210; display: flex; align-items: flex-end; justify-content: center; background: rgba(4, 21, 46, .55);
  animation: pwa-fade .25s ease-out both; }
.pwa-sheet { width: min(480px, 100%); max-height: 88vh; overflow: auto; padding: 8px 20px calc(20px + env(safe-area-inset-bottom));
  border-radius: 24px 24px 0 0; background: #FFFFFF; animation: pwa-sheet-up .38s cubic-bezier(.2, .9, .3, 1) both; }
.pwa-sheet-handle { display: block; width: 40px; height: 5px; margin: 0 auto 12px; border-radius: 99px; background: #C9D9E4; }
.pwa-sheet-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.pwa-sheet-head img { width: 48px; height: 48px; border-radius: 12px; background: #EAF8FF; padding: 5px; }
.pwa-sheet h2 { flex: 1; margin: 0; font: 400 22px/1.15 "PWA Lilita", "Lilita One", system-ui, sans-serif; }
.pwa-sheet p { margin: 0 0 12px; font-size: 15px; line-height: 1.45; color: #52738C; }
.pwa-steps { margin: 0 0 14px; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 10px; }
.pwa-steps li { counter-increment: s; display: flex; gap: 12px; align-items: center; font-size: 15px; font-weight: 600; line-height: 1.35; }
.pwa-steps li::before { content: counter(s); flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: #0B2E5C; color: #FFFFFF; font-weight: 800; font-size: 13px; }
.pwa-steps svg { flex: none; }
.pwa-copy { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; padding: 10px 12px; border-radius: 12px; background: #F1F6FA;
  font-size: 13px; word-break: break-all; color: #3D5A72; }
.pwa-sheet .pwa-btn { width: 100%; }
@keyframes pwa-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pwa-sheet-up { from { transform: translateY(100%); } to { transform: none; } }

/* ---------- onboarding (hanya mode app terpasang) ---------- */
.pwa-onb { position: fixed; inset: 0; z-index: 220; display: flex; flex-direction: column; background: #FFFFFF;
  padding: env(safe-area-inset-top) 0 calc(18px + env(safe-area-inset-bottom)); animation: pwa-fade .3s ease-out both; }
.pwa-onb-top { display: flex; justify-content: space-between; align-items: center; min-height: 52px; padding: 4px 16px 0; }
.pwa-lang { display: flex; gap: 2px; padding: 3px; border-radius: 999px; background: #F1F6FA; }
.pwa-lang a { min-width: 44px; padding: 7px 11px; border-radius: 999px; text-align: center; color: #52738C; font-size: 12.5px; font-weight: 800; text-decoration: none; }
.pwa-lang a[aria-current="true"] { background: #0B2E5C; color: #FFFFFF; }
.pwa-onb-track { flex: 1; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.pwa-onb-track::-webkit-scrollbar { display: none; }
.pwa-onb-slide { flex: 0 0 100%; scroll-snap-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 0 26px; text-align: center; }
.pwa-onb-slide h2 { margin: 0 0 8px; font: 400 26px/1.15 "PWA Lilita", "Lilita One", system-ui, sans-serif; color: #0B2E5C; }
.pwa-onb-slide p { margin: 0; max-width: 340px; font-size: 15px; line-height: 1.45; color: #52738C; }
.pwa-onb-art { position: relative; width: min(300px, 100%); height: 290px; margin-bottom: 24px; border-radius: 28px; overflow: hidden; }
.pwa-onb-bottom { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 0 20px; }
.pwa-dots { display: flex; gap: 6px; }
.pwa-dots span { width: 7px; height: 7px; border-radius: 99px; background: #C9D9E4; transition: width .2s ease, background .2s ease; }
.pwa-dots span.is-on { width: 18px; background: #0B2E5C; }
.pwa-onb-bottom .pwa-btn { width: 100%; max-width: 420px; }
.pwa-onb.is-out { animation: pwa-fade-out .3s ease-in both; }
@keyframes pwa-fade-out { to { opacity: 0; } }

/* layar 1: peta */
.pwa-art-map { box-shadow: 0 24px 44px -20px rgba(4, 21, 46, .6); }
.pwa-art-map > img { width: 100%; height: 100%; object-fit: cover; animation: pwa-map-zoom 2.4s cubic-bezier(.2, .8, .3, 1) both; }
.pwa-ping { position: absolute; width: 18px; height: 18px; border-radius: 50%; background: #FFC52E; animation: pwa-ping 1.8s ease-out infinite; }
.pwa-art-card { position: absolute; left: 12px; right: 12px; bottom: 12px; display: flex; gap: 10px; align-items: center; padding: 9px 10px;
  border-radius: 14px; background: rgba(255, 246, 227, .96); text-align: left; animation: pwa-card-in 3s ease-out both; }
.pwa-art-card img { width: 34px; height: 34px; }
.pwa-art-card small { display: block; font-size: 11px; font-weight: 800; color: #3D6AA3; }
.pwa-art-card strong { display: block; font-size: 14px; }
@keyframes pwa-map-zoom { from { transform: scale(1.25) rotate(-4deg); } to { transform: none; } }
@keyframes pwa-ping { 0% { transform: scale(.6); opacity: .9; } 100% { transform: scale(2.2); opacity: 0; } }
@keyframes pwa-card-in { 0%, 30% { opacity: 0; transform: translateY(16px); } 45%, 100% { opacity: 1; transform: none; } }

/* layar 2: pilih trip */
.pwa-art-sea { background: linear-gradient(180deg, #9EDDFB 0%, #1EA7E8 100%); }
.pwa-swim { position: absolute; animation: pwa-swim 5s ease-in-out infinite; }
@keyframes pwa-swim { 0%, 100% { transform: translate(0, 0) rotate(-4deg); } 50% { transform: translate(8px, -10px) rotate(4deg); } }
.pwa-chips { position: absolute; left: 12px; right: 12px; top: 104px; display: flex; gap: 6px; justify-content: center; }
.pwa-chips span { padding: 7px 12px; border-radius: 999px; background: #FFFFFF; color: #0B2E5C; font-size: 12.5px; font-weight: 800; }
.pwa-chips span.is-pick { animation: pwa-chip 4s ease-out infinite; }
@keyframes pwa-chip { 0%, 20% { background: #FFFFFF; color: #0B2E5C; } 30%, 100% { background: #0B2E5C; color: #FFFFFF; } }
.pwa-trip { position: absolute; left: 12px; right: 12px; bottom: 12px; display: flex; gap: 10px; align-items: center; padding: 8px; border-radius: 16px;
  background: #FFFFFF; text-align: left; animation: pwa-trip-in 4s ease-out infinite; }
.pwa-trip i { flex: none; width: 60px; height: 60px; border-radius: 12px; background: linear-gradient(135deg, #2FC47A, #0C6FB0); }
.pwa-trip em { display: inline-block; padding: 2px 7px; border-radius: 999px; background: #FFC52E; font-size: 10px; font-weight: 800; font-style: normal; }
.pwa-trip strong { display: block; margin-top: 2px; font-size: 14px; }
.pwa-trip small { font-size: 12px; color: #52738C; }
@keyframes pwa-trip-in { 0%, 35% { opacity: 0; transform: translateX(30px); } 50%, 100% { opacity: 1; transform: none; } }

/* layar 3: tanya tim */
.pwa-art-chat { display: flex; flex-direction: column; gap: 10px; padding: 18px 16px; background: #EFE7DC; text-align: left; }
.pwa-bubble { max-width: 80%; padding: 9px 12px; font-size: 13.5px; line-height: 1.35; color: #0B2E5C; }
.pwa-bubble.is-me { align-self: flex-end; border-radius: 14px 14px 4px 14px; background: #D5F5E3; animation: pwa-b1 6s ease-out infinite; }
.pwa-bubble.is-them { align-self: flex-start; border-radius: 14px 14px 14px 4px; background: #FFFFFF; animation: pwa-b2 6s ease-out infinite; }
.pwa-typing { align-self: flex-start; display: flex; gap: 4px; padding: 11px 14px; border-radius: 14px 14px 14px 4px; background: #FFFFFF; animation: pwa-typing 6s ease-out infinite; }
.pwa-typing span { width: 7px; height: 7px; border-radius: 50%; background: #9DB2C2; animation: pwa-dot .9s ease-in-out infinite; }
.pwa-typing span:nth-child(2) { animation-delay: .15s; } .pwa-typing span:nth-child(3) { animation-delay: .3s; }
.pwa-wave-hand { position: absolute; right: 10px; bottom: -6px; width: 104px; animation: pwa-wave 2.4s ease-in-out infinite; }
@keyframes pwa-b1 { 0%, 8% { opacity: 0; transform: translateY(10px) scale(.9); } 15%, 100% { opacity: 1; transform: none; } }
@keyframes pwa-typing { 0%, 30% { opacity: 0; } 35%, 55% { opacity: 1; } 60%, 100% { opacity: 0; } }
@keyframes pwa-b2 { 0%, 58% { opacity: 0; transform: translateY(10px) scale(.9); } 66%, 100% { opacity: 1; transform: none; } }
@keyframes pwa-dot { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes pwa-wave { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(5deg) translateY(-4px); } }

/* ---------- tombol kabar status pesanan ---------- */
.pwa-order-push { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 12px; border-radius: 14px; background: #EAF8FF; }
.pwa-order-push p { flex: 1; margin: 0; font-size: 13.5px; line-height: 1.35; color: #0B2E5C; }
.pwa-order-push button { flex: none; min-height: 44px; padding: 0 14px; border: 0; border-radius: 12px; background: #0B2E5C; color: #FFFFFF;
  font: 800 13.5px/1 "PWA Nunito", Nunito, system-ui, sans-serif; cursor: pointer; }
.pwa-order-push button:disabled { background: #2FC47A; color: #0B2E5C; cursor: default; }

/* ---------- toast ---------- */
.pwa-toast { position: fixed; z-index: 230; left: 50%; bottom: calc(110px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  max-width: calc(100% - 32px); padding: 11px 16px; border-radius: 12px; background: #0B2E5C; color: #FFFFFF; font-size: 14px; font-weight: 700;
  box-shadow: 0 12px 26px -10px rgba(4, 21, 46, .6); animation: pwa-fade .25s ease-out both; }

/* ---------- halaman offline ---------- */
.pwa-offline-body { margin: 0; min-height: 100vh; background: #F1F6FA; font-family: "PWA Nunito", Nunito, system-ui, sans-serif; color: #0B2E5C; }
.pwa-offline { max-width: 480px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; padding: calc(16px + env(safe-area-inset-top)) 16px calc(24px + env(safe-area-inset-bottom)); text-align: center; }
.pwa-offline-pill { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0; min-height: 36px; border-radius: 999px; background: #0B2E5C; color: #FFFFFF; font-size: 13px; font-weight: 800; }
.pwa-offline-art { position: relative; width: 200px; height: 170px; margin: 24px auto 0; }
.pwa-offline-art img { position: absolute; left: 30px; bottom: 18px; width: 140px; height: auto; animation: pwa-breathe 3s ease-in-out infinite; }
.pwa-zzz { position: absolute; right: 30px; top: 6px; font: 400 22px/1 "PWA Lilita", "Lilita One", sans-serif; color: #0C6FB0; animation: pwa-zzz 2.6s ease-out infinite; }
.pwa-zzz.is-2 { right: 20px; top: 20px; font-size: 16px; animation-delay: .9s; }
.pwa-offline-wave { position: absolute; left: 0; right: 0; bottom: 0; height: 24px; border-radius: 999px; background-color: #9EDDFB;
  background-image: radial-gradient(circle at 15px 0, transparent 12px, #1EA7E8 13px); background-size: 30px 24px; animation: pwa-sea 3s linear infinite; }
.pwa-offline h1 { margin: 18px 0 8px; font: 400 26px/1.15 "PWA Lilita", "Lilita One", sans-serif; }
.pwa-muted { margin: 0; font-size: 15px; line-height: 1.45; color: #52738C; }
.pwa-offline-saved { margin-top: 22px; text-align: left; }
.pwa-offline-saved h2 { margin: 0 0 6px 16px; font-size: 12.5px; font-weight: 800; letter-spacing: .04em; color: #52738C; text-transform: uppercase; }
.pwa-list { margin: 0; padding: 0; list-style: none; border-radius: 12px; background: #FFFFFF; overflow: hidden; }
.pwa-list li + li { border-top: 1px solid #E3EBF1; }
.pwa-list a { display: flex; align-items: center; min-height: 48px; padding: 0 14px; color: #0B2E5C; font-size: 15px; font-weight: 600; text-decoration: none; }
.pwa-list a::after { content: "›"; margin-left: auto; color: #9DB2C2; font-size: 20px; }
.pwa-offline-actions { margin-top: auto; padding-top: 22px; display: grid; gap: 10px; }
@keyframes pwa-zzz { 0% { opacity: 0; transform: translate(0, 0) scale(.7); } 30% { opacity: 1; } 100% { opacity: 0; transform: translate(26px, -60px) scale(1.2); } }
@keyframes pwa-breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.04); } }
@keyframes pwa-sea { from { background-position: 0 0; } to { background-position: 120px 0; } }

@media (prefers-reduced-motion: reduce) {
  .pwa-ui *, .pwa-ui, .pwa-offline * { animation: none !important; transition: none !important; }
}
