/* CCIC Chat widget. Blue (#3E8BDA) + white/black. Bottom-right bubble. */

:root {
	--ccic-blue: #3E8BDA;
	--ccic-blue-dark: #2f6fb0;
	--ccic-black: #1a1a1a;
	--ccic-white: #ffffff;
	--ccic-gray: #f0f2f5;
	--ccic-border: #e2e6ea;
}

#ccic-chat-root * {
	box-sizing: border-box;
}

/* Launcher — the favicon clipped to a clean circle (crops the PNG's square
   background). box-shadow follows the circle, so no square halo on hover. */
.ccic-launcher {
	position: fixed;
	right: 24px;
	bottom: 24px;
	width: 62px;
	height: 62px;
	border-radius: 50%;
	overflow: hidden;
	background: #16233f; /* navy, matches the logo behind the image */
	border: none;
	padding: 0;
	cursor: pointer;
	display: block;
	z-index: 999999;
	box-shadow: 0 5px 16px rgba(0, 0, 0, 0.35);
	transition: transform 0.15s ease, box-shadow 0.15s ease;
	-webkit-appearance: none;
	appearance: none;
}

.ccic-launcher:hover {
	transform: translateY(-2px) scale(1.05);
	box-shadow: 0 9px 24px rgba(0, 0, 0, 0.4);
}

.ccic-launcher img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	/* Scale up so the round logo fills the circle and the fuchsia border is
	   cropped out by the circular overflow. */
	transform: scale(1.22);
}

/* Fallback (only if the logo fails to load): a simple blue circle. */
.ccic-launcher .ccic-launcher-fallback {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	background: var(--ccic-blue);
	color: #fff;
	font-size: 26px;
	line-height: 1;
}

/* Panel */
.ccic-panel {
	position: fixed;
	right: 24px;
	bottom: 96px;
	width: 380px;
	max-width: calc(100vw - 32px);
	height: 560px;
	max-height: calc(100vh - 120px);
	background: var(--ccic-white);
	border-radius: 16px;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.28);
	display: none;
	flex-direction: column;
	overflow: hidden;
	z-index: 999999;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	color: var(--ccic-black);
}

.ccic-panel.ccic-open {
	display: flex;
	animation: ccic-in 0.18s ease;
}

@keyframes ccic-in {
	from { opacity: 0; transform: translateY(12px); }
	to   { opacity: 1; transform: translateY(0); }
}

/* Header */
.ccic-header {
	background: var(--ccic-blue);
	color: #fff;
	padding: 14px 16px;
	display: flex;
	align-items: center;
	gap: 10px;
}

.ccic-header img {
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background: #16233f;
	object-fit: cover;
	flex: 0 0 auto;
}

.ccic-header .ccic-h-title {
	font-weight: 700;
	font-size: 15px;
	line-height: 1.2;
}

.ccic-header .ccic-h-sub {
	font-size: 11px;
	opacity: 0.9;
}

.ccic-header .ccic-close {
	margin-left: auto;
	background: transparent;
	border: none;
	color: #fff;
	font-size: 22px;
	cursor: pointer;
	line-height: 1;
	padding: 4px 6px;
	border-radius: 6px;
}

.ccic-header .ccic-close:hover {
	background: rgba(255, 255, 255, 0.15);
}

/* Body */
.ccic-body {
	flex: 1 1 auto;
	overflow-y: auto;
	padding: 16px;
	background: var(--ccic-gray);
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.ccic-msg {
	max-width: 82%;
	padding: 10px 13px;
	border-radius: 14px;
	font-size: 14px;
	line-height: 1.45;
	white-space: pre-wrap;
	word-wrap: break-word;
}

.ccic-msg.ccic-bot {
	align-self: flex-start;
	background: #fff;
	color: var(--ccic-black);
	border: 1px solid var(--ccic-border);
	border-bottom-left-radius: 4px;
}

.ccic-msg.ccic-user {
	align-self: flex-end;
	background: var(--ccic-blue);
	color: #fff;
	border-bottom-right-radius: 4px;
}

.ccic-msg a {
	color: inherit;
	text-decoration: underline;
}

.ccic-msg.ccic-bot a {
	color: var(--ccic-blue-dark);
}

/* Typing indicator */
.ccic-typing {
	align-self: flex-start;
	background: #fff;
	border: 1px solid var(--ccic-border);
	border-radius: 14px;
	padding: 12px 14px;
	display: inline-flex;
	gap: 4px;
}

.ccic-typing span {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #b8c0c8;
	animation: ccic-bounce 1.2s infinite ease-in-out;
}

.ccic-typing span:nth-child(2) { animation-delay: 0.15s; }
.ccic-typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes ccic-bounce {
	0%, 60%, 100% { transform: translateY(0); opacity: 0.6; }
	30% { transform: translateY(-5px); opacity: 1; }
}

/* Email gate */
.ccic-gate {
	padding: 22px 18px;
	display: flex;
	flex-direction: column;
	gap: 12px;
	flex: 1 1 auto;
	justify-content: center;
	background: #fff;
}

.ccic-gate h4 {
	margin: 0;
	font-size: 17px;
	color: var(--ccic-black);
}

.ccic-gate p {
	margin: 0;
	font-size: 13px;
	color: #555;
}

.ccic-gate input[type="email"] {
	width: 100%;
	padding: 11px 12px;
	border: 1px solid var(--ccic-border);
	border-radius: 10px;
	font-size: 14px;
	outline: none;
}

.ccic-gate input[type="email"]:focus {
	border-color: var(--ccic-blue);
	box-shadow: 0 0 0 3px rgba(62, 139, 218, 0.15);
}

.ccic-btn {
	background: var(--ccic-blue);
	color: #fff;
	border: none;
	padding: 11px 14px;
	border-radius: 10px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
}

.ccic-btn:hover { background: var(--ccic-blue-dark); }
.ccic-btn:disabled { opacity: 0.6; cursor: default; }

.ccic-gate-error {
	color: #b32d2e;
	font-size: 12.5px;
	min-height: 16px;
}

.ccic-gate-note {
	font-size: 11px;
	color: #888;
}

/* Footer / composer */
.ccic-footer {
	border-top: 1px solid var(--ccic-border);
	padding: 10px;
	display: flex;
	gap: 8px;
	background: #fff;
}

.ccic-footer textarea {
	flex: 1 1 auto;
	resize: none;
	border: 1px solid var(--ccic-border);
	border-radius: 10px;
	padding: 10px 12px;
	font-size: 14px;
	max-height: 100px;
	outline: none;
	font-family: inherit;
}

.ccic-footer textarea:focus {
	border-color: var(--ccic-blue);
	box-shadow: 0 0 0 3px rgba(62, 139, 218, 0.15);
}

.ccic-send {
	background: var(--ccic-blue);
	border: none;
	color: #fff;
	border-radius: 10px;
	width: 44px;
	cursor: pointer;
	font-size: 18px;
	flex: 0 0 auto;
}

.ccic-send:hover { background: var(--ccic-blue-dark); }
.ccic-send:disabled { opacity: 0.5; cursor: default; }

.ccic-hidden { display: none !important; }

@media (max-width: 480px) {
	.ccic-panel {
		right: 8px;
		bottom: 84px;
		width: calc(100vw - 16px);
		height: calc(100vh - 100px);
	}
	.ccic-launcher { right: 16px; bottom: 16px; }
}
