/**
 * Asystent AlleZoo - chat widget
 * Modern Bright, brand #26B170
 */

:root {
	--azc-brand: #26B170;
	--azc-brand-dark: #1f9560;
	--azc-bg: #ffffff;
	--azc-text: #1e293b;
	--azc-muted: #64748b;
	--azc-border: #e5e7eb;
	--azc-bubble-user: #26B170;
	--azc-bubble-bot: #f1f5f9;
	--azc-radius: 16px;
	--azc-shadow: 0 12px 48px rgba(15,23,42,.18);
	--azc-z: 9990;
}

.azchat[hidden] { display: none; }
.azchat [hidden] { display: none !important; }

.azchat {
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: var(--azc-z);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Arial, sans-serif;
	color: var(--azc-text);
}

/* === BUBBLE === */
.azchat-bubble {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 14px 18px 14px 14px;
	background: var(--azc-brand);
	color: #fff;
	border: 0;
	border-radius: 999px;
	cursor: pointer;
	box-shadow: var(--azc-shadow);
	font-size: 14px;
	font-weight: 600;
	transition: transform .15s ease, background .15s ease;
}
.azchat-bubble:hover { background: var(--azc-brand-dark); transform: translateY(-2px); }
.azchat-bubble svg { flex: none; }
.azchat-bubble__label { line-height: 1; }
.azchat[data-azchat-open="1"] .azchat-bubble { display: none; }

@media (max-width: 480px) {
	.azchat-bubble__label { display: none; }
	.azchat-bubble { padding: 14px; }
}

/* === PANEL === */
.azchat-panel {
	position: absolute;
	right: 0;
	bottom: 0;
	width: 380px;
	max-width: calc(100vw - 24px);
	height: 560px;
	max-height: calc(100vh - 24px);
	background: var(--azc-bg);
	border-radius: var(--azc-radius);
	box-shadow: var(--azc-shadow);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	animation: azcSlideIn .2s ease-out;
}
.azchat-panel[hidden] { display: none; }

@keyframes azcSlideIn {
	from { opacity: 0; transform: translateY(20px); }
	to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 600px) {
	.azchat { right: 0; bottom: 0; }
	.azchat-panel {
		width: 100vw;
		max-width: 100vw;
		height: 100vh;
		max-height: 100vh;
		border-radius: 0;
	}
}

/* === HEADER === */
.azchat-panel__header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 14px 16px;
	background: linear-gradient(135deg, #26B170 0%, #1f9560 100%);
	color: #fff;
}
.azchat-panel__title {
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 14px;
	line-height: 1.2;
}
.azchat-panel__title strong { display: block; font-size: 15px; }
.azchat-panel__title small { font-size: 11px; opacity: .85; }
.azchat-panel__avatar {
	display: inline-flex;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: rgba(255,255,255,.18);
	align-items: center;
	justify-content: center;
	flex: none;
}
.azchat-panel__close {
	background: rgba(255,255,255,.15);
	border: 0;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	color: #fff;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: background .15s;
}
.azchat-panel__close:hover { background: rgba(255,255,255,.28); }

/* === VERIFY FORM === */
.azchat-verify {
	flex: 1;
	overflow-y: auto;
	padding: 20px 18px;
	display: flex;
	flex-direction: column;
	gap: 14px;
}
.azchat-verify__msg { font-size: 13px; line-height: 1.5; color: var(--azc-muted); }
.azchat-verify__msg strong { color: var(--azc-text); font-size: 14px; display: block; margin-bottom: 4px; }
.azchat-verify__field { display: flex; flex-direction: column; gap: 4px; }
.azchat-verify__field span { font-size: 12px; font-weight: 600; color: var(--azc-text); }
.azchat-verify__field input {
	border: 1px solid var(--azc-border);
	border-radius: 10px;
	padding: 10px 12px;
	font-size: 14px;
	outline: none;
	transition: border-color .15s;
}
.azchat-verify__field input:focus { border-color: var(--azc-brand); }
.azchat-verify__error {
	font-size: 13px;
	color: #b91c1c;
	background: #fee2e2;
	padding: 8px 12px;
	border-radius: 8px;
}
.azchat-verify__submit {
	background: var(--azc-brand);
	color: #fff;
	border: 0;
	padding: 11px 16px;
	border-radius: 10px;
	font-weight: 600;
	cursor: pointer;
	font-size: 14px;
	transition: background .15s;
}
.azchat-verify__submit:hover { background: var(--azc-brand-dark); }
.azchat-verify__submit:disabled { opacity: .6; cursor: not-allowed; }
.azchat-verify__alt {
	text-align: center;
	font-size: 12px;
	color: var(--azc-muted);
	padding-top: 8px;
	border-top: 1px solid var(--azc-border);
}
.azchat-verify__alt a { color: var(--azc-brand); text-decoration: underline; }

