/* AniTech Chat Experience — Rina x ZiN | styles.css */

:root {
  --lavender-base: #C6CBE9;
  --accent-mid: #7A82C0;
  --accent-dark: #4C5391;
  --bubble-in: #FFFFFF;
  --text-dark: #2A2A35;
  --text-muted: #8A8DA6;
  --bg-overlay: rgba(10, 10, 25, .25);
  --font-body: 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-display: 'Baloo 2', cursive;

  /* Round-2: warna brand dari landing (Rina=biru, ZiN=maroon-emas) dibawa
     masuk ke chat demo, biar orang yang lompat dari landing ngerasa "dunia
     yang sama". Wallpaper lavender (--lavender-base, dan rgba(198,203,233,*)
     hardcoded di notice-strip/input-bar/home-indicator) SENGAJA gak disentuh. */
  --rina-blue: #3A76BD; /* kontras WCAG 4.66:1 vs putih (tadinya #3D7BC4 = 4.35:1) */
  --zin-maroon: #5C2E3E;
  --zin-gold: #C9A45C;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: #0A0A19;
  font-family: var(--font-body);
  color: var(--text-dark);
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

body { overflow: hidden; }

button { font-family: inherit; border: none; background: none; cursor: pointer; color: inherit; }
img { display: block; max-width: 100%; }

/* Disalin dari landing/styles.css (audit 2026-08-06) -- atribut `hidden` bawaan
   HTML cuma aturan UA berbobot rendah, kalah lawan selector class manapun di
   stylesheet kita. landing/ pernah kena bug nyata gara-gara ini (2 tombol
   "Coba Sekarang" dikira hidden tapi tetap tampil & bisa diklik). Dinaikkan
   jadi global di sini juga supaya site/ gak jadi korban berikutnya. */
[hidden] { display: none !important; }

/* ============ LOADING SCREEN ============ */
#loading-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background-image:
    linear-gradient(rgba(10, 10, 25, .45), rgba(10, 10, 25, .7)),
    url('../assets/images/bg-mobile.jpg');
  background-size: cover;
  background-position: center;
  transition: opacity .4s ease, transform .4s ease;
}
/* Adopsi kakekoi (.effect-blur-fadein logo transition): blur ikut fade,
   nambah rasa reveal premium di titik pertama user liat brand. */
#loading-screen { filter: blur(0); transition: opacity .5s ease, filter .5s ease; }
#loading-screen.fade-out { opacity: 0; filter: blur(8px); transform: scale(1.03); pointer-events: none; }

.loading-logo-mark {
  width: 72px;
  height: 72px;
  object-fit: contain;
}

.loading-logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.2rem, 9vw, 3.2rem);
  color: #fff;
  letter-spacing: .02em;
  animation: logoPulse 1.2s ease-in-out infinite;
}
@keyframes logoPulse {
  0%, 100% { transform: scale(1); opacity: .85; }
  50% { transform: scale(1.05); opacity: 1; }
}

.loading-dots { display: flex; gap: 6px; }
.loading-dots .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: rgba(255,255,255,.85);
  animation: dotBounce 1s ease-in-out infinite;
}
.loading-dots .dot:nth-child(2) { animation-delay: .15s; }
.loading-dots .dot:nth-child(3) { animation-delay: .3s; }
@keyframes dotBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: .5; }
  30% { transform: translateY(-5px); opacity: 1; }
}

.loading-caption {
  font-size: 12px;
  color: rgba(255,255,255,.7);
  letter-spacing: .02em;
}

/* ============ DESKTOP BACKDROP (>=1024px only) ============ */
#desktop-backdrop { display: none; }

@media (min-width: 1024px) {
  #desktop-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 0;
    background-image: url('../assets/images/bg-desktop.jpg');
    background-size: cover;
    background-position: center;
    overflow: hidden;
  }
  #desktop-backdrop::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--bg-overlay);
  }
  .desktop-left-col {
    position: absolute;
    left: 6%;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1;
    color: #fff;
    max-width: 320px;
  }
  .desktop-left-col .desktop-wordmark {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2.5rem, 5vw, 3.6rem);
    letter-spacing: .02em;
  }
  .desktop-left-col .desktop-tagline {
    margin-top: 10px;
    font-size: 14px;
    color: rgba(255,255,255,.75);
  }
  .desktop-marquee {
    position: absolute;
    top: 12%;
    left: 0;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    z-index: 0;
    opacity: .1;
    pointer-events: none;
  }
  .desktop-marquee span {
    display: inline-block;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(3rem, 8vw, 6rem);
    color: #fff;
    animation: marqueeScroll 75s linear infinite;
  }
  @keyframes marqueeScroll {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
  }
}

