/* SDB — Kingster Adapter | Contact Form 7 em contexto Kingster */

body.sdb-kingster-child .kingster-page-wrapper .wpcf7-form,
body.sdb-kingster-child .gdlr-core-page-builder-body .wpcf7-form {
	color: var(--sdb-color-text, inherit);
}

body.sdb-kingster-child .kingster-page-wrapper .wpcf7-form :where(input[type="text"], input[type="email"], input[type="tel"], input[type="url"], input[type="number"], select, textarea),
body.sdb-kingster-child .gdlr-core-page-builder-body .wpcf7-form :where(input[type="text"], input[type="email"], input[type="tel"], input[type="url"], input[type="number"], select, textarea) {
	border-color: var(--sdb-color-border, currentColor);
	border-radius: var(--sdb-radius-md, 10px);
}

body.sdb-kingster-child .kingster-page-wrapper .wpcf7-form :where(input, select, textarea):focus,
body.sdb-kingster-child .gdlr-core-page-builder-body .wpcf7-form :where(input, select, textarea):focus {
	border-color: var(--sdb-color-primary, currentColor);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--sdb-color-primary, currentColor) 14%, transparent);
}

body.sdb-kingster-child .wpcf7-not-valid-tip {
	color: var(--sdb-state-error-border, var(--sdb-color-danger, #b42318));
}

body.sdb-kingster-child .wpcf7 form .wpcf7-response-output {
	border-color: var(--sdb-color-border, currentColor);
	border-radius: var(--sdb-radius-md, 10px);
}

body.sdb-kingster-child .wpcf7-radio.radio-box,
body.sdb-kingster-child .wpcf7-checkbox.radio-box {
	display: flex;
	flex-wrap: wrap;
	gap: 10px 14px;
}

/* --------------------------------------------------------------------------
 * Modal de sucesso CF7
 * --------------------------------------------------------------------------
 * O antigo CSS Global era responsável por esconder e posicionar este markup.
 * O child theme passa a assumir integralmente esse contrato. `.active` fica
 * apenas como alias de compatibilidade; o runtime atual usa `.is-open`.
 */
body.sdb-kingster-child #cf7-success-modal {
	display: none !important;
	position: fixed;
	inset: 0;
	z-index: 999998;
}

body.sdb-kingster-child #cf7-success-modal.is-open,
body.sdb-kingster-child #cf7-success-modal.active {
	display: block !important;
}

body.sdb-kingster-child #cf7-success-modal[aria-hidden="true"] {
	display: none !important;
}

body.sdb-kingster-child #cf7-success-modal .cf7-success-backdrop {
	position: absolute;
	inset: 0;
	background: var(--sdb-color-overlay, rgba(17, 24, 39, 0.6));
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
}

body.sdb-kingster-child #cf7-success-modal .cf7-success-box {
	position: absolute;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	width: min(520px, calc(100vw - 32px));
	max-height: min(80vh, 680px);
	overflow: auto;
	box-sizing: border-box;
	padding: 30px;
	background: var(--sdb-color-surface, #fff);
	border-radius: var(--sdb-radius-lg, 14px);
	box-shadow: var(--sdb-elevation-4, var(--sdb-shadow-card, 0 24px 70px rgba(0, 0, 0, 0.18)));
	text-align: center;
	z-index: 1;
}

html.sdb-cf7-modal-open,
html.sdb-cf7-modal-open body {
	overflow: hidden;
}

@media (max-width: 520px) {
	body.sdb-kingster-child #cf7-success-modal .cf7-success-box {
		padding: 22px;
	}
}

@media (prefers-reduced-motion: reduce) {
	body.sdb-kingster-child #cf7-success-modal .cf7-success-backdrop {
		backdrop-filter: none;
		-webkit-backdrop-filter: none;
	}
}
