/* Chat Form — conversational form UI */

.cerka-chat {
	max-width: 760px;
	margin: 0 auto;
	display: flex;
	flex-direction: column;
	background: #f8f7f5;
	border: 1px solid #e5e3df;
	border-radius: 20px;
	overflow: hidden;
}

/* ── Progress ── */

.cerka-chat__progress {
	padding: 12px 24px;
	font-size: 0.8rem;
	color: #888;
	text-align: right;
	letter-spacing: 0.02em;
}

/* ── Messages area ── */

.cerka-chat__messages {
	flex: 1;
	overflow-y: auto;
	padding: 28px 24px 12px;
	max-height: 65vh;
	min-height: 300px;
	scroll-behavior: smooth;
}

/* ── Message wrappers ── */

.cerka-chat__message {
	display: flex;
	align-items: flex-end;
	margin-bottom: 14px;
	gap: 10px;
}

.cerka-chat__message--bot {
	justify-content: flex-start;
}

.cerka-chat__message--user {
	justify-content: flex-end;
}

/* ── Animation ── */

.cerka-chat__message--animate {
	animation: cerka-chat-slide-in 0.3s ease-out both;
}

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

/* ── Avatar ── */

.cerka-chat .cerka-chat__avatar {
	flex-shrink: 0;
	width: 32px !important;
	height: 32px !important;
	border-radius: 50%;
	object-fit: cover;
}

/* ── Bubbles ── */

.cerka-chat__bubble {
	padding: 14px 18px;
	border-radius: 18px;
	max-width: 85%;
	line-height: 1.55;
	font-size: 1rem;
	font-family: Archivo, sans-serif;
	word-break: break-word;
}

.cerka-chat__message--bot .cerka-chat__bubble {
	background: #fff;
	color: #2c2c2c;
	border-radius: 18px 18px 18px 4px;
}

.cerka-chat__message--user .cerka-chat__bubble {
	background: #015947;
	color: #fff;
	border-radius: 18px 18px 4px 18px;
}

/* ── Typing indicator ── */

.cerka-chat__typing {
	display: flex;
	gap: 5px;
	padding: 14px 20px;
	background: #fff;
	border-radius: 18px 18px 18px 4px;
}

.cerka-chat__typing span {
	width: 8px;
	height: 8px;
	background: #aaa;
	border-radius: 50%;
	animation: cerka-chat-dot 1.2s ease-in-out infinite;
}

.cerka-chat__typing span:nth-child(2) {
	animation-delay: 0.15s;
}

.cerka-chat__typing span:nth-child(3) {
	animation-delay: 0.3s;
}

@keyframes cerka-chat-dot {
	0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
	30% { transform: translateY(-6px); opacity: 1; }
}

/* ── Input area ── */

.cerka-chat__input-area {
	padding: 20px 24px 20px;
	background: #efedea;
	border-radius: 0 0 20px 20px;
}

.cerka-chat__input-area:empty {
	background: transparent;
	padding: 0;
}

.cerka-chat__input-row {
	display: flex;
	gap: 10px;
	align-items: flex-end;
}

.cerka-chat .cerka-chat__input {
	flex: 1;
	padding: 13px 18px !important;
	border: 1px solid #ddd !important;
	border-radius: 10px !important;
	font-size: 1rem !important;
	font-family: Archivo, sans-serif !important;
	background: #fff !important;
	color: #2c2c2c !important;
	outline: none;
	transition: border-color 0.2s;
	-webkit-appearance: none;
	box-shadow: none !important;
}

.cerka-chat .cerka-chat__input:focus {
	border-color: #015947 !important;
}

.cerka-chat .cerka-chat__input--textarea {
	resize: vertical;
	min-height: 70px;
}

/* Send button — must override Elementor global button styles */
.cerka-chat .cerka-chat__send {
	width: 46px !important;
	height: 46px !important;
	min-width: 46px !important;
	flex-shrink: 0;
	border: none !important;
	border-radius: 10px !important;
	background: #015947 !important;
	color: #fff !important;
	cursor: pointer;
	display: flex !important;
	align-items: center;
	justify-content: center;
	transition: background 0.2s;
	padding: 0 !important;
	line-height: 1 !important;
}

.cerka-chat .cerka-chat__send svg {
	color: #fff !important;
	stroke: #fff !important;
	fill: none !important;
	width: 20px !important;
	height: 20px !important;
	display: block;
}

