/* ============================================================
   CISSA — Assistente Virtual do CISAB — widget de chat
   ============================================================ */

.cissa-root {
	--cissa-primary: #0F5FA6;
	--cissa-primary-dark: color-mix(in srgb, var(--cissa-primary) 82%, #000);
	--cissa-text: #1f2937;
	--cissa-bot-bg: #f1f5f9;
	--cissa-radius: 18px;
	position: fixed;
	z-index: 2147483000;
	right: 22px;
	bottom: 22px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ---- Botão flutuante (bolha) ---- */
.cissa-launcher {
	width: 62px;
	height: 62px;
	border-radius: 50%;
	border: none;
	cursor: pointer;
	background: var(--cissa-primary);
	color: #fff;
	box-shadow: 0 8px 24px rgba(15, 23, 42, 0.28);
	display: flex;
	align-items: center;
	justify-content: center;
	transition: transform .18s ease, box-shadow .18s ease;
	padding: 0;
}
.cissa-launcher:hover { transform: translateY(-2px) scale(1.04); box-shadow: 0 12px 30px rgba(15, 23, 42, 0.34); }
.cissa-launcher svg { width: 30px; height: 30px; }
.cissa-launcher .cissa-ico-close { display: none; }
.cissa-root.cissa-open .cissa-launcher .cissa-ico-open { display: none; }
.cissa-root.cissa-open .cissa-launcher .cissa-ico-close { display: block; }

/* selo de "novo" */
.cissa-badge {
	position: absolute;
	top: -3px; right: -3px;
	min-width: 18px; height: 18px;
	background: #ef4444; color: #fff;
	border-radius: 999px;
	font-size: 11px; font-weight: 700;
	display: flex; align-items: center; justify-content: center;
	border: 2px solid #fff;
}
.cissa-root.cissa-open .cissa-badge { display: none; }

/* ---- Janela do chat ---- */
.cissa-panel {
	position: absolute;
	right: 0;
	bottom: 78px;
	width: 372px;
	max-width: calc(100vw - 44px);
	height: 540px;
	max-height: calc(100vh - 120px);
	background: #fff;
	border-radius: var(--cissa-radius);
	box-shadow: 0 18px 50px rgba(15, 23, 42, 0.30);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	opacity: 0;
	transform: translateY(12px) scale(.98);
	pointer-events: none;
	transition: opacity .2s ease, transform .2s ease;
}
.cissa-root.cissa-open .cissa-panel {
	opacity: 1;
	transform: translateY(0) scale(1);
	pointer-events: auto;
}

/* ---- Cabeçalho ---- */
.cissa-header {
	background: linear-gradient(135deg, var(--cissa-primary), var(--cissa-primary-dark));
	color: #fff;
	padding: 14px 16px;
	display: flex;
	align-items: center;
	gap: 12px;
}
.cissa-avatar {
	width: 40px; height: 40px;
	border-radius: 50%;
	background: rgba(255,255,255,.18);
	display: flex; align-items: center; justify-content: center;
	flex: 0 0 auto;
}
.cissa-avatar svg { width: 24px; height: 24px; }
.cissa-htext { line-height: 1.2; flex: 1 1 auto; min-width: 0; }
.cissa-htext strong { display: block; font-size: 16px; font-weight: 700; }
.cissa-htext span { font-size: 12px; opacity: .85; display: flex; align-items: center; gap: 5px; }
.cissa-dot { width: 8px; height: 8px; border-radius: 50%; background: #34d399; display: inline-block; }
.cissa-min {
	background: transparent; border: none; color: #fff; cursor: pointer;
	opacity: .85; padding: 4px; border-radius: 6px; line-height: 0;
}
.cissa-min:hover { opacity: 1; background: rgba(255,255,255,.15); }

/* ---- Corpo / mensagens ---- */
.cissa-body {
	flex: 1 1 auto;
	overflow-y: auto;
	padding: 16px;
	background: #fbfcfe;
	display: flex;
	flex-direction: column;
	gap: 10px;
}
.cissa-msg {
	max-width: 82%;
	padding: 10px 13px;
	border-radius: 14px;
	font-size: 14.5px;
	line-height: 1.5;
	color: var(--cissa-text);
	word-wrap: break-word;
	white-space: normal;
}
.cissa-msg a { color: var(--cissa-primary); font-weight: 600; text-decoration: underline; }
.cissa-msg.cissa-bot {
	background: var(--cissa-bot-bg);
	border-bottom-left-radius: 4px;
	align-self: flex-start;
}
.cissa-msg.cissa-user {
	background: var(--cissa-primary);
	color: #fff;
	border-bottom-right-radius: 4px;
	align-self: flex-end;
}
.cissa-msg.cissa-user a { color: #fff; }

/* indicador "digitando" */
.cissa-typing { display: inline-flex; gap: 4px; align-items: center; }
.cissa-typing i {
	width: 7px; height: 7px; border-radius: 50%; background: #94a3b8;
	animation: cissa-bounce 1.2s infinite ease-in-out;
}
.cissa-typing i:nth-child(2) { animation-delay: .15s; }
.cissa-typing i:nth-child(3) { animation-delay: .30s; }
@keyframes cissa-bounce {
	0%, 60%, 100% { transform: translateY(0); opacity: .5; }
	30% { transform: translateY(-5px); opacity: 1; }
}

/* ---- Rodapé / input ---- */
.cissa-foot {
	border-top: 1px solid #eef2f7;
	padding: 10px;
	display: flex;
	gap: 8px;
	align-items: flex-end;
	background: #fff;
}
.cissa-foot textarea {
	flex: 1 1 auto;
	resize: none;
	border: 1px solid #dfe6ee;
	border-radius: 12px;
	padding: 10px 12px;
	font-size: 14.5px;
	font-family: inherit;
	max-height: 96px;
	line-height: 1.4;
	outline: none;
	color: var(--cissa-text);
}
.cissa-foot textarea:focus { border-color: var(--cissa-primary); }
.cissa-send {
	flex: 0 0 auto;
	width: 42px; height: 42px;
	border-radius: 50%;
	border: none;
	background: var(--cissa-primary);
	color: #fff;
	cursor: pointer;
	display: flex; align-items: center; justify-content: center;
	transition: opacity .15s ease, transform .15s ease;
}
.cissa-send:hover { transform: scale(1.06); }
.cissa-send:disabled { opacity: .45; cursor: default; transform: none; }
.cissa-send svg { width: 20px; height: 20px; }

.cissa-credit {
	text-align: center;
	font-size: 10.5px;
	color: #9aa5b1;
	padding: 0 0 8px;
	background: #fff;
}
.cissa-credit a { color: #9aa5b1; text-decoration: none; }

/* ---- Mobile ---- */
@media (max-width: 480px) {
	.cissa-root { right: 14px; bottom: 14px; }
	.cissa-panel {
		width: calc(100vw - 20px);
		height: calc(100vh - 92px);
		right: -6px;
		bottom: 74px;
	}
}