/* === CONVERSATION === */
.azchat-conv {
	flex: 1;
	display: flex;
	flex-direction: column;
	overflow: hidden;
}
.azchat-messages {
	flex: 1;
	overflow-y: auto;
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	background: #fafbfc;
}
.azchat-msg {
	max-width: 85%;
	padding: 10px 14px;
	border-radius: 14px;
	font-size: 14px;
	line-height: 1.4;
	word-wrap: break-word;
}
.azchat-msg--user {
	align-self: flex-end;
	background: var(--azc-bubble-user);
	color: #fff;
	border-bottom-right-radius: 4px;
}
.azchat-msg--bot {
	align-self: flex-start;
	background: var(--azc-bubble-bot);
	color: var(--azc-text);
	border-bottom-left-radius: 4px;
}
.azchat-msg--system {
	align-self: center;
	background: transparent;
	color: var(--azc-muted);
	font-size: 12px;
	max-width: 100%;
	text-align: center;
}
.azchat-actions {
	align-self: flex-start;
	max-width: 90%;
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: -4px;
}
.azchat-action {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 6px 12px;
	background: #fff;
	border: 1px solid var(--azc-brand);
	color: var(--azc-brand);
	border-radius: 999px;
	font-size: 12px;
	font-weight: 600;
	text-decoration: none;
	transition: background .15s;
}
.azchat-action:hover { background: var(--azc-brand); color: #fff; }

.azchat-typing {
	padding: 0 16px 8px;
	display: flex;
	gap: 4px;
	align-self: flex-start;
}
.azchat-typing span {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--azc-muted);
	animation: azcTyping 1.2s infinite;
}
.azchat-typing span:nth-child(2) { animation-delay: .2s; }
.azchat-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes azcTyping {
	0%, 60%, 100% { opacity: .3; transform: translateY(0); }
	30% { opacity: 1; transform: translateY(-4px); }
}

/* === INPUT === */
.azchat-input {
	display: flex;
	gap: 8px;
	padding: 12px;
	border-top: 1px solid var(--azc-border);
	background: #fff;
}
.azchat-input[hidden] { display: none; }
.azchat-input textarea {
	flex: 1;
	border: 1px solid var(--azc-border);
	border-radius: 18px;
	padding: 9px 14px;
	font-size: 14px;
	font-family: inherit;
	resize: none;
	max-height: 100px;
	outline: none;
	transition: border-color .15s;
}
.azchat-input textarea:focus { border-color: var(--azc-brand); }
.azchat-input button {
	background: var(--azc-brand);
	color: #fff;
	border: 0;
	width: 38px;
	height: 38px;
	border-radius: 50%;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: background .15s;
	flex: none;
	align-self: flex-end;
}
.azchat-input button:hover { background: var(--azc-brand-dark); }
.azchat-input button:disabled { opacity: .5; cursor: not-allowed; }

/* === FOOTER === */
.azchat-panel__footer {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 6px 14px;
	background: #fff;
	border-top: 1px solid var(--azc-border);
	font-size: 11px;
	color: var(--azc-muted);
}
.azchat-clear {
	background: transparent;
	border: 0;
	color: var(--azc-muted);
	cursor: pointer;
	font-size: 11px;
	text-decoration: underline;
}
.azchat-clear:hover { color: var(--azc-text); }
.azchat-panel__powered a { color: var(--azc-muted); text-decoration: none; }
.azchat-panel__powered a:hover { color: var(--azc-brand); }
