/* Popup Overlay */
.mbc-book-tool-popup-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(255, 255, 255, 0.7);
	backdrop-filter: blur(15px);
	-webkit-backdrop-filter: blur(15px);
	z-index: 9999999;
	display: none;
	overflow-y: auto;
	padding: 20px;
	box-sizing: border-box;
	font-family: "Inter", system-ui, -apple-system, sans-serif;
}

/* Popup Content */
.mbc-book-tool-popup-content {
	position: relative;
	max-width: 800px;
	margin: 50px auto;
	padding: 40px;
	background: rgba(255, 255, 255, 0.9);
	border-radius: 15px;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
	border: 1px solid rgba(0, 0, 0, 0.1);
}

/* Оставить только базовые стили для кнопки закрытия */
.mbc-book-tool-close {
	position: absolute;
	top: 15px;
	right: 15px;
	border: none;
	background: rgba(0, 0, 0, 0.1);
	border-radius: 100%;
	cursor: pointer;
	width: 40px;
	height: 40px;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.2s ease;
	font-family: inherit;
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
}

.mbc-book-tool-close:hover {
	background: rgba(0, 0, 0, 0.2);
}

.mbc-book-tool-close:focus {
	outline: 2px solid #204ce5;
	outline-offset: 2px;
}

/* Mobile Styles */
@media (max-width: 782px) {
	.mbc-book-tool-popup-overlay {
		padding: 10px;
	}

	.mbc-book-tool-popup-content {
		width: 100%;
		margin: 0px auto;
		padding: 0px;
	}

	.mbc-book-tool-close {
		top: 10px;
		right: 10px;
		width: 35px;
		height: 35px;
		font-size: 20px;
	}
}

/* ===== Base Styles ===== */
#mbc-book-root {
	all: initial;
	position: fixed;
	bottom: 20px;
	left: 50%;
	transform: translateX(-50%);
	z-index: 999999;
	isolation: isolate;
	filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.1));
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	border-radius: 30px;
	will-change: transform, opacity;
}

#mbc-book-trigger {
	position: relative;
	display: block;
	background: rgba(255, 255, 255, 0.25);
	border-radius: 8px;
	padding: 6px;
	border: 1px solid rgba(255, 255, 255, 0.2);
	cursor: pointer;
	transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
	overflow: hidden;
	width: 100%;
	font-family: inherit;
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
}

.mbc-book-btn-inner {
	display: flex;
	padding: 12px 16px;
	background: var(--bricks-color-civnyb);
	color: white;
	font: 500 16px/1.2 -apple-system, BlinkMacSystemFont, "Inter", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
	border-radius: 8px;
	position: relative;
	transition: inherit;
	flex-direction: row;
	align-items: center;
	gap: 8px;
	justify-content: center;
}

/* ===== Gloss Effect ===== */
#mbc-book-trigger::before {
	content: "";
	position: absolute;
	top: 0;
	left: -100%;
	width: 60%;
	height: 100%;
	background: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.45) 50%, rgba(255, 255, 255, 0) 100%);
	transform: skewX(-20deg);
	animation: mbc-gloss 3s infinite;
	opacity: 0.4;
	pointer-events: none;
}

@keyframes mbc-gloss {
	0% {
		left: -100%;
	}
	100% {
		left: 150%;
	}
}

/* ===== Hover States ===== */
#mbc-book-trigger:hover {
	/* Убираем трансформацию */
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);

	/* Эффект пульсации */
	animation: mbc-pulse 1.5s infinite;
}

/* Новая анимация пульсации */
@keyframes mbc-pulse {
	0% {
		box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.2);
	}
	70% {
		box-shadow: 0 0 0 12px rgba(255, 255, 255, 0);
	}
	100% {
		box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
	}
}

/* Улучшенный эффект блика при наведении */
#mbc-book-trigger:hover::before {
	animation: mbc-gloss 3s infinite, mbc-soft-glow 2s ease-in-out infinite;
	opacity: 0.8;
}

/* Дополнительная анимация свечения */
@keyframes mbc-soft-glow {
	0%,
	100% {
		opacity: 0.6;
	}
	50% {
		opacity: 0.8;
	}
}

/* ===== Mobile Adaptation ===== */
@media (max-width: 782px) {
	#mbc-book-root {
		bottom: 20px !important;
		width: calc(100% - 40px);
		left: 20px !important;
		transform: none !important;
	}

	#mbc-book-trigger {
		width: 100%;
	}

	#mbc-book-trigger:focus {
		outline: 2px solid #204ce5;
		outline-offset: 2px;
	}

	/* WordPress Admin Bar Fix */
	body.admin-bar #mbc-book-root {
		bottom: 60px !important;
	}

	@media (max-width: 600px) {
		body.admin-bar #mbc-book-root {
			bottom: 74px !important;
		}
	}
}

/* ===== Performance Tweaks ===== */
@media (prefers-reduced-motion: reduce) {
	#mbc-book-trigger::before {
		animation: none !important;
	}

	#mbc-book-trigger {
		transition: none !important;
	}
}

/* Фикс для iOS скролла */
.mbc-no-scroll {
	overflow: hidden !important;
	height: 100% !important;
	width: 100% !important;
}

@supports (-webkit-touch-callout: none) {
	#mbc-book-root {
		transition: transform 0.3s ease;
	}

	.mbc-book-tool-popup-overlay {
		-webkit-overflow-scrolling: touch;
	}
}

.gform-theme--foundation .gform_fields {
	grid-row-gap: 8px !important;
}

