/* Kancelaria Chatbot – frontend */

.kc-chatbot-wrap {
	--kc-primary: #1a365d;
	--kc-primary-light: #2c5282;
	--kc-bg: #fff;
	--kc-bot-bg: #edf2f7;
	--kc-user-bg: #1a365d;
	--kc-text: #2d3748;
	--kc-shadow: 0 4px 20px rgba(0,0,0,.15);
	--kc-radius: 12px;
	--kc-trigger-size: 56px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, sans-serif;
	font-size: 15px;
	line-height: 1.5;
	box-sizing: border-box;
}

/* Motywy kolorów */
.kc-chatbot-wrap[data-theme="green"] {
	--kc-primary: #276749;
	--kc-primary-light: #2f855a;
	--kc-user-bg: #276749;
}
.kc-chatbot-wrap[data-theme="burgundy"] {
	--kc-primary: #702459;
	--kc-primary-light: #97266d;
	--kc-user-bg: #702459;
}
.kc-chatbot-wrap[data-theme="slate"] {
	--kc-primary: #334155;
	--kc-primary-light: #475569;
	--kc-user-bg: #334155;
	--kc-bot-bg: #e2e8f0;
}

.kc-chatbot-wrap *,
.kc-chatbot-wrap *::before,
.kc-chatbot-wrap *::after {
	box-sizing: border-box;
}

/* Tryb pływający – przycisk w rogu */
.kc-chatbot-floating {
	position: fixed;
	z-index: 999998;
}

/* Pozycja: prawy dolny (domyślna) */
.kc-chatbot-floating.kc-chatbot-pos-bottom-right {
	bottom: 20px;
	right: 20px;
}
.kc-chatbot-floating.kc-chatbot-pos-bottom-right .kc-chatbot-window {
	bottom: calc(var(--kc-trigger-size) + 12px);
	right: 0;
	top: auto;
	left: auto;
}

/* Pozycja: lewy dolny */
.kc-chatbot-floating.kc-chatbot-pos-bottom-left {
	bottom: 20px;
	left: 20px;
}
.kc-chatbot-floating.kc-chatbot-pos-bottom-left .kc-chatbot-window {
	bottom: calc(var(--kc-trigger-size) + 12px);
	left: 0;
	right: auto;
	top: auto;
}

/* Pozycja: prawy górny */
.kc-chatbot-floating.kc-chatbot-pos-top-right {
	top: 20px;
	right: 20px;
}
.kc-chatbot-floating.kc-chatbot-pos-top-right .kc-chatbot-window {
	top: calc(var(--kc-trigger-size) + 12px);
	right: 0;
	bottom: auto;
	left: auto;
}

/* Pozycja: lewy górny */
.kc-chatbot-floating.kc-chatbot-pos-top-left {
	top: 20px;
	left: 20px;
}
.kc-chatbot-floating.kc-chatbot-pos-top-left .kc-chatbot-window {
	top: calc(var(--kc-trigger-size) + 12px);
	left: 0;
	bottom: auto;
	right: auto;
}

.kc-chatbot-floating .kc-chatbot-trigger {
	width: var(--kc-trigger-size);
	height: var(--kc-trigger-size);
	border-radius: 50%;
	background: var(--kc-primary);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	box-shadow: var(--kc-shadow);
	transition: transform .2s, background .2s;
}

.kc-chatbot-floating .kc-chatbot-trigger:hover {
	background: var(--kc-primary-light);
	transform: scale(1.05);
}

.kc-chatbot-floating .kc-chatbot-trigger-label {
	display: none;
}

.kc-chatbot-floating .kc-chatbot-trigger-icon {
	width: 24px;
	height: 24px;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2'%3E%3Cpath d='M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z'/%3E%3C/svg%3E") center/contain no-repeat;
}

