/* Rise Migration Lawyers AI Chatbot - widget styles. Scoped under .rmcb- to avoid theme bleed.
 *
 * Brand: navy #03244F, orange #F6550B (the site's own tokens), Inter / Inter
 * Tight (already loaded by the theme). Orange is used for accents and for the
 * enquiry button with NAVY text on it (4.55:1). It is never used for small text
 * on white, where it measures 3.37:1 - the same trade-off the site documents in
 * style.css, avoided here rather than repeated.
 */

.rmcb-root {
	--rmcb-primary: #03244F;
	--rmcb-accent: #F6550B;
	--rmcb-bg: #ffffff;
	--rmcb-surface: #F5F4EE;
	--rmcb-text: #0b1b33;
	--rmcb-muted: #586778;
	--rmcb-border: #E2DDD0;
	--rmcb-user: var(--rmcb-primary);
	--rmcb-agent: #0e7a52;
	--rmcb-shadow: 0 18px 50px -12px rgba(3, 36, 79, 0.42), 0 6px 16px -8px rgba(3, 36, 79, 0.26);
	position: fixed;
	bottom: 22px;
	z-index: 2147483000;
	font-family: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	font-size: 15px;
	line-height: 1.5;
	color: var(--rmcb-text);
	text-align: left;
	letter-spacing: normal;
}
.rmcb-root.rmcb-pos-right { right: 22px; }
.rmcb-root.rmcb-pos-left { left: 22px; }

.rmcb-root *,
.rmcb-root *::before,
.rmcb-root *::after { box-sizing: border-box; }

.rmcb-root button { font-family: inherit; text-transform: none; letter-spacing: normal; margin: 0; }

/* ---------------------------------------------------------------- launcher */

