/* Website assistant: the chat button and window (frontend/partials/chatbot.blade.php, assets/js/chatbot.js) */
.cb { --cb-blue: var(--maroon, #0F6CBD); --cb-deep: var(--band, #0C4A8F); --cb-gold: var(--flame, #FEB628); font-family: var(--body, system-ui, sans-serif); }
html.has-cb .to-top { bottom: 5.9rem; }

.cb__fab {
  position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 950;
  display: inline-flex; align-items: center; gap: .55rem; height: 56px; padding: 0 1.2rem 0 1rem;
  border: 0; border-radius: 999px; cursor: pointer;
  background: radial-gradient(circle at 30% 50%, #0E3A6E, #061A33 70%); color: #fff;
  font: 650 .95rem/1 var(--body, system-ui, sans-serif); letter-spacing: .01em;
  box-shadow: 0 14px 34px -12px rgba(8, 47, 99, .85), inset 0 0 0 1px rgba(95, 212, 255, .28);
  transition: transform .3s cubic-bezier(.2, .7, .2, 1), box-shadow .3s, padding .3s;
}
.cb__fab:hover { transform: translateY(-2px); box-shadow: 0 18px 40px -12px rgba(8, 47, 99, .85), inset 0 0 0 1px rgba(255, 255, 255, .2); }
.cb__fab:focus-visible { outline: 3px solid var(--cb-gold); outline-offset: 3px; }
.cb__fab::before { content: ""; position: absolute; inset: -5px; border-radius: inherit; border: 2px solid var(--cb-gold); opacity: 0; animation: cb-ring 2.6s ease-out 3s 3; pointer-events: none; }
.cb__fab svg { width: 26px; height: 26px; flex: none; }
.cb__fab { width: 64px; height: 64px; padding: 0; justify-content: center; }
.cb__orb { width: 58px; height: 58px; flex: none; }
.cb__fab:hover { box-shadow: 0 18px 40px -12px rgba(8, 47, 99, .9), inset 0 0 0 1px rgba(95, 212, 255, .5); }
.cb__fab-close { display: none; }
.cb.is-open .cb__fab { width: 56px; height: 56px; }
.cb.is-open .cb__orb, .cb.is-open .cb__fab-label { display: none; }
.cb.is-open .cb__fab-close { display: block; width: 22px; height: 22px; }
@keyframes cb-ring { 0% { opacity: .9; transform: scale(.92); } 100% { opacity: 0; transform: scale(1.25); } }

.cb__panel {
  position: fixed; right: 1.25rem; bottom: 5.6rem; z-index: 951;
  display: flex; flex-direction: column; width: min(400px, calc(100vw - 2rem)); height: min(600px, calc(100vh - 7.5rem)); height: min(600px, calc(100dvh - 7.5rem));
  border-radius: 20px; overflow: hidden; background: var(--surface, #fff); color: var(--ink, #191714);
  box-shadow: 0 40px 90px -30px rgba(5, 30, 66, .55), 0 0 0 1px rgba(8, 47, 99, .08);
  transform-origin: 100% 100%; animation: cb-in .32s cubic-bezier(.2, .7, .2, 1);
}
.cb__panel[hidden] { display: none; }
@keyframes cb-in { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: none; } }

.cb__head { display: flex; align-items: center; gap: .7rem; padding: .85rem .75rem .85rem 1rem; background: linear-gradient(135deg, var(--cb-deep), var(--cb-blue)); color: #fff; }
.cb__avatar { display: grid; place-items: center; width: 42px; height: 42px; flex: none; border-radius: 50%; background: #fff; box-shadow: 0 0 0 3px var(--cb-gold); }
.cb__avatar img { width: 34px; height: 34px; object-fit: contain; }
.cb__who { display: grid; gap: .15rem; min-width: 0; margin-right: auto; }
.cb__who strong { font: 600 1.05rem/1.2 var(--display, Georgia, serif); }
.cb__who small { display: inline-flex; align-items: center; gap: .4rem; font-size: .75rem; color: rgba(255, 255, 255, .8); }
.cb__live { width: 8px; height: 8px; border-radius: 50%; background: #65F1B2; box-shadow: 0 0 0 3px rgba(101, 241, 178, .25); }
.cb__icon-btn { display: grid; place-items: center; width: 36px; height: 36px; flex: none; padding: 0; border: 0; border-radius: 50%; background: transparent; color: #fff; cursor: pointer; transition: background-color .2s; }
.cb__icon-btn:hover { background: rgba(255, 255, 255, .14); }
.cb__icon-btn:focus-visible { outline: 2px solid var(--cb-gold); outline-offset: 1px; }
.cb__icon-btn svg { width: 20px; height: 20px; }

.cb__log { flex: 1; overflow-y: auto; padding: 1rem .9rem .5rem; display: flex; flex-direction: column; gap: .7rem; background: var(--base, #F7F4EF); scroll-behavior: smooth; overscroll-behavior: contain; }
.cb__msg { max-width: 88%; padding: .7rem .9rem; border-radius: 16px; font-size: .9rem; line-height: 1.5; overflow-wrap: anywhere; animation: cb-msg .25s ease-out; }
@keyframes cb-msg { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.cb__msg--me { align-self: flex-end; background: var(--cb-blue); color: #fff; border-bottom-right-radius: 5px; }
.cb__msg--bot { align-self: flex-start; background: #fff; color: var(--ink, #191714); border-bottom-left-radius: 5px; box-shadow: 0 1px 2px rgba(8, 47, 99, .08), 0 0 0 1px rgba(8, 47, 99, .05); }
.cb__msg p { margin: 0; }
.cb__msg p + p { margin-top: .35rem; }
.cb__msg mark { background: var(--flame-tint, #FFF3DA); color: inherit; border-radius: 3px; padding: 0 .1em; }
.cb__src { display: block; margin-bottom: .4rem; font-size: .72rem; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; color: var(--cb-blue); }
.cb__acts { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .65rem; }
.cb__act { display: inline-flex; align-items: center; gap: .35rem; padding: .45rem .8rem; border-radius: 999px; background: var(--cb-blue); color: #fff; font-size: .8rem; font-weight: 600; text-decoration: none; line-height: 1.2; transition: background-color .2s, transform .2s; }
.cb__act:hover { background: var(--cb-deep); transform: translateY(-1px); color: #fff; }
.cb__act:focus-visible, .cb__chip:focus-visible { outline: 2px solid var(--cb-gold); outline-offset: 2px; }
.cb__more { margin-top: .7rem; padding-top: .55rem; border-top: 1px dashed var(--line, #E2DCD2); font-size: .75rem; color: var(--muted, #6E675C); }
.cb__more a { display: block; margin-top: .3rem; color: var(--cb-blue); font-weight: 600; text-decoration: none; }
.cb__more a:hover { text-decoration: underline; }
.cb__chips { display: flex; flex-wrap: wrap; gap: .4rem; align-self: stretch; }
.cb__chip { padding: .45rem .8rem; border: 1px solid rgba(15, 108, 189, .3); border-radius: 999px; background: #fff; color: var(--cb-deep); font: 600 .8rem/1.2 var(--body, system-ui, sans-serif); cursor: pointer; text-decoration: none; transition: background-color .2s, border-color .2s; }
.cb__chip:hover { background: var(--rose-tint, #E4F2FD); border-color: var(--cb-blue); }
.cb__typing { display: inline-flex; gap: 4px; padding: .85rem 1rem; }
.cb__typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--cb-blue); opacity: .35; animation: cb-dot 1s infinite; }
.cb__typing i:nth-child(2) { animation-delay: .15s; }
.cb__typing i:nth-child(3) { animation-delay: .3s; }
@keyframes cb-dot { 0%, 80%, 100% { opacity: .25; transform: none; } 40% { opacity: 1; transform: translateY(-3px); } }

.cb__form { display: flex; gap: .5rem; padding: .7rem .75rem .35rem; border-top: 1px solid var(--line, #E2DCD2); background: #fff; }
.cb__credit { margin: 0; padding: 0 .75rem .55rem; background: #fff; text-align: center; font-size: .7rem; letter-spacing: .02em; color: var(--muted, #6E675C); }
.cb__credit a { color: var(--cb-blue); font-weight: 650; text-decoration: none; }
.cb__credit a:hover { text-decoration: underline; }
.cb__form input { flex: 1; min-width: 0; height: 44px; padding: 0 1rem; border: 1px solid var(--line, #E2DCD2); border-radius: 999px; background: var(--base, #F7F4EF); color: var(--ink, #191714); font: 400 .95rem var(--body, system-ui, sans-serif); }
.cb__form input:focus { outline: none; border-color: var(--cb-blue); box-shadow: 0 0 0 3px rgba(15, 108, 189, .18); background: #fff; }
.cb__send { display: grid; place-items: center; width: 44px; height: 44px; flex: none; padding: 0; border: 0; border-radius: 50%; background: var(--cb-gold); color: var(--cb-deep); cursor: pointer; transition: transform .2s, filter .2s; }
.cb__send:hover { transform: scale(1.06); filter: brightness(1.04); }
.cb__send:focus-visible { outline: 2px solid var(--cb-blue); outline-offset: 2px; }
.cb__send svg { width: 20px; height: 20px; }

@media (max-width: 560px) {
  .cb__fab { right: .9rem; bottom: .9rem; }
  .cb__fab-label { display: none; }
  .cb__fab { width: 56px; height: 56px; padding: 0; justify-content: center; }
  .cb__orb { width: 50px; height: 50px; }
  html.has-cb .to-top { bottom: 5rem; right: .9rem; }
  .cb__panel { right: 0; left: 0; bottom: 0; width: 100%; height: calc(100vh - 4rem); height: calc(100dvh - 4rem); border-radius: 20px 20px 0 0; }
  .cb.is-open .cb__fab { display: none; }
  .cb__form input { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .cb__panel, .cb__msg, .cb__fab::before { animation: none; }
  .cb__fab, .cb__act, .cb__send { transition: none; }
}
@media print { .cb { display: none; } }
