/* SSSS Website Chat — after-hours panel.
   Tokens derive from the site theme (CartoGothic + the orange/slate/teal brand set). */
.ssss-chat {
	--ssss-chat-brand: #f37734;        /* theme primary orange */
	--ssss-chat-brand-deep: #d9611f;
	--ssss-chat-brand-tint: #fff1e8;
	--ssss-chat-ink: #22333f;          /* slate, tinted toward brand */
	--ssss-chat-ink-soft: #5a6b78;
	--ssss-chat-line: #e3dcd6;
	--ssss-chat-surface: #fffdfb;
	--ssss-chat-surface-2: #f6f1ec;
	--ssss-chat-accent: #00a3a6;       /* theme teal, used once */
	--ssss-chat-danger: #b3261e;
	--ssss-chat-success: #1e7a4a;
	--ssss-chat-radius: 14px;
	--ssss-chat-shadow: 0 18px 48px rgba(34, 51, 63, .22), 0 2px 6px rgba(34, 51, 63, .12);
	--ssss-chat-ease-out: cubic-bezier(.2, .8, .2, 1);
	--ssss-chat-t-fast: 150ms;
	--ssss-chat-t: 240ms;

	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 2147483000;
	font-family: 'CartoGothicPro', 'Gill Sans', 'Trebuchet MS', sans-serif;
	font-size: 16px;
	line-height: 1.5;
	color: var(--ssss-chat-ink);
	box-sizing: border-box;
}
.ssss-chat *, .ssss-chat *::before, .ssss-chat *::after { box-sizing: inherit; }
.ssss-chat[hidden] { display: none; }

/* Launcher — same corner the Salesforce button lives in, so the hand-off is seamless. */
.ssss-chat__launcher {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	min-height: 48px;
	padding: 0 20px 0 16px;
	border: 0;
	border-radius: 999px;
	background: var(--ssss-chat-brand);
	color: #fff;
	font: inherit;
	font-weight: 700;
	letter-spacing: .01em;
	cursor: pointer;
	box-shadow: 0 10px 24px rgba(243, 119, 52, .35);
	transition: transform var(--ssss-chat-t-fast) var(--ssss-chat-ease-out), background-color var(--ssss-chat-t-fast), box-shadow var(--ssss-chat-t-fast);
}
.ssss-chat__launcher:hover { background: var(--ssss-chat-brand-deep); transform: translateY(-1px); }
.ssss-chat__launcher:active { transform: translateY(1px) scale(.98); box-shadow: 0 4px 12px rgba(243, 119, 52, .3); }
.ssss-chat__launcher:focus-visible { outline: 3px solid var(--ssss-chat-ink); outline-offset: 3px; }
.ssss-chat__icon { width: 22px; height: 22px; flex: none; }
.ssss-chat[data-state="open"] .ssss-chat__launcher,
.ssss-chat[data-state="sending"] .ssss-chat__launcher,
.ssss-chat[data-state="sent"] .ssss-chat__launcher { display: none; }

/* Panel */
.ssss-chat__panel {
	position: absolute;
	right: 0;
	bottom: 0;
	width: min(380px, calc(100vw - 40px));
	max-height: min(640px, calc(100vh - 40px));
	overflow: auto;
	background: var(--ssss-chat-surface);
	border-radius: var(--ssss-chat-radius);
	box-shadow: var(--ssss-chat-shadow);
	transform-origin: bottom right;
	animation: ssss-chat-in var(--ssss-chat-t) var(--ssss-chat-ease-out);
}
.ssss-chat__panel[hidden] { display: none; }
@keyframes ssss-chat-in {
	from { opacity: 0; transform: translateY(12px) scale(.98); }
	to   { opacity: 1; transform: none; }
}

/* Header: brand-tinted block with the orange edge cut on a diagonal — one deliberate
   asymmetry so it reads as designed, not templated. */
