/* Brilean Contact Widget - frontend (clean & pro) */
.bcw-app {
	--bcw-primary: #0E2A47;
	--bcw-accent: #C9A24B;
	--bcw-wa: #25D366;
	--bcw-text: #1f2937;
	--bcw-muted: #6b7280;
	--bcw-border: #e9eaee;
	--bcw-bg: #ffffff;
	position: fixed;
	bottom: 22px;
	z-index: 999990;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	box-sizing: border-box;
	-webkit-font-smoothing: antialiased;
}
.bcw-app *, .bcw-app *::before, .bcw-app *::after { box-sizing: border-box; }
.bcw-right { right: 22px; }
.bcw-left { left: 22px; }

/* Honeypot */
.bcw-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

/* ---- Botão flutuante ---- */
.bcw-launcher {
	height: 60px;
	border-radius: 999px;
	border: none;
	background: var(--bcw-launcher);
	color: #fff;
	cursor: pointer;
	box-shadow: 0 10px 26px rgba(var(--bcw-launcher-rgb), 0.45);
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	transition: transform 0.22s cubic-bezier(.2,.8,.2,1), box-shadow 0.22s ease, width 0.28s cubic-bezier(.2,.8,.2,1), padding 0.28s ease;
	position: relative;
	margin-left: auto;
}
.bcw-launcher:hover { transform: translateY(-2px) scale(1.03); box-shadow: 0 16px 34px rgba(var(--bcw-launcher-rgb), 0.55); }
.bcw-launcher:active { transform: scale(0.98); }
.bcw-launcher svg { width: 28px; height: 28px; }
.bcw-launcher-label { font-size: 16px; font-weight: 600; white-space: nowrap; letter-spacing: .2px; }
.bcw-launcher .bcw-launcher-close { display: none; }

/* Estilo PÍLULA (largo, com texto) */
.bcw-style-pill .bcw-launcher { width: auto; padding: 0 24px; }
/* Estilo CÍRCULO */
.bcw-style-circle .bcw-launcher { width: 62px; height: 62px; padding: 0; }
.bcw-style-circle .bcw-launcher-label { display: none; }

/* Estado ABERTO: colapsa para círculo com X */
.bcw-app[data-state="open"] .bcw-launcher { width: 58px; height: 58px; padding: 0; gap: 0; }
.bcw-app[data-state="open"] .bcw-launcher-label,
.bcw-app[data-state="open"] .bcw-launcher .bcw-launcher-open { display: none; }
.bcw-app[data-state="open"] .bcw-launcher .bcw-launcher-close { display: flex; }

/* Efeito de PULSAR para chamar a atenção */
.bcw-launcher.bcw-pulse { animation: bcw-pulse 2.2s infinite; }
.bcw-launcher.bcw-pulse:hover { animation: none; }
.bcw-app[data-state="open"] .bcw-launcher.bcw-pulse { animation: none; }
@keyframes bcw-pulse {
	0%   { box-shadow: 0 10px 26px rgba(var(--bcw-launcher-rgb), 0.45), 0 0 0 0 rgba(var(--bcw-launcher-rgb), 0.55); }
	70%  { box-shadow: 0 10px 26px rgba(var(--bcw-launcher-rgb), 0.45), 0 0 0 18px rgba(var(--bcw-launcher-rgb), 0); }
	100% { box-shadow: 0 10px 26px rgba(var(--bcw-launcher-rgb), 0.45), 0 0 0 0 rgba(var(--bcw-launcher-rgb), 0); }
}
@media (prefers-reduced-motion: reduce) {
	.bcw-launcher.bcw-pulse { animation: none; }
}

/* ---- Painel ---- */
.bcw-panel {
	position: absolute;
	bottom: 80px;
	width: 360px;
	max-width: calc(100vw - 44px);
	background: var(--bcw-bg);
	border-radius: 18px;
	box-shadow: 0 24px 60px rgba(14, 42, 71, 0.28);
	overflow: hidden;
	opacity: 0;
	visibility: hidden;
	transform: translateY(14px) scale(0.97);
	transform-origin: bottom right;
	transition: opacity 0.2s ease, transform 0.24s cubic-bezier(.2,.8,.2,1), visibility 0.24s;
}
.bcw-right .bcw-panel { right: 0; }
.bcw-left .bcw-panel { left: 0; transform-origin: bottom left; }
.bcw-app[data-state="open"] .bcw-panel { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }

