/* =============================================================================
   ClientZapp website assistant — floating launcher and chat panel.

   Companion to assist.js. Uses the brand tokens declared in site.css (--navy-*,
   --gold-*, --line, --shell, --radius, --shadow) so it inherits any palette
   change. Loaded by site/layout.blade.php after site.css; bump
   config/site.php → asset_version when this file changes.
   ========================================================================== */

.cz-assist { position: fixed; right: 20px; bottom: 20px; z-index: 60; display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }

/* ---- launcher ---------------------------------------------------------- */
.cz-assist-launcher {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 48px; padding: 0 18px 0 12px; border: 0; border-radius: 999px;
  background: var(--navy-600); color: #fff; font: inherit; font-weight: 650; font-size: .95rem;
  box-shadow: 0 2px 6px rgba(12, 16, 48, .18), 0 10px 28px rgba(12, 16, 48, .18);
  cursor: pointer; transition: background-color .15s ease, transform .15s ease;
}
.cz-assist-launcher:hover { background: var(--navy-700); transform: translateY(-1px); }
.cz-assist-launcher-icon {
  display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: var(--gold-400); color: var(--navy-900); font-weight: 800; font-size: 1rem;
}
.cz-assist.is-open .cz-assist-launcher-text { display: none; }
.cz-assist.is-open .cz-assist-launcher { padding: 0 10px; }

/* ---- panel ------------------------------------------------------------- */
.cz-assist-panel {
  display: flex; flex-direction: column;
  width: min(380px, calc(100vw - 40px)); height: min(560px, calc(100vh - 100px));
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 4px 12px rgba(12, 16, 48, .12), 0 24px 48px rgba(12, 16, 48, .18);
  overflow: hidden; transform-origin: bottom right;
  animation: cz-assist-in .18s ease-out;
}
.cz-assist-panel[hidden] { display: none; }
@keyframes cz-assist-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }

.cz-assist-header {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 14px 14px 12px 18px; background: var(--navy-600); color: #fff;
}
.cz-assist-title { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cz-assist-heading { font-weight: 750; font-size: 1rem; letter-spacing: -.01em; }
.cz-assist-sub { font-size: .78rem; color: var(--navy-100); line-height: 1.35; }
.cz-assist-close {
  flex: none; width: 36px; height: 36px; border: 0; border-radius: 8px; background: transparent; color: #fff;
  font-size: 1.5rem; line-height: 1; cursor: pointer;
}
.cz-assist-close:hover { background: rgba(255, 255, 255, .14); }
.cz-assist-close:focus-visible { outline-color: var(--gold-400); }

.cz-assist-log { flex: 1; overflow-y: auto; padding: 16px 16px 8px; background: var(--shell); }
.cz-assist-msg { width: fit-content; max-width: 92%; margin-bottom: 10px; padding: 10px 13px; border-radius: 12px; font-size: .92rem; line-height: 1.5; }
.cz-assist-msg p { margin: 0 0 .5rem; }
.cz-assist-msg p:last-child { margin-bottom: 0; }
.cz-assist-msg-bot { background: var(--surface); border: 1px solid var(--line); color: var(--body); border-bottom-left-radius: 4px; }
.cz-assist-msg-user { margin-left: auto; background: var(--navy-600); color: #fff; border-bottom-right-radius: 4px; }
.cz-assist-msg-user a { color: #fff; }
.cz-assist-q { display: block; color: var(--ink); margin-bottom: .3rem; font-weight: 700; }
.cz-assist-small { font-size: .82rem; color: var(--muted); }
.cz-assist-cta { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 4px; }
.cz-assist-cta .btn { text-decoration: none; }
.cz-assist-suggest { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }

.cz-assist-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 16px 10px; border-top: 1px solid var(--line-soft); background: var(--surface); }
.cz-assist-chip {
  padding: 6px 11px; border: 1px solid var(--navy-100); border-radius: 999px;
  background: var(--navy-50); color: var(--navy-600); font: inherit; font-size: .82rem; font-weight: 600; line-height: 1.3;
  cursor: pointer; text-align: left;
}
.cz-assist-chip:hover { background: var(--navy-100); color: var(--navy-700); }

.cz-assist-form { display: flex; gap: 8px; padding: 10px 16px 14px; border-top: 1px solid var(--line); background: var(--surface); }
.cz-assist-input {
  flex: 1; min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  font: inherit; font-size: 16px; /* 16px stops iOS zooming the page on focus */ color: var(--ink); background: var(--surface);
}
.cz-assist-input::placeholder { color: var(--muted); }
.cz-assist-send { flex: none; }

/* visually hidden label for screen readers ("You:" / "Guide:") */
.cz-assist-vh { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---- phones: the panel becomes a bottom sheet ---------------------------- */
@media (max-width: 520px) {
  .cz-assist { right: 12px; bottom: 12px; left: 12px; align-items: stretch; }
  .cz-assist-launcher { align-self: flex-end; }
  .cz-assist-panel { width: auto; height: min(78vh, 600px); }
  .cz-assist-msg { max-width: 96%; }
}

@media (prefers-reduced-motion: reduce) {
  .cz-assist-panel { animation: none; }
  .cz-assist-launcher { transition: none; }
  .cz-assist-launcher:hover { transform: none; }
}

@media print { .cz-assist { display: none; } }