.cerka-chat .cerka-chat__send:hover {
	background: #01483b !important;
}

/* ── Error ── */

.cerka-chat__error {
	display: none;
	color: #d32f2f;
	font-size: 0.85rem;
	padding: 6px 18px 0;
}

.cerka-chat__error-msg {
	color: #d32f2f;
}

/* ── Card select — must override Elementor button styles ── */

.cerka-chat .cerka-chat__cards {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.cerka-chat .cerka-chat__card {
	padding: 11px 18px !important;
	border: 1px solid #e0ddd8 !important;
	border-radius: 10px !important;
	background: #fff !important;
	font-size: 0.95rem !important;
	font-family: Archivo, sans-serif !important;
	color: #2c2c2c !important;
	cursor: pointer;
	text-align: left !important;
	line-height: 1.4 !important;
	transition: border-color 0.2s, background 0.2s, color 0.2s;
	flex: 1 1 auto;
	min-width: 45%;
	white-space: normal !important;
	overflow: visible !important;
	text-overflow: clip !important;
	text-transform: none !important;
	letter-spacing: normal !important;
	box-shadow: none !important;
}

@media (hover: hover) {
	.cerka-chat .cerka-chat__card:hover {
		border-color: #015947 !important;
		background: #eaf5f2 !important;
		color: #015947 !important;
	}

	.cerka-chat .cerka-chat__card--selected:hover {
		background: #01483b !important;
		color: #fff !important;
	}

	.cerka-chat .cerka-chat__card--primary:hover {
		background: #a80087 !important;
		border-color: #a80087 !important;
		color: #fff !important;
	}
}

.cerka-chat .cerka-chat__card--selected {
	border-color: #015947 !important;
	background: #015947 !important;
	color: #fff !important;
}

/* Primary card (submit, confirm actions) — magenta */
.cerka-chat .cerka-chat__card--primary {
	background: #C6009F !important;
	color: #fff !important;
	border-color: #C6009F !important;
}

/* ── Confirm / Skip ── */

.cerka-chat .cerka-chat__confirm-row {
	display: flex;
	gap: 10px;
	margin-top: 10px;
	align-items: center;
}

.cerka-chat .cerka-chat__confirm {
	padding: 11px 24px !important;
	border: none !important;
	border-radius: 10px !important;
	background: #015947 !important;
	color: #fff !important;
	font-size: 1rem !important;
	font-family: Archivo, sans-serif !important;
	cursor: pointer;
	transition: background 0.2s, opacity 0.2s;
	box-shadow: none !important;
	text-transform: none !important;
	letter-spacing: normal !important;
}

.cerka-chat .cerka-chat__confirm:disabled {
	opacity: 0.4;
	cursor: default;
}

.cerka-chat .cerka-chat__confirm:not(:disabled):hover {
	background: #01483b !important;
}

.cerka-chat .cerka-chat__skip {
	padding: 11px 18px !important;
	border: none !important;
	border-radius: 10px !important;
	background: transparent !important;
	color: #888 !important;
	font-size: 1rem !important;
	font-family: Archivo, sans-serif !important;
	cursor: pointer;
	transition: color 0.2s;
	box-shadow: none !important;
	text-transform: none !important;
}

.cerka-chat .cerka-chat__skip:hover {
	color: #2c2c2c !important;
}

/* ── Responsive: Tablet ── */

@media (max-width: 1024px) {
	.cerka-chat__messages {
		max-height: 60vh;
	}
}

/* ── Responsive: Mobile ── */

@media (max-width: 767px) {
	.cerka-chat {
		border-radius: 14px;
		margin: 0 5px;
	}

	.cerka-chat__messages {
		padding: 20px 16px 8px;
		max-height: 55vh;
		min-height: 250px;
	}

	.cerka-chat__input-area {
		padding: 12px 16px 16px;
	}

	.cerka-chat__bubble {
		max-width: 90%;
		padding: 12px 16px;
	}

	.cerka-chat .cerka-chat__card {
		min-width: 100% !important;
	}
}

/* ── Reduced motion ── */

@media (prefers-reduced-motion: reduce) {
	.cerka-chat__message--animate {
		animation: none;
	}

	.cerka-chat__typing span {
		animation: none;
		opacity: 0.6;
	}

	.cerka-chat__messages {
		scroll-behavior: auto;
	}
}
