/**
 * Overlay: `[precisis_cf7_modal]` (Theme-Shortcode).
 */

.precisis-cf7-modal-shell {
	display: block;
	max-width: 100%;
}

.precisis-cf7-modal-shell__trigger.wp-block-button__link {
	display: inline-block;
	cursor: pointer;
	text-decoration: none;
}

/**
 * Sekundär-Button („Glas“) — im Shortcode: button_class="precisis-cf7-modal-shell__trigger--secondary"
 * (Preset „Button Glas“ aus theme.json.)
 */
.precisis-cf7-modal-shell__trigger.precisis-cf7-modal-shell__trigger--secondary {
	background-color: var(--wp--preset--color--button-secondary, rgba(255, 255, 255, 0.5));
	color: var(--wp--preset--color--base, #fff);
	box-shadow: inset 0 0 0 1px rgb(255 255 255 / 35%);
}

.precisis-cf7-modal-shell__trigger.precisis-cf7-modal-shell__trigger--secondary:hover,
.precisis-cf7-modal-shell__trigger.precisis-cf7-modal-shell__trigger--secondary:focus-visible {
	background-color: rgb(255 255 255 / 28%);
	color: var(--wp--preset--color--base, #fff);
}

/*
 * Gleiche Optik wie .wp-block-button.is-style-precisis-button-secondary (precisis-theme.css),
 * aber Klasse direkt auf dem Shortcode-Link — ohne .wp-block-button-Parent.
 */
.precisis-cf7-modal-shell__trigger.wp-block-button__link.is-style-precisis-button-secondary {
	max-width: 100%;
	box-sizing: border-box;
	overflow-wrap: normal;
	word-break: normal;
	background-color: var(--wp--preset--color--button-secondary, rgba(255, 255, 255, 0.5)) !important;
	color: var(--wp--preset--color--primary-alt-accent, #1f3b4c) !important;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.precisis-cf7-modal-shell__trigger.wp-block-button__link.is-style-precisis-button-secondary:hover,
.precisis-cf7-modal-shell__trigger.wp-block-button__link.is-style-precisis-button-secondary:focus-visible {
	background-color: rgba(255, 255, 255, 1) !important;
}

/**
 * Von JS unter body ausgerichtet (.precisis-cf7-modal-shell__modal-root) —
 * eigene Root-Klasse unabhängig vom Shell-Wrapper.
 */
.precisis-cf7-modal[hidden],
.precisis-cf7-modal-shell__modal-root[hidden] {
	display: none !important;
}

.precisis-cf7-modal {
	position: fixed;
	inset: 0;
	box-sizing: border-box;
	width: 100vw;
	min-height: 100vh;
	height: 100%;
	max-width: none;
	max-height: none;
	margin: 0;
	padding: 0;
	z-index: 2147483000;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: auto;
	overscroll-behavior: contain;
	isolation: isolate;
}

.precisis-cf7-modal__backdrop {
	position: absolute;
	inset: 0;
	z-index: 0;
	cursor: pointer;
	background-color: var(--wp--preset--color--overlay-50) !important;
	backdrop-filter: blur(15px);
	-webkit-backdrop-filter: blur(15px);
	border: none;
	padding: 0;
	margin: 0;
	pointer-events: auto;
}

.precisis-cf7-modal__wrapper {
	position: relative;
	z-index: 1;
	box-sizing: border-box;
	width: min(100% - var(--wp--preset--spacing--40, 1.25rem), 36rem);
	max-height: calc(100vh - var(--wp--preset--spacing--50, 2rem));
	margin: var(--wp--preset--spacing--40, 1rem) auto;
	padding: var(--wp--preset--spacing--40, 1.25rem);
	background: transparent;
	border-radius: 0.5rem;
	overflow: auto;
	box-shadow: none;
	outline: none;
	color: var(--wp--preset--color--base, #fff);
}

.precisis-cf7-modal__header {
	display: flex;
	flex-wrap: nowrap;
	align-items: flex-start;
	justify-content: space-between;
	gap: var(--wp--preset--spacing--30, 0.875rem);
	margin-bottom: var(--wp--preset--spacing--40, 1.25rem);
}

.precisis-cf7-modal__title {
	margin: 0;
	font-size: var(--wp--preset--font-size--large, clamp(1.125rem, 2.5vw, 1.5rem));
	line-height: 1.25;
	flex: 1 1 auto;
	min-width: 0;
	padding-right: 0.5rem;
	color: var(--wp--preset--color--base, #fff);
}

.precisis-cf7-modal__close {
	flex: 0 0 auto;
	appearance: none;
	border: none;
	background: transparent;
	font-size: 1.75rem;
	line-height: 1;
	padding: 0.125rem 0.375rem;
	margin: -0.125rem -0.25rem 0 0;
	cursor: pointer;
	color: var(--wp--preset--color--base, #fff);
	border-radius: 0.25rem;
	transition: opacity 0.15s ease, background-color 0.15s ease;
}

.precisis-cf7-modal__close:hover,
.precisis-cf7-modal__close:focus-visible {
	opacity: 0.9;
	background-color: rgba(255, 255, 255, 0.12);
	outline: 2px solid var(--wp--preset--color--base, #fff);
	outline-offset: 2px;
}

/*
 * CF7-Skin (Labels, Inputs, Submit) liegt in precisis-wpcf7-skin.css — Klassen auf dem Formular,
 * Modal-Shortcode setzt automatisch html_class precisis-wpcf7--on-dark (dunkle Skin-Variante).
 */
.precisis-cf7-modal__form {
	margin: 0;
	color: var(--wp--preset--color--base, #fff);
}

.precisis-cf7-modal__form form {
	max-width: 100%;
	margin: 0;
}
