/* Medtest Callback — floating call button */

.medtest-cb {
	--medtest-cb-color: #0d8ec8;
	--medtest-cb-hover: #0a7ab0;
	--medtest-cb-white: #ffffff;
	--medtest-cb-text: #1a2b3c;
	--medtest-cb-muted: #5a6b7c;
	--medtest-cb-radius: 16px;
	--medtest-cb-z: 999999;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
}

/* ── FAB button ── */
body.medtest-cb-body-lock {
	overflow: hidden;
}

.medtest-cb__fab {
	position: fixed;
	right: max(16px, env(safe-area-inset-right, 0px));
	bottom: max(16px, env(safe-area-inset-bottom, 0px));
	z-index: var(--medtest-cb-z);
	pointer-events: auto;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 60px;
	height: 60px;
	padding: 0;
	border: 3px solid var(--medtest-cb-white);
	border-radius: 50%;
	background: var(--medtest-cb-color);
	color: var(--medtest-cb-white);
	cursor: pointer;
	box-shadow:
		0 4px 16px rgba(0, 0, 0, 0.28),
		0 0 0 4px rgba(13, 142, 200, 0.18);
	transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
	-webkit-tap-highlight-color: transparent;
}

.medtest-cb__fab:hover,
.medtest-cb__fab:focus-visible {
	background: var(--medtest-cb-hover);
	transform: scale(1.06);
	box-shadow:
		0 6px 24px rgba(0, 0, 0, 0.32),
		0 0 0 5px rgba(13, 142, 200, 0.25);
	outline: none;
}

.medtest-cb__fab:active {
	transform: scale(0.96);
}

.medtest-cb__fab-icon {
	display: block;
	pointer-events: none;
}

/* Pulse ring — draws attention without blending into slides */
.medtest-cb__fab-pulse {
	position: absolute;
	inset: -6px;
	border-radius: 50%;
	border: 2px solid var(--medtest-cb-color);
	opacity: 0;
	animation: medtest-cb-pulse 2.8s ease-out infinite;
	pointer-events: none;
}

@keyframes medtest-cb-pulse {
	0%   { transform: scale(1);   opacity: 0.7; }
	70%  { transform: scale(1.45); opacity: 0; }
	100% { transform: scale(1.45); opacity: 0; }
}

/* ── Overlay ── */
.medtest-cb__overlay {
	position: fixed;
	inset: 0;
	z-index: calc(var(--medtest-cb-z) + 1);
	background: rgba(10, 20, 35, 0.55);
	backdrop-filter: blur(2px);
	-webkit-backdrop-filter: blur(2px);
	opacity: 0;
	transition: opacity 0.25s ease;
}

.medtest-cb__overlay.is-open,
.medtest-cb__overlay:not([hidden]) {
	display: block;
	opacity: 1;
}

/* ── Modal ── */
.medtest-cb__modal {
	position: fixed;
	z-index: calc(var(--medtest-cb-z) + 2);
	right: max(16px, env(safe-area-inset-right, 0px));
	bottom: max(88px, calc(16px + env(safe-area-inset-bottom, 0px) + 60px));
	left: auto;
	width: min(380px, calc(100vw - 32px));
	opacity: 0;
	transform: translateY(12px) scale(0.97);
	transition: opacity 0.25s ease, transform 0.25s ease;
	pointer-events: none;
}

.medtest-cb__modal.is-open,
.medtest-cb__modal:not([hidden]) {
	display: block;
	opacity: 1;
	transform: translateY(0) scale(1);
	pointer-events: auto;
}

.medtest-cb__modal-inner {
	position: relative;
	padding: 24px 24px 20px;
	border-radius: var(--medtest-cb-radius);
	background: var(--medtest-cb-white);
	box-shadow: 0 12px 48px rgba(0, 0, 0, 0.22);
}

.medtest-cb__close {
	position: absolute;
	top: 12px;
	right: 12px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	padding: 0;
	border: none;
	border-radius: 50%;
	background: #f0f4f8;
	color: var(--medtest-cb-muted);
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease;
}

