/* ------------------------------------------------------------------
   The AI assistant of /chat (guest-assist.js): status in the header,
   typing bubble, quick replies, solution cards and the get-started
   forms inside the chat. Soft look: light surfaces, rounded cards,
   hairline borders, soft shadows. Loaded after guest-chat.css.
   ------------------------------------------------------------------ */
:root {
    --gca-ink: var(--bc-text, #16192c);
    --gca-muted: var(--bc-muted, #6b7b93);
    --gca-line: #e9ecf2;
    --gca-soft: #f6f7fb;
    --gca-primary: var(--bc-primary, #5C60F5);
    --gca-primary-soft: var(--bc-primary-soft, rgba(92, 96, 245, .1));
    --gca-ok: #12805c;
    --gca-ok-soft: #e7f6ef;
    --gca-bad: #c0362c;
    --gca-shadow: 0 1px 2px rgba(22, 25, 44, .04), 0 8px 24px rgba(22, 25, 44, .06);
    --gca-radius: 18px;
}

/* ---------- header: who answers ---------- */
.gca-head .active-room-name { margin-bottom: 0; }
.bc-chat-head .gca-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 10px;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--gca-ok-soft);
    color: var(--gca-ok);
    font-size: .75rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}
.bc-chat-head .gca-status[hidden] { display: none; }
.gca-staff .bc-chat-head .gca-status { background: #e8efff; color: #2453c8; }
.gca-dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px rgba(18, 128, 92, .15); }

/* ---------- assistant avatar, typing ---------- */
.bc-avatar.gca-av {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(160deg, #8a8df9, var(--gca-primary));
    color: #fff;
    font-size: .95rem;
}
/* no name/time line above the typing bubble: the avatar sits level with it */
.msg-item-container.gca-typing { align-items: center; }
.gca-typing .bc-msg-avatar { margin-top: 0; }
.gca-typing .bc-bubble { display: inline-flex; gap: 4px; padding: 12px 14px; }
.gca-typing .bc-bubble i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #b7bfd0;
    animation: gca-blink 1.2s infinite ease-in-out;
}
.gca-typing .bc-bubble i:nth-child(2) { animation-delay: .15s; }
.gca-typing .bc-bubble i:nth-child(3) { animation-delay: .3s; }
@keyframes gca-blink { 0%, 80%, 100% { opacity: .35; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

.gca-ai-msg .bc-bubble { background: #fff; border-color: var(--gca-line); box-shadow: 0 1px 2px rgba(22, 25, 44, .03); }
.gca-ai-msg .bc-bubble b { font-weight: 700; }
.gca-staff-msg .bc-bubble { border-color: #dbe5fb; background: #f3f7ff; }

/* a message with cards or a form gets the width it needs instead of wrapping */
.msg-item-container.gca-wide { width: min(100%, 600px); max-width: min(100%, 600px); }
.msg-item-container.gca-wide .bc-msg-main { flex: 1; align-items: stretch; }
.msg-item-container.gca-wide .msg-item-content { align-self: flex-start; }

/* ---------- notices ---------- */
.msg-item-container.gca-sys,
.gca-sys {
    align-self: center;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    max-width: min(92%, 560px);
    margin: 14px auto 0;
    padding: 9px 16px;
    border-radius: 14px;
    background: var(--gca-ok-soft);
    color: var(--gca-ok);
    font-size: .84rem;
    font-weight: 600;
    line-height: 1.45;
}
.gca-sys i { margin-top: 1px; }
.gca-sys.is-error { background: #fdeeed; color: var(--gca-bad); }

/* ---------- quick replies ---------- */
.gca-chips { align-self: stretch; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.msg-item-container:has(.gca-chips) { width: min(100%, 600px); }
.msg-item-container:has(.gca-chips) .bc-msg-main { flex: 1; }
.gca-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 13px;
    border: 1px solid #dcdffb;
    border-radius: 999px;
    background: #fff;
    color: var(--gca-primary);
    font: inherit;
    font-size: .84rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color .15s, border-color .15s;
}
.gca-chip:hover:not(:disabled) { background: var(--gca-primary-soft); border-color: transparent; }
.gca-chips.is-used { opacity: .55; }
.gca-chips.is-used .gca-chip { cursor: default; }

/* ---------- solution cards ---------- */
.gca-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; margin-top: 8px; }
.gca-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    border: 1px solid var(--gca-line);
    border-radius: var(--gca-radius);
    background: #fff;
    box-shadow: var(--gca-shadow);
    overflow: hidden;
}
.gca-card__img { position: relative; display: block; aspect-ratio: 16 / 9; background: var(--gca-soft); }
.gca-card__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gca-card__tag {
    position: absolute;
    left: 10px;
    bottom: 10px;
    padding: 3px 9px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .92);
    color: var(--gca-ink);
    font-size: .72rem;
    font-weight: 700;
}
.gca-card__body { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px 14px; }
.gca-card__body b { font-size: .92rem; line-height: 1.35; color: var(--gca-ink); }
.gca-card__body small { color: var(--gca-muted); font-size: .8rem; line-height: 1.45; }
.gca-card__btns { display: flex; gap: 6px; margin-top: 8px; }
.gca-card__btns .gca-btn { flex: 1; }

/* ---------- buttons ---------- */
.gca-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 38px;
    padding: 0 16px;
    border: 0;
    border-radius: 12px;
    background: var(--gca-primary);
    color: #fff;
    font: inherit;
    font-size: .86rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: filter .15s, background-color .15s;
}
.gca-btn:hover { filter: brightness(1.06); color: #fff; }
.gca-btn:disabled { opacity: .6; cursor: default; filter: none; }
.gca-btn--ghost { background: #f1f2f7; color: var(--gca-ink); }
.gca-btn--ghost:hover { background: #e7e9f1; color: var(--gca-ink); filter: none; }
.gca-btn--block { width: 100%; }

/* ---------- forms inside the chat ---------- */
.gca-form {
    margin-top: 8px;
    padding: 16px 16px 18px;
    border: 1px solid var(--gca-line);
    border-radius: var(--gca-radius);
    background: #fff;
    box-shadow: var(--gca-shadow);
    color: var(--gca-ink);
    font-size: .88rem;
}
.gca-form__head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-size: .98rem; font-weight: 700; }
.gca-form__head > i {
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: var(--gca-primary-soft);
    color: var(--gca-primary);
    font-size: .95rem;
}
.gca-form__time { margin-left: auto; color: var(--gca-muted); font-size: .76rem; font-weight: 500; white-space: nowrap; }
.gca-form__item { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; padding: 10px; border-radius: 14px; background: var(--gca-soft); }
.gca-form__item img, .gca-form__item > span { flex: none; width: 64px; height: 44px; border-radius: 10px; object-fit: cover; display: grid; place-items: center; background: #fff; color: var(--gca-primary); }
.gca-form__item div { display: flex; flex-direction: column; min-width: 0; }
.gca-form__item small { color: var(--gca-muted); font-size: .74rem; font-weight: 600; }
.gca-form__item b { font-size: .88rem; line-height: 1.35; }
.gca-form__note { margin: 0 0 10px; color: var(--gca-muted); font-size: .82rem; }

.gca-steps { display: flex; gap: 6px; margin: 0 0 14px; padding: 0; list-style: none; }
.gca-steps li {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    padding: 6px 8px;
    border-radius: 10px;
    background: var(--gca-soft);
    color: var(--gca-muted);
    font-size: .76rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
}
.gca-steps li span {
    flex: none;
    display: inline-grid;
    place-items: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    font-size: .7rem;
}
.gca-steps li.is-on { background: var(--gca-primary-soft); color: var(--gca-primary); }
.gca-steps li.is-on span { background: var(--gca-primary); color: #fff; }
.gca-steps li.is-done { color: var(--gca-ok); }
.gca-steps li.is-done span { background: var(--gca-ok); color: #fff; }

.gca-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; }
.gca-grid .span-2 { grid-column: 1 / -1; }
.gca-f { display: flex; flex-direction: column; gap: 5px; min-width: 0; margin: 0 0 10px; font-weight: 400; }
.gca-grid .gca-f { margin: 0; }
.gca-f > span { color: var(--gca-muted); font-size: .76rem; font-weight: 600; }
.gca-f > span b { color: var(--gca-bad); }
.gca-f em { color: #9aa3b5; font-size: .74rem; font-style: normal; }
.gca-opt { color: #9aa3b5; font-style: normal; font-weight: 400; }
.gca-form input:not([type=hidden]):not([type=checkbox]),
.gca-form textarea,
.gca-select__btn {
    width: 100%;
    min-height: 40px;
    padding: 8px 12px;
    border: 1px solid #dfe3ea;
    border-radius: 12px;
    background: #fff;
    color: var(--gca-ink);
    font: inherit;
    font-size: .88rem;
    transition: border-color .15s, box-shadow .15s;
}
.gca-form textarea { resize: vertical; min-height: 64px; }
.gca-form input:focus, .gca-form textarea:focus, .gca-select__btn:focus-visible, .gca-select.is-open .gca-select__btn {
    outline: none;
    border-color: var(--gca-primary);
    box-shadow: 0 0 0 3px var(--gca-primary-soft);
}
.gca-form .is-bad { border-color: var(--gca-bad) !important; box-shadow: 0 0 0 3px rgba(192, 54, 44, .12) !important; }
.gca-form input:disabled, .gca-form textarea:disabled, .gca-select__btn:disabled { background: var(--gca-soft); color: var(--gca-muted); }
.gca-form__err { margin: 10px 0 0; padding: 8px 12px; border-radius: 10px; background: #fdeeed; color: var(--gca-bad); font-size: .82rem; }
.gca-form__err[hidden] { display: none; }
.gca-form__ok { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: var(--gca-ok-soft); color: var(--gca-ok); font-weight: 600; }
.gca-form__ok[hidden] { display: none; }
.gca-form > .gca-btn--block { margin-top: 12px; }
.gca-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.gca-pass, .gca-captcha { position: relative; display: flex; align-items: center; gap: 8px; }
.gca-pass input { padding-right: 42px !important; }
.gca-eye { position: absolute; right: 6px; width: 32px; height: 32px; border: 0; border-radius: 8px; background: none; color: var(--gca-muted); cursor: pointer; }
.gca-captcha img { flex: none; width: 120px; height: 40px; border: 1px solid #dfe3ea; border-radius: 10px; object-fit: cover; background: var(--gca-soft); }
.gca-refresh { flex: none; width: 38px; height: 38px; border: 0; border-radius: 10px; background: #f1f2f7; color: var(--gca-ink); cursor: pointer; }
.gca-captcha input { flex: 1; min-width: 0; }
.gca-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 14px; }
.gca-nav[hidden], .gca-step[hidden], .gca-done[hidden] { display: none; }
.gca-done { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 4px 2px; text-align: center; }
.gca-done__icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; background: var(--gca-ok-soft); color: var(--gca-ok); font-size: 1.5rem; }
.gca-done p { margin: 0 0 6px; color: var(--gca-muted); font-size: .84rem; line-height: 1.5; }
.gca-done p b { color: var(--gca-ink); overflow-wrap: anywhere; }
.gca-form.is-done .gca-step { display: none; }

/* ---------- custom select (no native select on the guest page) ---------- */
.gca-select { position: relative; min-width: 0; }
.gca-select > select { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.gca-select__btn { display: flex; align-items: center; justify-content: space-between; gap: 8px; text-align: left; cursor: pointer; }
.gca-select__value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gca-select__value.is-placeholder { color: #9aa3b5; }
.gca-select__btn .bi-chevron-down { flex: none; color: var(--gca-muted); font-size: .75rem; transition: transform .2s; }
.gca-select.is-open .gca-select__btn .bi-chevron-down { transform: rotate(180deg); }
.gca-select__list {
    position: absolute;
    z-index: 30;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    max-height: 240px;
    margin: 0;
    padding: 6px;
    overflow-y: auto;
    list-style: none;
    border: 1px solid var(--gca-line);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 12px 32px rgba(22, 25, 44, .14);
}
.gca-select__list[hidden] { display: none; }
.gca-select__opt { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border-radius: 10px; cursor: pointer; font-size: .86rem; }
.gca-select__opt i { color: var(--gca-primary); visibility: hidden; }
.gca-select__opt.is-active { background: var(--gca-soft); }
.gca-select__opt[aria-selected="true"] { color: var(--gca-primary); font-weight: 600; }
.gca-select__opt[aria-selected="true"] i { visibility: visible; }

/* ---------- phones ---------- */
@media (max-width: 575.98px) {
    .msg-item-container.gca-wide { width: 100%; max-width: 100%; }
    .gca-wide .bc-msg-avatar { display: none; }
    .gca-grid { grid-template-columns: minmax(0, 1fr); }
    .gca-cards { grid-template-columns: minmax(0, 1fr); }
    .gca-chips { gap: 5px; }
    .gca-chip { padding: 6px 10px; font-size: .8rem; gap: 5px; }
    .gca-form { padding: 14px 12px 16px; }
    .gca-steps li { justify-content: center; padding: 6px 4px; }
    .gca-form__time { display: none; }
    .gca-captcha img { width: 96px; }
    .bc-chat-head .gca-status { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    .gca-typing .bc-bubble i { animation: none; }
}
