.aurachat-modal {
	position: fixed;
	z-index: 999999;
	inset: 0;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 16px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.aurachat-modal.is-open {
	display: flex;
}

.aurachat-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(15, 23, 42, 0.48);
}

.aurachat-dialog {
	position: relative;
	display: flex;
	flex-direction: column;
	width: min(400px, 100%);
	height: min(600px, calc(100vh - 32px));
	overflow: hidden;
	border-radius: 16px;
	background: #fff;
	box-shadow: 0 16px 48px rgba(15, 23, 42, 0.24);
}

.aurachat-dialog [hidden] {
	display: none !important;
}

.aurachat-lead-step {
	flex: 1;
	overflow-y: auto;
	padding: 20px;
	background: #f8fafc;
}

.aurachat-lead-intro {
	margin: 0 0 16px;
	color: #1e293b;
	font-size: 15px;
}

.aurachat-lead-form {
	display: grid;
	gap: 8px;
}

.aurachat-lead-form > label:not(.aurachat-consent) {
	margin-top: 4px;
	color: #1e293b;
	font-size: 13px;
	font-weight: 600;
}

.aurachat-lead-form input[type="text"],
.aurachat-lead-form input[type="tel"],
.aurachat-lead-form input[type="email"] {
	box-sizing: border-box;
	width: 100%;
	min-height: 40px;
	padding: 8px 10px;
	border: 1px solid #cbd5e1;
	border-radius: 8px;
	background: #fff;
	color: #1e293b;
	font: inherit;
}

.aurachat-lead-form input:focus {
	border-color: #4f46e5;
	outline: 2px solid rgba(79, 70, 229, 0.18);
}

.aurachat-privacy-notice {
	margin: 8px 0 0;
	color: #475569;
	font-size: 12px;
	line-height: 1.5;
}

.aurachat-privacy-notice a {
	color: #4338ca;
	text-decoration: underline;
}

.aurachat-consent {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	margin: 4px 0;
	color: #334155;
	font-size: 12px;
	line-height: 1.45;
}

.aurachat-consent input {
	flex: 0 0 auto;
	margin-top: 2px;
}

.aurachat-lead-status {
	margin: 0;
	color: #b91c1c;
	font-size: 13px;
}

.aurachat-chat-step {
	display: flex;
	flex: 1;
	flex-direction: column;
	min-height: 0;
}

.aurachat-edit-contact {
	align-self: flex-start;
	margin: 10px 14px 0;
	padding: 6px 10px;
	border: 1px solid #cbd5e1;
	border-radius: 6px;
	background: #fff;
	color: #334155;
	cursor: pointer;
	font: inherit;
	font-size: 12px;
}

.aurachat-edit-contact:hover,
.aurachat-edit-contact:focus-visible {
	border-color: #4f46e5;
	color: #4338ca;
}

.aurachat-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 18px 20px;
	background: #4f46e5;
	color: #fff;
}

.aurachat-header h2,
.aurachat-header p {
	margin: 0;
	color: inherit;
}

.aurachat-header h2 {
	font-size: 17px;
	line-height: 1.35;
}

.aurachat-header p {
	margin-top: 3px;
	font-size: 13px;
	opacity: 0.9;
}

.aurachat-close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: #fff;
	cursor: pointer;
	font-size: 28px;
	line-height: 1;
}

.aurachat-close:hover,
.aurachat-close:focus-visible {
	background: rgba(255, 255, 255, 0.16);
}

.aurachat-messages {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: 12px;
	overflow-y: auto;
	padding: 20px;
	background: #f8fafc;
}

.aurachat-message {
	max-width: 85%;
	padding: 10px 13px;
	border-radius: 14px;
	background: #e2e8f0;
	color: #1e293b;
	overflow-wrap: anywhere;
}

.aurachat-message p {
	margin: 0;
	white-space: pre-wrap;
}

.aurachat-message--user {
	align-self: flex-end;
	background: #4f46e5;
	color: #fff;
}

.aurachat-message--typing {
	opacity: 0.7;
	font-style: italic;
}

.aurachat-message--consultant {
	align-self: flex-start;
	background: #eef2ff;
}

.aurachat-message--consultant-button-only {
	padding: 8px 10px;
}

.aurachat-consultant-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 40px;
	margin-top: 12px;
	padding: 0 14px;
	border-radius: 8px;
	background: #16a34a;
	color: #fff;
	font-size: 14px;
	font-weight: 600;
	text-align: center;
	text-decoration: none;
}

.aurachat-message--consultant-button-only .aurachat-consultant-button {
	margin-top: 0;
}

.aurachat-consultant-button:hover,
.aurachat-consultant-button:focus-visible {
	background: #15803d;
	color: #fff;
}

.aurachat-form {
	display: flex;
	align-items: flex-end;
	gap: 8px;
	padding: 14px;
	border-top: 1px solid #e2e8f0;
	background: #fff;
}

.aurachat-input {
	flex: 1;
	min-height: 42px;
	max-height: 120px;
	padding: 10px 12px;
	border: 1px solid #cbd5e1;
	border-radius: 10px;
	color: #1e293b;
	font: inherit;
	resize: vertical;
}

.aurachat-input:focus {
	border-color: #4f46e5;
	outline: 2px solid rgba(79, 70, 229, 0.18);
}

.aurachat-send {
	min-height: 42px;
	padding: 0 14px;
	border: 0;
	border-radius: 10px;
	background: #4f46e5;
	color: #fff;
	cursor: pointer;
	font: inherit;
	font-weight: 600;
}

.aurachat-send:hover,
.aurachat-send:focus-visible {
	background: #4338ca;
}

.aurachat-send:disabled,
.aurachat-input:disabled {
	cursor: wait;
	opacity: 0.65;
}

.aurachat-status {
	margin: 0;
	padding: 0 14px 10px;
	color: #b91c1c;
	font-size: 13px;
}

body.aurachat-open {
	overflow: hidden;
}

@media (max-width: 480px) {
	.aurachat-modal {
		padding: 12px;
	}

	.aurachat-dialog {
		width: 100%;
		height: min(600px, calc(100vh - 24px));
		max-height: calc(100dvh - 24px);
	}
}

@media (prefers-reduced-motion: no-preference) {
	.aurachat-backdrop {
		animation: aurachat-fade-in 180ms ease-out both;
	}

	.aurachat-dialog {
		animation: aurachat-enter 220ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
	}

	@keyframes aurachat-fade-in {
		from {
			opacity: 0;
		}

		to {
			opacity: 1;
		}
	}

	@keyframes aurachat-enter {
		from {
			transform: translateY(12px) scale(0.97);
			opacity: 0;
		}

		to {
			transform: translateY(0) scale(1);
			opacity: 1;
		}
	}
}