.rmcb-launcher {
	position: relative;
	width: 62px;
	height: 62px;
	border-radius: 50%;
	border: none;
	padding: 0;
	cursor: pointer;
	color: #fff;
	background: var(--rmcb-primary);
	box-shadow: var(--rmcb-shadow);
	display: flex;
	align-items: center;
	justify-content: center;
	margin-left: auto;
	transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.rmcb-pos-left .rmcb-launcher { margin-left: 0; margin-right: auto; }
.rmcb-launcher:hover { transform: translateY(-2px) scale(1.04); }
.rmcb-launcher:active { transform: scale(.97); }
.rmcb-launcher:focus-visible { outline: 3px solid var(--rmcb-accent); outline-offset: 3px; }

.rmcb-launcher-icon {
	position: absolute;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: opacity .2s ease, transform .25s ease;
}
.rmcb-icon-close { opacity: 0; transform: rotate(-90deg) scale(.6); }
.rmcb-active .rmcb-icon-chat { opacity: 0; transform: rotate(90deg) scale(.6); }
.rmcb-active .rmcb-icon-close { opacity: 1; transform: rotate(0) scale(1); }

.rmcb-launcher-badge {
	position: absolute;
	top: -2px; right: -2px;
	min-width: 20px; height: 20px;
	padding: 0 5px;
	border-radius: 10px;
	background: var(--rmcb-accent);
	color: var(--rmcb-primary);
	font-size: 11px;
	font-weight: 800;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 2px solid #fff;
}

/* ------------------------------------------------------------------- panel */

.rmcb-panel {
	position: absolute;
	bottom: 78px;
	width: 390px;
	max-width: calc(100vw - 32px);
	height: 620px;
	max-height: calc(100vh - 120px);
	background: var(--rmcb-bg);
	border-radius: 18px;
	box-shadow: var(--rmcb-shadow);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	opacity: 0;
	visibility: hidden;
	transform: translateY(16px) scale(.98);
	transform-origin: bottom right;
	pointer-events: none;
	transition: opacity .25s ease, transform .25s cubic-bezier(.16,1,.3,1), visibility 0s linear .25s;
}
.rmcb-pos-right .rmcb-panel { right: 0; }
.rmcb-pos-left .rmcb-panel { left: 0; transform-origin: bottom left; }
.rmcb-is-open .rmcb-panel {
	opacity: 1;
	visibility: visible;
	transform: translateY(0) scale(1);
	pointer-events: auto;
	transition: opacity .25s ease, transform .25s cubic-bezier(.16,1,.3,1), visibility 0s;
}

/* ------------------------------------------------------------------ header */

.rmcb-header {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 15px 14px 15px 16px;
	color: #fff;
	background:
		radial-gradient(120% 140% at 0% 0%, rgba(255,255,255,.14) 0%, rgba(255,255,255,0) 45%),
		var(--rmcb-primary);
	border-bottom: 3px solid var(--rmcb-accent);
	flex: 0 0 auto;
}
.rmcb-header-avatar {
	width: 40px; height: 40px;
	border-radius: 12px;
	background: #fff;
	display: flex; align-items: center; justify-content: center;
	flex: 0 0 auto;
}
.rmcb-header-text { flex: 1 1 auto; min-width: 0; }
.rmcb-header-title {
	font-family: 'Inter Tight', 'Inter', system-ui, sans-serif;
	font-weight: 700; font-size: 16.5px; letter-spacing: -.005em; line-height: 1.25;
	color: #fff;
	white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rmcb-header-sub {
	display: flex; align-items: center; gap: 6px;
	font-size: 12.5px; color: rgba(255,255,255,.88); margin-top: 1px;
}
.rmcb-dot {
	width: 7px; height: 7px; border-radius: 50%;
	background: #3ad29f;
	box-shadow: 0 0 0 0 rgba(58,210,159,.6);
	animation: rmcb-pulse 2s infinite;
	flex: 0 0 auto;
}
@keyframes rmcb-pulse {
	0% { box-shadow: 0 0 0 0 rgba(58,210,159,.55); }
	70% { box-shadow: 0 0 0 6px rgba(58,210,159,0); }
	100% { box-shadow: 0 0 0 0 rgba(58,210,159,0); }
}
.rmcb-header-close,
.rmcb-header-human {
	background: transparent; border: none; color: #fff; cursor: pointer;
	width: 36px; height: 36px; border-radius: 9px; padding: 0;
	display: flex; align-items: center; justify-content: center;
	opacity: .9; transition: background .15s ease, opacity .15s ease;
	flex: 0 0 auto;
}
.rmcb-header-human { background: rgba(255,255,255,.12); }
.rmcb-header-close:hover,
.rmcb-header-human:hover { background: rgba(255,255,255,.18); opacity: 1; }
.rmcb-header-close:focus-visible,
.rmcb-header-human:focus-visible { outline: 2px solid var(--rmcb-accent); outline-offset: 2px; }

/* ---------------------------------------------------------------- messages */

.rmcb-messages {
	flex: 1 1 auto;
	overflow-y: auto;
	overflow-x: hidden;
	overscroll-behavior: contain;
	padding: 18px 14px 8px;
	background: var(--rmcb-surface);
	scroll-behavior: smooth;
}
.rmcb-messages::-webkit-scrollbar { width: 8px; }
.rmcb-messages::-webkit-scrollbar-thumb { background: rgba(3,36,79,.18); border-radius: 8px; }

.rmcb-row {
	display: flex;
	align-items: flex-end;
	gap: 8px;
	margin-bottom: 12px;
	animation: rmcb-in .28s cubic-bezier(.16,1,.3,1);
}
@keyframes rmcb-in {
	from { opacity: 0; transform: translateY(8px); }
	to { opacity: 1; transform: translateY(0); }
}
.rmcb-row-user { flex-direction: row-reverse; }

.rmcb-avatar {
	width: 28px; height: 28px; border-radius: 50%;
	background: var(--rmcb-primary);
	display: flex; align-items: center; justify-content: center;
	flex: 0 0 auto;
	margin-bottom: 2px;
}

.rmcb-bubble {
	max-width: 82%;
	min-width: 0;
	padding: 10px 14px;
	border-radius: 16px;
	font-size: 14.5px;
	line-height: 1.5;
	word-wrap: break-word;
	overflow-wrap: anywhere;
}
.rmcb-bubble-assistant {
	background: #fff;
	border: 1px solid var(--rmcb-border);
	border-bottom-left-radius: 5px;
	color: var(--rmcb-text);
	box-shadow: 0 1px 2px rgba(3,36,79,.05);
}
.rmcb-bubble-user {
	background: var(--rmcb-user);
	color: #fff;
	border-bottom-right-radius: 5px;
}
.rmcb-bubble p { margin: 0 0 8px; padding: 0; font-size: inherit; line-height: inherit; color: inherit; }
.rmcb-bubble p:last-child { margin-bottom: 0; }
.rmcb-bubble ul { margin: 6px 0; padding-left: 18px; list-style: disc; }
.rmcb-bubble li { margin: 2px 0; font-size: inherit; color: inherit; }
/* Links: bold navy, no underline (a heavy underline broke badly across lines).
   A thin underline appears only on hover or keyboard focus. */
.rmcb-root .rmcb-bubble a {
	color: var(--rmcb-primary);
	font-weight: 700;
	text-decoration: none;
	border: 0;
	box-shadow: none;
	background: none;
}
.rmcb-root .rmcb-bubble a:hover,
.rmcb-root .rmcb-bubble a:focus-visible {
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 2px;
}
.rmcb-root .rmcb-bubble a:focus-visible { outline: 2px solid var(--rmcb-accent); outline-offset: 1px; border-radius: 2px; }
.rmcb-bubble-user a { color: #fff; text-decoration-color: #fff; }
.rmcb-bubble strong { font-weight: 700; }

/* collection notice / consent */
.rmcb-notice {
	font-size: 12px;
	line-height: 1.45;
	color: var(--rmcb-muted);
	background: #fff;
	border: 1px dashed #cfc8b6;
	border-radius: 12px;
	padding: 9px 12px;
	margin: 0 0 14px 36px;
}
.rmcb-root .rmcb-notice a { color: var(--rmcb-primary); font-weight: 700; text-decoration: none; }
.rmcb-root .rmcb-notice a:hover, .rmcb-root .rmcb-notice a:focus-visible { text-decoration: underline; text-decoration-thickness: 1px; }
.rmcb-notice-consent { margin-top: -4px; }

/* live chat: human agent bubbles */
.rmcb-avatar-agent { background: var(--rmcb-agent); color: #fff; }
.rmcb-bubble-agent {
	background: #eafaf3;
	border: 1px solid #bfe9d6;
	border-bottom-left-radius: 5px;
	color: #0c3b2a;
}
.rmcb-bubble-agent a { color: var(--rmcb-agent); }

/* live chat: system / status notes */
.rmcb-system {
	text-align: center;
	font-size: 12px;
	color: var(--rmcb-muted);
	margin: 4px auto 14px;
	padding: 0 12px;
	max-width: 90%;
	line-height: 1.45;
}

/* live chat: status banner between header and messages */
.rmcb-livebar {
	flex: 0 0 auto;
	font-size: 12.5px;
	font-weight: 600;
	text-align: center;
	padding: 7px 14px;
	border-bottom: 1px solid var(--rmcb-border);
}
.rmcb-livebar-live { background: #eafaf3; color: #0c6b4b; border-bottom-color: #cdeede; }
.rmcb-livebar-waiting { background: #fff4ec; color: #8a3a06; border-bottom-color: #f6d8c4; }
.rmcb-livebar-closed { background: #f1f3f6; color: var(--rmcb-muted); }

/* typing */
.rmcb-typing { display: flex; gap: 4px; align-items: center; min-height: 41px; }
.rmcb-typing span {
	width: 7px; height: 7px; border-radius: 50%;
	background: var(--rmcb-muted);
	animation: rmcb-bounce 1.3s infinite ease-in-out;
}
.rmcb-typing span:nth-child(2) { animation-delay: .15s; }
.rmcb-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes rmcb-bounce {
	0%, 60%, 100% { transform: translateY(0); opacity: .5; }
	30% { transform: translateY(-5px); opacity: 1; }
}

/* chips */
.rmcb-chips {
	display: flex; flex-wrap: wrap; gap: 8px;
	margin: 4px 0 14px 36px;
	animation: rmcb-in .3s ease;
}
.rmcb-chip {
	background: #fff;
	border: 1.5px solid var(--rmcb-primary);
	color: var(--rmcb-primary);
	border-radius: 999px;
	padding: 7px 14px;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	transition: background .15s ease, color .15s ease, transform .1s ease;
	line-height: 1.3;
	text-align: left;
	max-width: 100%;
	white-space: normal;
}
.rmcb-chip:hover { background: var(--rmcb-primary); color: #fff; }
.rmcb-chip:active { transform: scale(.97); }
.rmcb-chip:focus-visible { outline: 2px solid var(--rmcb-accent); outline-offset: 2px; }
.rmcb-chip-primary {
	background: var(--rmcb-accent);
	border-color: var(--rmcb-accent);
	color: var(--rmcb-primary);
	font-weight: 700;
}
.rmcb-chip-primary:hover { background: var(--rmcb-primary); border-color: var(--rmcb-primary); color: #fff; }

/* ------------------------------------------------------------------ footer */

.rmcb-footer {
	flex: 0 0 auto;
	padding: 12px 14px 10px;
	background: #fff;
	border-top: 1px solid var(--rmcb-border);
}
.rmcb-enquiry-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 9px;
	width: 100%;
	padding: 11px 14px;
	margin-bottom: 10px;
	border: none;
	border-radius: 999px;
	background: var(--rmcb-accent);
	color: var(--rmcb-primary);
	font-weight: 800;
	font-size: 14.5px;
	line-height: 1.2;
	cursor: pointer;
	text-decoration: none;
	box-shadow: 0 6px 16px -6px rgba(246,85,11,.55);
	transition: transform .12s ease, box-shadow .2s ease, background .2s ease, color .2s ease;
}
.rmcb-enquiry-btn:hover { background: var(--rmcb-primary); color: #fff; transform: translateY(-1px); box-shadow: 0 8px 18px -6px rgba(3,36,79,.5); }
.rmcb-enquiry-btn:active { transform: translateY(0); }
.rmcb-enquiry-btn:focus-visible { outline: 3px solid var(--rmcb-primary); outline-offset: 2px; }
.rmcb-enquiry-btn svg { flex: 0 0 auto; }
.rmcb-enquiry-arrow { transition: transform .2s ease; }
.rmcb-enquiry-btn:hover .rmcb-enquiry-arrow { transform: translateX(3px); }

.rmcb-composer {
	display: flex;
	align-items: flex-end;
	gap: 8px;
	background: var(--rmcb-surface);
	border: 1px solid var(--rmcb-border);
	border-radius: 14px;
	padding: 6px 6px 6px 12px;
	transition: border-color .15s ease, box-shadow .15s ease;
}
.rmcb-composer:focus-within {
	border-color: var(--rmcb-primary);
	box-shadow: 0 0 0 3px rgba(246,85,11,.18);
}
.rmcb-root .rmcb-input {
	flex: 1 1 auto;
	min-width: 0;
	width: auto;
	border: none;
	background: transparent;
	box-shadow: none;
	resize: none;
	font-family: inherit;
	font-size: 16px; /* 16px stops iOS zooming the page on focus */
	line-height: 1.4;
	color: var(--rmcb-text);
	max-height: 120px;
	min-height: 0;
	padding: 6px 0;
	margin: 0;
	outline: none;
	border-radius: 0;
}
.rmcb-input::placeholder { color: var(--rmcb-muted); opacity: 1; }
.rmcb-send {
	flex: 0 0 auto;
	width: 38px; height: 38px;
	border: none; border-radius: 10px; padding: 0;
	background: var(--rmcb-primary);
	color: #fff;
	cursor: pointer;
	display: flex; align-items: center; justify-content: center;
	transition: transform .12s ease, opacity .15s ease, background .15s ease;
}
.rmcb-send:hover { transform: scale(1.06); }
.rmcb-send:active { transform: scale(.95); }
.rmcb-send:disabled { opacity: .5; cursor: default; transform: none; }
.rmcb-send:focus-visible { outline: 2px solid var(--rmcb-accent); outline-offset: 2px; }

.rmcb-disclaimer {
	font-size: 11.5px;
	color: var(--rmcb-muted);
	text-align: center;
	margin-top: 8px;
	line-height: 1.4;
}
.rmcb-disclaimer a { color: var(--rmcb-muted); text-decoration: underline; }
.rmcb-disclaimer a:hover { color: var(--rmcb-primary); }
.rmcb-credit {
	font-size: 11px;
	color: var(--rmcb-muted);
	text-align: center;
	margin-top: 3px;
	letter-spacing: .02em;
}
.rmcb-credit a { color: var(--rmcb-muted); text-decoration: none; }
.rmcb-credit a:hover { color: var(--rmcb-primary); text-decoration: underline; }

/* ----------------------------------------------------------- enquiry form */

.rmcb-enquiry-card {
	background: #fff;
	border: 1px solid var(--rmcb-border);
	border-radius: 16px;
	box-shadow: 0 6px 20px -10px rgba(3,36,79,.28);
	padding: 14px 14px 12px;
	margin: 2px 0 14px;
	animation: rmcb-in .28s cubic-bezier(.16,1,.3,1);
}
.rmcb-q-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin-bottom: 4px;
}
.rmcb-q-title { font-family: 'Inter Tight', 'Inter', sans-serif; font-weight: 700; font-size: 15.5px; color: var(--rmcb-primary); }
.rmcb-q-close {
	background: transparent; border: none; cursor: pointer; padding: 0;
	width: 30px; height: 30px; border-radius: 7px;
	display: flex; align-items: center; justify-content: center;
	color: var(--rmcb-muted);
	transition: background .15s ease, color .15s ease;
}
.rmcb-q-close:hover { background: var(--rmcb-surface); color: var(--rmcb-text); }
.rmcb-q-intro { margin: 0 0 10px; font-size: 12.5px; color: var(--rmcb-muted); line-height: 1.45; }

.rmcb-q-body { display: flex; flex-direction: column; gap: 9px; }
.rmcb-q-step { display: flex; flex-direction: column; gap: 9px; }
.rmcb-q-field-wrap { display: flex; flex-direction: column; gap: 3px; }
.rmcb-q-label { font-size: 12.5px; font-weight: 600; color: var(--rmcb-text); }
.rmcb-root .rmcb-q-field {
	width: 100%;
	font-family: inherit;
	font-size: 16px;
	color: var(--rmcb-text);
	background: var(--rmcb-surface);
	border: 1px solid var(--rmcb-border);
	border-radius: 10px;
	padding: 9px 11px;
	margin: 0;
	outline: none;
	box-shadow: none;
	transition: border-color .15s ease, box-shadow .15s ease;
}
.rmcb-root textarea.rmcb-q-field { resize: vertical; min-height: 80px; line-height: 1.45; }
.rmcb-root .rmcb-q-field:focus {
	border-color: var(--rmcb-primary);
	box-shadow: 0 0 0 3px rgba(246,85,11,.18);
	background: #fff;
}
.rmcb-root .rmcb-q-field.rmcb-q-invalid { border-color: #c0392b; box-shadow: 0 0 0 3px rgba(192,57,43,.12); }
.rmcb-q-field::placeholder { color: var(--rmcb-muted); opacity: 1; }
.rmcb-root select.rmcb-q-field {
	appearance: none; -webkit-appearance: none; cursor: pointer;
	padding-right: 34px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23586778' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 12px center;
}

.rmcb-q-error { font-size: 12px; color: #b3261e; line-height: 1.3; }
.rmcb-q-error:empty { display: none; }
.rmcb-q-consent { font-size: 12px; color: var(--rmcb-muted); line-height: 1.45; margin: 2px 0 0; }
.rmcb-q-consent a { color: var(--rmcb-primary); font-weight: 600; }

.rmcb-q-actions { display: flex; gap: 8px; margin-top: 12px; }
.rmcb-q-back {
	flex: 0 0 auto;
	padding: 10px 16px;
	border: 1px solid var(--rmcb-border);
	background: #fff;
	color: var(--rmcb-muted);
	border-radius: 999px;
	font-size: 13.5px;
	font-weight: 600;
	cursor: pointer;
}
.rmcb-q-back:hover { background: var(--rmcb-surface); color: var(--rmcb-text); }
.rmcb-q-next,
.rmcb-q-submit {
	flex: 1 1 auto;
	padding: 10px 14px;
	border: none;
	background: var(--rmcb-primary);
	color: #fff;
	border-radius: 999px;
	font-size: 14px;
	font-weight: 700;
	cursor: pointer;
	transition: filter .15s ease, transform .1s ease, opacity .15s ease;
}
.rmcb-q-submit { background: var(--rmcb-accent); color: var(--rmcb-primary); }
.rmcb-q-next:hover,
.rmcb-q-submit:hover { filter: brightness(1.08); }
.rmcb-q-submit:disabled { opacity: .6; cursor: default; }

.rmcb-q-status { font-size: 12.5px; margin-top: 9px; line-height: 1.4; }
.rmcb-q-status:empty { display: none; }
.rmcb-q-status-err { color: #b3261e; }
.rmcb-q-stepper { font-size: 11.5px; font-weight: 600; color: var(--rmcb-muted); margin-top: 2px; }
.rmcb-q-req { color: #b3261e; font-weight: 700; }

/* guided-intake footer controls */
.rmcb-intakebar {
	display: flex;
	gap: 6px;
	margin-bottom: 10px;
}
.rmcb-ibtn {
	flex: 1 1 0;
	min-width: 0;
	white-space: nowrap;
	padding: 9px 6px;
	border: 1px solid var(--rmcb-border);
	background: #fff;
	color: var(--rmcb-text);
	border-radius: 999px;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	transition: background .15s ease, color .15s ease;
}
.rmcb-ibtn:hover { background: var(--rmcb-surface); }
.rmcb-ibtn-danger { color: #b3261e; }
.rmcb-ibtn-danger:hover { background: #fdecec; }

/* ------------------------------------------------------------------ mobile */

@media (max-width: 480px) {
	.rmcb-root { bottom: 16px; }
	.rmcb-root.rmcb-pos-right { right: 16px; }
	.rmcb-root.rmcb-pos-left { left: 16px; }
	.rmcb-launcher { width: 56px; height: 56px; }
	.rmcb-panel {
		position: fixed;
		top: 0; bottom: 0; left: 0; right: 0;
		width: 100%;
		max-width: 100%;
		height: 100%;
		height: 100dvh;
		max-height: none;
		border-radius: 0;
	}
	.rmcb-is-open .rmcb-launcher { opacity: 0; pointer-events: none; }
	.rmcb-chips, .rmcb-notice { margin-left: 0; }
	.rmcb-bubble { max-width: 86%; }
}

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
	.rmcb-root *,
	.rmcb-root *::before,
	.rmcb-root *::after {
		animation-duration: .001ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: .001ms !important;
	}
}

/* v2: summary bubble reads as a card */
.rmcb-bubble-assistant strong { color: var(--rmcb-primary); }
@media (max-width: 380px) {
	.rmcb-ibtn { font-size: 12.5px; padding: 9px 4px; }
}
