/**
 * FormStep — conversational front-end (Typeform-like).
 */

.xplore-form {
	--xf-accent: #2d6a4f;
	--xf-accent-2: #00c2ff;
	--xf-text: #0a1020;
	--xf-muted: #667085;
	--xf-border: #dfe4ec;
	--xf-field-bg: #ffffff;
	--xf-field-radius: 18px;
	--xf-form-radius: 28px;
	--xf-glow: rgba(45, 106, 79, 0.28);
	--xf-glow: color-mix(in srgb, var(--xf-accent) 28%, transparent);
	--xf-ink-on-accent: #ffffff;
	--xf-bg: #ffffff;
	--xf-dy: 28px;
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	width: 100%;
	margin: 0;
	min-height: 480px;
	background: var(--xf-bg);
	color: var(--xf-text);
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	position: relative;
	overflow: hidden;
	border: none;
	box-shadow: none;
	/* !important : certains thèmes WordPress forcent border-radius: 0 */
	border-radius: var(--xf-form-radius) !important;
	isolation: isolate;
	transform: translateZ(0);
}

/* Remonter l’arrondi sur les wrappers thème / Elementor (sinon coins carrés du parent blanc) */
.elementor-widget:has(.xplore-form),
.elementor-widget-container:has(.xplore-form),
.elementor-shortcode:has(.xplore-form),
.wp-block-shortcode:has(.xplore-form),
.entry-content > .xplore-form,
.entry-content > *:has(> .xplore-form) {
	background: transparent !important;
	border: none !important;
	box-shadow: none !important;
	padding: 0 !important;
	margin-left: 0 !important;
	margin-right: 0 !important;
	border-radius: var(--xf-form-radius, 28px) !important;
	overflow: hidden !important;
}

.xplore-form *,
.xplore-form *::before,
.xplore-form *::after {
	box-sizing: border-box;
}

.xplore-form__loading {
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 48px 24px;
	text-align: center;
	color: var(--xf-muted);
}

.xplore-form__loading-inner {
	display: flex;
	flex-direction: column;
	align-items: center;
	max-width: 22rem;
}

.xplore-form__spinner {
	width: 44px;
	height: 44px;
	margin-bottom: 20px;
	border: 3px solid var(--xf-border);
	border-top-color: var(--xf-accent);
	border-radius: 50%;
	animation: xplore-form-spin 0.85s linear infinite;
}

.xplore-form__spinner.is-error {
	animation: none;
	border-color: #fecaca;
	border-top-color: #dc2626;
}

.xplore-form__loading-text {
	margin: 0 0 18px;
	font-size: 15px;
	line-height: 1.4;
	color: var(--xf-muted);
}

@keyframes xplore-form-spin {
	to {
		transform: rotate(360deg);
	}
}

@media (prefers-reduced-motion: reduce) {
	.xplore-form__spinner {
		animation: none;
		border-color: var(--xf-border);
		border-top-color: var(--xf-accent);
		opacity: 0.85;
	}
}

.xplore-form__shell {
	display: flex;
	flex-direction: column;
	min-height: 480px;
	height: 100%;
	flex: 1;
}

.xplore-form__main {
	display: flex;
	flex-direction: column;
	flex: 1;
	min-width: 0;
	min-height: 0;
	background: var(--xf-bg);
}

.xplore-form__progress {
	padding: 14px 24px 0;
	background: var(--xf-bg);
	z-index: 2;
	flex: none;
}

.xplore-form__progress-track {
	height: 4px;
	background: var(--xf-border);
	border-radius: 999px;
	overflow: hidden;
}

.xplore-form__progress-bar {
	height: 100%;
	width: 0%;
	background: var(--xf-accent);
	border-radius: 999px;
	transition: width 0.35s ease;
}

.xplore-form__progress-meta {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-top: 8px;
	font-size: 12px;
	color: var(--xf-muted);
}

.xplore-form__steps {
	display: flex;
	flex-wrap: wrap;
	margin-top: 8px;
	/* gap fallback: Safari < 14.5 / Chrome < 84 lack flex gap */
	margin-left: -4px;
}