/* ============ PHONE MOCKUP (shared mobile/desktop shell) ============ */
#phone-mockup {
  position: fixed;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: #000;
  overflow: hidden;
}

/* Bug-hunt fix (next-blueprint C): tanpa ini, tablet/foldable/window-resize
   di 481-1023px dapet chat UI full-bleed edge-to-edge (gak pernah didesain
   buat lebar segitu) - kasih cap lebar biar tetep kerasa "kartu chat", bukan
   stretch mentah. Height tetep 100dvh, cuma lebar yang dibatasin+ditengahin. */
@media (min-width: 600px) and (max-width: 1023px) {
  #phone-mockup {
    max-width: 480px;
    margin: 0 auto;
    box-shadow: 0 0 60px rgba(0,0,0,.35);
  }
}

@media (min-width: 1024px) {
  #phone-mockup {
    inset: auto;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 390px;
    height: 800px;
    border-radius: 44px;
    border: 9px solid #1A1A22;
    box-shadow: 0 40px 90px rgba(0,0,0,.55), 0 0 0 2px rgba(255,255,255,.04) inset;
    z-index: 2;
  }
  #phone-mockup::before {
    /* screen glare */
    content: '';
    position: absolute;
    top: 0; left: -20%;
    width: 60%; height: 34%;
    background: linear-gradient(120deg, rgba(255,255,255,.08), rgba(255,255,255,0) 70%);
    mix-blend-mode: overlay;
    opacity: .5;
    transform: skewX(-18deg);
    pointer-events: none;
    z-index: 50;
  }
}

/* ============ STATUS BAR ============ */
#status-bar {
  flex-shrink: 0;
  height: 32px;
  padding-top: env(safe-area-inset-top, 0px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-left: 16px;
  padding-right: 16px;
  background: var(--accent-dark);
  color: #fff;
  position: relative;
  z-index: 20;
}
.status-time { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.status-notch {
  position: absolute;
  left: 50%; top: 6px;
  transform: translateX(-50%);
  width: 84px; height: 16px;
  background: #000;
  border-radius: 10px;
}
.status-icons { display: flex; align-items: center; gap: 5px; }
.status-icons svg { display: block; }

/* ============ CHAT HEADER ============ */
#chat-header {
  flex-shrink: 0;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 10px;
  background: var(--accent-dark);
  color: #fff;
  position: relative;
  z-index: 20;
}
.header-back { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; opacity: .9; }
.header-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--zin-gold);
  background: #E9EBF7;
  /* foto candidate cafe udah close-up, gak butuh object-view-box crop lagi (Sesi177 poin 9) */
}
/* Header grup (fitur "You Have Been Added") - avatar dobel mini Rina+ZiN overlap.
   Update Sesi ini: sekarang IKUT pakai foto candidate (sama kayak header solo),
   crop object-view-box lama (buat foto lama yang badan/portrait) udah dilepas
   soalnya foto candidate udah close-up, kalo dipaksa crop lagi malah kepotong. */
.header-avatar-group { position: relative; width: 48px; height: 34px; flex-shrink: 0; }
.header-avatar-group[hidden] { display: none; }
.header-avatar-group-img {
  position: absolute;
  top: 0;
  width: 34px; height: 34px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--zin-gold);
  background: #E9EBF7;
}
.header-avatar-group-img.ha-back { left: 0; z-index: 1; }
.header-avatar-group-img.ha-front { left: 14px; z-index: 2; }
.header-info { flex: 1; min-width: 0; }
.header-name {
  font-size: 15px; font-weight: 600; line-height: 1.2;
  /* sentuhan maroon-emas halus (round-2) — teks tetap putih, cuma dikasih
     glow tipis di belakangnya */
  text-shadow: 0 0 10px rgba(201, 164, 92, .45);
}
.header-status { display: flex; align-items: center; gap: 5px; font-size: 11px; color: rgba(255,255,255,.75); min-width: 0; }
/* Bug-hunt fix (LOW-MEDIUM): nama user (max 20 char) + "Rina, ZiN, " bisa
   wrap 2 baris di layar sempit tanpa guard ini - ellipsis + nowrap = 1 baris
   selalu, gak nabrak notice-strip di bawahnya. */