.medtest-cb__close:hover,
.medtest-cb__close:focus-visible {
	background: #e2e8f0;
	color: var(--medtest-cb-text);
	outline: none;
}

.medtest-cb__title {
	margin: 0 36px 6px 0;
	font-size: 1.25rem;
	font-weight: 700;
	line-height: 1.3;
	color: var(--medtest-cb-text);
}

.medtest-cb__subtitle {
	margin: 0 0 18px;
	font-size: 0.9rem;
	line-height: 1.45;
	color: var(--medtest-cb-muted);
}

/* ── Form ── */
.medtest-cb__field {
	margin-bottom: 14px;
}

.medtest-cb__field label {
	display: block;
	margin-bottom: 5px;
	font-size: 0.85rem;
	font-weight: 600;
	color: var(--medtest-cb-text);
}

.medtest-cb__field input {
	box-sizing: border-box;
	width: 100%;
	padding: 12px 14px;
	border: 1.5px solid #d8e2ec;
	border-radius: 10px;
	font-size: 16px; /* prevents iOS zoom on focus */
	line-height: 1.4;
	color: var(--medtest-cb-text);
	background: #fafbfc;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
	-webkit-appearance: none;
	appearance: none;
}

.medtest-cb__field input:focus {
	border-color: var(--medtest-cb-color);
	box-shadow: 0 0 0 3px rgba(13, 142, 200, 0.18);
	outline: none;
	background: var(--medtest-cb-white);
}

.medtest-cb__field input.medtest-cb__input--error {
	border-color: #e53e3e;
	box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.15);
}

.medtest-cb__error {
	margin: 0 0 10px;
	font-size: 0.85rem;
	color: #c53030;
}

.medtest-cb__error:not([hidden]) {
	display: block;
}

.medtest-cb__submit {
	box-sizing: border-box;
	width: 100%;
	padding: 14px 20px;
	border: none;
	border-radius: 10px;
	background: var(--medtest-cb-color);
	color: var(--medtest-cb-white);
	font-size: 1rem;
	font-weight: 700;
	cursor: pointer;
	transition: background 0.15s ease, opacity 0.15s ease;
	-webkit-tap-highlight-color: transparent;
}

.medtest-cb__submit:hover:not(:disabled) {
	background: var(--medtest-cb-hover);
}

.medtest-cb__submit:disabled {
	opacity: 0.65;
	cursor: wait;
}

.medtest-cb__privacy {
	margin: 12px 0 0;
	font-size: 0.75rem;
	line-height: 1.4;
	color: #8a9bab;
	text-align: center;
}

/* Success state */
.medtest-cb__modal-inner--success .medtest-cb__form,
.medtest-cb__modal-inner--success .medtest-cb__subtitle {
	display: none;
}

.medtest-cb__success {
	display: none;
	margin: 8px 0 4px;
	font-size: 1rem;
	line-height: 1.5;
	color: #276749;
	text-align: center;
}

.medtest-cb__modal-inner--success .medtest-cb__success {
	display: block;
}

/* ── Mobile: larger touch target, centered modal ── */
@media (max-width: 480px) {
	.medtest-cb__fab {
		width: 56px;
		height: 56px;
		right: max(14px, env(safe-area-inset-right, 0px));
		bottom: max(14px, env(safe-area-inset-bottom, 0px));
	}

	.medtest-cb__modal {
		right: 12px;
		left: 12px;
		bottom: max(82px, calc(14px + env(safe-area-inset-bottom, 0px) + 56px));
		width: auto;
	}

	.medtest-cb__modal-inner {
		padding: 20px 18px 18px;
	}

	.medtest-cb__title {
		font-size: 1.15rem;
	}
}

/* Very small screens — modal takes more space */
@media (max-width: 360px) {
	.medtest-cb__modal {
		right: 8px;
		left: 8px;
	}
}

/* Hide FAB when modal open (optional visual) */
.medtest-cb--open .medtest-cb__fab {
	transform: scale(0.9);
	opacity: 0.85;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
	.medtest-cb__fab-pulse {
		animation: none;
		display: none;
	}

	.medtest-cb__modal,
	.medtest-cb__overlay,
	.medtest-cb__fab {
		transition: none;
	}
}