.xplore-form__step-dot {
	width: 8px;
	height: 8px;
	margin: 0 0 4px 4px;
	border-radius: 50%;
	background: var(--xf-border);
}

.xplore-form__step-dot.is-done,
.xplore-form__step-dot.is-current {
	background: var(--xf-accent);
}

.xplore-form__step-dot.is-current {
	box-shadow: 0 0 0 3px rgba(45, 106, 79, 0.25);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--xf-accent) 25%, transparent);
}

/* Legacy alias — older markup used .xplore-form__body */
.xplore-form__body {
	display: flex;
	flex: 1;
	min-height: 0;
}

.xplore-form__media {
	position: relative;
	flex: none;
	background: #0b1220;
	overflow: hidden;
	isolation: isolate;
}

.xplore-form__media img,
.xplore-form__media video {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
	display: block;
}

/* Soft edge blend into the form panel */
.xplore-form__media::after {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
	z-index: 1;
}

.xplore-form__panel {
	flex: 1;
	display: flex;
	flex-direction: column;
	justify-content: center;
	padding: 24px 28px 20px;
	background: var(--xf-bg);
	min-width: 0;
	min-height: 0;
}

.xplore-form--questions_only .xplore-form__media {
	display: none;
}

/* ——— media_left : photo full-height beside the form ——— */
.xplore-form--media_left .xplore-form__shell {
	flex-direction: row;
	align-items: stretch;
}

.xplore-form--media_left .xplore-form__media {
	flex: 0 0 clamp(240px, 40%, 520px);
	align-self: stretch;
	min-height: 100%;
	/* Subtle vignette — keeps a clean Typeform-like split without muddy fade */
	box-shadow: inset -24px 0 40px -28px rgba(0, 0, 0, 0.18);
}

.xplore-form--media_left .xplore-form__media::after {
	background:
		linear-gradient(180deg, rgba(0, 0, 0, 0.12) 0%, transparent 28%),
		linear-gradient(0deg, rgba(0, 0, 0, 0.1) 0%, transparent 22%);
}

.xplore-form--media_left .xplore-form__main {
	flex: 1 1 auto;
}

.xplore-form--media_left .xplore-form__panel {
	padding-left: clamp(28px, 5vw, 56px);
	padding-right: clamp(28px, 5vw, 56px);
}

/* ——— media_top : cinematic banner above the form ——— */
.xplore-form--media_top .xplore-form__shell {
	flex-direction: column;
}

.xplore-form--media_top .xplore-form__media {
	flex: 0 0 auto;
	width: 100%;
	height: clamp(160px, 28vh, 280px);
}

.xplore-form--media_top .xplore-form__media::after {
	background: linear-gradient(
		180deg,
		transparent 45%,
		color-mix(in srgb, var(--xf-bg) 88%, transparent) 88%,
		var(--xf-bg) 100%
	);
}

.xplore-form--media_top .xplore-form__progress {
	padding-top: 8px;
}

.xplore-form--media_top .xplore-form__panel {
	padding-top: 12px;
}

