/* ===== Berry: website chat assistant (Dec 2026) =====
   Greeting card -> "May I help you?"; "No thanks" shrinks it to the floating AI icon.
   Everything is scoped under .cbc so it cannot clash with the site's styles. */
.cbc { --cbc-navy: #14213d; --cbc-navy-2: #1d2f57; --cbc-gold: #a8843f; --cbc-gold-l: #e2c588;
  --cbc-green: #1fae5f; --cbc-mint: #7dffb8; --cbc-ink: #111827; --cbc-muted: #5b6478; --cbc-line: #e6e8ee;
  position: fixed; right: 22px; bottom: 22px; z-index: 1500; font-family: 'IBM Plex Sans', 'Inter', system-ui, sans-serif;
  color: var(--cbc-ink); font-size: 15px; line-height: 1.5; }
.cbc *, .cbc *::before, .cbc *::after { box-sizing: border-box; }
.cbc [hidden] { display: none !important; }

/* ---------- floating AI icon ---------- */
.cbc-fab { position: relative; width: 66px; height: 66px; border-radius: 50%; border: 0; cursor: pointer; padding: 0;
  background: radial-gradient(circle at 30% 25%, #2a4277, var(--cbc-navy) 70%);
  box-shadow: 0 10px 28px rgba(20,33,61,.35), inset 0 0 0 2px rgba(226,197,136,.55);
  display: grid; place-items: center; transition: transform .35s cubic-bezier(.34,1.56,.64,1), box-shadow .3s;
  animation: cbcPop .5s cubic-bezier(.34,1.56,.64,1); }
.cbc-fab:hover, .cbc-fab:focus-visible { transform: scale(1.08) rotate(-4deg); box-shadow: 0 14px 34px rgba(20,33,61,.42), inset 0 0 0 2px var(--cbc-gold-l); outline: none; }
.cbc-fab img { width: 46px; height: 46px; filter: drop-shadow(0 2px 6px rgba(125,255,184,.35)); }
.cbc-fab::before { content: ''; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid rgba(31,174,95,.55);
  animation: cbcRing 2.6s ease-out infinite; pointer-events: none; }
.cbc-badge { position: absolute; top: -4px; right: -6px; background: linear-gradient(135deg, var(--cbc-green), #13894a);
  color: #fff; font-size: 10.5px; font-weight: 700; letter-spacing: .06em; padding: 3px 7px; border-radius: 999px;
  box-shadow: 0 3px 8px rgba(19,137,74,.4); border: 2px solid #fff; }
.cbc-tip { position: absolute; right: 78px; bottom: 18px; white-space: nowrap; background: var(--cbc-navy); color: #fff;
  font-size: 13px; padding: 7px 12px; border-radius: 10px; opacity: 0; transform: translateX(6px); pointer-events: none;
  transition: opacity .25s, transform .25s; }
.cbc-fab:hover + .cbc-tip, .cbc-fab:focus-visible + .cbc-tip { opacity: 1; transform: none; }

/* ---------- greeting card: "May I help you?" ---------- */
.cbc-greet { position: absolute; right: 0; bottom: 0; width: 320px; background: #fff; border-radius: 18px;
  box-shadow: 0 18px 48px rgba(20,33,61,.22); border: 1px solid var(--cbc-line); padding: 18px 18px 16px;
  transform-origin: bottom right; animation: cbcIn .45s cubic-bezier(.34,1.56,.64,1); }
.cbc-greet.is-leaving { animation: cbcShrink .4s ease-in forwards; }
.cbc-greet-top { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.cbc-greet-top img { width: 48px; height: 48px; flex: none; animation: cbcBob 3s ease-in-out infinite; }
.cbc-greet h3 { margin: 0; font-size: 17px; font-weight: 700; color: var(--cbc-navy); font-family: inherit; letter-spacing: 0; }
.cbc-greet p { margin: 0 0 14px; color: var(--cbc-muted); font-size: 14px; }
.cbc-greet-actions { display: flex; gap: 8px; }
.cbc-greet-x { position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; border: 0; background: transparent;
  border-radius: 8px; color: var(--cbc-muted); font-size: 20px; line-height: 1; cursor: pointer; }
.cbc-greet-x:hover { background: #f1f3f7; color: var(--cbc-ink); }

/* ---------- buttons ---------- */
.cbc-btn { border: 0; border-radius: 10px; padding: 10px 14px; font-weight: 600; font-size: 14px; line-height: 1.2; font-family: inherit; cursor: pointer;
  transition: transform .15s, box-shadow .2s, background .2s; }
.cbc-btn:active { transform: scale(.97); }
.cbc-btn-primary { flex: 1; background: var(--cbc-navy); color: #fff; box-shadow: 0 6px 16px rgba(20,33,61,.22); }
.cbc-btn-primary:hover { background: var(--cbc-navy-2); }
.cbc-btn-ghost { background: #f3f4f7; color: var(--cbc-ink); }
.cbc-btn-ghost:hover { background: #e9ebf0; }
.cbc-btn-gold { width: 100%; background: linear-gradient(135deg, #c9a45c, var(--cbc-gold)); color: #fff; padding: 12px; font-size: 15px;
  box-shadow: 0 6px 16px rgba(168,132,63,.3); }
.cbc-btn-gold:disabled { opacity: .6; cursor: wait; }

/* ---------- chat panel ---------- */
.cbc-panel { position: absolute; right: 0; bottom: 0; width: 390px; height: min(640px, calc(100vh - 110px));
  background: #fff; border-radius: 20px; overflow: hidden; display: flex; flex-direction: column;
  box-shadow: 0 24px 60px rgba(20,33,61,.28); border: 1px solid var(--cbc-line);
  transform-origin: bottom right; animation: cbcIn .4s cubic-bezier(.34,1.56,.64,1); }
.cbc-head { display: flex; align-items: center; gap: 11px; padding: 14px 14px 14px 16px; color: #fff;
  background: linear-gradient(135deg, var(--cbc-navy) 0%, #22386b 100%); border-bottom: 2px solid var(--cbc-gold); }
.cbc-head img { width: 42px; height: 42px; flex: none; }
.cbc-head-t { flex: 1; min-width: 0; }
.cbc-head-t strong { display: block; font-size: 16px; }
.cbc-head-t span { font-size: 12.5px; color: #c9d3e6; display: flex; align-items: center; gap: 6px; }
.cbc-head-t span::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--cbc-mint); box-shadow: 0 0 8px var(--cbc-mint); }
.cbc-icon-btn { width: 34px; height: 34px; border-radius: 10px; border: 0; background: rgba(255,255,255,.1); color: #fff;
  cursor: pointer; display: grid; place-items: center; font-size: 18px; line-height: 1; }
.cbc-icon-btn:hover, .cbc-icon-btn:focus-visible { background: rgba(255,255,255,.2); outline: none; }
.cbc-talk { border: 1px solid rgba(226,197,136,.6); background: transparent; color: var(--cbc-gold-l); border-radius: 999px;
  padding: 6px 10px; font-weight: 600; font-size: 12px; line-height: 1; font-family: inherit; cursor: pointer; white-space: nowrap; }
.cbc-talk:hover { background: rgba(226,197,136,.15); }

.cbc-log { flex: 1; overflow-y: auto; padding: 16px 14px 8px; background: #f7f8fb; scroll-behavior: smooth; }
.cbc-msg { display: flex; gap: 8px; margin-bottom: 12px; align-items: flex-end; animation: cbcMsg .3s ease-out; }
.cbc-msg img { width: 28px; height: 28px; flex: none; }
.cbc-bubble { max-width: 82%; padding: 10px 13px; border-radius: 16px; white-space: pre-line; word-wrap: break-word; font-size: 14.5px; }
.cbc-msg.bot .cbc-bubble { background: #fff; border: 1px solid var(--cbc-line); border-bottom-left-radius: 5px; color: var(--cbc-ink); }
.cbc-msg.me { justify-content: flex-end; }
.cbc-msg.me .cbc-bubble { background: var(--cbc-navy); color: #fff; border-bottom-right-radius: 5px; }
.cbc-typing { display: inline-flex; gap: 4px; padding: 13px 14px; }
.cbc-typing i { width: 7px; height: 7px; border-radius: 50%; background: #9aa3b5; animation: cbcDot 1.2s infinite; }
.cbc-typing i:nth-child(2) { animation-delay: .15s; } .cbc-typing i:nth-child(3) { animation-delay: .3s; }

.cbc-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 14px 10px; background: #f7f8fb; }
.cbc-chip { border: 1px solid rgba(31,174,95,.45); background: #fff; color: #11613a; border-radius: 999px; padding: 6px 12px;
  font-weight: 500; font-size: 13px; line-height: 1.2; font-family: inherit; cursor: pointer; transition: background .2s, transform .15s; }
.cbc-chip:hover, .cbc-chip:focus-visible { background: #eafaf1; transform: translateY(-1px); outline: none; }
.cbc-chip.gold { border-color: rgba(168,132,63,.55); color: #6b4f1a; }
.cbc-chip.gold:hover { background: #fbf5e8; }

.cbc-input { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--cbc-line); background: #fff; align-items: flex-end; }
.cbc-input textarea { flex: 1; resize: none; border: 1px solid #d9dde5; border-radius: 12px; padding: 10px 12px; font-size: 14.5px; line-height: 1.4;
  font-family: inherit; max-height: 110px; min-height: 42px; color: var(--cbc-ink); background: #fff; }
.cbc-input textarea:focus { outline: none; border-color: var(--cbc-green); box-shadow: 0 0 0 3px rgba(31,174,95,.15); }
.cbc-send { width: 42px; height: 42px; flex: none; border-radius: 12px; border: 0; background: var(--cbc-green); color: #fff; cursor: pointer;
  display: grid; place-items: center; transition: background .2s, transform .15s; }
.cbc-send:hover { background: #17934f; } .cbc-send:disabled { background: #b8c2b9; cursor: default; }
.cbc-send svg { width: 18px; height: 18px; }
.cbc-foot { font-size: 11px; color: #8a92a3; text-align: center; padding: 0 12px 8px; background: #fff; }

/* ---------- lead form card inside the chat ---------- */
.cbc-form { background: #fff; border: 1px solid rgba(168,132,63,.4); border-radius: 16px; padding: 14px; margin: 2px 0 14px 36px;
  box-shadow: 0 6px 18px rgba(20,33,61,.06); animation: cbcMsg .3s ease-out; }
.cbc-form h4 { margin: 0 0 2px; font-size: 15px; color: var(--cbc-navy); font-family: inherit; letter-spacing: 0; }
.cbc-form > p { margin: 0 0 10px; font-size: 12.5px; color: var(--cbc-muted); }
.cbc-form label { display: block; font-size: 12px; font-weight: 600; color: #374151; margin: 8px 0 3px; }
.cbc-form label b { color: #b42318; font-weight: 600; }
.cbc-form input, .cbc-form select, .cbc-form textarea { width: 100%; border: 1px solid #d9dde5; border-radius: 9px; padding: 8px 10px;
  font-size: 14px; line-height: 1.35; font-family: inherit; color: var(--cbc-ink); background: #fff; }
.cbc-form textarea { resize: vertical; min-height: 64px; }
.cbc-form input:focus, .cbc-form select:focus, .cbc-form textarea:focus { outline: none; border-color: var(--cbc-gold); box-shadow: 0 0 0 3px rgba(168,132,63,.15); }
.cbc-form .cbc-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cbc-form .cbc-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.cbc-form .cbc-err { color: #b42318; font-size: 12.5px; margin: 8px 0 0; min-height: 0; }
.cbc-form .cbc-btn-gold { margin-top: 12px; }
.cbc-form .cbc-note { font-size: 11.5px; color: #8a92a3; margin: 8px 0 0; text-align: center; }
.cbc-done { text-align: center; padding: 6px 4px; }
.cbc-done .cbc-tick { width: 46px; height: 46px; margin: 0 auto 8px; border-radius: 50%; background: #e7f8ee; color: var(--cbc-green);
  display: grid; place-items: center; font-size: 24px; animation: cbcPop .5s cubic-bezier(.34,1.56,.64,1); }

/* ---------- animations ---------- */
@keyframes cbcIn { from { opacity: 0; transform: translateY(14px) scale(.92); } to { opacity: 1; transform: none; } }
@keyframes cbcShrink { to { opacity: 0; transform: translate(10px, 10px) scale(.2); } }
@keyframes cbcPop { 0% { transform: scale(.3); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes cbcRing { 0% { transform: scale(.92); opacity: .9; } 80%, 100% { transform: scale(1.35); opacity: 0; } }
@keyframes cbcBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes cbcMsg { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes cbcDot { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }

/* ---------- phones ---------- */
@media (max-width: 520px) {
  .cbc { right: 14px; bottom: 14px; }
  .cbc-greet { width: calc(100vw - 28px); }
  .cbc-panel { position: fixed; inset: 0; width: 100%; height: 100%; border-radius: 0; border: 0; }
  .cbc-form .cbc-row { grid-template-columns: 1fr; }
  .cbc-talk { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .cbc *, .cbc *::before { animation: none !important; transition: none !important; }
}
