/**
 * CF7 Popup Button - Frontend Styles
 */

/* Trigger button */
.cf7pb-trigger-button {
	display: inline-block;
	font-family: inherit;
	font-size: inherit;
	font-weight: 500;
	line-height: 1.4;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	border: none;
	transition: background-color 0.2s ease, transform 0.1s ease;
	vertical-align: middle;
}

.cf7pb-trigger-button:active {
	transform: translateY(1px);
}

.cf7pb-trigger-button:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

/* Modal overlay wrapper */
.cf7pb-modal {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: none;
	align-items: flex-start;
	justify-content: center;
	padding: 20px;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
}

.cf7pb-modal.cf7pb-is-open {
	display: flex;
	animation: cf7pb-fade-in 0.25s ease;
}

.cf7pb-modal.cf7pb-is-closing {
	animation: cf7pb-fade-out 0.2s ease forwards;
}

/* Overlay backdrop */
.cf7pb-modal-overlay {
	position: fixed;
	inset: 0;
	z-index: 1;
}

/* Dialog wrapper */
.cf7pb-modal-dialog {
	position: relative;
	z-index: 2;
	width: 100%;
	max-width: 100%;
	margin: auto 0;
	display: flex;
	justify-content: center;
	animation: cf7pb-slide-down 0.3s ease;
}

.cf7pb-modal.cf7pb-is-closing .cf7pb-modal-dialog {
	animation: cf7pb-slide-up 0.2s ease forwards;
}

/* Dialog content */
.cf7pb-modal-content {
	position: relative;
	width: 100%;
	padding: 30px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
	box-sizing: border-box;
	max-height: calc(100vh - 40px);
	overflow-y: auto;
}

/* Close button */
.cf7pb-modal-close {
	position: absolute;
	top: 8px;
	right: 8px;
	width: 36px;
	height: 36px;
	padding: 0;
	background: transparent;
	border: none;
	cursor: pointer;
	font-size: 28px;
	line-height: 1;
	color: #555;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.cf7pb-modal-close:hover,
.cf7pb-modal-close:focus {
	background-color: rgba(0, 0, 0, 0.08);
	color: #000;
	outline: none;
}

.cf7pb-modal-close:focus-visible {
	outline: 2px solid #0073aa;
	outline-offset: 2px;
}

/* Modal title */
.cf7pb-modal-title {
	margin: 0 0 20px;
	padding-right: 40px;
	font-size: 22px;
	line-height: 1.3;
	color: #222;
}

/* Screen-reader only helper (in case theme doesn't provide one). */
.cf7pb-modal-title.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* Modal body */
.cf7pb-modal-body {
	font-size: 16px;
	line-height: 1.5;
}

/* Prevent background scroll when modal open */
body.cf7pb-modal-open {
	overflow: hidden;
}

/* Animations */
@keyframes cf7pb-fade-in {
	from { opacity: 0; }
	to   { opacity: 1; }
}

@keyframes cf7pb-fade-out {
	from { opacity: 1; }
	to   { opacity: 0; }
}

@keyframes cf7pb-slide-down {
	from {
		opacity: 0;
		transform: translateY(-20px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@keyframes cf7pb-slide-up {
	from {
		opacity: 1;
		transform: translateY(0);
	}
	to {
		opacity: 0;
		transform: translateY(-20px);
	}
}

/* Responsive adjustments */
@media (max-width: 600px) {
	.cf7pb-modal {
		padding: 10px;
	}
	.cf7pb-modal-content {
		padding: 20px;
	}
	.cf7pb-modal-title {
		font-size: 18px;
	}
}

/* Respect reduced-motion preference */
@media (prefers-reduced-motion: reduce) {
	.cf7pb-modal.cf7pb-is-open,
	.cf7pb-modal.cf7pb-is-closing,
	.cf7pb-modal-dialog,
	.cf7pb-modal.cf7pb-is-closing .cf7pb-modal-dialog {
		animation: none;
	}
	.cf7pb-trigger-button {
		transition: none;
	}
}
