/* The "Ask about our work" chat (Pages/Tools/AskAboutOurWork), mobile first */

.ask-about {
    margin: 0 0 14px;
    padding: 8px 12px;
    border-left: 3px solid #e39b2b;
    background: #eef5fa;
    font-weight: 600;
}

.ask-starters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.ask-starters .btn {
    white-space: normal;
    text-align: left;
}

.ask-messages:empty {
    display: none;
}

.ask-messages {
    margin-bottom: 16px;
}

.ask-message {
    margin: 0 0 12px;
    padding: 10px 14px;
    border-radius: 6px;
    overflow-wrap: anywhere;
}

.ask-message p {
    margin: 0 0 8px;
    white-space: pre-wrap;
}

.ask-message p:last-child {
    margin-bottom: 0;
}

.ask-message.user {
    margin-left: 15%;
    background: #e8f3fa;
}

.ask-message.assistant {
    margin-right: 5%;
    background: #f5f5f5;
}

/* while an answer is on its way: a message and three pulsing dots */
.ask-wait {
    color: #5d6470;
    font-style: italic;
}

.ask-dots::after {
    content: "";
    display: inline-block;
    width: 1.5em;
    text-align: left;
    animation: ask-dots 1.2s steps(4, end) infinite;
}

@keyframes ask-dots {
    0% { content: ""; }
    25% { content: "."; }
    50% { content: ".."; }
    75% { content: "..."; }
}

@media (prefers-reduced-motion: reduce) {
    .ask-dots::after { animation: none; content: "..."; }
}

.ask-chat.is-busy .ask-starter {
    opacity: 0.6;
}

.ask-sources {
    margin-top: 8px;
    font-size: 13px;
    color: #555;
}

.ask-sources a {
    margin-right: 10px;
}

.ask-offer {
    margin-top: 10px;
}

.ask-input {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.ask-input textarea {
    flex: 1 1 auto;
    min-width: 0;
    resize: vertical;
}

.ask-notice {
    margin: 8px 0 0;
    font-size: 12px;
    color: #666;
}

/* the contact panel, follow-up form and confirmation: teal, like the closing call to action on the content pages (.page-cta) */
.ask-contact,
.ask-handover,
.ask-confirmation {
    margin: 16px 0 0;
    padding: 16px 18px;
    border-radius: 6px;
    background: var(--ps-panel, #22505c);
    color: #e6eef4;
}

.ask-contact a,
.ask-confirmation a {
    color: #fff;
    text-decoration: underline;
}

/* the theme colours headings with !important, as .page-cta overrides it */
.ask-handover h2 {
    margin-top: 0;
    color: #fff !important;
}

.ask-handover .form-label {
    color: #fff;
}

.ask-handover .text-muted {
    color: #c9d8e4 !important;
}

.ask-handover .btn-link {
    color: #fff;
}

.ask-handover-error {
    padding: 6px 10px;
    border-radius: 4px;
    background: #fff;
}

/* the chat's calls to action (Ask, the follow-up offer and Send): amber, as on the rest of the site */
.ask-cta {
    --bs-btn-color: #1b1b1b;
    --bs-btn-bg: #e39b2b;
    --bs-btn-border-color: #e39b2b;
    --bs-btn-hover-color: #1b1b1b;
    --bs-btn-hover-bg: #f0ae47;
    --bs-btn-hover-border-color: #f0ae47;
    --bs-btn-active-color: #1b1b1b;
    --bs-btn-active-bg: #d08a1f;
    --bs-btn-active-border-color: #d08a1f;
    --bs-btn-disabled-color: #1b1b1b;
    --bs-btn-disabled-bg: #e39b2b;
    --bs-btn-disabled-border-color: #e39b2b;
    --bs-btn-focus-box-shadow: 0 0 0 0.2rem rgba(227, 155, 43, 0.5);
    font-weight: 700;
}

.ask-handover-note {
    margin: 12px 0 8px;
    font-size: 13px;
}

/* the honeypot field, off screen */
.ask-website {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.ask-footer {
    margin-top: 12px;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
}

.ask-footer .btn-link {
    padding-left: 0;
    padding-right: 0;
}
