/* Practice Claim site assistant widget.
   Self contained so it does not depend on the theme stylesheet loading first.
   Colours mirror the brand navy and cyan. */

.pcc-chat {
	--pcc-navy: #0b1f3a;
	--pcc-navy-soft: #12294a;
	--pcc-cyan: #22aecd;
	--pcc-cyan-deep: #1687a3;
	--pcc-cyan-light: #63d5e6;
	--pcc-ink: #1a2433;
	--pcc-grey: #5b6675;
	--pcc-line: #e7ebf0;
	position: fixed;
	right: clamp(14px, 3vw, 28px);
	bottom: clamp(14px, 3vw, 28px);
	z-index: 2147483000;
	font-family: Roboto, system-ui, -apple-system, sans-serif;
}

/* Launcher ---------------------------------------------------------------- */
.pcc-chat__launch {
	display: inline-flex;
	align-items: center;
	gap: 0.55rem;
	padding: 0.85rem 1.15rem 0.85rem 1rem;
	border: 0;
	border-radius: 999px;
	background: linear-gradient(135deg, var(--pcc-cyan-deep), var(--pcc-navy));
	color: #fff;
	font-size: 0.95rem;
	font-weight: 650;
	cursor: pointer;
	box-shadow: 0 14px 34px -12px rgba(11, 31, 58, 0.6);
	transition: transform 240ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 240ms ease;
}

.pcc-chat__launch:hover {
	transform: translateY(-3px);
	box-shadow: 0 20px 44px -14px rgba(11, 31, 58, 0.7);
}

.pcc-chat__launch-ic {
	display: inline-grid;
	place-items: center;
}

.pcc-chat__launch-ic::after {
	content: "";
	position: absolute;
	width: 10px;
	height: 10px;
	margin: -14px 0 0 14px;
	border-radius: 50%;
	background: var(--pcc-cyan-light);
	box-shadow: 0 0 0 0 rgba(99, 213, 230, 0.7);
	animation: pcc-chat-pulse 2.2s ease-out infinite;
}

@keyframes pcc-chat-pulse {
	0% { box-shadow: 0 0 0 0 rgba(99, 213, 230, 0.6); }
	70% { box-shadow: 0 0 0 10px rgba(99, 213, 230, 0); }
	100% { box-shadow: 0 0 0 0 rgba(99, 213, 230, 0); }
}

.pcc-chat.is-open .pcc-chat__launch {
	transform: scale(0.9);
	opacity: 0;
	pointer-events: none;
}

/* Panel ------------------------------------------------------------------- */
/* The hidden attribute must win over the flex display below: an author rule
   for display always beats the UA [hidden] rule on specificity, so without
   this the panel (and launcher, if ever hidden) would stay visible. */
.pcc-chat[hidden],
.pcc-chat__panel[hidden] {
	display: none !important;
}

.pcc-chat__panel {
	position: absolute;
	right: 0;
	bottom: 0;
	width: min(380px, calc(100vw - 28px));
	height: min(620px, calc(100vh - 40px));
	display: flex;
	flex-direction: column;
	background: #fff;
	border: 1px solid var(--pcc-line);
	border-radius: 18px;
	overflow: hidden;
	box-shadow: 0 30px 70px -20px rgba(11, 31, 58, 0.5);
	transform-origin: bottom right;
	animation: pcc-chat-in 260ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes pcc-chat-in {
	from { opacity: 0; transform: translateY(16px) scale(0.96); }
	to { opacity: 1; transform: translateY(0) scale(1); }
}

.pcc-chat__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	padding: 0.9rem 1rem;
	background: linear-gradient(135deg, var(--pcc-navy), var(--pcc-navy-soft));
	color: #fff;
}

.pcc-chat__head-id {
	display: flex;
	align-items: center;
	gap: 0.65rem;
}

.pcc-chat__avatar {
	display: inline-grid;
	place-items: center;
	width: 38px;
	height: 38px;
	border-radius: 50%;
	background: linear-gradient(135deg, var(--pcc-cyan-light), var(--pcc-cyan));
	color: var(--pcc-navy);
	font-weight: 800;
	font-size: 0.85rem;
	letter-spacing: 0.02em;
}

.pcc-chat__head strong {
	display: block;
	font-size: 0.95rem;
	line-height: 1.2;
}

.pcc-chat__head small {
	display: block;
	font-size: 0.72rem;
	opacity: 0.72;
	margin-top: 1px;
}

.pcc-chat__close {
	border: 0;
	background: rgba(255, 255, 255, 0.12);
	color: #fff;
	width: 32px;
	height: 32px;
	border-radius: 9px;
	display: grid;
	place-items: center;
	cursor: pointer;
	transition: background 200ms ease;
}