#header-status-text { display: inline-block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; max-width: 100%; }
.header-status .dot {
  width: 6px; height: 6px; border-radius: 50%; background: #3ED598;
  box-shadow: 0 0 0 1.5px rgba(201, 164, 92, .5);
}
#close-btn {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,.16);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
  flex-shrink: 0;
}
#close-btn svg { width: 16px; height: 16px; }

/* ============ NOTICE STRIP ============ */
#notice-strip {
  flex-shrink: 0;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-dark);
  background: rgba(198, 203, 233, .85);
  position: relative;
  z-index: 15;
}

/* ============ CHAT BODY ============ */
#chat-body {
  flex: 1;
  min-height: 0;
  position: relative;
  background-image: url('../assets/images/wallpaper-chat.jpg');
  background-repeat: repeat;
  background-size: 320px auto;
  overflow-y: auto;
  padding: 14px 12px 24px;
  -webkit-overflow-scrolling: touch;
}
/* Dark mode: ganti wallpaper ke versi gelap (keputusan Mecca), bubble/teks TIDAK
   disentuh (bubble tetap opaque, tetap kebaca). */
@media (prefers-color-scheme: dark) {
  #chat-body {
    background-image: url('../assets/images/wallpaper-chat-dark.jpg');
    background-repeat: repeat;
    background-size: 320px auto;
  }
}
#chat-body.locked { overflow: hidden; touch-action: none; }
#chat-body::-webkit-scrollbar { display: none; }

#bubbles-container { display: flex; flex-direction: column; }

.bubble-row {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  margin-top: 14px;
}
.bubble-row.same-sender { margin-top: 6px; }
.bubble-row.zin { justify-content: flex-start; }
.bubble-row.rina { justify-content: flex-end; }
.bubble-row.user { justify-content: flex-end; }

.bubble-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: #E9EBF7;
  /* crop object-view-box lama dilepas: foto candidate cafe udah close-up,
     crop strip-atas bikin cuma dahi yang keliatan */
}
.bubble-row.same-sender .bubble-avatar { visibility: hidden; }

/* Pesan break-character krisis: pembeda visual tenang (bukan alarm merah) -
   krem hangat + garis aksen kiri, biar kerasa "ini beda register" tanpa norak */
.bubble--serius {
  background: #FFF9EC !important;
  color: #2A2A35 !important;
  border-left: 3px solid #C9A45C;
  box-shadow: 0 2px 10px rgba(42, 42, 53, .10);
}

.bubble {
  max-width: 75%;
  padding: 11px 14px;
  border-radius: 20px;
  font-size: 14px;
  line-height: 1.42;
  position: relative;
  opacity: 0;
  transform: translateY(8px) scale(.97);
  transition: opacity .2s ease-out, transform .2s ease-out;
}
.bubble.bubble-enter-active { opacity: 1; transform: translateY(0) scale(1); }
.bubble.no-anim { opacity: 1; transform: none; transition: none; }

/* Restyle premium (Sesi177 poin 7): satu sudut kecil 6px di sisi bawah-pengirim
   (ganti gaya "ekor" lama 4px), shadow sangat halus di bubble masuk (ZiN). Warna
   TIDAK diubah. */
.bubble--zin {
  background: var(--bubble-in);
  color: var(--text-dark);
  border-bottom-left-radius: 6px;
  box-shadow: 0 1px 3px rgba(20, 20, 35, .07), 0 1px 2px rgba(20, 20, 35, .04);
}
.bubble--rina { background: var(--rina-blue); color: #fff; border-bottom-right-radius: 6px; }
.bubble--rina .bubble-text { font-weight: 500; }
/* Grup chat: bubble user, NETRAL beda dari Rina (user bukan Rina, bukan biru brand) */
.bubble--user { background: #4A4A58; color: #fff; border-bottom-right-radius: 6px; }

.bubble-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  margin-top: 3px;
  font-size: 10px;
  opacity: .65;
}
.bubble--zin .bubble-meta { color: var(--text-muted); }
.bubble--rina .bubble-meta { color: rgba(255,255,255,.8); }
.bubble--user .bubble-meta { color: rgba(255,255,255,.7); }

.tick-svg { width: 13px; height: 8px; }
.tick-svg path { stroke: currentColor; transition: stroke .3s ease; }
.bubble-meta.read .tick-svg path { stroke: #53BDEB; }

/* Typing indicator */
.typing-bubble {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px 14px;
}
.typing-bubble .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--text-muted);
  animation: typingBounce 1s ease-in-out infinite;
}
.typing-bubble .dot:nth-child(2) { animation-delay: .15s; }
.typing-bubble .dot:nth-child(3) { animation-delay: .3s; }
@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: .4; }
  30% { transform: translateY(-4px); opacity: 1; }
}
/* Rina/user typing indicator jalan di bubble biru/abu-gelap, dot muted-gray gak
   kontras di situ - dipaksa putih transparan (grup chat feature) */
