/* demos/whatsapp-booking/style.css — WhatsApp-style appointment booking demo (DEMO-17)
   Authentic WhatsApp light-theme look: #075E54 header, #ECE5DD wallpaper, #D9FDD3 outgoing. */

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
  background: #0b1220 radial-gradient(900px 500px at 80% -10%, rgba(0, 168, 132, 0.14), transparent 60%) no-repeat;
  color: #e2e8f0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ---------- site topbar ---------- */
.topbar { border-bottom: 1px solid rgba(255,255,255,0.08); background: rgba(2,6,23,0.7); position: relative; z-index: 30; }
.topbar-in {
  max-width: 1080px; margin: 0 auto; padding: 0 16px; height: 56px;
  display: flex; align-items: center; justify-content: space-between;
}
.brand { color: #fff; font-weight: 800; text-decoration: none; font-size: 17px; letter-spacing: -0.01em; }
.brand span { color: #34d399; font-family: 'JetBrains Mono', monospace; font-size: 11px; margin-left: 4px; vertical-align: 2px; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.demo-chip {
  font-family: 'JetBrains Mono', monospace; font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase;
  color: #94a3b8; border: 1px solid rgba(255,255,255,0.12); border-radius: 999px; padding: 4px 10px;
}
.back-link { color: #cbd5e1; font-size: 13px; text-decoration: none; }
.back-link:hover { color: #fff; }

/* ---------- stage layout ---------- */
.stage {
  flex: 1; width: 100%; max-width: 1080px; margin: 0 auto;
  display: flex; align-items: center; justify-content: center; gap: 56px;
  padding: 28px 16px 34px;
}

.pitch { max-width: 380px; }
.badge-live {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: #6ee7b7; background: rgba(16,185,129,0.1); border: 1px solid rgba(16,185,129,0.35);
  border-radius: 999px; padding: 5px 12px; margin-bottom: 16px;
}
.badge-live i { width: 6px; height: 6px; border-radius: 50%; background: #34d399; animation: pulse 1.6s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }
.pitch h1 { color: #fff; font-size: 30px; line-height: 1.15; letter-spacing: -0.02em; font-weight: 800; }
.pitch > p { margin-top: 14px; font-size: 14.5px; line-height: 1.65; color: #9fb0c3; }
.pitch strong { color: #d7e3f0; }
.pitch-list { margin-top: 16px; list-style: none; display: grid; gap: 9px; }
.pitch-list li { font-size: 13.5px; color: #9fb0c3; padding-left: 18px; position: relative; line-height: 1.5; }
.pitch-list li::before { content: ''; position: absolute; left: 0; top: 7px; width: 7px; height: 7px; border-radius: 2px; background: #10b981; }
.pitch-list b { color: #d7e3f0; font-weight: 600; }
.pitch .fine { margin-top: 18px; font-size: 12px; color: #64748b; }

/* ---------- phone mock ---------- */
.phone {
  position: relative; width: 400px; max-width: 100%;
  height: min(740px, calc(100dvh - 96px)); min-height: 560px;
  background: #0f172a; border-radius: 34px; padding: 10px;
  box-shadow: 0 40px 90px -20px rgba(0,0,0,0.65), 0 0 0 1px rgba(255,255,255,0.06);
  display: flex; flex-direction: column;
}
.phone-notch {
  position: absolute; top: 10px; left: 50%; transform: translateX(-50%);
  width: 120px; height: 22px; background: #0f172a; border-radius: 0 0 14px 14px; z-index: 5;
}
.phone > * { position: relative; }

/* ---------- WhatsApp header ---------- */
.wa-head {
  background: #075e54; color: #fff; border-radius: 26px 26px 0 0;
  padding: 30px 10px 10px; display: flex; align-items: center; gap: 8px; flex-shrink: 0;
}
.wa-back, .wa-ico {
  background: none; border: 0; cursor: pointer; color: rgba(255,255,255,0.85);
  display: inline-flex; align-items: center; justify-content: center;
}
.wa-back svg, .wa-ico svg { width: 21px; height: 21px; fill: currentColor; }
.wa-ico { width: 34px; height: 34px; border-radius: 50%; }
.wa-ico:hover { background: rgba(255,255,255,0.1); }
.wa-avatar {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  background: #128c7e; display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 16px; color: #fff; border: 1.5px solid rgba(255,255,255,0.35);
}
.wa-id { flex: 1; min-width: 0; }
.wa-name { font-size: 15.5px; font-weight: 600; line-height: 1.2; }
.wa-status { font-size: 11.5px; color: rgba(255,255,255,0.72); margin-top: 1px; }
.wa-status.typing { font-style: italic; }

/* kebab menu */
.wa-head { position: relative; }
.kebab-menu {
  position: absolute; top: 56px; right: 8px; z-index: 40;
  background: #fff; color: #3b4a54; border-radius: 10px; overflow: hidden; min-width: 240px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.25);
  opacity: 0; transform: translateY(-6px); pointer-events: none; transition: all 0.18s ease;
}
.kebab-menu.open { opacity: 1; transform: none; pointer-events: auto; }
.kebab-menu button {
  width: 100%; text-align: left; background: none; border: 0; cursor: pointer;
  font: 600 13.5px 'Inter', sans-serif; color: #3b4a54; padding: 13px 16px;
}
.kebab-menu button:hover { background: #f5f6f6; }
.kebab-note { font-size: 11px; color: #8696a0; padding: 0 16px 12px; line-height: 1.45; border-top: 1px solid #eef1f2; padding-top: 10px; }

/* ---------- chat area ---------- */
.wa-chat {
  flex: 1; overflow-y: auto; overscroll-behavior: contain;
  background-color: #efeae2;
  background-image:
    radial-gradient(rgba(11,20,26,0.05) 1.1px, transparent 1.3px),
    radial-gradient(rgba(11,20,26,0.035) 1.1px, transparent 1.3px);
  background-size: 26px 26px, 26px 26px;
  background-position: 0 0, 13px 13px;
  padding: 12px 12px 10px;
  display: flex; flex-direction: column; gap: 3px;
  scrollbar-width: thin; scrollbar-color: rgba(11,20,26,0.18) transparent;
}
.wa-chat::-webkit-scrollbar { width: 5px; }
.wa-chat::-webkit-scrollbar-thumb { background: rgba(11,20,26,0.18); border-radius: 4px; }

.enc-pill {
  margin: 2px auto 8px; max-width: 85%;
  background: #fff7d6; color: #54656f; border-radius: 8px;
  font-size: 10.8px; line-height: 1.45; text-align: center; padding: 7px 12px;
  display: flex; align-items: center; gap: 6px; justify-content: center;
  box-shadow: 0 1px 0.5px rgba(11,20,26,0.13);
}
.enc-pill svg { width: 13px; height: 13px; fill: #b08c3d; flex-shrink: 0; }

.day-chip {
  align-self: center; background: #fff; color: #54656f;
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.06em;
  border-radius: 7px; padding: 5px 12px; margin: 2px 0 6px;
  box-shadow: 0 1px 0.5px rgba(11,20,26,0.13);
}

/* ---------- bubbles ---------- */
.row { display: flex; margin-top: 2px; animation: bIn 0.22s ease-out both; }
.row.out { justify-content: flex-end; }
@keyframes bIn { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }

.bubble {
  position: relative; max-width: 78%;
  background: #fff; color: #111b21; border-radius: 9px; padding: 7px 9px 6px;
  font-size: 13.6px; line-height: 1.45;
  box-shadow: 0 1px 0.5px rgba(11,20,26,0.13);
  word-wrap: break-word; overflow-wrap: anywhere;
}
.row.in .bubble { border-top-left-radius: 2px; }
.row.in .bubble::before {
  content: ''; position: absolute; left: -7px; top: 0;
  width: 8px; height: 13px; background: #fff;
  clip-path: polygon(100% 0, 100% 100%, 0 0);
}
.row.out .bubble { background: #d9fdd3; border-top-right-radius: 2px; }
.row.out .bubble::after {
  content: ''; position: absolute; right: -7px; top: 0;
  width: 8px; height: 13px; background: #d9fdd3;
  clip-path: polygon(0 0, 0 100%, 100% 0);
}

.bubble .meta {
  display: flex; align-items: center; justify-content: flex-end; gap: 3px;
  font-size: 10.5px; color: #667781; margin-top: 2px; user-select: none;
}
.meta .ticks svg { width: 15px; height: 14px; fill: #8696a0; display: block; }
.meta .ticks.read svg { fill: #53bdeb; }

.bubble b { font-weight: 600; }
.bubble .sys-line { color: #54656f; font-size: 12.4px; }

/* appointment confirmation card inside a bubble */
.appt-card { border: 1px solid #d9e3e7; border-radius: 8px; padding: 9px 10px; margin: 3px 0 5px; background: #f7fbf6; }
.appt-card .ac-title { font-size: 11px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: #00a884; display: flex; align-items: center; gap: 6px; }
.appt-card .ac-title svg { width: 14px; height: 14px; fill: #00a884; }
.appt-card dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; margin-top: 7px; font-size: 12.6px; }
.appt-card dt { color: #667781; }
.appt-card dd { color: #111b21; font-weight: 600; text-align: right; }
.appt-card .ac-ref { margin-top: 8px; border-top: 1px dashed #cdd9dd; padding-top: 7px; font-size: 12px; color: #54656f; }
.appt-card .ac-ref code { font-family: 'JetBrains Mono', monospace; font-weight: 700; color: #008069; letter-spacing: 0.04em; }

/* quick replies (WhatsApp interactive buttons) */
.qr-wrap { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; margin: 6px 0 4px; animation: bIn 0.22s ease-out both; max-width: 86%; }
.qr {
  width: 100%; text-align: center; cursor: pointer;
  background: #fff; color: #00a884; border: 1px solid rgba(0,0,0,0.08); border-radius: 9px;
  font: 600 13px 'Inter', sans-serif; padding: 10px 14px;
  box-shadow: 0 1px 0.5px rgba(11,20,26,0.13);
  transition: background 0.15s ease, transform 0.1s ease;
}
.qr:hover { background: #f0f2f5; }
.qr:active { transform: scale(0.98); }
.qr:disabled { color: #a5b6bd; cursor: default; }
.qr:disabled:hover { background: #fff; }
.qr-head {
  align-self: stretch; background: #fff; border-radius: 9px 9px 0 0; border: 1px solid rgba(0,0,0,0.08); border-bottom: 0;
  font-size: 11px; color: #667781; text-align: center; padding: 6px 10px 5px;
  box-shadow: 0 1px 0.5px rgba(11,20,26,0.13);
}
.qr-wrap.has-head { margin-top: 0; }
.qr-wrap.has-head .qr { border-radius: 0; }
.qr-wrap.has-head .qr:last-child { border-radius: 0 0 9px 9px; }

/* typing indicator bubble */
.typing-bubble { display: inline-flex; gap: 4px; align-items: center; padding: 12px 14px; }
.typing-bubble span { width: 7px; height: 7px; border-radius: 50%; background: #8696a0; animation: tp 1.1s infinite; }
.typing-bubble span:nth-child(2) { animation-delay: 0.18s; }
.typing-bubble span:nth-child(3) { animation-delay: 0.36s; }
@keyframes tp { 0%,60%,100% { opacity: 0.35; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

/* ---------- input bar ---------- */
.wa-inputbar {
  flex-shrink: 0; background: #f0f2f5; border-radius: 0 0 26px 26px;
  padding: 8px 8px 10px; display: flex; align-items: center; gap: 7px;
}
.wa-input-wrap {
  flex: 1; min-width: 0; /* allow shrinking on 320px screens */
  display: flex; align-items: center; gap: 4px;
  background: #fff; border-radius: 999px; padding: 4px 6px 4px 10px;
  box-shadow: 0 1px 0.5px rgba(11,20,26,0.09);
}
.wa-input-wrap .wa-ico { color: #8696a0; width: 32px; height: 32px; }
.wa-input-wrap .wa-ico:hover { background: none; color: #54656f; }
#wbInput, #waInput {
  flex: 1; border: 0; outline: none; background: none;
  font: 400 14px 'Inter', sans-serif; color: #111b21; min-width: 0; padding: 7px 2px;
}
#wbInput::placeholder, #waInput::placeholder { color: #8696a0; }
.wa-send {
  width: 42px; height: 42px; border-radius: 50%; border: 0; cursor: pointer; flex-shrink: 0;
  background: #00a884; color: #fff; display: flex; align-items: center; justify-content: center;
  transition: background 0.15s ease, transform 0.12s ease;
}
.wa-send:hover { background: #017561; }
.wa-send:active { transform: scale(0.94); }
.wa-send svg { width: 20px; height: 20px; fill: currentColor; }
.wa-send .ic-send { display: none; margin-left: 2px; }
.wa-send.typing .ic-send { display: block; }
.wa-send.typing .ic-mic { display: none; }

/* ---------- responsive ---------- */
@media (max-width: 920px) {
  .stage { flex-direction: column; gap: 22px; padding: 22px 14px 30px; }
  .pitch { max-width: 460px; order: 2; }
  .pitch h1 { font-size: 24px; }
  .phone { order: 1; }
}
@media (max-width: 560px) {
  .topbar-in { height: 50px; }
  .demo-chip { display: none; }
  .stage { padding: 10px 8px 16px; }
  .phone {
    width: 100%; height: calc(100dvh - 76px); min-height: 480px;
    border-radius: 22px; padding: 6px;
  }
  .phone-notch { display: none; }
  .wa-head { border-radius: 16px 16px 0 0; padding-top: 16px; }
  .wa-inputbar { border-radius: 0 0 16px 16px; }
  .pitch { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
