/* ELKA Quote Chat — front widget */

.elka-quote-chat {
	--elka-qc-text: #1f2940;
	--elka-qc-muted: #6d7382;
	--elka-qc-accent: #c62828;
	--elka-qc-accent-dark: #a61a31;
	--elka-qc-navy: #1e263c;
	--elka-qc-surface: #ffffff;
	--elka-qc-bg: #f7f5f0;
	--elka-qc-border: #ebe4da;
	--elka-qc-shadow: 0 18px 48px rgba(26, 34, 54, 0.16);
	--elka-qc-font: "Poppins", Inter, "Segoe UI", Roboto, Arial, sans-serif;
	--elka-qc-radius: 10px;
	font-family: var(--elka-qc-font);
	color: var(--elka-qc-text);
}

.elka-quote-chat__launcher {
	position: fixed;
	right: 0;
	top: 50%;
	transform: translateY(-50%);
	z-index: 2147483000;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: flex-start;
	gap: 10px;
	margin: 0;
	padding: 16px 10px;
	border: 0;
	border-radius: var(--elka-qc-radius) 0 0 var(--elka-qc-radius);
	background: var(--elka-qc-accent);
	color: #fff;
	cursor: pointer;
	box-shadow: var(--elka-qc-shadow);
	box-sizing: border-box;
	font-size: 14px !important;
	font-weight: 600;
	line-height: 1;
	letter-spacing: 0.08em !important;
	text-transform: uppercase;
	transition: background 0.2s ease;
}

.elka-quote-chat[data-lang="de"] .elka-quote-chat__launcher {
	padding: 16px 9px;
	font-size: 12px;
}

.elka-quote-chat[data-lang="en"] .elka-quote-chat__launcher {
	padding: 16px 9px;
	font-size: 12px;
}

.elka-quote-chat__launcher:hover,
.elka-quote-chat__launcher:focus-visible {
	background: var(--elka-qc-accent-dark);
	outline: 2px solid #fff;
	outline-offset: 2px;
}

.elka-quote-chat__launcher-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: 16px !important;
	height: 28px;
	line-height: 0;
}

.elka-quote-chat__launcher-icon svg {
	display: block;
	width: 24px;
	height: 24px;
	flex-shrink: 0;
}

.elka-quote-chat__launcher-label {
	display: block;
	flex-shrink: 0;
	-webkit-writing-mode: vertical-rl;
	writing-mode: vertical-rl;
	-webkit-text-orientation: upright;
	text-orientation: upright;
	text-align: center;
	white-space: nowrap;
	line-height: 1;
	letter-spacing: 0.01em !important;
}

.elka-quote-chat[data-lang="de"] .elka-quote-chat__launcher-label,
.elka-quote-chat[data-lang="en"] .elka-quote-chat__launcher-label {
	letter-spacing: 0.06em;
}

.elka-quote-chat__overlay {
	position: fixed;
	inset: 0;
	z-index: 2147483001;
	background: rgba(30, 38, 60, 0.42);
}

.elka-quote-chat__overlay[hidden],
.elka-quote-chat__panel[hidden],
.elka-quote-chat__step[hidden] {
	display: none !important;
}

.elka-quote-chat__panel {
	position: fixed;
	top: 0;
	right: 0;
	z-index: 2147483002;
	display: flex;
	flex-direction: column;
	width: min(420px, 100vw);
	height: 100%;
	background: var(--elka-qc-surface);
	box-shadow: var(--elka-qc-shadow);
	transform: translateX(0);
}

.elka-quote-chat__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 18px 18px 14px;
	border-bottom: 1px solid var(--elka-qc-border);
	background: linear-gradient(180deg, #fbfaf7 0%, #fff 100%);
}

.elka-quote-chat__title {
	margin: 0;
	font-size: 1.15rem;
	font-weight: 700;
	letter-spacing: -0.02em;
	color: var(--elka-qc-navy);
}

.elka-quote-chat__close {
	border: 0;
	background: transparent;
	color: var(--elka-qc-muted);
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
	padding: 4px 8px;
}

.elka-quote-chat__close:focus-visible {
	outline: 2px solid var(--elka-qc-accent);
	outline-offset: 2px;
}

.elka-quote-chat__body {
	display: flex;
	flex-direction: column;
	gap: 14px;
	padding: 18px;
	overflow: auto;
	flex: 1;
	background: var(--elka-qc-bg);
}

.elka-quote-chat__intro,
.elka-quote-chat__help,
.elka-quote-chat__hint,
.elka-quote-chat__thanks {
	margin: 0;
	color: var(--elka-qc-muted);
	font-size: 0.92rem;
	line-height: 1.45;
}