.ssss-chat__head {
	position: relative;
	padding: 22px 56px 22px 24px;
	background: var(--ssss-chat-brand-tint);
	border-bottom: 1px solid var(--ssss-chat-line);
}
.ssss-chat__head::before {
	content: "";
	position: absolute;
	inset: 0 auto 0 0;
	width: 8px;
	background: var(--ssss-chat-brand);
	clip-path: polygon(0 0, 100% 0, 100% 78%, 0 100%);
}
.ssss-chat__eyebrow {
	margin: 0 0 4px;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .12em;
	text-transform: uppercase;
	color: var(--ssss-chat-brand-deep);
}
.ssss-chat__title {
	margin: 0 0 6px;
	font-size: 22px;
	line-height: 1.15;
	font-weight: 700;
	letter-spacing: -.01em;
	color: var(--ssss-chat-ink);
}
.ssss-chat__lede { margin: 0; font-size: 14.5px; color: var(--ssss-chat-ink-soft); max-width: 40ch; }
.ssss-chat__hours { color: var(--ssss-chat-ink); font-weight: 700; white-space: nowrap; }
.ssss-chat__close {
	position: absolute;
	top: 10px;
	right: 10px;
	width: 44px;
	height: 44px;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--ssss-chat-ink-soft);
	cursor: pointer;
	transition: background-color var(--ssss-chat-t-fast), color var(--ssss-chat-t-fast);
}
.ssss-chat__close svg { width: 20px; height: 20px; }
.ssss-chat__close:hover { background: rgba(34, 51, 63, .08); color: var(--ssss-chat-ink); }
.ssss-chat__close:active { background: rgba(34, 51, 63, .16); }
.ssss-chat__close:focus-visible { outline: 3px solid var(--ssss-chat-brand); outline-offset: 2px; }

