/* ==========================================================================
   MSOS Assistant widget styles. All selectors are .msa-* scoped so they can't
   collide with the site. Colours echo the site's teal accent.
   ========================================================================== */
.msa-root {
    --msa-accent: #12707e;
    --msa-accent-dark: #0d5560;
    --msa-bg: #ffffff;
    --msa-bot: #f1f5f6;
    --msa-user: #12707e;
    --msa-text: #16232a;
    position: fixed;
    right: 20px; bottom: 20px;
    z-index: 9999;
    font-family: inherit;
}
/* On the Become-a-member page the floating "Become a member" CTA sits
   bottom-right, so move the assistant to the bottom-left there. */
.msa-root.msa-left { right: auto; left: 20px; }
.msa-root.msa-left .msa-panel { right: auto; left: 0; }

/* launcher */
.msa-launch {
    position: relative;
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--msa-accent); color: #fff;
    border: 0; border-radius: 999px;
    padding: 12px 18px; font-size: 15px; font-weight: 600;
    cursor: pointer; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    transition: transform .15s ease, background .15s ease, box-shadow .15s ease;
}
.msa-launch:hover { background: var(--msa-accent-dark); transform: translateY(-2px); box-shadow: 0 12px 30px rgba(0,0,0,.24); }
.msa-launch i { font-size: 17px; }
.msa-open .msa-launch { display: none; }
/* gentle attention pulse on the launcher */
.msa-launch::before {
    content: ""; position: absolute; inset: 0; border-radius: 999px;
    box-shadow: 0 0 0 0 rgba(18,112,126,.45); animation: msa-pulse 2.8s ease-out infinite;
}
@keyframes msa-pulse { 0%{box-shadow:0 0 0 0 rgba(18,112,126,.45);} 70%{box-shadow:0 0 0 14px rgba(18,112,126,0);} 100%{box-shadow:0 0 0 0 rgba(18,112,126,0);} }

/* panel */
.msa-panel {
    position: absolute; right: 0; bottom: 0;
    width: min(380px, calc(100vw - 32px));
    height: min(560px, calc(100vh - 40px));
    display: none; flex-direction: column;
    background: var(--msa-bg); border-radius: 16px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
    overflow: hidden;
}
.msa-open .msa-panel { display: flex; animation: msa-rise .22s ease; }
@keyframes msa-rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* one-time disclaimer note under the greeting */
.msa-note {
    font-size: 12px; line-height: 1.45; color: #6a787e;
    background: #fff8ec; border: 1px solid #f0e3c8; border-radius: 10px;
    padding: 8px 11px;
}

/* suggested-question chips */
.msa-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.msa-chips-label { width: 100%; font-size: 12.5px; color: #5a6b72; margin-bottom: 2px; }
.msa-chip {
    background: #fff; border: 1px solid var(--msa-accent); color: var(--msa-accent);
    border-radius: 999px; padding: 7px 12px; font-size: 13px; font-family: inherit;
    cursor: pointer; line-height: 1.2; transition: background .12s ease, color .12s ease;
}
.msa-chip:hover { background: var(--msa-accent); color: #fff; }

/* typing indicator */
.msa-typing { display: inline-flex; gap: 4px; padding: 2px 0; }
.msa-typing i { width: 7px; height: 7px; border-radius: 50%; background: #9fb0b6; display: inline-block; animation: msa-blink 1.2s infinite; }
.msa-typing i:nth-child(2) { animation-delay: .2s; }
.msa-typing i:nth-child(3) { animation-delay: .4s; }
@keyframes msa-blink { 0%,80%,100%{ opacity:.3; } 40%{ opacity:1; } }

.msa-head {
    display: flex; align-items: center; justify-content: space-between;
    background: var(--msa-accent); color: #fff;
    padding: 14px 16px; font-weight: 700; font-size: 16px;
}
.msa-x { background: none; border: 0; color: #fff; font-size: 26px; line-height: 1; cursor: pointer; padding: 0 4px; }
.msa-x:hover { opacity: .8; }

.msa-log {
    flex: 1; overflow-y: auto; padding: 14px;
    display: flex; flex-direction: column; gap: 10px;
    background: #fafbfb;
}
.msa-msg { display: flex; }
.msa-bot { justify-content: flex-start; }
.msa-user { justify-content: flex-end; }
.msa-bubble {
    max-width: 85%; padding: 10px 13px; border-radius: 14px;
    font-size: 14.5px; line-height: 1.5; color: var(--msa-text);
    background: var(--msa-bot); border-bottom-left-radius: 4px;
    word-wrap: break-word;
}
.msa-user .msa-bubble {
    background: var(--msa-user); color: #fff; border-radius: 14px; border-bottom-right-radius: 4px;
}
.msa-also { color: #5a6b72; font-size: 13px; }
.msa-link {
    display: inline-block; margin-top: 6px;
    color: var(--msa-accent); font-weight: 600; text-decoration: none;
}
.msa-link:hover { text-decoration: underline; }

.msa-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid #eceff0; background: #fff; }
.msa-input {
    flex: 1; border: 1px solid #d6dcde; border-radius: 10px;
    padding: 10px 12px; font-size: 14.5px; font-family: inherit; color: var(--msa-text);
}
.msa-input:focus { outline: 2px solid var(--msa-accent); outline-offset: -1px; border-color: var(--msa-accent); }
.msa-send {
    background: var(--msa-accent); color: #fff; border: 0; border-radius: 10px;
    width: 44px; cursor: pointer; font-size: 16px;
}
.msa-send:hover { background: var(--msa-accent-dark); }
.msa-foot { margin: 0; padding: 8px 12px; font-size: 11.5px; color: #8a979d; background: #fff; text-align: center; }

@media (max-width: 480px) {
    .msa-root { right: 12px; bottom: 12px; }
    .msa-panel { width: calc(100vw - 24px); height: calc(100vh - 24px); }
}
@media (prefers-reduced-motion: reduce) {
    .msa-launch { transition: none; }
}