.elka-quote-chat__label {
	display: block;
	margin-bottom: 6px;
	font-size: 0.78rem;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--elka-qc-navy);
}

.elka-quote-chat__textarea,
.elka-quote-chat__input {
	width: 100%;
	box-sizing: border-box;
	margin-bottom: 12px;
	padding: 12px 14px;
	border: 1px solid var(--elka-qc-border);
	border-radius: 8px;
	background: #fff;
	color: var(--elka-qc-text);
	font: inherit;
	font-size: 0.95rem;
	resize: vertical;
}

.elka-quote-chat__textarea:focus,
.elka-quote-chat__input:focus {
	outline: 2px solid rgba(198, 40, 40, 0.35);
	border-color: var(--elka-qc-accent);
}

.elka-quote-chat__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	margin: 0;
	padding: 14px 20px;
	border: 0;
	border-radius: 6px;
	font: inherit;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 1.2px;
	text-transform: uppercase;
	cursor: pointer;
	transition: background 0.2s ease;
}

.elka-quote-chat__btn--primary {
	background: var(--elka-qc-accent);
	color: #fff;
}

.elka-quote-chat__btn--primary:hover,
.elka-quote-chat__btn--primary:focus-visible {
	background: var(--elka-qc-accent-dark);
}

.elka-quote-chat__btn:disabled {
	opacity: 0.65;
	cursor: wait;
}

.elka-quote-chat__btn:focus-visible {
	outline: 2px solid var(--elka-qc-navy);
	outline-offset: 2px;
}

.elka-quote-chat__linkbtn {
	display: inline-block;
	margin: 0 0 10px;
	padding: 0;
	border: 0;
	background: none;
	color: var(--elka-qc-accent);
	font: inherit;
	font-size: 0.9rem;
	text-decoration: underline;
	cursor: pointer;
}

.elka-quote-chat__check {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin: 8px 0 16px;
	font-size: 0.9rem;
	color: var(--elka-qc-text);
}

.elka-quote-chat__check a {
	color: var(--elka-qc-accent);
}

.elka-quote-chat__preview {
	margin-bottom: 8px;
	padding: 12px 14px;
	border-radius: 8px;
	background: #fff;
	border: 1px solid var(--elka-qc-border);
	white-space: pre-wrap;
	font-size: 0.95rem;
}

.elka-quote-chat__errors:empty {
	display: none;
}

.elka-quote-chat__errors {
	padding: 10px 12px;
	border-radius: 8px;
	background: #fdecec;
	color: #8a1f1f;
	font-size: 0.9rem;
}

.elka-quote-chat__hp {
	position: absolute !important;
	left: -10000px !important;
	width: 1px !important;
	height: 1px !important;
	overflow: hidden !important;
}

.elka-quote-chat__thread {
	display: flex;
	flex-direction: column;
	gap: 10px;
	max-height: 42vh;
	overflow: auto;
	margin-bottom: 8px;
	padding: 4px;
}

.elka-quote-chat__bubble {
	max-width: 92%;
	padding: 10px 12px;
	border-radius: 10px;
	font-size: 0.92rem;
	line-height: 1.4;
	white-space: pre-wrap;
	word-break: break-word;
}

.elka-quote-chat__bubble--visitor {
	align-self: flex-end;
	background: #fff;
	border: 1px solid var(--elka-qc-border);
}

.elka-quote-chat__bubble--agent {
	align-self: flex-start;
	background: var(--elka-qc-navy);
	color: #fff;
}

.elka-quote-chat__bubble-meta {
	display: block;
	margin-bottom: 4px;
	font-size: 0.72rem;
	opacity: 0.75;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

body.elka-quote-chat--open {
	overflow: hidden;
}

@media (max-width: 767px) {
	.elka-quote-chat__launcher {
		right: 16px;
		bottom: calc(16px + env(safe-area-inset-bottom, 0px));
		top: auto;
		transform: none;
		flex-direction: row;
		border-radius: 999px;
		padding: 12px 16px;
		gap: 8px;
		font-size: 11px;
		letter-spacing: 0.04em;
	}

	.elka-quote-chat__launcher-label {
		-webkit-writing-mode: horizontal-tb;
		writing-mode: horizontal-tb;
		-webkit-text-orientation: initial;
		text-orientation: initial;
		text-align: left;
		max-width: 9.5em;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
		line-height: 1.2;
		letter-spacing: 0.04em;
	}

	.elka-quote-chat__panel {
		top: auto;
		bottom: 0;
		width: 100%;
		height: min(92vh, 100%);
		border-radius: 16px 16px 0 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	.elka-quote-chat__launcher,
	.elka-quote-chat__btn {
		transition: none;
	}
}