.xplore-form__panel.is-entering {
	animation: xplore-form-in 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes xplore-form-in {
	from {
		opacity: 0;
		transform: translateY(var(--xf-dy, 28px));
	}
}

.xplore-form__label {
	font-size: 1.5rem; /* fallback when clamp() unsupported */
	font-size: clamp(1.4rem, 4vw, 2.2rem);
	font-weight: 600;
	line-height: 1.18;
	letter-spacing: -0.022em;
	margin: 0 0 8px;
	max-width: 20em;
	color: var(--xf-text);
}

.xplore-form__label .req {
	color: #e5384f;
	margin-left: 4px;
}

.xplore-form__panel--multi {
	justify-content: flex-start;
	overflow-y: auto;
}

.xplore-form__field-block {
	margin-bottom: 8px;
}

.xplore-form__field-block + .xplore-form__field-block {
	margin-top: 22px;
	padding-top: 20px;
	border-top: 1px solid var(--xf-border);
}

.xplore-form__label--compact {
	font-size: 1.15rem; /* fallback when clamp() unsupported */
	font-size: clamp(1.1rem, 2vw, 1.45rem);
	margin-bottom: 10px;
	letter-spacing: -0.015em;
}

.xplore-form__panel--multi .xplore-form__option {
	padding: 12px 14px;
}

.xplore-form__panel--multi .xplore-form__actions {
	margin-top: 20px;
}

.xplore-form__help {
	font-size: 15px;
	line-height: 1.5;
	color: var(--xf-muted);
	margin: 0 0 22px;
}

/* Field shell — style maquette multi-étapes */
.xplore-form__field {
	position: relative;
	max-width: 40rem;
	overflow: hidden;
	border-radius: var(--xf-field-radius) !important;
	background: var(--xf-field-bg);
	border: 1px solid var(--xf-border);
	transition: box-shadow 0.25s ease, border-color 0.25s ease;
}

.xplore-form__field::before {
	content: "";
	position: absolute;
	inset: -1px;
	border-radius: inherit;
	padding: 1px;
	pointer-events: none;
	opacity: 0;
	transition: opacity 0.25s ease;
	background: linear-gradient(120deg, var(--xf-accent), var(--xf-accent-2));
	-webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
	-webkit-mask-composite: xor;
	mask-composite: exclude;
}

.xplore-form__field:hover {
	border-color: color-mix(in srgb, var(--xf-accent) 50%, var(--xf-border));
}

.xplore-form__field:focus-within {
	border-color: transparent;
	box-shadow: 0 0 0 5px var(--xf-glow);
}

.xplore-form__field:focus-within::before {
	opacity: 1;
}

.xplore-form__input,
.xplore-form__textarea {
	-webkit-appearance: none !important;
	appearance: none !important;
	width: 100%;
	border: 0 !important;
	outline: 0;
	background: transparent !important;
	color: var(--xf-text);
	font: inherit;
	/* >=16px: avoids iOS Safari auto-zoom on focus */
	font-size: 16px;
	font-size: clamp(1.125rem, 3vw, 1.375rem);
	padding: 18px 20px;
	border-radius: var(--xf-field-radius) !important;
	letter-spacing: -0.01em;
	box-shadow: none !important;
}

.xplore-form__textarea {
	min-height: 150px;
	resize: vertical;
	line-height: 1.5;
}

.xplore-form__input::placeholder,
.xplore-form__textarea::placeholder {
	color: var(--xf-muted);
	opacity: 0.6;
}

.xplore-form__input[type="date"]::-webkit-calendar-picker-indicator {
	cursor: pointer;
	opacity: 0.55;
}

.xplore-form__input[type="date"]:hover::-webkit-calendar-picker-indicator,
.xplore-form__field:focus-within .xplore-form__input[type="date"]::-webkit-calendar-picker-indicator {
	opacity: 0.9;
}

.xplore-form__input[type="number"] {
	-moz-appearance: textfield;
}

.xplore-form__input[type="number"]::-webkit-outer-spin-button,
.xplore-form__input[type="number"]::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.xplore-form__options {
	display: grid;
	gap: 10px;
	max-width: 32rem;
}

.xplore-form__option {
	position: relative;
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 13px 16px;
	border: 1px solid var(--xf-border);
	border-radius: 16px !important;
	cursor: pointer;
	background: var(--xf-field-bg);
	font-size: 1.05rem;
	transition: border-color 0.2s ease, background 0.2s ease, transform 0.15s ease;
}

.xplore-form__option input {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
	margin: 0;
	pointer-events: none;
}

.xplore-form__option-key {
	display: grid;
	place-items: center;
	flex: none;
	width: 28px;
	height: 28px;
	border-radius: 8px;
	border: 1px solid var(--xf-border);
	font-size: 12px;
	font-weight: 600;
	color: var(--xf-muted);
	background: #fff;
	transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.xplore-form__option-label {
	flex: 1;
	min-width: 0;
	line-height: 1.4;
	letter-spacing: -0.01em;
	color: var(--xf-text);
}

.xplore-form__option:hover {
	border-color: var(--xf-accent);
}

.xplore-form__option.is-selected {
	border-color: var(--xf-accent);
	background: rgba(45, 106, 79, 0.11);
	background: color-mix(in srgb, var(--xf-accent) 11%, var(--xf-field-bg));
}

.xplore-form__option.is-selected .xplore-form__option-key {
	background: var(--xf-accent);
	border-color: var(--xf-accent);
	color: var(--xf-ink-on-accent);
}

.xplore-form__option:active {
	transform: scale(0.995);
}

.xplore-form__error {
	color: #e5384f;
	font-size: 14px;
	margin-top: 10px;
	min-height: 1.35em;
}

.xplore-form__captcha {
	display: flex;
	justify-content: center;
	margin-top: 16px;
	min-height: 0;
}

.xplore-form__captcha--dock {
	display: none;
	margin: 8px 0 4px;
}

.xplore-form__captcha--dock.is-visible {
	display: flex;
}

.xplore-form__loading .xplore-form__captcha {
	margin-top: 20px;
}

.xplore-form__actions {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 16px;
	margin-top: 22px;
}

.xplore-form__actions > * + * {
	margin-left: 0;
}

.xplore-form__ok {
	-webkit-appearance: none;
	appearance: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	border: none;
	background: var(--xf-accent);
	color: var(--xf-ink-on-accent);
	font-weight: 600;
	font-size: 16px;
	padding: 14px 28px;
	border-radius: 14px;
	cursor: pointer;
	box-shadow: 0 12px 30px -12px var(--xf-accent);
	transition: transform 0.15s ease, filter 0.2s ease, opacity 0.15s ease;
}

.xplore-form__ok:hover {
	filter: brightness(1.08);
	transform: translateY(-1px);
}

.xplore-form__ok:active {
	transform: translateY(0);
	filter: brightness(0.96);
}

.xplore-form__ok:disabled {
	opacity: 0.55;
	cursor: wait;
	box-shadow: none;
}

.xplore-form__ok:focus {
	outline: none;
}

.xplore-form__ok:focus-visible {
	outline: 2px solid var(--xf-accent);
	outline-offset: 3px;
}

.xplore-form__hint {
	font-size: 13px;
	color: var(--xf-muted);
}

.xplore-form__nav {
	display: flex;
	justify-content: flex-end;
	padding: 8px 20px 12px;
}

.xplore-form__nav-group {
	display: inline-flex;
	align-items: stretch;
	border: 1px solid var(--xf-border);
	border-radius: 14px;
	overflow: hidden;
	background: var(--xf-field-bg);
}

.xplore-form__nav-btn {
	-webkit-appearance: none;
	appearance: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	margin: 0;
	padding: 0;
	border: none;
	border-radius: 0;
	background: transparent;
	color: var(--xf-muted);
	cursor: pointer;
	transition: background 0.18s ease, color 0.18s ease, opacity 0.15s ease, filter 0.18s ease;
}

.xplore-form__nav-btn + .xplore-form__nav-btn {
	border-left: 1px solid var(--xf-border);
}

.xplore-form__nav-icon {
	display: block;
	pointer-events: none;
}

.xplore-form__nav-btn.xplore-form__next {
	background: var(--xf-accent);
	color: var(--xf-ink-on-accent);
}

.xplore-form__nav-btn:disabled {
	opacity: 0.35;
	cursor: default;
}

.xplore-form__nav-btn:not(:disabled):hover {
	color: var(--xf-text);
}

.xplore-form__nav-btn.xplore-form__next:not(:disabled):hover {
	background: var(--xf-accent);
	color: var(--xf-ink-on-accent);
	filter: brightness(1.08);
}

.xplore-form__nav-btn:not(:disabled):active {
	filter: brightness(0.96);
}

.xplore-form__nav-btn:focus {
	outline: none;
}

.xplore-form__nav-btn:focus-visible {
	outline: 2px solid var(--xf-accent);
	outline-offset: -2px;
	z-index: 1;
}

.xplore-form__nav-btn.xplore-form__next:focus-visible {
	outline-color: #fff;
	box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.35);
}

.xplore-form__powered {
	padding: 0 20px 14px;
	text-align: center;
	font-size: 11px;
	line-height: 1.4;
	color: var(--xf-muted);
	text-transform: none;
}

.xplore-form__powered a {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.xplore-form__powered a:hover {
	color: var(--xf-accent);
}

.xplore-form__powered--loading {
	padding: 0;
	font-size: 16px;
	line-height: 1.45;
	color: var(--xf-text);
}

.xplore-form__powered--loading a {
	color: var(--xf-accent);
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.xplore-form__powered--loading a:hover {
	filter: brightness(0.92);
}

@media (max-width: 768px) {
	/* media_left stacks as a hero banner on small screens */
	.xplore-form--media_left .xplore-form__shell {
		flex-direction: column;
	}

	.xplore-form--media_left .xplore-form__media {
		flex: 0 0 auto;
		width: 100%;
		height: clamp(140px, 26vh, 220px);
		min-height: 0;
		max-height: none;
	}

	.xplore-form--media_left .xplore-form__media {
		box-shadow: none;
	}

	.xplore-form--media_left .xplore-form__media::after {
		background: linear-gradient(
			180deg,
			rgba(0, 0, 0, 0.08) 0%,
			transparent 30%,
			transparent 45%,
			rgba(255, 255, 255, 0.55) 82%,
			var(--xf-bg) 100%
		);
	}

	.xplore-form--media_left .xplore-form__panel {
		max-width: none;
		margin-inline: 0;
	}

	.xplore-form--media_top .xplore-form__media {
		height: clamp(120px, 22vh, 200px);
	}

	.xplore-form__progress {
		padding: 12px 16px 0;
	}

	.xplore-form__panel {
		padding: 16px;
		padding-left: max(16px, env(safe-area-inset-left));
		padding-right: max(16px, env(safe-area-inset-right));
	}

	.xplore-form--media_left .xplore-form__panel,
	.xplore-form--media_top .xplore-form__panel {
		padding-top: 8px;
	}

	.xplore-form__hint {
		display: none; /* "Entrée" is desktop-oriented on touch devices */
	}
}

@media (hover: none) and (pointer: coarse) {
	.xplore-form__hint {
		display: none;
	}
}

/* Full-page templates — edge-to-edge, no theme margins */
html:has(body.xplore-form-page),
body.xplore-form-page {
	margin: 0 !important;
	padding: 0 !important;
	width: 100%;
	max-width: none;
	min-height: 100vh;
	min-height: 100dvh;
	background: #fff;
	overflow-x: hidden;
}

body.xplore-form-page #wpadminbar {
	display: none !important;
}

body.xplore-form-page {
	padding-top: 0 !important;
}

.xplore-form-page .xplore-form {
	width: 100%;
	max-width: none;
	margin: 0;
	min-height: 100vh;
	min-height: 100dvh;
	/* Allow scroll when iOS keyboard shrinks the visual viewport */
	overflow: auto;
	border-radius: 0 !important;
	border: none;
	box-shadow: none;
}

.xplore-form-page .xplore-form__shell {
	min-height: 100vh;
	min-height: 100dvh;
}

.xplore-form-page .xplore-form__main {
	min-height: 0;
}

.xplore-form-page--media_left .xplore-form__media {
	flex-basis: clamp(280px, 42vw, 560px);
	min-height: 100vh;
	min-height: 100dvh;
}

.xplore-form-page--media_top .xplore-form__media {
	height: clamp(200px, 32vh, 360px);
	max-height: none;
}

@media (max-width: 768px) {
	.xplore-form-page--media_left .xplore-form__media {
		flex-basis: auto;
		min-height: 0;
		height: clamp(160px, 28vh, 240px);
	}

	.xplore-form-page--media_top .xplore-form__media {
		height: clamp(140px, 24vh, 220px);
	}
}

@supports (padding: max(0px)) {
	.xplore-form-page .xplore-form__powered {
		padding-bottom: max(14px, env(safe-area-inset-bottom));
	}
}

@media (prefers-reduced-motion: reduce) {
	.xplore-form__panel.is-entering,
	.xplore-form__spinner {
		animation: none !important;
	}

	.xplore-form__field,
	.xplore-form__option,
	.xplore-form__ok,
	.xplore-form__nav-btn {
		transition: none !important;
	}
}