.pcc-chat__close:hover {
	background: rgba(255, 255, 255, 0.24);
}

/* Message log ------------------------------------------------------------- */
.pcc-chat__log {
	flex: 1;
	overflow-y: auto;
	padding: 1.1rem 1rem 0.4rem;
	display: flex;
	flex-direction: column;
	gap: 0.7rem;
	background:
		radial-gradient(120% 60% at 100% 0%, rgba(34, 174, 205, 0.06), transparent 60%),
		#f7f9fb;
}

.pcc-msg {
	max-width: 84%;
	padding: 0.7rem 0.9rem;
	border-radius: 14px;
	font-size: 0.9rem;
	line-height: 1.5;
	white-space: pre-wrap;
	word-wrap: break-word;
	animation: pcc-msg-in 200ms ease;
}

@keyframes pcc-msg-in {
	from { opacity: 0; transform: translateY(6px); }
	to { opacity: 1; transform: translateY(0); }
}

.pcc-msg--bot {
	align-self: flex-start;
	background: #fff;
	border: 1px solid var(--pcc-line);
	color: var(--pcc-ink);
	border-bottom-left-radius: 5px;
}

.pcc-msg--user {
	align-self: flex-end;
	background: linear-gradient(135deg, var(--pcc-cyan-deep), var(--pcc-navy));
	color: #fff;
	border-bottom-right-radius: 5px;
}

.pcc-msg a {
	color: inherit;
	font-weight: 650;
	text-decoration: underline;
}

.pcc-msg--bot a {
	color: var(--pcc-cyan-deep);
}

/* Quick starter chips shown in the first bot message. */
.pcc-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	margin-top: 0.6rem;
}

.pcc-chip {
	border: 1px solid rgba(34, 174, 205, 0.35);
	background: rgba(34, 174, 205, 0.08);
	color: var(--pcc-cyan-deep);
	border-radius: 999px;
	padding: 0.35rem 0.75rem;
	font-size: 0.78rem;
	font-weight: 600;
	cursor: pointer;
	transition: background 180ms ease;
}

.pcc-chip:hover {
	background: rgba(34, 174, 205, 0.16);
}

/* Typing indicator. */
.pcc-typing {
	display: inline-flex;
	gap: 4px;
	align-items: center;
}

.pcc-typing span {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--pcc-grey);
	opacity: 0.5;
	animation: pcc-blink 1.2s infinite;
}

.pcc-typing span:nth-child(2) { animation-delay: 0.2s; }
.pcc-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes pcc-blink {
	0%, 100% { opacity: 0.25; transform: translateY(0); }
	50% { opacity: 1; transform: translateY(-2px); }
}

/* Composer ---------------------------------------------------------------- */
.pcc-chat__form {
	display: flex;
	align-items: flex-end;
	gap: 0.5rem;
	padding: 0.7rem 0.7rem 0.4rem;
	border-top: 1px solid var(--pcc-line);
	background: #fff;
}

.pcc-chat__input {
	flex: 1;
	resize: none;
	border: 1px solid var(--pcc-line);
	border-radius: 12px;
	padding: 0.65rem 0.8rem;
	font: inherit;
	font-size: 0.9rem;
	line-height: 1.4;
	max-height: 120px;
	color: var(--pcc-ink);
	background: #f7f9fb;
	outline: none;
	transition: border-color 180ms ease, background 180ms ease;
}

.pcc-chat__input:focus {
	border-color: var(--pcc-cyan);
	background: #fff;
}

.pcc-chat__send {
	flex: none;
	width: 42px;
	height: 42px;
	border: 0;
	border-radius: 12px;
	background: linear-gradient(135deg, var(--pcc-cyan-deep), var(--pcc-navy));
	color: #fff;
	display: grid;
	place-items: center;
	cursor: pointer;
	transition: transform 180ms ease, opacity 180ms ease;
}

.pcc-chat__send:hover { transform: translateY(-2px); }
.pcc-chat__send:disabled { opacity: 0.5; cursor: default; transform: none; }

.pcc-chat__foot {
	margin: 0;
	padding: 0 0.9rem 0.7rem;
	background: #fff;
	font-size: 0.72rem;
	color: var(--pcc-grey);
	text-align: center;
}

.pcc-chat__foot a {
	color: var(--pcc-cyan-deep);
	font-weight: 600;
}

@media (prefers-reduced-motion: reduce) {
	.pcc-chat__launch-ic::after,
	.pcc-chat__panel,
	.pcc-msg,
	.pcc-typing span { animation: none; }
}
