/**
 * Roark – Exposé Inquiry Form
 *
 * Structural/base styles only.
 * All colours, typography and spacing are controlled via Elementor style controls.
 */

/* ── Honeypot (always hidden) ───────────────────────────────────────────── */
.roark-inquiry-honeypot {
	position: absolute;
	left: -9999px;
	top: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
	opacity: 0;
	pointer-events: none;
}

/* ── Wrapper & title ────────────────────────────────────────────────────── */
.roark-inquiry-wrap {
	width: 100%;
}

.roark-inquiry-title {
	margin: 0 0 1rem;
}

/* ── Grid / fields ──────────────────────────────────────────────────────── */
.roark-inquiry-grid {
	display: flex;
	flex-direction: column;
	gap: 0;
}

.roark-inquiry-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin-bottom: 1rem;
}

.roark-inquiry-field--submit {
	margin-bottom: 0;
}

/* ── Labels ─────────────────────────────────────────────────────────────── */
.roark-inquiry-label {
	display: block;
}

.roark-inquiry-required {
	color: currentColor;
	margin-left: 2px;
}

/* ── Inputs / select / textarea ─────────────────────────────────────────── */
.roark-inquiry-input,
.roark-inquiry-select,
.roark-inquiry-textarea {
	display: block;
	width: 100%;
	box-sizing: border-box;
	padding: 8px 12px;
	line-height: 1.5;
}

.roark-inquiry-input:focus,
.roark-inquiry-select:focus,
.roark-inquiry-textarea:focus {
	outline: none;
}

.roark-inquiry-textarea {
	resize: vertical;
	min-height: 100px;
}

/* ── Consent checkbox ───────────────────────────────────────────────────── */
.roark-inquiry-checkbox {
	display: inline-flex;
	align-items: flex-start;
	gap: 0.5rem;
	cursor: pointer;
}

.roark-inquiry-checkbox input[type="checkbox"] {
	flex-shrink: 0;
	margin-top: 3px;
}

/* ── Success message ────────────────────────────────────────────────────── */
.roark-inquiry-success {
	padding: 16px;
	border-radius: 6px;
	font-size: inherit;
	line-height: 1.5;
}

.roark-inquiry-error {
	padding: 12px 16px;
	border-radius: 6px;
	background: #fff5f5;
	border: 1px solid #feb2b2;
	color: #c53030;
	font-size: inherit;
	line-height: 1.5;
	margin-bottom: 16px;
}

/* ── Per-field validation errors (inquiry-form.js) ──────────────────────── */
.roark-inquiry-field-error {
	display: block;
	margin-top: 4px;
	font-size: 0.85em;
	line-height: 1.4;
	color: #c53030;
}

.roark-inquiry-input[aria-invalid="true"],
.roark-inquiry-select[aria-invalid="true"],
.roark-inquiry-textarea[aria-invalid="true"] {
	border-color: #c53030;
}


/* ── International phone input (dial code + number) ──────────────────────── */
/* The field is a query container so the layout responds to its own column
   width, not the viewport — the inquiry form often sits in a narrow Elementor
   column where a viewport media query would never fire. */
.roark-inquiry-field--phone {
	container-type: inline-size;
}

.roark-inquiry-phone-group {
	display: flex;
	flex-wrap: wrap;
	align-items: stretch;
	gap: 8px;
}

.roark-inquiry-dialcode {
	flex: 0 0 auto;
	width: auto;
	min-width: 6.5em;
	box-sizing: border-box;
	padding: 8px 8px;
	line-height: 1.5;
}

/* Themes that wrap every <select> in a width:100% box (ThemeREX `.select_container`)
   pushed the number input onto its own row — size the wrapper like the select. */
.roark-inquiry-phone-group > .select_container,
.roark-inquiry-phone-group > .select-wrapper {
	flex: 0 0 auto;
	width: auto !important;
	min-width: 6.5em;
}

