/* Acelera Leads — asistente comercial */
.acl-widget,
.acelera-quote {
	--acl-ink: #0b0b0f;
	--acl-ink-2: #1b1b22;
	--acl-wine: #8b1e2d;
	--acl-wine-2: #a8273a;
	--acl-bg: #ffffff;
	--acl-soft: #f5f3f1;
	--acl-line: #e7e3e3;
	--acl-text: #17171c;
	--acl-muted: #5d5d68;
	--acl-radius: 18px;
	--acl-shadow: 0 24px 60px rgba(11, 11, 15, 0.22), 0 4px 14px rgba(11, 11, 15, 0.12);
	font-family: inherit;
	color: var(--acl-text);
	line-height: 1.5;
}

.acl-widget *,
.acelera-quote * {
	box-sizing: border-box;
}

.acl-widget {
	position: fixed;
	right: max(20px, env(safe-area-inset-right));
	bottom: max(20px, env(safe-area-inset-bottom));
	z-index: 99990;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 12px;
}

.acl-launcher {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	min-height: 56px;
	padding: 0 22px 0 16px;
	border: 0;
	border-radius: 999px;
	background: var(--acl-wine);
	color: #fff;
	font: inherit;
	font-weight: 700;
	font-size: 15px;
	cursor: pointer;
	box-shadow: 0 12px 30px rgba(139, 30, 45, 0.35);
	transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.acl-launcher:hover {
	background: var(--acl-wine-2);
	transform: translateY(-2px);
}

.acl-launcher:focus-visible,
.acl-chip:focus-visible,
.acl-btn:focus-visible,
.acl-send:focus-visible,
.acl-icon-btn:focus-visible,
.acl-tab:focus-visible {
	outline: 3px solid #f2b8c1;
	outline-offset: 2px;
}

.acl-launcher__icon svg {
	width: 26px;
	height: 26px;
	display: block;
	color: #fff;
}

.acl-widget[data-open='true'] .acl-launcher__label {
	display: none;
}

.acl-widget[data-open='true'] .acl-launcher {
	padding: 0 16px;
}

.acl-teaser {
	display: flex;
	align-items: flex-start;
	gap: 4px;
	max-width: 280px;
	padding: 12px 8px 12px 16px;
	border-radius: 16px 16px 4px 16px;
	background: #fff;
	box-shadow: var(--acl-shadow);
	animation: acl-in 0.25s ease-out;
}

.acl-teaser__text {
	border: 0;
	background: none;
	padding: 0;
	font: inherit;
	font-size: 14px;
	text-align: left;
	color: var(--acl-text);
	cursor: pointer;
}

.acl-panel {
	width: min(400px, calc(100vw - 32px));
	height: min(640px, calc(100vh - 120px));
	border-radius: var(--acl-radius);
	background: var(--acl-bg);
	box-shadow: var(--acl-shadow);
	overflow: hidden;
	animation: acl-in 0.22s ease-out;
}

.acl-panel[hidden] {
	display: none;
}

@keyframes acl-in {
	from {
		opacity: 0;
		transform: translateY(12px) scale(0.98);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

.acl-chat {
	display: flex;
	flex-direction: column;
	height: 100%;
	background: var(--acl-bg);
}

.acl-head {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 16px 16px 14px 18px;
	background: var(--acl-ink);
	color: #fff;
}

.acl-avatar {
	flex: 0 0 auto;
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	border-radius: 12px;
	background: linear-gradient(135deg, var(--acl-wine), #3d0c14);
	font-weight: 800;
	font-size: 14px;
	letter-spacing: 0.5px;
}

.acl-head__text {
	flex: 1 1 auto;
	min-width: 0;
}

.acl-title {
	margin: 0;
	font-weight: 700;
	font-size: 15px;
	line-height: 1.25;
	color: #fff;
}

.acl-status {
	margin: 2px 0 0;
	font-size: 12px;
	color: #b9b9c4;
}

.acl-status::before {
	content: '';
	display: inline-block;
	width: 7px;
	height: 7px;
	margin-right: 6px;
	border-radius: 50%;
	background: #3ccf7a;
	vertical-align: 1px;
}

.acl-icon-btn {
	display: grid;
	place-items: center;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 0;
	border-radius: 10px;
	background: transparent;
	color: inherit;
	cursor: pointer;
}

.acl-icon-btn svg {
	width: 20px;
	height: 20px;
}

.acl-close:hover {
	background: rgba(255, 255, 255, 0.12);
}

.acl-teaser__close {
	width: 28px;
	height: 28px;
	color: var(--acl-muted);
}

.acl-body {
	position: relative;
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	min-height: 0;
}

.acl-progress {
	padding: 10px 18px 0;
}

.acl-progress[hidden] {
	display: none;
}

.acl-progress__track {
	height: 4px;
	border-radius: 4px;
	background: var(--acl-soft);
	overflow: hidden;
}

.acl-progress__bar {
	height: 100%;
	width: 6%;
	border-radius: 4px;
	background: var(--acl-wine);
	transition: width 0.35s ease;
}

.acl-progress__text {
	display: block;
	margin-top: 4px;
	font-size: 11px;
	color: var(--acl-muted);
}

.acl-log {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	padding: 16px 16px 8px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	scroll-behavior: smooth;
	overscroll-behavior: contain;
}

.acl-msg {
	max-width: 86%;
	padding: 10px 14px;
	border-radius: 16px;
	font-size: 14.5px;
	line-height: 1.5;
	word-wrap: break-word;
	animation: acl-msg 0.18s ease-out;
}

@keyframes acl-msg {
	from {
		opacity: 0;
		transform: translateY(4px);
	}
}

.acl-msg--assistant {
	align-self: flex-start;
	background: var(--acl-soft);
	border-bottom-left-radius: 4px;
}

.acl-msg--assistant a {
	color: var(--acl-wine);
	font-weight: 700;
}

.acl-msg--user {
	align-self: flex-end;
	background: var(--acl-ink-2);
	color: #fff;
	border-bottom-right-radius: 4px;
	white-space: pre-wrap;
}

.acl-typing {
	display: inline-flex;
	gap: 4px;
	padding: 14px 16px;
}

.acl-typing span {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #a3a3ad;
	animation: acl-dot 1.1s infinite ease-in-out;
}

.acl-typing span:nth-child(2) {
	animation-delay: 0.15s;
}

.acl-typing span:nth-child(3) {
	animation-delay: 0.3s;
}

@keyframes acl-dot {
	0%,
	80%,
	100% {
		opacity: 0.3;
		transform: translateY(0);
	}
	40% {
		opacity: 1;
		transform: translateY(-3px);
	}
}

.acl-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	padding: 4px 16px 10px;
}

.acl-chips[hidden] {
	display: none;
}

.acl-chip {
	padding: 7px 13px;
	border: 1px solid #d9c3c7;
	border-radius: 999px;
	background: #fff;
	color: var(--acl-wine);
	font: inherit;
	font-size: 13px;
	font-weight: 700;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease;
}

.acl-chip:hover {
	background: var(--acl-wine);
	border-color: var(--acl-wine);
	color: #fff;
}

.acl-compose {
	display: flex;
	align-items: flex-end;
	gap: 8px;
	margin: 0 12px;
	padding: 6px 6px 6px 14px;
	border: 1px solid var(--acl-line);
	border-radius: 16px;
	background: #fff;
}

.acl-compose:focus-within {
	border-color: var(--acl-wine);
	box-shadow: 0 0 0 3px rgba(139, 30, 45, 0.12);
}

.acl-input {
	flex: 1 1 auto;
	min-height: 40px;
	max-height: 120px;
	padding: 9px 0;
	border: 0;
	outline: 0;
	resize: none;
	background: transparent;
	font: inherit;
	font-size: 16px;
	line-height: 1.4;
	color: var(--acl-text);
}

.acl-hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	opacity: 0;
}

.acl-send {
	flex: 0 0 auto;
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	border: 0;
	border-radius: 12px;
	background: var(--acl-wine);
	color: #fff;
	cursor: pointer;
}

.acl-send:hover {
	background: var(--acl-wine-2);
}

.acl-send svg {
	width: 20px;
	height: 20px;
}

.acl-foot {
	margin: 0;
	padding: 8px 16px 12px;
	font-size: 11.5px;
	color: var(--acl-muted);
	text-align: center;
}

.acl-foot a {
	color: inherit;
	text-decoration: underline;
}

/* Resumen */
.acl-summary,
.acl-editor {
	align-self: stretch;
	padding: 16px;
	border: 1px solid var(--acl-line);
	border-radius: 16px;
	background: #fff;
	box-shadow: 0 6px 20px rgba(11, 11, 15, 0.06);
}

.acl-summary__title {
	margin: 0 0 10px;
	font-weight: 800;
	font-size: 15px;
}

.acl-summary__list {
	display: grid;
	grid-template-columns: minmax(96px, 36%) 1fr;
	gap: 6px 12px;
	margin: 0 0 12px;
	font-size: 13.5px;
}

.acl-summary__list dt {
	color: var(--acl-muted);
}

.acl-summary__list dd {
	margin: 0;
	font-weight: 600;
	overflow-wrap: anywhere;
	white-space: pre-line;
}

.acl-summary__pending {
	margin: 0 0 12px;
	font-size: 13px;
}

.acl-summary__pending p {
	margin: 0 0 4px;
	color: var(--acl-muted);
}

.acl-summary__pending ul {
	margin: 0;
	padding-left: 18px;
}

.acl-consent {
	display: flex;
	gap: 10px;
	align-items: flex-start;
	padding: 10px 12px;
	border-radius: 12px;
	background: var(--acl-soft);
	font-size: 13px;
}

.acl-consent input {
	flex: 0 0 auto;
	width: 18px;
	height: 18px;
	margin-top: 2px;
	accent-color: var(--acl-wine);
}

.acl-consent a {
	color: var(--acl-wine);
	font-weight: 700;
}

.acl-captcha {
	margin-top: 10px;
}

.acl-summary__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 12px;
}

.acl-btn {
	flex: 1 1 auto;
	min-height: 44px;
	padding: 10px 16px;
	border-radius: 12px;
	font: inherit;
	font-weight: 800;
	font-size: 14px;
	cursor: pointer;
	transition: background 0.15s ease, opacity 0.15s ease;
}

.acl-btn--primary {
	border: 0;
	background: var(--acl-wine);
	color: #fff;
}

.acl-btn--primary:hover:not([disabled]) {
	background: var(--acl-wine-2);
}

.acl-btn[disabled] {
	opacity: 0.45;
	cursor: not-allowed;
}

.acl-btn--ghost {
	border: 1px solid var(--acl-line);
	background: #fff;
	color: var(--acl-text);
}

.acl-error {
	margin: 8px 0 0;
	font-size: 13px;
	color: #b3261e;
}

.acl-error:empty {
	display: none;
}

/* Editor de datos */
.acl-chat.is-editing .acl-log,
.acl-chat.is-editing .acl-chips,
.acl-chat.is-editing .acl-compose,
.acl-chat.is-editing .acl-progress {
	display: none;
}

.acl-editor {
	margin: 12px;
	overflow-y: auto;
	flex: 1 1 auto;
	min-height: 0;
}

.acl-fields {
	display: grid;
	gap: 12px;
}

.acl-field {
	display: grid;
	gap: 4px;
}

.acl-field label {
	font-size: 13px;
	font-weight: 700;
}

.acl-field small {
	font-size: 12px;
	color: var(--acl-muted);
}

.acl-field input,
.acl-field select,
.acl-field textarea {
	width: 100%;
	min-height: 44px;
	padding: 10px 12px;
	border: 1px solid #d6d3d6;
	border-radius: 10px;
	background: #fff;
	font: inherit;
	font-size: 16px;
	color: var(--acl-text);
}

.acl-field textarea {
	min-height: 88px;
	resize: vertical;
}

.acl-field input:focus,
.acl-field select:focus,
.acl-field textarea:focus {
	outline: 0;
	border-color: var(--acl-wine);
	box-shadow: 0 0 0 3px rgba(139, 30, 45, 0.12);
}

.acl-field [aria-invalid='true'] {
	border-color: #b3261e;
}

.acl-field-error {
	font-size: 12.5px;
	color: #b3261e;
}

/* Modo en página */
.acelera-quote {
	max-width: 760px;
	margin: 0 auto;
}

.acelera-quote__loading {
	padding: 40px;
	text-align: center;
	color: var(--acl-muted);
}

.acl-tabs {
	display: flex;
	gap: 6px;
	padding: 6px;
	margin-bottom: 14px;
	border-radius: 14px;
	background: var(--acl-soft);
}

.acl-tab {
	flex: 1 1 0;
	min-height: 44px;
	padding: 8px 12px;
	border: 0;
	border-radius: 10px;
	background: transparent;
	font: inherit;
	font-weight: 700;
	font-size: 14px;
	color: var(--acl-muted);
	cursor: pointer;
}

.acl-tab[aria-selected='true'] {
	background: #fff;
	color: var(--acl-ink);
	box-shadow: 0 2px 8px rgba(11, 11, 15, 0.08);
}

.acl-pane[hidden] {
	display: none;
}

.acl-chat--inline {
	height: min(680px, 78vh);
	border: 1px solid var(--acl-line);
	border-radius: 20px;
	overflow: hidden;
	box-shadow: 0 20px 50px rgba(11, 11, 15, 0.08);
}

.acl-pane--form {
	padding: 22px;
	border: 1px solid var(--acl-line);
	border-radius: 20px;
	background: #fff;
}

.acl-form-intro {
	margin: 0 0 16px;
	color: var(--acl-muted);
	font-size: 14.5px;
}

@media (min-width: 700px) {
	.acl-pane--form .acl-fields {
		grid-template-columns: 1fr 1fr;
	}

	.acl-pane--form .acl-field--description,
	.acl-pane--form .acl-field--features,
	.acl-pane--form .acl-field--comments,
	.acl-pane--form .acl-summary__actions,
	.acl-pane--form .acl-error {
		grid-column: 1 / -1;
	}
}

/* Móvil: el asistente ocupa la pantalla */
@media (max-width: 640px) {
	.acl-widget {
		right: 14px;
		bottom: 14px;
	}

	.acl-launcher {
		min-height: 52px;
		padding: 0 18px 0 14px;
		font-size: 14px;
	}

	.acl-widget[data-open='true'] {
		inset: 0;
		gap: 0;
	}

	.acl-widget[data-open='true'] .acl-launcher {
		display: none;
	}

	.acl-widget[data-open='true'] .acl-panel {
		width: 100%;
		height: 100%;
		height: 100dvh;
		border-radius: 0;
		padding-bottom: env(safe-area-inset-bottom);
	}

	html.acl-open,
	html.acl-open body {
		overflow: hidden;
	}

	.acl-msg {
		max-width: 92%;
	}

	.acl-chat--inline {
		height: 75vh;
		height: 75dvh;
	}

	.acl-pane--form {
		padding: 16px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.acl-widget *,
	.acelera-quote * {
		animation: none !important;
		transition: none !important;
		scroll-behavior: auto !important;
	}
}

@media print {
	.acl-widget {
		display: none !important;
	}
}