.kc-chatbot-floating .kc-chatbot-window {
	position: absolute;
	width: 380px;
	max-width: calc(100vw - 40px);
	height: 480px;
	max-height: 70vh;
	background: var(--kc-bg);
	border-radius: var(--kc-radius);
	box-shadow: var(--kc-shadow);
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.kc-chatbot-floating .kc-chatbot-window[hidden] {
	display: none !important;
}

.kc-chatbot-floating .kc-chatbot-window.kc-chatbot-open {
	display: flex !important;
}

/* Tryb inline (shortcode / widget) */
.kc-chatbot-inline {
	max-width: 420px;
	margin: 1em 0;
}

.kc-chatbot-inline .kc-chatbot-trigger {
	display: none;
}

.kc-chatbot-inline .kc-chatbot-window {
	width: 100%;
	height: 420px;
	border: 1px solid #e2e8f0;
	border-radius: var(--kc-radius);
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.kc-chatbot-inline .kc-chatbot-window[hidden] {
	display: none !important;
}

.kc-chatbot-inline .kc-chatbot-window.kc-chatbot-open {
	display: flex !important;
}

/* Wspólne: okno chatu */
.kc-chatbot-header {
	background: var(--kc-primary);
	color: #fff;
	padding: 14px 16px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-shrink: 0;
}

.kc-chatbot-title {
	margin: 0;
	font-size: 1em;
	font-weight: 600;
}

.kc-chatbot-close {
	background: none;
	border: none;
	color: inherit;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
	padding: 0 4px;
	opacity: .9;
}

.kc-chatbot-close:hover {
	opacity: 1;
}

.kc-chatbot-messages {
	flex: 1;
	overflow-y: auto;
	padding: 16px;
	background: #f7fafc;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.kc-chatbot-msg {
	max-width: 85%;
	align-self: flex-start;
}

.kc-chatbot-msg-user {
	align-self: flex-end;
}

.kc-chatbot-msg-content {
	padding: 10px 14px;
	border-radius: 14px;
	word-wrap: break-word;
}

.kc-chatbot-msg-bot .kc-chatbot-msg-content {
	background: var(--kc-bot-bg);
	color: var(--kc-text);
	border-bottom-left-radius: 4px;
}

.kc-chatbot-msg-user .kc-chatbot-msg-content {
	background: var(--kc-user-bg);
	color: #fff;
	border-bottom-right-radius: 4px;
}

.kc-chatbot-msg-content p {
	margin: 0 0 .5em;
}

.kc-chatbot-msg-content p:last-child {
	margin-bottom: 0;
}

.kc-chatbot-msg-loading .kc-chatbot-msg-content::after {
	content: '';
	display: inline-block;
	width: 8px;
	height: 8px;
	margin-left: 4px;
	background: currentColor;
	border-radius: 50%;
	animation: kc-blink 1s ease-in-out infinite;
}

@keyframes kc-blink {
	0%, 100% { opacity: .3; }
	50% { opacity: 1; }
}

.kc-chatbot-input-wrap {
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 12px 16px;
	background: var(--kc-bg);
	border-top: 1px solid #e2e8f0;
	flex-shrink: 0;
}

.kc-chatbot-suggestions {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.kc-chatbot-suggestions[hidden] {
	display: none !important;
}

.kc-chatbot-suggestion-chip {
	display: inline-block;
	padding: 6px 12px;
	background: var(--kc-bot-bg);
	color: var(--kc-text);
	border: 1px solid #cbd5e0;
	border-radius: 20px;
	font-size: 12px;
	font-family: inherit;
	cursor: pointer;
	white-space: nowrap;
	max-width: 100%;
	overflow: hidden;
	text-overflow: ellipsis;
	transition: background .15s, border-color .15s;
}

.kc-chatbot-suggestion-chip:hover {
	background: #e2e8f0;
	border-color: var(--kc-primary);
	color: var(--kc-primary);
}

.kc-chatbot-input-row {
	display: flex;
	gap: 8px;
}

.kc-chatbot-input {
	flex: 1;
	padding: 10px 14px;
	border: 1px solid #cbd5e0;
	border-radius: 8px;
	font-size: 14px;
	font-family: inherit;
	min-width: 0;
}

.kc-chatbot-input:focus {
	outline: none;
	border-color: var(--kc-primary);
	box-shadow: 0 0 0 2px rgba(26, 54, 93, .2);
}

.kc-chatbot-send {
	padding: 10px 18px;
	background: var(--kc-primary);
	color: #fff;
	border: none;
	border-radius: 8px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	white-space: nowrap;
}

.kc-chatbot-send:hover {
	background: var(--kc-primary-light);
}

.kc-chatbot-send:disabled {
	opacity: .6;
	cursor: not-allowed;
}

/* Blok leadów – przycisk i formularz */
.kc-chatbot-lead-block {
	margin-bottom: 8px;
}

.kc-chatbot-lead-cta {
	display: block;
	width: 100%;
	padding: 8px 12px;
	background: transparent;
	color: var(--kc-primary);
	border: 1px dashed var(--kc-primary);
	border-radius: 8px;
	font-size: 13px;
	font-family: inherit;
	cursor: pointer;
}

.kc-chatbot-lead-cta:hover {
	background: rgba(26, 54, 93, 0.06);
}

.kc-chatbot-lead-form {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.kc-chatbot-lead-form input,
.kc-chatbot-lead-form textarea {
	padding: 8px 12px;
	border: 1px solid #cbd5e0;
	border-radius: 6px;
	font-size: 13px;
	font-family: inherit;
}

.kc-chatbot-lead-form textarea {
	resize: vertical;
	min-height: 48px;
}

.kc-chatbot-lead-submit {
	align-self: flex-start;
	padding: 8px 16px;
	background: var(--kc-primary);
	color: #fff;
	border: none;
	border-radius: 6px;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
}

.kc-chatbot-lead-submit:hover:not(:disabled) {
	background: var(--kc-primary-light);
}

.kc-chatbot-lead-submit:disabled {
	opacity: 0.7;
	cursor: not-allowed;
}

.kc-chatbot-disclaimer {
	margin: 0;
	padding: 8px 16px 12px;
	font-size: 11px;
	color: #718096;
	background: var(--kc-bg);
	border-top: 1px solid #e2e8f0;
}
