/* Middle Mann SMS chat widget. Ported from Local BJJ with MM brand tokens.
   Fixed-position bubble bottom-right on every page. Panel is a dark modal
   that texts the message straight to Gavin via the mm-mailer SMS gateway. */

.mm-chat-btn {
	position: fixed;
	right: 24px;
	bottom: 24px;
	width: 64px;
	height: 64px;
	border-radius: 50%;
	background: var(--mm-accent, #00B4FF);
	border: none;
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
	cursor: pointer;
	z-index: 9998;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: transform 0.2s ease, filter 0.2s ease;
	padding: 0;
}
.mm-chat-btn:hover { filter: brightness(1.1); transform: scale(1.05); }
.mm-chat-btn svg { width: 30px; height: 30px; fill: #000; }

.mm-chat-panel {
	position: fixed;
	right: 24px;
	bottom: 100px;
	width: 380px;
	max-width: calc(100vw - 32px);
	max-height: calc(100dvh - 130px);
	background: #0f0f10;
	border: 1px solid #2a2a2a;
	border-radius: 0;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.7);
	z-index: 9999;
	display: none;
	flex-direction: column;
	overflow: hidden;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}
.mm-chat-panel.open { display: flex; }

.mm-chat-header {
	background: var(--mm-accent, #00B4FF);
	color: #000;
	padding: 20px 20px;
	display: flex;
	align-items: center;
	justify-content: space-between;
}
.mm-chat-header-title {
	font-size: 20px;
	font-weight: 700;
	letter-spacing: 0.3px;
}
.mm-chat-close {
	background: transparent;
	border: none;
	color: #000;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
	padding: 0 4px;
	opacity: 0.8;
}
.mm-chat-close:hover { opacity: 1; }

.mm-chat-body {
	padding: 20px;
	overflow-y: auto;
	color: #e5e7eb;
	scrollbar-width: none;
	-ms-overflow-style: none;
}
.mm-chat-body::-webkit-scrollbar { width: 0; height: 0; display: none; }

.mm-chat-intro {
	font-size: 13px;
	color: #cbd5e1;
	margin-bottom: 16px;
	line-height: 1.5;
}

.mm-chat-field { margin-bottom: 10px; }
.mm-chat-field input,
.mm-chat-field textarea {
	width: 100%;
	height: 52px;
	background: #0a0a0a;
	border: 1px solid #2a2a2a;
	border-radius: 0;
	padding: 0 14px;
	color: #ffffff;
	font-size: 14px;
	font-family: inherit;
	box-sizing: border-box;
	margin: 0;
	display: block;
}
.mm-chat-field textarea {
	height: auto;
	min-height: 90px;
	padding: 12px 14px;
	resize: vertical;
	line-height: 1.4;
}
.mm-chat-field input:focus,
.mm-chat-field textarea:focus {
	outline: none;
	border-color: var(--mm-accent, #00B4FF);
}
.mm-chat-field input::placeholder,
.mm-chat-field textarea::placeholder { color: #64748b; opacity: 1; }

.mm-chat-consent {
	background: #0a0a0a;
	border: 1px solid #2a2a2a;
	border-radius: 0;
	padding: 14px;
	margin-bottom: 10px;
}
.mm-chat-consent-row {
	display: flex;
	align-items: flex-start;
	gap: 10px;
}
.mm-chat-consent input[type="checkbox"] {
	appearance: none;
	-webkit-appearance: none;
	width: 20px;
	height: 20px;
	min-width: 20px;
	background: #0a0a0a;
	border: 2px solid #444;
	border-radius: 0;
	cursor: pointer;
	position: relative;
	margin: 0;
	flex-shrink: 0;
	margin-top: 2px;
}
.mm-chat-consent input[type="checkbox"]:checked {
	background: var(--mm-accent, #00B4FF);
	border-color: var(--mm-accent, #00B4FF);
}
.mm-chat-consent input[type="checkbox"]:checked::after {
	content: '';
	position: absolute;
	left: 5px;
	top: 1px;
	width: 6px;
	height: 11px;
	border: solid #000;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}
.mm-chat-consent label {
	font-size: 12px;
	color: #cbd5e1;
	line-height: 1.5;
	cursor: pointer;
}
.mm-chat-consent a { color: var(--mm-accent, #00B4FF); text-decoration: underline; }

.mm-chat-err {
	background: rgba(239, 68, 68, 0.1);
	border: 1px solid rgba(239, 68, 68, 0.4);
	color: #fca5a5;
	font-size: 13px;
	line-height: 1.4;
	padding: 10px 12px;
	margin-bottom: 10px;
}

.mm-chat-submit {
	width: 100%;
	height: 52px;
	background: var(--mm-accent, #00B4FF);
	color: #000;
	border: none;
	border-radius: 0;
	font-size: 14px;
	font-weight: 700;
	letter-spacing: 0.5px;
	text-transform: uppercase;
	cursor: pointer;
	transition: filter 0.2s ease;
}
.mm-chat-submit:hover:not(:disabled) { filter: brightness(1.1); }
.mm-chat-submit:disabled {
	background: #2a2a2a;
	color: #64748b;
	cursor: not-allowed;
}

.mm-chat-success {
	padding: 30px 20px;
	text-align: center;
	color: #ffffff;
}
.mm-chat-success-icon {
	width: 56px;
	height: 56px;
	background: var(--mm-accent, #00B4FF);
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0 auto 16px;
}
.mm-chat-success-icon svg { width: 28px; height: 28px; fill: #000; }
.mm-chat-success h4 {
	font-size: 18px;
	font-weight: 700;
	margin: 0 0 8px;
	color: #ffffff;
}
.mm-chat-success p {
	font-size: 13px;
	color: #cbd5e1;
	line-height: 1.5;
	margin: 0;
}

@media (max-width: 480px) {
	.mm-chat-panel { right: 12px; left: 12px; width: auto; bottom: 90px; }
	.mm-chat-btn   { right: 16px; bottom: 16px; }
}
