/*!
 * GrowthCrew Page Builder — Contact Form 7 addon styles.
 *
 * Two surfaces:
 *   1. The embedded form (`.wppb-cf7-addon__form`) — we DON'T
 *      restyle CF7 inputs here. The founder owns the CF7 form
 *      styling either through their theme or addon custom_css.
 *   2. The optional after-submit modal (`.wppb-cf7-modal`) — we
 *      style the modal SHELL (backdrop, dialog box, heading,
 *      close button). The CF7 form inside the modal inherits
 *      the same styling as the embedded form on the page.
 */

/* The addon wrapper has visible content (the form) — no
 * `display: none` / zero-size tricks. */
.wppb-cf7-addon {
	display: block;
}

.wppb-cf7-addon__form {
	display: block;
}

/* ─── Modal shell ────────────────────────────────────────────── */

.wppb-cf7-modal {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 16px;
	box-sizing: border-box;
}

.wppb-cf7-modal[hidden] {
	display: none !important;
}

.wppb-cf7-modal--open {
	display: flex !important;
}

.wppb-cf7-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(3, 24, 69, 0.55);
	-webkit-backdrop-filter: blur(2px);
	backdrop-filter: blur(2px);
	cursor: pointer;
	animation: wppbCf7ModalFade 0.18s ease;
}

.wppb-cf7-modal__dialog {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: 460px;
	max-height: calc(100vh - 32px);
	background: #fff;
	border-radius: 16px;
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
	padding: 2.5rem 2rem 2rem;
	box-sizing: border-box;
	overflow-y: auto;
	animation: wppbCf7ModalPop 0.22s ease;
}

.wppb-cf7-modal__close {
	position: absolute;
	top: 12px;
	right: 14px;
	width: 32px;
	height: 32px;
	padding: 0;
	border: 0;
	background: transparent;
	color: #9aa1ad;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
	border-radius: 8px;
	transition: background 0.14s ease, color 0.14s ease;
}

.wppb-cf7-modal__close:hover,
.wppb-cf7-modal__close:focus {
	background: rgba(3, 24, 69, 0.06);
	color: #031845;
	outline: 0;
}

.wppb-cf7-modal__title {
	margin: 0 0 0.5rem;
	font-size: 1.5rem;
	font-weight: 700;
	color: #031845;
	text-align: center;
	line-height: 1.25;
}

.wppb-cf7-modal__subtitle {
	margin: 0 0 1.5rem;
	font-size: 0.875rem;
	color: #6B7280;
	text-align: center;
	line-height: 1.5;
}

.wppb-cf7-modal__body {
	margin: 0;
}

body.wppb-cf7-modal-active {
	overflow: hidden;
}

/* ─── Editor placeholder card ────────────────────────────────
 * Shown ONLY in the live preview (the engine.js editor canvas),
 * because CF7's shortcode is server-rendered and can't mount in
 * the editor's client-side preview. The card surfaces what the
 * addon is wired to so the founder doesn't lose track of the
 * configuration. On the published page, render() outputs the
 * real form HTML instead and this card never appears. */

.wppb-cf7-addon-preview {
	display: block;
}

.wppb-cf7-addon__editor-card {
	display: flex;
	gap: 14px;
	align-items: center;
	padding: 16px 18px;
	background: #F4F6FB;
	border: 1px dashed #C5CEDB;
	border-radius: 10px;
	color: #031845;
}

.wppb-cf7-addon__editor-icon {
	flex: 0 0 auto;
	width: 36px;
	height: 36px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #145ef3;
	color: #fff;
	border-radius: 8px;
}

.wppb-cf7-addon__editor-text {
	display: flex;
	flex-direction: column;
	gap: 2px;
	font-size: 13px;
	line-height: 1.4;
	min-width: 0;
}

.wppb-cf7-addon__editor-text strong {
	font-size: 13px;
	font-weight: 600;
}

.wppb-cf7-addon__editor-text span {
	color: #6B7280;
	font-size: 12px;
}

.wppb-cf7-addon__editor-text code {
	background: #E6EAF1;
	padding: 1px 6px;
	border-radius: 4px;
	font-size: 11px;
}

@keyframes wppbCf7ModalFade {
	from { opacity: 0; }
	to   { opacity: 1; }
}

@keyframes wppbCf7ModalPop {
	from { opacity: 0; transform: scale(0.95); }
	to   { opacity: 1; transform: scale(1); }
}

/* Narrow viewport — modal fills the screen with a tiny gutter */
@media (max-width: 480px) {
	.wppb-cf7-modal {
		padding: 8px;
	}
	.wppb-cf7-modal__dialog {
		padding: 2rem 1.5rem 1.5rem;
		border-radius: 12px;
	}
}
