/* Guided matching chatbot (templates/_components/chatbot.twig). */
/* Above the site header (999) and socials bar (999999) while open; cookie consent stays on top. */
.mcs-chat-trigger{position:fixed;right:24px;bottom:24px;z-index:1000000;display:flex;align-items:center;gap:9px;background:var(--darkBlueColour);color:#fff;border:0;border-radius:50px;padding:13px 22px 13px 18px;font:600 0.875rem/1.2 var(--primaryFont);cursor:pointer;box-shadow:0 4px 20px rgba(11,35,66,.35);transform-origin:bottom right;transition:transform .25s cubic-bezier(.2,1.3,.4,1),opacity .18s ease,background-color .18s,visibility 0s;animation:mcsLauncherIn .45s .5s cubic-bezier(.2,1.3,.4,1) backwards;}
.mcs-chat-trigger:hover{background:#152e4a;transform:translateY(-2px);}
.mcs-chat-trigger.is-hidden{opacity:0;transform:scale(.85);visibility:hidden;pointer-events:none;transition:transform .2s ease-in,opacity .15s ease,visibility 0s linear .2s;}
.mcs-chat-trigger svg{width:18px;height:18px;flex-shrink:0;}
.mcs-chat-trigger[hidden],.mcs-chat[hidden]{display:none;}

/* One size throughout, so the panel never jumps: 600px, enough for the
   tallest question (the issue list) above the crisis footer; results and the
   form scroll inside. Never taller than the window. */
.mcs-chat{position:fixed;right:24px;bottom:24px;z-index:1000000;width:400px;max-width:calc(100vw - 32px);height:min(600px, calc(100vh - 48px));display:flex;flex-direction:column;background:#fff;border-radius:16px;box-shadow:0 8px 48px rgba(11,35,66,.22);overflow:hidden;color:var(--darkBlueColour);font-family:var(--primaryFont);
    opacity:0;visibility:hidden;pointer-events:none;transform:translateY(16px) scale(.92);transform-origin:bottom right;transition:opacity .16s ease,transform .22s ease-in,visibility 0s linear .22s;}
/* Opening "pops" from the corner, with a little overshoot. */
.mcs-chat.is-open{opacity:1;visibility:visible;pointer-events:auto;transform:none;transition:opacity .2s ease-out,transform .38s cubic-bezier(.2,1.3,.4,1),visibility 0s;}
.mcs-chat-head{flex:none;background:var(--darkBlueColour);color:#fff;padding:16px 18px;display:flex;align-items:center;justify-content:space-between;gap:12px;}
.mcs-chat-title{font-size:1rem;font-weight:700;margin:0;color:#fff;line-height:1.3;}
.mcs-chat-sub{font-size:0.75rem;color:rgba(255,255,255,.72);margin-top:2px;}
.mcs-chat-close{background:none;border:0;color:#fff;opacity:.8;font-size:1.6rem;line-height:1;cursor:pointer;padding:2px 6px;}
.mcs-chat-close:hover,.mcs-chat-close:focus-visible{opacity:1;}
.mcs-chat-scroll{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;} /* reaching the end never scrolls the page behind */
.mcs-chat-body{padding:16px 18px 4px;}
.mcs-chat-form{padding:0 18px 18px;}
.mcs-chat button:focus-visible,.mcs-chat a:focus-visible,.mcs-chat-trigger:focus-visible{outline:2px solid var(--lightBlueColour);outline-offset:2px;}

.mcs-chat-progress{display:flex;gap:4px;margin-bottom:12px;}
.mcs-chat-dot{height:3px;border-radius:2px;flex:1;background:#E4EBF2;}
.mcs-chat-dot.done{background:var(--darkBlueColour);}
.mcs-chat-dot.active{background:var(--lightBlueColour);}

.mcs-chat-msg{background:#EEF3F8;border-radius:12px 12px 12px 4px;padding:10px 14px;font-size:0.875rem;line-height:1.55;margin:0 0 12px;max-width:92%;}
.mcs-chat-msg.strong{font-weight:600;}
.mcs-chat-msg:focus{outline:none;}
.mcs-chat-step{font-size:0.75rem;color:#4a5566;margin:-6px 0 10px;}

/* The crisis footer (MCS's wording, Nov 2026): while he answers and browses matches, not on the message form. */
.mcs-chat-foot{flex:none;border-top:1px solid #E4E8EE;background:#F7F9FB;padding:10px 16px 12px;font-size:0.75rem;line-height:1.45;color:#4a5566;}
.mcs-chat-foot p{margin:0 0 8px;}
.mcs-chat-foot-btn{display:flex;justify-content:center;border:1.5px solid #D8DEE6;border-radius:20px;background:#fff;color:var(--darkBlueColour);font:700 0.8125rem/1.2 var(--primaryFont);padding:9px 14px;text-decoration:none;}
.mcs-chat-foot-btn:hover,.mcs-chat-foot-btn:focus-visible{border-color:var(--darkBlueColour);background:#EEF3F8;}

.mcs-chat-options{display:flex;flex-wrap:wrap;gap:8px;margin:4px 0 14px;}
.mcs-chat-opt{font:500 0.8125rem/1.3 var(--primaryFont);padding:9px 14px;border:1.5px solid #D8DEE6;border-radius:20px;background:#fff;color:var(--darkBlueColour);cursor:pointer;text-align:left;}
.mcs-chat-opt:hover,.mcs-chat-opt:focus-visible{border-color:var(--darkBlueColour);background:#EEF3F8;}
.mcs-chat-opt.unsure{border-style:dashed;color:#4a5566;background:#F7F9FB;}
.mcs-chat-back{display:block;background:none;border:0;padding:4px 0;margin:0 0 12px;font:500 0.8125rem var(--primaryFont);color:#4a5566;text-decoration:underline;cursor:pointer;}

.mcs-chat-place{display:flex;gap:8px;margin:0 0 6px;}
.mcs-chat-place input{flex:1;min-width:0;font:400 0.875rem var(--primaryFont);border:1.5px solid #D8DEE6;border-radius:8px;padding:9px 12px;color:var(--darkBlueColour);}
.mcs-chat-place input:focus{outline:2px solid var(--lightBlueColour);outline-offset:1px;border-color:var(--darkBlueColour);}
.mcs-chat-btn{display:inline-flex;align-items:center;justify-content:center;font:600 0.8125rem/1.2 var(--primaryFont);padding:9px 16px;border-radius:20px;border:1.5px solid var(--darkBlueColour);background:var(--darkBlueColour);color:#fff;cursor:pointer;text-decoration:none;white-space:nowrap;}
.mcs-chat-btn.ghost{background:#fff;color:var(--darkBlueColour);}
.mcs-chat-error{color:#B42318;font-size:0.8125rem;margin:0 0 10px;}
.mcs-chat-error:empty{display:none;}
.mcs-chat-note{font-size:0.8125rem;color:#4a5566;margin:-4px 0 12px;}

/* minmax(0,1fr) + wrapping below: one very long name can never push the cards wider than the chat. */
.mcs-chat-results{display:grid;grid-template-columns:minmax(0,1fr);gap:10px;margin-bottom:12px;}
.mcs-chat-more{min-height:40px;margin:4px 0 14px;}
.mcs-chat-more .mcs-chat-typing{margin:0;}
.mcs-chat-card{display:flex;gap:12px;border:1px solid #E4E8EE;border-radius:12px;padding:12px;}
.mcs-chat-photo{width:64px;height:64px;border-radius:50%;object-fit:cover;flex-shrink:0;background:#E4EBF2;}
.mcs-chat-photo.initials{display:flex;align-items:center;justify-content:center;font-weight:700;font-size:1.1rem;}
.mcs-chat-card-text{min-width:0;flex:1;overflow-wrap:anywhere;}
.mcs-chat-name{font-size:0.9375rem;font-weight:700;margin:0 0 2px;}
.mcs-chat-role,.mcs-chat-where{font-size:0.75rem;color:#4a5566;margin:0 0 4px;}
.mcs-chat-badges{display:flex;flex-wrap:wrap;gap:6px;align-items:center;margin:0 0 8px;}
.mcs-chat-badge{font-size:0.6875rem;font-weight:600;padding:3px 9px;border-radius:10px;}
.mcs-chat-badge.online{background:#EAF3FF;color:#1B5EA0;}
.mcs-chat-badge.inperson{background:#EAFAF1;color:#1a7a4a;}
.mcs-chat-fee{font-size:0.75rem;font-weight:600;}
.mcs-chat-done{font-size:0.75rem;font-weight:600;color:#1a7a4a;margin:0 0 6px;}
.mcs-chat-actions{display:flex;gap:8px;flex-wrap:wrap;}
.mcs-chat-actions .mcs-chat-btn{white-space:normal;text-align:center;}

.mcs-chat-hint{font-size:0.75rem;color:#4a5566;margin:0 0 4px;}
/* One text size through the message form (MCS, Nov 2026): the tick-box prompts
   and the privacy text match the form's own labels (14px). */
.mcs-chat-prompt-box{margin:4px 0 14px;font-size:0.875rem;}
.mcs-chat-form .fui-type-html p,.mcs-chat-form .fui-type-html li{font-size:0.875rem;line-height:1.5;}
.mcs-chat-recaptcha{font-size:0.75rem;color:#4a5566;margin:10px 0 0;}
.mcs-chat-recaptcha a{color:inherit;}
/* Only on pages with the chat: the badge would cover it (notice shown in the chat form instead). */
.grecaptcha-badge{visibility:hidden;}
.mcs-chat-prompt-box p{margin:0;}
.mcs-chat-prompts{list-style:none;margin:6px 0 0;padding:0;display:grid;gap:6px;}
.mcs-chat-prompts li{display:flex;gap:8px;align-items:flex-start;}
.mcs-chat-prompts input{margin-top:3px;flex-shrink:0;}

.mcs-chat-sent-box{margin-bottom:6px;font-size:0.875rem;}

@media (max-width:600px){
    .mcs-chat-trigger{right:16px;bottom:16px;}
    .mcs-chat{right:8px;left:8px;bottom:8px;width:auto;max-width:none;height:calc(100vh - 16px);height:calc(100dvh - 16px);transform-origin:bottom center;}
    .mcs-chat-place input{font-size:16px;} /* under 16px, iPhones zoom the whole page when the box is tapped */
}
/* Steps slide across: forward from the right, back from the left. The answer
   buttons follow a beat later; new matches fade up one after another. */
@keyframes mcsSlideNext{from{opacity:0;transform:translateX(28px);}to{opacity:1;transform:none;}}
@keyframes mcsSlideBack{from{opacity:0;transform:translateX(-28px);}to{opacity:1;transform:none;}}
@keyframes mcsFadeUp{from{opacity:0;transform:translateY(8px);}to{opacity:1;transform:none;}}
@keyframes mcsLauncherIn{from{opacity:0;transform:translateY(12px) scale(.8);}to{opacity:1;transform:none;}}
@keyframes mcsTyping{0%,60%,100%{transform:translateY(0);opacity:.45;}30%{transform:translateY(-4px);opacity:1;}}
.mcs-chat-scroll.mcs-slide-next{animation:mcsSlideNext .3s cubic-bezier(.2,.8,.2,1);}
.mcs-chat-scroll.mcs-slide-back{animation:mcsSlideBack .3s cubic-bezier(.2,.8,.2,1);}
.mcs-slide-next .mcs-chat-options,.mcs-slide-back .mcs-chat-options{animation:mcsFadeUp .3s .08s ease-out backwards;}
.mcs-chat-card.is-new{animation:mcsFadeUp .32s ease-out backwards;}

/* "Typing" dots while matches load. */
.mcs-chat-typing{display:inline-flex;align-items:center;gap:5px;padding:14px 16px;}
.mcs-chat-typing span[aria-hidden]{width:7px;height:7px;border-radius:50%;background:#7a8799;animation:mcsTyping 1.1s infinite ease-in-out;}
.mcs-chat-typing span[aria-hidden]:nth-of-type(3){animation-delay:.15s;}
.mcs-chat-typing span[aria-hidden]:nth-of-type(4){animation-delay:.3s;}
.mcs-sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;}

@media (prefers-reduced-motion:reduce){
    .mcs-chat-trigger,.mcs-chat,.mcs-chat.is-open,.mcs-chat-trigger.is-hidden{transition:none;animation:none;}
    .mcs-chat-trigger:hover{transform:none;}
    .mcs-chat-scroll.mcs-slide-next,.mcs-chat-scroll.mcs-slide-back,.mcs-chat-options,.mcs-chat-card.is-new,.mcs-chat-typing span[aria-hidden]{animation:none;}
}