/* Form */
.ssss-chat__form { padding: 18px 24px 24px; }
.ssss-chat__form[hidden] { display: none; }
.ssss-chat__field { margin-bottom: 14px; }
.ssss-chat__field label {
	display: block;
	margin-bottom: 5px;
	font-size: 13.5px;
	font-weight: 700;
	color: var(--ssss-chat-ink);
}
.ssss-chat__field input,
.ssss-chat__field textarea {
	width: 100%;
	min-height: 46px;
	padding: 11px 13px;
	border: 1.5px solid var(--ssss-chat-line);
	border-radius: 8px;
	background: #fff;
	color: var(--ssss-chat-ink);
	font: inherit;
	font-size: 15.5px;
	transition: border-color var(--ssss-chat-t-fast), box-shadow var(--ssss-chat-t-fast);
}
.ssss-chat__field textarea { resize: vertical; min-height: 104px; }
.ssss-chat__field input:hover, .ssss-chat__field textarea:hover { border-color: var(--ssss-chat-ink-soft); }
.ssss-chat__field input:focus-visible, .ssss-chat__field textarea:focus-visible {
	outline: none;
	border-color: var(--ssss-chat-brand);
	box-shadow: 0 0 0 3px rgba(243, 119, 52, .28);
}
.ssss-chat__field [aria-invalid="true"] { border-color: var(--ssss-chat-danger); }
.ssss-chat__error {
	margin: 5px 0 0;
	min-height: 0;
	font-size: 13px;
	color: var(--ssss-chat-danger);
}
.ssss-chat__error:empty { display: none; }
.ssss-chat__error--form { margin: 0 0 12px; padding: 10px 12px; background: #fdeceb; border-radius: 8px; }
.ssss-chat__trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.ssss-chat__submit {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 48px;
	border: 0;
	border-radius: 10px;
	background: var(--ssss-chat-ink);
	color: #fff;
	font: inherit;
	font-weight: 700;
	cursor: pointer;
	transition: background-color var(--ssss-chat-t-fast), transform var(--ssss-chat-t-fast) var(--ssss-chat-ease-out);
}
.ssss-chat__submit:hover { background: #33475a; }
.ssss-chat__submit:active { transform: scale(.99); }
.ssss-chat__submit:focus-visible { outline: 3px solid var(--ssss-chat-brand); outline-offset: 3px; }
.ssss-chat__submit:disabled { background: var(--ssss-chat-ink-soft); cursor: progress; }
.ssss-chat__spinner {
	display: none;
	width: 18px;
	height: 18px;
	margin-left: 10px;
	border: 2.5px solid rgba(255, 255, 255, .35);
	border-top-color: #fff;
	border-radius: 50%;
	animation: ssss-chat-spin .8s linear infinite;
}
.ssss-chat[data-state="sending"] .ssss-chat__spinner { display: inline-block; }
.ssss-chat[data-state="sending"] .ssss-chat__submit-label { opacity: .8; }
@keyframes ssss-chat-spin { to { transform: rotate(360deg); } }

/* Success */
.ssss-chat__done { padding: 28px 24px 26px; text-align: left; }
.ssss-chat__done[hidden] { display: none; }
.ssss-chat__done:focus { outline: none; }
.ssss-chat__done-mark {
	width: 44px;
	height: 44px;
	padding: 8px;
	border-radius: 50%;
	background: #e6f4ec;
	color: var(--ssss-chat-success);
}
.ssss-chat__done-title { margin: 12px 0 4px; font-size: 19px; font-weight: 700; }
.ssss-chat__done-text { margin: 0 0 14px; color: var(--ssss-chat-ink-soft); font-size: 14.5px; }
.ssss-chat__link {
	min-height: 44px;
	padding: 0 4px;
	border: 0;
	background: none;
	color: var(--ssss-chat-accent);
	font: inherit;
	font-weight: 700;
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
}
.ssss-chat__link:hover { color: var(--ssss-chat-ink); }
.ssss-chat__link:focus-visible { outline: 3px solid var(--ssss-chat-brand); outline-offset: 2px; border-radius: 4px; }

@media (max-width: 480px) {
	.ssss-chat { right: 12px; bottom: 12px; }
	.ssss-chat__panel { width: calc(100vw - 24px); max-height: calc(100vh - 24px); }
	.ssss-chat__launcher-label { display: none; }
	.ssss-chat__launcher { width: 56px; height: 56px; padding: 0; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
	.ssss-chat__panel { animation: none; }
	.ssss-chat__launcher, .ssss-chat__submit { transition: none; }
	.ssss-chat__spinner { animation-duration: 1.6s; }
}

/* Trigger mode: no launcher pill; the panel opens as a centered dialog over a scrim. */
.ssss-chat--trigger .ssss-chat__launcher { display: none; }
.ssss-chat--trigger { inset: 0; right: auto; bottom: auto; width: 100vw; height: 100vh; pointer-events: none; }
.ssss-chat__scrim {
	position: fixed;
	inset: 0;
	background: rgba(34, 51, 63, .45);
	pointer-events: auto;
	animation: ssss-chat-fade var(--ssss-chat-t) ease-out;
}
.ssss-chat__scrim[hidden] { display: none; }
@keyframes ssss-chat-fade { from { opacity: 0; } to { opacity: 1; } }
.ssss-chat--trigger .ssss-chat__panel {
	position: fixed;
	right: auto;
	bottom: auto;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	transform-origin: center;
	pointer-events: auto;
	width: min(420px, calc(100vw - 32px));
	animation-name: ssss-chat-in-center;
}
@keyframes ssss-chat-in-center {
	from { opacity: 0; transform: translate(-50%, calc(-50% + 12px)) scale(.98); }
	to   { opacity: 1; transform: translate(-50%, -50%); }
}
@media (prefers-reduced-motion: reduce) {
	.ssss-chat__scrim, .ssss-chat--trigger .ssss-chat__panel { animation: none; }
}