.bubble--rina.typing-bubble .dot,
.bubble--user.typing-bubble .dot { background: rgba(255,255,255,.85); }

/* ============ GROUP-MODE / DM LAYOUT (WA-style, temuan tim HP asli) ============
   Begitu grup ATAU DM aktif, #phone-mockup dapet class .group-mode (app.js
   enterGroupMode/enterDMMode) DAN tiap bubble-row yang dirender SELAMA mode itu
   aktif dapet class tambahan '.group-render' (ditempel di renderBubble/showTyping,
   app.js). WAJIB pakai marker per-row '.group-render', BUKAN cuma ancestor
   '.group-mode' - cerita+grup share #bubbles-container yang sama, jadi kalau
   cuma andelin ancestor class, bubble CERITA LAMA ikut ke-restyle retroaktif
   begitu ancestor dapet class group-mode (bug ke-detect live browser test).
   Marker per-row = bubble cerita yang UDAH ada sebelum grup mode aktif gak
   pernah dapet class ini, jadi beneran TIDAK BERUBAH SAMA SEKALI. */
.bubble-row.rina.group-render { justify-content: flex-start; }

.bubble-row.group-render .bubble--rina:not(.bubble--serius) {
  background: var(--bubble-in);
  color: var(--text-dark);
  border-bottom-left-radius: 6px;
  border-bottom-right-radius: 20px;
  box-shadow: 0 1px 3px rgba(20, 20, 35, .07), 0 1px 2px rgba(20, 20, 35, .04);
}
.bubble-row.group-render .bubble--rina .bubble-text { font-weight: 400; }
.bubble-row.group-render .bubble--rina .bubble-meta { color: var(--text-muted); }
.bubble-row.group-render .bubble--rina .bubble-meta.read .tick-svg path { stroke: #53BDEB; }
.bubble-row.group-render .bubble--rina .voice-play-btn { background: var(--rina-blue); color: #fff; }
.bubble-row.group-render .bubble--rina .wf-base span { background: rgba(76, 83, 145, .22); }
.bubble-row.group-render .bubble--rina .wf-progress span { background: rgba(76, 83, 145, .9); }
.bubble-row.group-render .bubble--rina .vn-transcript-toggle,
.bubble-row.group-render .bubble--rina .vn-hint { color: var(--text-muted); }
/* Rina bg jadi putih di grup/DM - dot typing muted-abu jangan putih-di-putih lagi */
.bubble-row.group-render .bubble--rina.typing-bubble .dot { background: var(--text-muted); }

/* Bug-hunt fix (MED #9): bubble serius di grup/DM sebelumnya kebawa shape default
   .bubble--rina (tail bottom-right, kayak bubble outgoing) walau posisinya di kiri
   (avatar+justify-content flex-start) - keliatan gak konsisten sama bubble
   karakter lain di grup. Dipaksa tail incoming (kiri) di sini, menang lewat
   specificity (3 class) atas .bubble--rina/.bubble--zin dasar (2 class). */
.bubble-row.group-render .bubble--serius {
  border-bottom-right-radius: 20px;
  border-bottom-left-radius: 6px;
}

/* Label nama pengirim (mode GRUP doang) - cuma di bubble pertama tiap rentetan
   penutur sama (app.js: gated !sameAsPrev). Serius tetap krem+aksen (menang
   lewat !important di .bubble--serius, gak disentuh di sini). */
.bubble-sender-label {
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 2px;
  line-height: 1.2;
}
.bubble-sender-label.sender-rina { color: var(--rina-blue); }
.bubble-sender-label.sender-zin { color: var(--zin-maroon); }

/* System message (gaya WA) - dipakai transisi masuk grup + cooldown bisu */
.system-message {
  align-self: center;
  margin: 14px auto;
  max-width: 80%;
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  background: rgba(255,255,255,.6);
  border-radius: 999px;
  padding: 5px 14px;
  opacity: 0;
  transition: opacity .4s ease;
}
.system-message.visible { opacity: 1; }

/* Voice bubble (border-radius diwarisi dari .bubble + .bubble--rina/.bubble--zin,
   JANGAN di-reset di sini biar sudut kecil sender-corner poin 7 tetap kepake) */
.bubble--voice { display: flex; flex-direction: column; align-items: stretch; gap: 6px; min-width: 190px; }
.voice-controls { display: flex; align-items: center; gap: 10px; }
.voice-play-btn {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(0,0,0,.12);
}
/* Poin 8: tombol play solid kontras - putih di pill biru Rina, biru brand di pill putih ZiN */
.bubble--rina .voice-play-btn { background: #fff; color: var(--rina-blue); }
.bubble--zin .voice-play-btn { background: var(--rina-blue); color: #fff; }
.voice-play-btn .icon-pause { display: none; }
.bubble--voice.playing .icon-play { display: none; }
.bubble--voice.playing .icon-pause { display: block; }

.voice-waveform { position: relative; width: 88px; height: 26px; flex-shrink: 0; }
.wf-bars { position: absolute; inset: 0; display: flex; align-items: center; gap: 2px; }
.wf-bars span { flex: 1; border-radius: 2px; transform-origin: center; }
.wf-progress { clip-path: inset(0 100% 0 0); }
.bubble--rina .wf-base span { background: rgba(255,255,255,.35); }
.bubble--rina .wf-progress span { background: rgba(255,255,255,.95); }
.bubble--zin .wf-base span { background: rgba(76,83,145,.22); }
.bubble--zin .wf-progress span { background: rgba(76,83,145,.9); }

/* Poin 8: waveform "hidup" pas playing - transform-only (scaleY), off di
   prefers-reduced-motion. Delay ke-nth-child dikasih variasi biar keliatan
   kayak equalizer, bukan barisan nge-bounce bareng. */
.bubble--voice.playing .wf-bars span { animation: wfPulse 900ms ease-in-out infinite; }
.wf-bars span:nth-child(3n) { animation-delay: 0ms; }
.wf-bars span:nth-child(3n+1) { animation-delay: 160ms; }
.wf-bars span:nth-child(3n+2) { animation-delay: 320ms; }
@keyframes wfPulse {
  0%, 100% { transform: scaleY(.75); }
  50% { transform: scaleY(1.15); }
}
@media (prefers-reduced-motion: reduce) {
  .bubble--voice.playing .wf-bars span { animation: none; }
}

.voice-duration { font-size: 11px; font-variant-numeric: tabular-nums; opacity: .85; flex-shrink: 0; }

/* Poin 8: baris bawah rapi - durasi (kiri) + jam & centang (kanan) */
.voice-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 2px; }
.voice-meta .bubble-meta { margin-top: 0; }

/* VN wait-gate hint ("dengerin dulu ya") */
.vn-hint {
  font-size: 12px;
  padding-left: 2px;
  opacity: 0;
  transition: opacity .4s ease;
}
.bubble--rina .vn-hint { color: rgba(255,255,255,.75); }
.bubble--zin .vn-hint { color: var(--text-muted); }
.vn-hint.visible { opacity: 1; animation: hintPulse 1.8s ease-in-out infinite; }
@keyframes hintPulse {
  0%, 100% { opacity: .55; }
  50% { opacity: .95; }
}
@media (prefers-reduced-motion: reduce) {
  .vn-hint.visible { animation: none; opacity: .85; }
}

/* VN transcript toggle (round-2) — "baca aja" link + italic transcript body */
.vn-transcript-toggle {
  align-self: flex-start;
  margin-top: 2px;
  font-size: 11px;
  text-decoration: underline;
  opacity: .8;
}
.bubble--rina .vn-transcript-toggle { color: rgba(255,255,255,.85); }
.bubble--zin .vn-transcript-toggle { color: var(--text-muted); }
.vn-transcript-body {
  margin-top: 4px;
  font-size: 12px;
  font-style: italic;
  line-height: 1.4;
}
.bubble--rina .vn-transcript-body { color: rgba(255,255,255,.85); }
.bubble--zin .vn-transcript-body { color: var(--text-muted); }

/* Image bubble (border-radius diwarisi dari .bubble + .bubble--rina/.bubble--zin,
   sama alasannya kayak .bubble--voice di atas) */
.bubble--image { padding: 0; overflow: hidden; width: 210px; max-width: 75%; cursor: zoom-in; }
.bubble--image img { width: 100%; display: block; }
.bubble--image .image-caption {
  padding: 8px 12px 6px;
  font-size: 13px;
  line-height: 1.4;
  background: var(--rina-blue);
  color: #fff;
  font-weight: 500;
}

/* ============ SHARE + CTA SECTION ============ */
#share-section { margin-top: 22px; padding-bottom: 8px; }
#share-section[hidden] { display: none; }

.share-divider {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  letter-spacing: .3em;
  margin-bottom: 16px;
  opacity: 0;
  transition: opacity .4s ease;
}
.share-divider.visible { opacity: .8; }

.share-copy {
  text-align: center;
  font-size: 13px;
  color: var(--text-dark);
  background: rgba(255,255,255,.75);
  border-radius: 6px; /* parity luxury-pass landing */
  padding: 10px 14px;
  margin-bottom: 14px;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .4s ease, transform .4s ease;
}
.share-copy.visible { opacity: 1; transform: none; }

.share-row { display: flex; justify-content: center; gap: 18px; margin-bottom: 18px; }
.share-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .4s ease, transform .4s ease;
}
.share-btn.visible { opacity: 1; transform: none; }
.share-circle {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 4px 14px rgba(0,0,0,.18);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent-dark);
}
.share-label { font-size: 10px; color: var(--text-muted); }

.cta-card {
  border-radius: 6px; /* parity luxury-pass landing (review Opus): kartu tajam, 1 generasi visual */
  background: linear-gradient(135deg, var(--accent-mid), var(--accent-dark));
  padding: 14px;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .4s ease, transform .4s ease;
}
.cta-card.visible { opacity: 1; transform: none; }
.cta-banner-img { width: 100%; border-radius: 4px; margin-bottom: 12px; } /* parity tajam */

/* Kartu produk mobile (poin 10): daftar 5 produk+harga, CUMA muncul <=480px,
   gantiin banner (banner di-hide di mobile, tetap tampil di desktop). */
.cta-product-list { display: none; }

.cta-body { display: flex; align-items: center; gap: 10px; }
/* Foto candidate udah close-up, gak butuh object-view-box crop lama lagi (sama alasan header-avatar solo) */
.cta-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(255,255,255,.8); flex-shrink: 0; background: #E9EBF7; }
.cta-text { flex: 1; }
.cta-headline {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  color: #fff;
  line-height: 1.3;
}
/* poin 9: badge "Coming Soon" dipindah ke sini (teks kecil di bawah headline),
   dipisah dari sebelah tombol biar tombol "Gas cek ah" tetap dominan */
.cta-substatus {
  margin-top: 4px;
  font-size: 11px;
  color: rgba(255, 255, 255, .65);
}
.cta-actions { display: flex; align-items: center; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
#cta-button {
  height: 44px;
  padding: 0 20px;
  border-radius: 999px;
  background: #fff;
  color: var(--accent-dark);
  font-weight: 600;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

@media (max-width: 480px) {
  .cta-banner-img { display: none; }
  .cta-product-list {
    display: block;
    list-style: none;
    margin: 0 0 12px;
    padding: 0;
    background: rgba(255, 255, 255, .12);
    border-radius: 6px;
    overflow: hidden;
  }
  .cta-product-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    font-size: 12px;
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, .12);
  }
  .cta-product-list li:last-child { border-bottom: none; }
  .cta-product-name { font-weight: 500; }
  .cta-product-price { font-weight: 700; color: var(--zin-gold); flex-shrink: 0; }
}