.roark-inquiry-phone-group > .select_container .roark-inquiry-dialcode,
.roark-inquiry-phone-group > .select-wrapper .roark-inquiry-dialcode {
	width: 100%;
}

.roark-inquiry-phone-group .roark-inquiry-phone-input {
	flex: 1 1 9em;
	/* min-width:0 lets the number shrink inside the flex row instead of
	   overflowing the column border; flex-wrap drops it below when there is
	   no room (graceful fallback where @container is unsupported). */
	min-width: 0;
	width: auto;
}

/* Narrow column (or small viewport): stack dial-code over the number, both
   full width, so neither is squashed and nothing overflows. */
@container (max-width: 340px) {
	.roark-inquiry-phone-group {
		flex-direction: column;
		align-items: stretch;
	}

	.roark-inquiry-dialcode,
	.roark-inquiry-phone-group > .select_container,
	.roark-inquiry-phone-group > .select-wrapper,
	.roark-inquiry-phone-group .roark-inquiry-phone-input {
		width: 100% !important;
		flex-basis: auto;
	}
}

/* ── Legal blocks: Datenschutz note, Widerrufsbelehrung, Provisionshinweis ── */
.roark-inquiry-checkbox + .roark-inquiry-checkbox {
	margin-top: 8px;
}

.roark-inquiry-privacy-note {
	margin: 8px 0 0;
	font-size: 0.85em;
	line-height: 1.5;
}

.roark-inquiry-field--widerruf {
	gap: 10px;
}

.roark-inquiry-widerruf-summary {
	cursor: pointer;
	font-weight: 600;
	text-decoration: underline;
}

.roark-inquiry-widerruf-text {
	margin-top: 8px;
	font-size: 0.85em;
	line-height: 1.6;
}

.roark-inquiry-provision-note {
	margin: 0;
	font-size: 0.85em;
	line-height: 1.5;
}

/* ── Submit button: default accent colour ─────────────────────────────────
   The widget's Style ▸ Button controls leave background unset by design, so
   the button falls back to Elementor core's own default `.elementor-button`
   style (grey, ~#6b7280) instead of the site accent. The extra `.roark-
   inquiry-form` qualifier only raises specificity above that bare Elementor
   class — it still loses to any Background/Border colour the user sets via
   the widget's Style tab, since that per-instance CSS is enqueued with this
   stylesheet as an explicit dependency (get_style_depends()) and therefore
   prints after it. */
.roark-inquiry-form .roark-inquiry-button {
	background: var( --roark-btn-bg, #2563eb );
	border-color: var( --roark-btn-bg, #2563eb );
	color: var( --roark-btn-fg, #fff );
}

.roark-inquiry-form .roark-inquiry-button:hover,
.roark-inquiry-form .roark-inquiry-button:focus-visible {
	background: var( --roark-btn-bg-hover, #1d4ed8 );
	border-color: var( --roark-btn-bg-hover, #1d4ed8 );
	color: var( --roark-btn-fg, #fff );
}

/* ── Captcha (Cloudflare Turnstile / Google reCAPTCHA v3) ─────────────────── */
.roark-inquiry-field--captcha {
	margin-bottom: 1rem;
}

.roark-captcha-widget {
	/* Turnstile's own iframe sizes itself; this just keeps it from stretching
	   to the full form width and reserves a little breathing room. */
	display: inline-block;
	max-width: 100%;
}

.roark-inquiry-captcha-error {
	display: block;
	margin-top: 8px;
	font-size: 0.85em;
	line-height: 1.5;
	color: #c53030;
}

.roark-inquiry-recaptcha-notice {
	margin: 8px 0 0;
	font-size: 12px;
	line-height: 1.5;
	color: #6b7280;
}

/* Google requires the notice above whenever the floating badge is hidden —
   only hide it on pages where that notice is actually rendered. */
body:has( .roark-inquiry-recaptcha-notice ) .grecaptcha-badge {
	visibility: hidden;
}
