.wfr {
	--wfr-green: #25d366;
	--wfr-dark: #0b5c4f;
	--wfr-field: #e3fde3;
	--wfr-field-border: #c9efc9;
	--wfr-chat-bg: #ece5dd;
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 99999;
	font-family: Arial, Helvetica, sans-serif;
	font-size: 15px;
	line-height: 1.35;
}

.wfr *,
.wfr *::before,
.wfr *::after {
	box-sizing: border-box;
}

/* Botão flutuante */
.wfr-toggle {
	width: 60px;
	height: 60px;
	border: 0;
	border-radius: 50%;
	background: var(--wfr-green);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
	transition: transform 0.2s ease;
	animation: wfr-pulse 2.5s infinite;
	padding: 0;
	margin-left: auto;
}

.wfr-toggle svg {
	width: 34px;
	height: 34px;
}

.wfr-toggle:hover {
	transform: scale(1.06);
}

.wfr.is-open .wfr-toggle {
	animation: none;
}

@keyframes wfr-pulse {
	0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.55), 0 6px 20px rgba(0, 0, 0, 0.25); }
	70% { box-shadow: 0 0 0 16px rgba(37, 211, 102, 0), 0 6px 20px rgba(0, 0, 0, 0.25); }
	100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0), 0 6px 20px rgba(0, 0, 0, 0.25); }
}

/* Painel */
.wfr-panel {
	position: absolute;
	right: 0;
	bottom: 76px;
	width: 380px;
	max-width: calc(100vw - 40px);
	max-height: calc(100vh - 120px);
	display: flex;
	flex-direction: column;
	background: var(--wfr-chat-bg);
	border-radius: 6px;
	overflow: hidden;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
	opacity: 0;
	visibility: hidden;
	transform: translateY(12px);
	transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}

.wfr.is-open .wfr-panel {
	opacity: 1;
	visibility: visible;
	transform: none;
}

/* Cabeçalho */
.wfr-header {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 14px 16px;
	background: var(--wfr-dark);
	color: #fff;
	flex-shrink: 0;
}

.wfr-avatar {
	width: 50px;
	height: 50px;
	border-radius: 50%;
	background: #fff;
	color: var(--wfr-green);
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	flex-shrink: 0;
}

.wfr-avatar img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	padding: 4px;
}

.wfr-header-text strong {
	display: block;
	font-size: 19px;
	font-weight: 700;
}

.wfr-header-text span {
	display: block;
	font-size: 14px;
	opacity: 0.9;
}

.wfr-close {
	margin-left: auto;
	align-self: flex-start;
	background: transparent;
	border: 0;
	color: #fff;
	cursor: pointer;
	padding: 0;
	line-height: 0;
}

/* Corpo estilo conversa */
.wfr-body {
	padding: 16px 14px 14px;
	overflow-y: auto;
	background-color: var(--wfr-chat-bg);
	background-image:
		radial-gradient(rgba(0, 0, 0, 0.045) 1.2px, transparent 1.4px),
		radial-gradient(rgba(0, 0, 0, 0.03) 1.2px, transparent 1.4px);
	background-size: 22px 22px, 22px 22px;
	background-position: 0 0, 11px 11px;
}

.wfr-bubble {
	position: relative;
	background: #fff;
	color: #222;
	padding: 10px 12px;
	border-radius: 0 8px 8px 8px;
	margin: 0 30px 16px 0;
	box-shadow: 0 1px 1px rgba(0, 0, 0, 0.12);
	font-size: 15px;
}

.wfr-bubble::before {
	content: "";
	position: absolute;
	top: 0;
	left: -8px;
	border-top: 0 solid transparent;
	border-right: 8px solid #fff;
	border-bottom: 10px solid transparent;
}

/* Formulário alinhado à direita, como mensagens enviadas */
.wfr-form {
	margin: 0 0 0 26%;
	padding: 0;
}

.wfr-input {
	display: block;
	width: 100%;
	height: 40px;
	margin: 0 0 10px;
	padding: 0 8px;
	border: 1px solid var(--wfr-field-border);
	border-radius: 4px;
	background: var(--wfr-field);
	color: #222;
	font: inherit;
	font-size: 15px;
	box-shadow: none;
	outline: none;
}

.wfr-input::placeholder {
	color: #777;
	opacity: 1;
}

.wfr-input:focus,
.wfr-phone:focus-within {
	border-color: var(--wfr-green);
	background: #f1fff1;
}

.wfr-select {
	cursor: pointer;
	color: #444;
}

/* Campo de celular com bandeira */
.wfr-phone {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 0 8px;
}

.wfr-flag {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: #222;
	flex-shrink: 0;
}

.wfr-flag svg {
	display: block;
}

.wfr-phone input {
	flex: 1;
	min-width: 0;
	height: 100%;
	border: 0;
	background: transparent;
	color: #222;
	font: inherit;
	font-size: 15px;
	padding: 0 0 0 6px;
	margin: 0;
	outline: none;
	box-shadow: none;
}

.wfr-phone input::placeholder {
	color: #777;
	opacity: 1;
}

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

.wfr-error {
	color: #b91c1c;
	font-size: 13px;
	margin: 0 0 10px;
	text-align: right;
}

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

.wfr-actions {
	display: flex;
	justify-content: flex-end;
}

.wfr-submit {
	padding: 10px 16px;
	border: 0;
	border-radius: 4px;
	background: var(--wfr-dark);
	color: #fff;
	font: inherit;
	font-size: 16px;
	cursor: pointer;
	transition: filter 0.2s ease;
}

.wfr-submit:hover {
	filter: brightness(1.15);
}

.wfr-submit:disabled {
	opacity: 0.7;
	cursor: wait;
}

@media (max-width: 480px) {
	.wfr {
		right: 16px;
		bottom: 16px;
	}

	.wfr-panel {
		max-width: calc(100vw - 32px);
	}

	.wfr-form {
		margin-left: 12%;
	}
}