.footer-mini {
  text-align: center;
  margin-top: 18px;
  color: var(--text-muted);
  font-size: 11px;
  opacity: 0;
  transition: opacity .4s ease;
}
.footer-mini.visible { opacity: .85; }
.footer-mini .footer-wordmark { font-family: var(--font-display); font-weight: 700; color: var(--text-dark); }
/* link IG: warna ikut footer (bukan biru default), underline halus pas hover */
.footer-mini a { color: inherit; text-decoration: none; border-bottom: 1px solid transparent; transition: border-color .25s ease; }
.footer-mini a:hover, .footer-mini a:focus-visible { border-bottom-color: currentColor; }

/* ============ WATERMARK ============ */
.watermark {
  position: absolute;
  right: 12px;
  bottom: 72px;
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: .35;
  z-index: 25;
  pointer-events: none;
}
.watermark-logo { width: 14px; height: 14px; object-fit: contain; }
.watermark span {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13px;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0,0,0,.4);
}

/* ============ INPUT BAR ============ */
#input-bar {
  flex-shrink: 0;
  height: 52px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  background: rgba(198, 203, 233, .5);
  position: relative;
  z-index: 15;
}
#group-form { flex: 1; display: flex; min-width: 0; }
.input-pill {
  flex: 1;
  min-width: 0;
  height: 34px;
  border-radius: 999px;
  background: rgba(255,255,255,.85);
  color: var(--text-dark);
  font-size: 13px;
  font-family: inherit;
  border: none;
  outline: none;
  padding: 0 14px;
}
.input-pill::placeholder { color: var(--text-muted); }
.input-pill:disabled { color: var(--text-muted); cursor: default; }
/* Grup chat aktif (Sesi177 poin grup): shake halus pas spam-enter/buffer penuh */
.input-pill.shake { animation: inputShake .32s ease; }
@keyframes inputShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

