/* Website chat widget "Disha" — views/partials/webchat_widget.php + assets/js/webchat.js */
.zc-root {
	--zc-teal: #046461;
	--zc-teal-dark: #034c4a;
	--zc-mint: #eaf6f3;
	--zc-mint-2: #d7eee8;
	--zc-peach: #fdf1e8;
	--zc-text: #1e2d2c;
	--zc-muted: #5f7270;
	--zc-radius: 18px;
	--zc-shadow: 0 12px 36px rgba(4, 60, 58, 0.18), 0 2px 8px rgba(4, 60, 58, 0.08);
	--zc-bottom: 24px;
	--zc-right: 24px;
	font-family: inherit;
	color: var(--zc-text);
	-webkit-font-smoothing: antialiased;
}
.zc-root *, .zc-root *::before, .zc-root *::after { box-sizing: border-box; }
.zc-root[hidden], .zc-root [hidden] { display: none !important; }

/* Never compete with modals, the mobile nav or the guidance sheet. */
body.modal-open .zc-root,
body.home-guidance-modal-open .zc-root,
body.zen-nav-open .zc-root { display: none !important; }

/* ---------- Launcher ---------- */
.zc-launcher {
	position: fixed;
	right: var(--zc-right);
	bottom: var(--zc-bottom);
	z-index: 100000;
	width: 64px;
	height: 64px;
	padding: 0;
	border: 3px solid #fff;
	border-radius: 50%;
	background: var(--zc-mint);
	box-shadow: var(--zc-shadow);
	cursor: pointer;
	transition: transform .2s ease, box-shadow .2s ease;
	animation: zc-pop-in .35s ease-out both;
}
.zc-launcher:hover, .zc-launcher:focus-visible { transform: translateY(-2px) scale(1.04); outline: none; box-shadow: 0 16px 40px rgba(4, 60, 58, 0.26); }
.zc-launcher img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.zc-launcher::after {
	content: '';
	position: absolute;
	inset: -6px;
	border-radius: 50%;
	border: 2px solid rgba(4, 100, 97, 0.35);
	animation: zc-halo 2.4s ease-out infinite;
	pointer-events: none;
}
.zc-root.is-open .zc-launcher::after, .zc-root.is-engaged .zc-launcher::after { animation: none; border-color: transparent; }
.zc-online-dot {
	position: absolute;
	right: 1px;
	bottom: 3px;
	width: 14px;
	height: 14px;
	border-radius: 50%;
	background: #22c55e;
	border: 2px solid #fff;
}
.zc-badge {
	position: absolute;
	right: -4px;
	bottom: -2px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	background: linear-gradient(135deg, #0b8a84, #034c4a);
	border: 2px solid #fff;
	box-shadow: 0 2px 6px rgba(4, 60, 58, 0.25);
}
.zc-badge svg { width: 15px; height: 15px; display: block; }
.zc-unread {
	position: absolute;
	top: -4px;
	right: -4px;
	min-width: 20px;
	height: 20px;
	padding: 0 5px;
	border-radius: 10px;
	background: #f47322;
	color: #fff;
	font-size: 12px;
	font-weight: 600;
	line-height: 20px;
	text-align: center;
}

/* ---------- Teaser bubble ---------- */
.zc-teaser {
	position: fixed;
	right: var(--zc-right);
	bottom: calc(var(--zc-bottom) + 76px);
	z-index: 100000;
	width: 320px;
	max-width: calc(100vw - 28px);
	padding: 16px 16px 14px;
	border-radius: var(--zc-radius) var(--zc-radius) 6px var(--zc-radius);
	background: #fff;
	box-shadow: var(--zc-shadow);
	animation: zc-rise .4s ease-out both;
}
.zc-teaser__head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; padding-right: 22px; }
.zc-teaser__avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex: 0 0 36px; background: var(--zc-mint); }
.zc-teaser__name { font-size: 14px; font-weight: 600; line-height: 1.2; color: var(--zc-teal-dark); }
.zc-teaser__role { font-size: 12px; color: var(--zc-muted); line-height: 1.3; }
.zc-teaser__text { margin: 0 0 12px; font-size: 14px; line-height: 1.5; cursor: pointer; }
.zc-teaser__close {
	position: absolute;
	top: 8px;
	right: 8px;
	width: 28px;
	height: 28px;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--zc-muted);
	font-size: 20px;
	line-height: 28px;
	cursor: pointer;
}
.zc-teaser__close:hover, .zc-teaser__close:focus-visible { background: var(--zc-mint); outline: none; }