/* ---- Vistas ---- */
.bcw-view { display: none; }
.bcw-view.is-active { display: block; animation: bcw-fade 0.25s ease; }
@keyframes bcw-fade { from { opacity: 0; transform: translateX(6px); } to { opacity: 1; transform: none; } }

/* Hero (menu) */
.bcw-hero {
	background: linear-gradient(135deg, var(--bcw-primary), color-mix(in srgb, var(--bcw-primary) 78%, #000));
	color: #fff;
	padding: 26px 20px 22px;
	text-align: center;
	position: relative;
}
.bcw-hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--bcw-accent); }
.bcw-hero-icon {
	width: 60px; height: 60px;
	margin: 0 auto 12px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.14);
	display: flex; align-items: center; justify-content: center;
}
.bcw-hero-icon svg { width: 30px; height: 30px; }
.bcw-hero-title { font-size: 18px; font-weight: 600; letter-spacing: .2px; }

/* Lista de canais */
.bcw-menu-list { padding: 6px 0; }
.bcw-channel {
	display: flex; align-items: center; gap: 14px;
	width: 100%;
	padding: 15px 18px;
	background: #fff; border: none;
	border-bottom: 1px solid var(--bcw-border);
	cursor: pointer; text-align: left;
	transition: background 0.15s ease;
}
.bcw-channel:last-child { border-bottom: none; }
.bcw-channel:hover { background: #f7f8fa; }
.bcw-channel-avatar {
	flex: 0 0 auto; width: 50px; height: 50px;
	border-radius: 50%;
	display: flex; align-items: center; justify-content: center;
	color: #fff;
}
.bcw-channel-avatar svg { width: 26px; height: 26px; }
.bcw-avatar-whatsapp { background: var(--bcw-wa); }
.bcw-avatar-phone { background: var(--bcw-primary); }
.bcw-channel-info { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.bcw-channel-cat { font-size: 11px; color: var(--bcw-muted); text-transform: uppercase; letter-spacing: 1px; }
.bcw-channel-title { font-size: 16px; font-weight: 600; color: var(--bcw-text); line-height: 1.25; }
.bcw-channel-status { font-size: 13px; color: #16a34a; display: flex; align-items: center; gap: 6px; }
.bcw-channel-status i { width: 7px; height: 7px; border-radius: 50%; background: #16a34a; display: inline-block; box-shadow: 0 0 0 3px rgba(22,163,74,.15); }
.bcw-channel-arrow { color: var(--bcw-muted); display: flex; opacity: .6; transition: transform .15s ease; }
.bcw-channel:hover .bcw-channel-arrow { transform: translateX(3px); opacity: 1; }
.bcw-channel-arrow svg { width: 18px; height: 18px; }
.bcw-channel-badge {
	flex: 0 0 auto; font-size: 12px; font-weight: 600; color: var(--bcw-primary);
	border: 1px solid var(--bcw-border); border-radius: 999px; padding: 5px 11px;
}

/* Cabeçalho do formulário */
.bcw-form-head {
	display: flex; align-items: center; gap: 10px;
	padding: 14px 16px;
	border-bottom: 1px solid var(--bcw-border);
}
.bcw-back { background: none; border: none; cursor: pointer; color: var(--bcw-text); padding: 4px; display: flex; border-radius: 8px; transition: background .15s; }
.bcw-back:hover { background: #f1f2f5; }
.bcw-back svg { width: 22px; height: 22px; }
.bcw-form-avatar { width: 42px; height: 42px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; flex: 0 0 auto; }
.bcw-form-avatar svg { width: 22px; height: 22px; }
.bcw-form-head-info { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.bcw-form-title { font-size: 16px; font-weight: 600; color: var(--bcw-text); line-height: 1.2; }

/* Corpo do formulário */
.bcw-form-body { padding: 18px; max-height: 62vh; overflow-y: auto; }
.bcw-form-intro { font-size: 14px; color: var(--bcw-text); text-align: center; margin: 0 0 16px; line-height: 1.5; }
.bcw-field {
	width: 100%; padding: 13px 14px;
	border: 1px solid var(--bcw-border); border-radius: 10px;
	font-size: 15px; margin-bottom: 12px; color: var(--bcw-text);
	background: #fff; font-family: inherit;
	transition: border-color .15s ease, box-shadow .15s ease;
}
.bcw-field::placeholder { color: #9aa0aa; }
.bcw-field:focus { outline: none; border-color: var(--bcw-primary); box-shadow: 0 0 0 3px rgba(14,42,71,.10); }
.bcw-textarea { resize: vertical; min-height: 92px; }
.bcw-phone-row { display: flex; gap: 8px; margin-bottom: 12px; }
.bcw-dial {
	flex: 0 0 auto; width: 112px; padding: 13px 8px;
	border: 1px solid var(--bcw-border); border-radius: 10px;
	font-size: 15px; background: #fff; color: var(--bcw-text);
}
.bcw-phone-row .bcw-field { margin-bottom: 0; }
.bcw-consent { display: flex; gap: 8px; font-size: 12.5px; color: var(--bcw-muted); margin-bottom: 14px; align-items: flex-start; line-height: 1.45; }
.bcw-consent input { margin-top: 2px; }
.bcw-consent a { color: var(--bcw-primary); text-decoration: underline; }
.bcw-submit {
	width: 100%; padding: 14px; border: none; border-radius: 10px;
	background: var(--bcw-primary); color: #fff; font-size: 15px; font-weight: 600;
	cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px;
	transition: filter .15s ease, transform .1s ease;
}
.bcw-submit:hover { filter: brightness(1.12); }
.bcw-submit:active { transform: scale(.99); }
.bcw-submit:disabled { opacity: 0.6; cursor: default; }
.bcw-submit svg { width: 18px; height: 18px; }
.bcw-form-msg { font-size: 13px; margin-bottom: 10px; min-height: 0; line-height: 1.4; }
.bcw-form-msg.is-error { color: #c0392b; }
.bcw-form-msg.is-success { color: #16a34a; font-weight: 600; }

@media (max-width: 480px) {
	.bcw-panel { width: calc(100vw - 28px); }
	.bcw-app { bottom: 16px; }
	.bcw-right { right: 14px; }
	.bcw-left { left: 14px; }
}

/* Fallback se color-mix não suportado */
@supports not (color: color-mix(in srgb, #000 50%, #fff)) {
	.bcw-hero { background: var(--bcw-primary); }
}

/* ---- Estado online / offline (horários) ---- */
.bcw-st { display: none; align-items: center; gap: 6px; }
.bcw-app[data-online="1"] .bcw-st-online { display: flex; }
.bcw-app[data-online="0"] .bcw-st-offline { display: flex; }
.bcw-st-offline { color: #9aa0aa; }
.bcw-st-offline i { background: #9aa0aa !important; box-shadow: 0 0 0 3px rgba(154,160,170,.18) !important; }
.bcw-offline-note {
	display: none;
	font-size: 13px; color: #8a6d00;
	background: #fff8e6; border: 1px solid #f3e2b3; border-radius: 8px;
	padding: 10px 12px; margin: 0 0 14px; line-height: 1.45;
}
.bcw-app[data-online="0"] .bcw-offline-note { display: block; }

/* Botão opcional "Abrir no WhatsApp Web" (desktop) */
.bcw-wa-web-btn {
	display: inline-flex;
	align-items: center;
	margin-top: 10px;
	padding: 9px 16px;
	background: var(--bcw-wa);
	color: #fff !important;
	text-decoration: none;
	border-radius: 8px;
	font-size: 14px;
	font-weight: 600;
	transition: filter .15s ease;
}
.bcw-wa-web-btn:hover { filter: brightness(1.08); }