/* Suggested chips (Round B digabung ke scope ini per arahan komando) */
.chip-row {
  flex-shrink: 0;
  display: flex;
  gap: 8px;
  padding: 8px 12px 0;
  overflow-x: auto;
  background: rgba(198, 203, 233, .5);
  position: relative;
  z-index: 14;
}
.chip-row[hidden] { display: none; }
.chip-btn {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 500;
  color: var(--accent-dark);
  background: rgba(255,255,255,.9);
  border-radius: 999px;
  padding: 7px 14px;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0,0,0,.08);
}

#mic-btn {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--accent-dark);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
/* Panel-review fix (Opus): mic-btn jadi tombol kirim beneran - icon swap
   mic -> paper-plane begitu input ada isinya (pola WA). Lihat app.js
   updateMicBtnState(). */
#mic-btn .icon-send { display: none; }
#mic-btn.has-content .icon-mic { display: none; }
#mic-btn.has-content .icon-send { display: block; }

/* ============ HOME INDICATOR ============ */
#home-indicator {
  flex-shrink: 0;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: rgba(198, 203, 233, .5);
}
#home-indicator .bar { width: 120px; height: 5px; border-radius: 999px; background: var(--text-dark); opacity: .35; }

/* ============ LIGHTBOX ============ */
#lightbox {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(0,0,0,.85);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  cursor: zoom-out;
}
#lightbox[hidden] { display: none; }
#lightbox img { max-width: 100%; max-height: 100%; border-radius: 12px; }

/* ============ SPEED BADGE ============ */
#speed-badge {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  z-index: 200;
  background: rgba(0,0,0,.7);
  color: #fff;
  font-weight: 700;
  font-size: 20px;
  padding: 10px 20px;
  border-radius: 999px;
  opacity: 0;
  transition: opacity .2s ease;
  pointer-events: none;
}
#speed-badge.visible { opacity: 1; }

/* ============ TOAST ============ */
#toast {
  position: absolute;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  background: rgba(20,20,30,.9);
  color: #fff;
  font-size: 12px;
  padding: 9px 16px;
  border-radius: 999px;
  opacity: 0;
  transition: opacity .3s ease;
  pointer-events: none;
  white-space: nowrap;
  max-width: 90%;
  text-overflow: ellipsis;
  overflow: hidden;
}
#toast.visible { opacity: 1; }

/* ============ ACCESSIBILITY ============ */
@media (prefers-reduced-motion: reduce) {
  .loading-logo { animation: none; }
  .desktop-marquee span { animation: none; }
  .loading-dots .dot, .typing-bubble .dot { animation: none; }
  .bubble { transition: none; }
  .system-message { transition: none; }
  .input-pill.shake { animation: none; }
}