/* ---------- Quick replies ---------- */
.zc-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.zc-chip {
	padding: 7px 12px;
	border: 1px solid var(--zc-mint-2);
	border-radius: 16px;
	background: var(--zc-mint);
	color: var(--zc-teal-dark);
	font: inherit;
	font-size: 13px;
	line-height: 1.2;
	cursor: pointer;
	transition: background .15s ease, border-color .15s ease;
}
.zc-chip:hover, .zc-chip:focus-visible { background: var(--zc-mint-2); border-color: var(--zc-teal); outline: none; }

/* ---------- Panel ---------- */
.zc-panel {
	position: fixed;
	right: var(--zc-right);
	bottom: var(--zc-bottom);
	z-index: 100003;
	display: flex;
	flex-direction: column;
	width: 370px;
	height: min(560px, calc(100vh - 48px));
	border-radius: var(--zc-radius);
	background: #fff;
	box-shadow: var(--zc-shadow);
	overflow: hidden;
	animation: zc-rise .3s ease-out both;
}
.zc-panel__head {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 14px 12px 14px 16px;
	background: linear-gradient(135deg, #046461 0%, #0b7d77 100%);
	color: #fff;
}
.zc-panel__avatar-wrap { position: relative; flex: 0 0 44px; }
.zc-panel__avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(255, 255, 255, .85); background: var(--zc-mint); display: block; }
.zc-panel__avatar-wrap .zc-online-dot { right: -1px; bottom: 0; width: 12px; height: 12px; border-color: #046461; }
.zc-panel__who { flex: 1 1 auto; min-width: 0; }
.zc-panel__name { font-size: 16px; font-weight: 600; line-height: 1.2; }
.zc-panel__role { font-size: 12px; opacity: .9; line-height: 1.35; }
.zc-icon-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: #fff;
	cursor: pointer;
	text-decoration: none;
}
.zc-icon-btn:hover, .zc-icon-btn:focus-visible { background: rgba(255, 255, 255, .16); color: #fff; outline: none; }
.zc-icon-btn svg { width: 20px; height: 20px; }

.zc-messages {
	flex: 1 1 auto;
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 16px 14px 8px;
	background: linear-gradient(180deg, var(--zc-mint) 0%, #f7fbfa 140px, #fff 100%);
}
.zc-msg { display: flex; margin: 0 0 10px; }
.zc-msg--user { justify-content: flex-end; }
.zc-bubble {
	max-width: 84%;
	padding: 10px 13px;
	border-radius: 16px;
	font-size: 14px;
	line-height: 1.5;
	white-space: pre-line;
	word-wrap: break-word;
	overflow-wrap: anywhere;
}
.zc-msg--bot .zc-bubble { background: #fff; border: 1px solid var(--zc-mint-2); border-bottom-left-radius: 5px; overflow-wrap: anywhere; }
.zc-msg--bot .zc-bubble a { color: var(--zc-teal); font-weight: 600; text-decoration: underline; }
.zc-msg--user .zc-bubble { background: var(--zc-teal); color: #fff; border-bottom-right-radius: 5px; }
.zc-msg--note .zc-bubble { background: var(--zc-peach); border: 0; color: #6b4a33; font-size: 13px; }
.zc-msg-chips { margin: -2px 0 12px; }

.zc-typing { display: inline-flex; gap: 4px; padding: 12px 14px; }
.zc-typing span { width: 7px; height: 7px; border-radius: 50%; background: #8fb3ae; animation: zc-dot 1.2s infinite ease-in-out; }
.zc-typing span:nth-child(2) { animation-delay: .15s; }
.zc-typing span:nth-child(3) { animation-delay: .3s; }

/* ---------- Phone card ---------- */
.zc-phone-card {
	margin: 2px 0 12px;
	padding: 14px;
	border-radius: 14px;
	background: #fff;
	border: 1px solid var(--zc-mint-2);
	box-shadow: 0 4px 14px rgba(4, 60, 58, 0.08);
}
.zc-phone-card__title { margin: 0 0 10px; font-size: 13px; font-weight: 600; color: var(--zc-teal-dark); }
.zc-phone-row { display: flex; gap: 6px; }
.zc-phone-row select,
.zc-phone-row input {
	height: 42px;
	border: 1px solid #cfdfdc;
	border-radius: 10px;
	background: #fff;
	color: var(--zc-text);
	font: inherit;
	font-size: 15px;
}
.zc-phone-row select { flex: 0 0 82px; padding: 0 6px; }
.zc-phone-row input { flex: 1 1 auto; min-width: 0; padding: 0 12px; }
.zc-phone-row input:focus, .zc-phone-row select:focus { border-color: var(--zc-teal); outline: 2px solid rgba(4, 100, 97, .15); }
.zc-phone-error { margin: 6px 0 0; font-size: 12px; color: #c0392b; }
.zc-btn {
	display: block;
	width: 100%;
	margin-top: 10px;
	padding: 11px 14px;
	border: 0;
	border-radius: 10px;
	background: #f47322;
	color: #fff;
	font: inherit;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
}
.zc-btn:hover, .zc-btn:focus-visible { background: #e0631a; outline: none; }
.zc-btn[disabled] { opacity: .65; cursor: default; }
.zc-phone-alt { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 10px; font-size: 13px; }
.zc-link-wa { display: inline-flex; align-items: center; gap: 5px; color: #128c4a; font-weight: 600; text-decoration: none; }
.zc-link-wa:hover { text-decoration: underline; color: #0e7a3f; }
.zc-link-wa svg { width: 16px; height: 16px; }
.zc-link-later { border: 0; background: none; padding: 0; color: var(--zc-muted); font: inherit; font-size: 13px; text-decoration: underline; cursor: pointer; }
.zc-phone-trust { margin: 8px 0 0; font-size: 11px; color: var(--zc-muted); }

/* ---------- Composer ---------- */
.zc-composer {
	display: flex;
	align-items: flex-end;
	gap: 8px;
	padding: 10px 12px;
	border-top: 1px solid #e6efed;
	background: #fff;
}
.zc-composer textarea {
	flex: 1 1 auto;
	min-height: 42px;
	max-height: 110px;
	padding: 10px 12px;
	border: 1px solid #cfdfdc;
	border-radius: 12px;
	resize: none;
	overflow-y: hidden;
	font: inherit;
	font-size: 15px;
	line-height: 1.4;
	color: var(--zc-text);
}
.zc-composer textarea:focus { border-color: var(--zc-teal); outline: 2px solid rgba(4, 100, 97, .15); }
.zc-send {
	flex: 0 0 42px;
	width: 42px;
	height: 42px;
	border: 0;
	border-radius: 50%;
	background: var(--zc-teal);
	color: #fff;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}
.zc-send:hover, .zc-send:focus-visible { background: var(--zc-teal-dark); outline: none; }
.zc-send[disabled] { opacity: .5; cursor: default; }
.zc-send svg { width: 18px; height: 18px; }
.zc-foot { padding: 0 12px 8px; font-size: 11px; color: var(--zc-muted); text-align: center; background: #fff; }

/* ---------- Mobile: sit above the sticky tab bar (sticky-footer-bar.css) ---------- */
@media (max-width: 767px) {
	.zc-root { --zc-right: 14px; --zc-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
	.zc-launcher { width: 56px; height: 56px; }
	.zc-teaser { right: 12px; bottom: calc(var(--zc-bottom) + 66px); width: auto; left: 12px; max-width: none; }
	.zc-panel {
		right: 8px;
		left: 8px;
		top: calc(8px + env(safe-area-inset-top, 0px));
		bottom: calc(8px + env(safe-area-inset-bottom, 0px));
		width: auto;
		height: auto;
	}
	.zc-composer textarea, .zc-phone-row input, .zc-phone-row select { font-size: 16px; }
}
@media (min-width: 768px) and (max-height: 620px) {
	.zc-panel { height: calc(100vh - 32px); bottom: 16px; }
}
/* Short desktop screens: keep the teaser clear of the vertically centred .zh-desk-rail (88px wide, 236px tall). */
@media (min-width: 992px) and (max-height: 820px) {
	.zc-teaser { right: calc(var(--zc-right) + 80px); bottom: var(--zc-bottom); border-radius: var(--zc-radius) var(--zc-radius) 6px var(--zc-radius); }
}

@keyframes zc-pop-in { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes zc-rise { from { transform: translateY(14px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes zc-halo { 0% { transform: scale(.95); opacity: .9; } 70% { transform: scale(1.25); opacity: 0; } 100% { opacity: 0; } }
@keyframes zc-dot { 0%, 80%, 100% { transform: translateY(0); opacity: .5; } 40% { transform: translateY(-4px); opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
	.zc-launcher, .zc-teaser, .zc-panel, .zc-launcher::after, .zc-typing span { animation: none !important; }
}