/* Container styling for all fields */
.mbc-book-tool-input {
	margin-bottom: 16px;
}

/* Label styling */
.mbc-book-tool-input .gfield_label {
	font-family: "Inter", sans-serif;
	font-weight: 500;
	font-size: 14px;
	line-height: 20px;
	color: #344054;
	margin: 0;
}

/* Hide required asterisk */
.mbc-book-tool-input .gfield_required {
	display: none !important;
}

/* Input/Select field styling */
.mbc-book-tool-input input,
.mbc-book-tool-input select {
	width: 100%;
	height: 44px;
	padding: 10px 14px;
	background: #ffffff;
	border: 1px solid #d0d5dd !important;
	border-radius: 8px !important;
	box-shadow: 0px 1px 2px rgba(16, 24, 40, 0.05);
	font-family: "Inter", sans-serif;
	font-size: 16px;
	line-height: 24px;
	color: #667085 !important;
	transition: all 0.3s ease;
}

/* Focus state */
.mbc-book-tool-input input:focus,
.mbc-book-tool-input select:focus {
	border-color: #204ce5 !important;
	box-shadow: 0px 0px 0px 4px rgba(127, 86, 217, 0.12) !important;
}

/* Placeholder text */
.mbc-book-tool-input input::placeholder {
	color: #667085;
	opacity: 1;
}

/* Checkbox styling */
.gfield_checkbox .gfield-choice-input {
	margin-top: 2px;
	accent-color: #204ce5;
}

.gfield_checkbox label {
	font-family: "Inter", sans-serif;
	font-size: 14px;
	line-height: 20px;
	color: #344054;
}

/* Specific width for half-width fields */
.gfield--width-half {
	width: 100%;
}

.gform_wrapper .top_label .gfield_label {
	margin-top: 8px !important;
}

/* Font styles */

.mbc-book-tool-header {
	margin-bottom: 24px;
	text-align: center;
}

.mbc-book-tool-title {
	font-size: 1.5rem; /* 24px */
	font-weight: 600;
	line-height: 32px;
	margin: 0 0 12px 0;
	color: #101828;
}

.mbc-book-tool-body {
	margin-bottom: 24px;
	font-size: 0.875rem; /* 14px */
	line-height: 1.5;
	color: #475467;
}

.mbc-book-tool-body p {
	margin: 0 0 16px 0;
	padding: 0;
}

.mbc-book-tool-contact {
	font-weight: 500;
	color: #101828;
}

.mbc-book-tool-patient a {
	color: #2970ff;
	text-decoration: none;
	font-weight: 500;
	transition: opacity 0.2s;
	padding: 0;
}

.mbc-book-tool-patient a:hover {
	opacity: 0.8;
	text-decoration: underline;
}

.mbc-book-tool-form {
	margin-bottom: 24px;
}

.mbc-book-tool-form input,
.mbc-book-tool-form select,
.mbc-book-tool-form textarea {
	width: 100%;
	padding: 12px 16px;
	margin-bottom: 16px;
	border: 1px solid #d0d5dd;
	border-radius: 8px;
	font-size: 0.875rem;
	transition: border-color 0.2s;
}

.mbc-book-tool-form input:focus {
	outline: none;
	border-color: #84caff;
	box-shadow: 0 0 0 4px rgba(165, 180, 252, 0.2);
}

.mbc-book-tool-form button {
	width: 100%;
	padding: 12px 20px;
	background: #2970ff;
	color: white;
	border: none;
	border-radius: 8px;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.2s;
}

.mbc-book-tool-form button:hover {
	background: #155eef;
}

.mbc-book-tool-popup > p,
.mbc-book-tool-footer-text {
	font-size: 0.75rem;
	color: #667085;
	text-align: center;
	line-height: 1.5;
	padding: 0;
	margin: 16px 0 0 0;
}

/* Error message styling */
.mbc-book-tool-error {
	padding: 16px;
	background: #fef2f2;
	border: 1px solid #fecaca;
	border-radius: 8px;
	color: #991b1b;
	text-align: center;
}

/* Mobile adaptation */
@media (max-width: 480px) {
	.mbc-book-tool-popup {
		padding: 8px;
		margin: 8px;
	}

	.mbc-book-tool-title {
		font-size: 1.25rem; /* 20px */
		line-height: 28px;
	}

	.mbc-book-tool-header {
		max-width: 290px;
	}
}

#gform_submit_button_1 {
	width: 100%;
}

/* Анимация появления */
@keyframes mbc-slideInUp {
	from {
		transform: translateY(50px);
		opacity: 0;
	}
	to {
		transform: translateY(0);
		opacity: 1;
	}
}

#gform_submit_button_1 {
	margin-top: 24px;
	background-color: #3072ff;
	font-size: 18px;
	line-height: 28px;
	padding-top: 16px;
	padding-bottom: 16px;
	padding-left: 22px;
}

/* Apply white background to all input containers */
.mbc-book-tool-input .ginput_container {
	background-color: #ffffff !important;
}

#gform_wrapper_1 .mbc-book-tool-input .ginput_container input,
#gform_wrapper_1 .mbc-book-tool-input .ginput_container select {
	width: 100% !important;
	max-width: none !important;
	display: block !important;
}

.gform-theme--framework select:where(:not([multiple])),
.gform-theme--framework select:where(:not([multiple])):hover,
.gform-theme--framework select:where(:not([multiple])):focus,
.gform-theme--framework select:where(:not([multiple])):active,
.gform-theme--framework select:where(:not([multiple])):disabled {
	background-image: none !important;
	appearance: none !important;
}
