/* =========================================================================
   OFAP Orientation Test — front-end
   Tout est scopé sous .ofap-ot pour éviter les conflits avec le thème.
   ========================================================================= */

.ofap-ot,
.ofap-ot * {
	box-sizing: border-box;
}

.ofap-ot {
	--ofap-ot-primary: #ED1C25;
	--ofap-ot-secondary: #22AF9E;
	--ofap-ot-bg: #FFEBDE;
	--ofap-ot-text: #2D2A4E;
	--ofap-ot-card: #FFFFFF;
	--ofap-ot-radius: 18px;
	--ofap-ot-maxw: 760px;

	font-family: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	font-weight: 400;
	color: var(--ofap-ot-text);
	line-height: 1.55;
	-webkit-font-smoothing: antialiased;
	position: relative;
	padding: clamp(20px, 4vw, 48px) clamp(14px, 3vw, 28px);
	border-radius: calc(var(--ofap-ot-radius) + 8px);
	background:
		radial-gradient(120% 80% at 12% -10%, color-mix(in srgb, var(--ofap-ot-secondary) 16%, transparent), transparent 55%),
		radial-gradient(120% 90% at 95% 110%, color-mix(in srgb, var(--ofap-ot-primary) 14%, transparent), transparent 50%),
		var(--ofap-ot-bg);
	overflow: hidden;
}

/* Force Montserrat sur tout le module, quel que soit le thème.
   (Les thèmes ciblent souvent h2/h3/h4 directement, ce qui battait l'héritage
   et faisait apparaître une police serif sur les titres.) */
.ofap-ot,
.ofap-ot *,
.ofap-ot-popup,
.ofap-ot-popup *,
.ofap-ot-modal,
.ofap-ot-modal * {
	font-family: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
}

.ofap-ot__inner {
	max-width: var(--ofap-ot-maxw);
	margin: 0 auto;
	position: relative;
	z-index: 1;
	container-type: inline-size;
	container-name: ofapot;
}

/* --- Marque --------------------------------------------------------------- */
.ofap-ot__brand {
	display: flex;
	justify-content: center;
	margin-bottom: clamp(16px, 3vw, 28px);
}
.ofap-ot__logo {
	height: 48px;
	width: auto;
	object-fit: contain;
}

/* --- Progression ---------------------------------------------------------- */
.ofap-ot__progress {
	margin-bottom: clamp(20px, 3vw, 32px);
}
.ofap-ot__progress-bar {
	height: 8px;
	border-radius: 999px;
	background: color-mix(in srgb, var(--ofap-ot-text) 12%, transparent);
	overflow: hidden;
}
.ofap-ot__progress-bar span {
	display: block;
	height: 100%;
	width: 0;
	border-radius: 999px;
	background: linear-gradient(90deg, var(--ofap-ot-secondary), var(--ofap-ot-primary));
	transition: width .5s cubic-bezier(.22,1,.36,1);
}
.ofap-ot__progress-label {
	margin-top: 8px;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: .02em;
	opacity: .65;
	text-align: right;
}

/* --- Scène + transitions -------------------------------------------------- */
.ofap-ot__stage {
	position: relative;
}
.ofap-ot__screen {
	animation: ofap-ot-in .45s cubic-bezier(.22,1,.36,1) both;
}
.ofap-ot__screen--out {
	animation: ofap-ot-out .28s ease both;
}
@keyframes ofap-ot-in {
	from { opacity: 0; transform: translateY(18px); }
	to   { opacity: 1; transform: translateY(0); }
}
@keyframes ofap-ot-out {
	from { opacity: 1; transform: translateY(0); }
	to   { opacity: 0; transform: translateY(-14px); }
}

/* --- Loader / spinner ----------------------------------------------------- */
.ofap-ot__loader {
	display: flex;
	justify-content: center;
	padding: 40px 0;
}
.ofap-ot__spinner {
	width: 38px; height: 38px;
	border-radius: 50%;
	border: 4px solid color-mix(in srgb, var(--ofap-ot-text) 16%, transparent);
	border-top-color: var(--ofap-ot-primary);
	animation: ofap-ot-spin 0.8s linear infinite;
}
@keyframes ofap-ot-spin { to { transform: rotate(360deg); } }

/* --- Typo communes -------------------------------------------------------- */
.ofap-ot h2.ofap-ot__title {
	font-size: clamp(24px, 4.4vw, 40px);
	font-weight: 700;
	line-height: 1.1;
	margin: 0 0 14px;
	letter-spacing: -0.02em;
	color: var(--ofap-ot-text);
}
.ofap-ot .ofap-ot__lead {
	font-size: clamp(15px, 2.2vw, 18px);
	opacity: .82;
	margin: 0 0 28px;
	max-width: 56ch;
}

/* --- Intro ---------------------------------------------------------------- */
.ofap-ot__intro {
	text-align: center;
	padding: clamp(8px, 2vw, 24px) 0;
}
.ofap-ot__intro .ofap-ot__lead { margin-inline: auto; }
.ofap-ot__kicker {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .14em;
	color: var(--ofap-ot-primary);
	background: color-mix(in srgb, var(--ofap-ot-primary) 12%, var(--ofap-ot-card));
	padding: 7px 14px;
	border-radius: 999px;
	margin-bottom: 18px;
}
.ofap-ot__meta {
	display: flex;
	gap: 22px;
	justify-content: center;
	flex-wrap: wrap;
	margin: 26px 0 30px;
	font-size: 13px;
	font-weight: 600;
	opacity: .7;
}
.ofap-ot__meta span { display: inline-flex; align-items: center; gap: 7px; }

/* --- Question ------------------------------------------------------------- */
.ofap-ot__qindex {
	font-size: 13px;
	font-weight: 700;
	letter-spacing: .04em;
	color: var(--ofap-ot-primary);
	margin-bottom: 10px;
}
.ofap-ot__cards {
	display: grid;
	gap: 12px;
	margin: 22px 0 28px;
}
.ofap-ot__card {
	display: flex;
	align-items: center;
	gap: 14px;
	width: 100%;
	text-align: left;
	background: var(--ofap-ot-card);
	border: 2px solid transparent;
	border-radius: var(--ofap-ot-radius);
	padding: 18px 20px;
	font: inherit;
	font-size: clamp(14px, 1.9vw, 16px);
	color: var(--ofap-ot-text);
	cursor: pointer;
	box-shadow: 0 6px 18px -12px rgba(45,42,78,.4);
	transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
/* Survol réservé aux appareils dotés d'un vrai pointeur (souris).
   Sur tactile (iOS/Android), :hover "colle" après un tap et pré-encadrait
   à tort la réponse suivante. */
@media (hover: hover) and (pointer: fine) {
	.ofap-ot__card:hover {
		transform: translateY(-3px);
		border-color: color-mix(in srgb, var(--ofap-ot-secondary) 55%, transparent);
		box-shadow: 0 16px 30px -16px rgba(45,42,78,.5);
	}
}
.ofap-ot__card:focus-visible {
	outline: 3px solid color-mix(in srgb, var(--ofap-ot-secondary) 60%, transparent);
	outline-offset: 2px;
}
.ofap-ot__card.is-selected {
	border-color: var(--ofap-ot-primary);
	background: color-mix(in srgb, var(--ofap-ot-primary) 7%, var(--ofap-ot-card));
}
.ofap-ot__card-bullet {
	flex: 0 0 auto;
	width: 30px; height: 30px;
	border-radius: 50%;
	display: grid;
	place-items: center;
	font-weight: 700;
	font-size: 13px;
	background: color-mix(in srgb, var(--ofap-ot-text) 8%, transparent);
	color: var(--ofap-ot-text);
	transition: background .18s ease, color .18s ease, transform .18s ease;
}
.ofap-ot__card.is-selected .ofap-ot__card-bullet {
	background: var(--ofap-ot-primary);
	color: #fff;
	transform: scale(1.06);
}
.ofap-ot__card-label { flex: 1; }

/* --- Navigation ----------------------------------------------------------- */
.ofap-ot__nav {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
	flex-wrap: wrap;
}
/* Quand « Précédent » est masqué (1re question), « Suivant » reste à droite. */
.ofap-ot__nav .ofap-ot__btn--primary { margin-left: auto; }
.ofap-ot__btn {
	appearance: none;
	border: none;
	font: inherit;
	font-weight: 700;
	cursor: pointer;
	border-radius: 999px;
	padding: 14px 28px;
	font-size: 15px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	text-align: center;
	transition: transform .15s ease, box-shadow .2s ease, opacity .2s ease, background .2s ease;
}
.ofap-ot__btn--primary {
	background: var(--ofap-ot-primary);
	color: #fff;
	box-shadow: 0 12px 24px -10px color-mix(in srgb, var(--ofap-ot-primary) 80%, transparent);
}
@media (hover: hover) and (pointer: fine) {
	.ofap-ot__btn--primary:hover { transform: translateY(-2px); }
}
.ofap-ot__btn--primary:disabled {
	opacity: .4;
	cursor: not-allowed;
	transform: none;
	box-shadow: none;
}
.ofap-ot__btn--ghost {
	background: transparent;
	color: var(--ofap-ot-text);
	opacity: .7;
	padding-inline: 8px;
}
@media (hover: hover) and (pointer: fine) {
	.ofap-ot__btn--ghost:hover { opacity: 1; }
}
.ofap-ot__btn--block { width: 100%; justify-content: center; }
.ofap-ot__btn--big { padding: 16px 40px; font-size: 16px; }
.ofap-ot__btn--secondary {
	background: var(--ofap-ot-secondary);
	color: #fff;
	box-shadow: 0 12px 24px -10px color-mix(in srgb, var(--ofap-ot-secondary) 80%, transparent);
}
@media (hover: hover) and (pointer: fine) {
	.ofap-ot__btn--secondary:hover { transform: translateY(-2px); }
}

/* --- Formulaire ----------------------------------------------------------- */
.ofap-ot__form { max-width: 540px; margin: 0 auto; }
.ofap-ot__fields {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 14px;
	margin: 24px 0 18px;
}
.ofap-ot__field { display: flex; flex-direction: column; gap: 6px; }
.ofap-ot__field--full { grid-column: 1 / -1; }
.ofap-ot__field label {
	font-size: 13px;
	font-weight: 600;
	opacity: .8;
}
.ofap-ot__field input[type="text"],
.ofap-ot__field input[type="tel"],
.ofap-ot__field input[type="email"] {
	font: inherit;
	font-size: 15px;
	padding: 13px 15px;
	border-radius: 12px;
	border: 2px solid color-mix(in srgb, var(--ofap-ot-text) 14%, transparent);
	background: var(--ofap-ot-card);
	color: var(--ofap-ot-text);
	transition: border-color .15s ease, box-shadow .15s ease;
	width: 100%;
}
.ofap-ot__field input:focus {
	outline: none;
	border-color: var(--ofap-ot-secondary);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--ofap-ot-secondary) 25%, transparent);
}
.ofap-ot__field.has-error input { border-color: var(--ofap-ot-primary); }

.ofap-ot__consent {
	display: flex;
	gap: 12px;
	align-items: flex-start;
	font-size: 13.5px;
	opacity: .9;
	margin: 6px 0 20px;
	line-height: 1.5;
}
.ofap-ot__consent input { margin-top: 3px; width: 18px; height: 18px; flex: 0 0 auto; accent-color: var(--ofap-ot-primary); }
.ofap-ot__consent.has-error { color: var(--ofap-ot-primary); }
.ofap-ot__consent a { color: var(--ofap-ot-secondary); font-weight: 600; }

.ofap-ot__error {
	color: var(--ofap-ot-primary);
	font-size: 14px;
	font-weight: 600;
	margin: 0 0 14px;
	display: none;
}
.ofap-ot__error.is-visible { display: block; }

/* Honeypot : invisible, hors flux, inaccessible aux humains. */
.ofap-ot__hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px; height: 1px;
	overflow: hidden;
	opacity: 0;
}

/* --- Calcul --------------------------------------------------------------- */
.ofap-ot__calc {
	text-align: center;
	padding: clamp(30px, 6vw, 60px) 0;
}
.ofap-ot__calc-ring {
	width: 88px; height: 88px;
	margin: 0 auto 24px;
	border-radius: 50%;
	border: 6px solid color-mix(in srgb, var(--ofap-ot-text) 12%, transparent);
	border-top-color: var(--ofap-ot-primary);
	border-right-color: var(--ofap-ot-secondary);
	animation: ofap-ot-spin 0.9s cubic-bezier(.5,.1,.5,.9) infinite;
}
.ofap-ot__calc-text {
	font-size: clamp(16px, 2.4vw, 20px);
	font-weight: 700;
}
.ofap-ot__calc-sub { opacity: .6; font-size: 14px; margin-top: 6px; }

/* --- Résultat ------------------------------------------------------------- */
.ofap-ot__result { animation: ofap-ot-in .5s cubic-bezier(.22,1,.36,1) both; }
.ofap-ot__result-badge {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .14em;
	color: var(--ofap-ot-secondary);
	margin-bottom: 14px;
}
.ofap-ot__result-card {
	background: var(--ofap-ot-card);
	border-radius: calc(var(--ofap-ot-radius) + 6px);
	padding: clamp(24px, 4vw, 40px);
	box-shadow: 0 30px 60px -30px rgba(45,42,78,.5);
	border-top: 6px solid var(--ofap-ot-primary);
	position: relative;
	overflow: hidden;
}
.ofap-ot__result-icon {
	font-size: 44px;
	line-height: 1;
	margin-bottom: 10px;
}
.ofap-ot__result-title {
	font-size: clamp(24px, 4vw, 36px);
	font-weight: 700;
	letter-spacing: -.02em;
	margin: 0 0 12px;
}
.ofap-ot__result-phrase {
	font-size: clamp(16px, 2.3vw, 19px);
	font-weight: 600;
	color: var(--ofap-ot-primary);
	margin: 0 0 16px;
}
.ofap-ot__result-long { opacity: .85; margin: 0 0 22px; }
.ofap-ot__skills {
	display: flex;
	flex-wrap: wrap;
	gap: 9px;
	margin: 0 0 26px;
	list-style: none;
	padding: 0;
}
.ofap-ot__skills li {
	font-size: 13px;
	font-weight: 600;
	padding: 7px 14px;
	border-radius: 999px;
	background: color-mix(in srgb, var(--ofap-ot-secondary) 14%, transparent);
	color: color-mix(in srgb, var(--ofap-ot-secondary) 75%, var(--ofap-ot-text));
}
.ofap-ot__skills-title,
.ofap-ot__secondary-title {
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .1em;
	opacity: .55;
	margin: 0 0 12px;
}
.ofap-ot__ctas {
	display: flex;
	gap: 12px;
	flex-wrap: wrap;
	margin-top: 8px;
}
.ofap-ot__cta {
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	gap: 8px;
}
.ofap-ot__cta--secondary {
	background: transparent;
	color: var(--ofap-ot-text);
	border: 2px solid color-mix(in srgb, var(--ofap-ot-text) 18%, transparent);
}
@media (hover: hover) and (pointer: fine) {
	.ofap-ot__cta--secondary:hover { border-color: var(--ofap-ot-secondary); }
}

.ofap-ot__secondary {
	margin-top: 22px;
	padding: 22px;
	border-radius: var(--ofap-ot-radius);
	background: color-mix(in srgb, var(--ofap-ot-text) 4%, var(--ofap-ot-card));
	border: 1px dashed color-mix(in srgb, var(--ofap-ot-text) 20%, transparent);
}
.ofap-ot__secondary h4 {
	margin: 0 0 6px;
	font-size: 18px;
	font-weight: 700;
}
.ofap-ot__secondary p { margin: 0 0 14px; opacity: .82; font-size: 14.5px; }

.ofap-ot__restart {
	text-align: center;
	margin-top: 22px;
}

/* --- Mode compact --------------------------------------------------------- */
.ofap-ot--mode-compact { padding: clamp(14px, 3vw, 28px); }
.ofap-ot--mode-compact .ofap-ot__logo { height: 38px; }

/* --- Responsive ----------------------------------------------------------- */
@media (max-width: 560px) {
	.ofap-ot__fields { grid-template-columns: 1fr; }
	.ofap-ot__nav { flex-direction: column-reverse; }
	.ofap-ot__btn--primary { width: 100%; }
	.ofap-ot__card { padding: 15px 16px; }
}

@media (prefers-reduced-motion: reduce) {
	.ofap-ot *,
	.ofap-ot *::before,
	.ofap-ot *::after {
		animation-duration: .01ms !important;
		transition-duration: .01ms !important;
	}
}

/* --- CTA de redirection (page de résultats) ------------------------------ */
.ofap-ot__redirect {
	text-align: center;
	margin-top: 18px;
}
.ofap-ot__redirect-btn { text-decoration: none; }

/* --- Calendly inline (page de résultats) --------------------------------- */
.ofap-ot__calendly {
	margin-top: 28px;
	padding-top: 24px;
	border-top: 1px dashed color-mix(in srgb, var(--ofap-ot-text, #2D2A4E) 22%, transparent);
}
.ofap-ot__calendly-title {
	text-align: center;
	font-size: clamp(18px, 3vw, 22px);
	font-weight: 700;
	margin: 0 0 16px;
	color: var(--ofap-ot-text, #2D2A4E);
}
.ofap-ot__calendly-embed {
	min-width: 320px;
	height: 700px;
	border-radius: calc(var(--ofap-ot-radius, 18px) - 6px);
	overflow: hidden;
}
.ofap-ot__calendly-embed a {
	display: inline-block;
	margin: 24px auto;
	font-weight: 700;
	color: var(--ofap-ot-primary, #ED1C25);
}

@media (max-width: 560px) {
	.ofap-ot__calendly-embed { height: 760px; }
	.ofap-ot__redirect-btn { width: 100%; }
}

/* --- Page de résultats : mise en page deux colonnes ---------------------- */
/* L'écran de résultat s'élargit uniquement quand Calendly est affiché. */
.ofap-ot--wide-result .ofap-ot__inner { max-width: 1080px; }

.ofap-ot__result-layout {
	display: grid;
	grid-template-columns: 1fr;   /* mobile : empilé (inchangé) */
	gap: 24px;
}

@container ofapot (min-width: 760px) {
	.ofap-ot__result-layout {
		grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
		gap: 32px;
		align-items: start;
	}
	/* Colonne Calendly à droite, maintenue visible au défilement. */
	.ofap-ot__result-side {
		position: sticky;
		top: 16px;
	}
	/* Le Calendly est déjà visible à droite : pas besoin de l'ancre. */
	.ofap-ot__bilan-cta { display: none; }
}

/* Repli (navigateurs sans container queries) : bascule sur la largeur écran. */
@supports not (container-type: inline-size) {
	@media (min-width: 1024px) {
		.ofap-ot__result-layout {
			grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
			gap: 32px;
			align-items: start;
		}
		.ofap-ot__result-side { position: sticky; top: 16px; }
		.ofap-ot__bilan-cta { display: none; }
	}
}

/* En côte-à-côte, on retire le séparateur/espacement du mode empilé. */
.ofap-ot__result-side .ofap-ot__calendly {
	margin-top: 0;
	padding-top: 0;
	border-top: none;
}
.ofap-ot__result-side .ofap-ot__calendly-embed { height: 760px; }

/* =========================================================================
   Shortcode popup : bouton déclencheur + fenêtre modale
   ========================================================================= */
/* Variables de repli pour le wrapper (le bouton est hors de .ofap-ot). */
.ofap-ot-popup {
	--ofap-ot-primary: #ED1C25;
	--ofap-ot-secondary: #22AF9E;
	--ofap-ot-text: #2D2A4E;
	--ofap-ot-card: #FFFFFF;
	--ofap-ot-radius: 18px;
	display: flex;
}
.ofap-ot-popup[data-align="center"] { justify-content: center; }
.ofap-ot-popup[data-align="left"]   { justify-content: flex-start; }
.ofap-ot-popup[data-align="right"]  { justify-content: flex-end; }

.ofap-ot-popup__trigger {
	appearance: none;
	border: none;
	cursor: pointer;
	font-weight: 700;
	border-radius: 999px;
	padding: 16px 40px;
	font-size: 16px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	color: #fff;
	background: var(--ofap-ot-primary);
	box-shadow: 0 14px 28px -12px color-mix(in srgb, var(--ofap-ot-primary) 70%, transparent);
	transition: transform .15s ease, box-shadow .2s ease;
}
@media (hover: hover) and (pointer: fine) {
	.ofap-ot-popup__trigger:hover { transform: translateY(-2px); }
}

/* Empêche le défilement de l'arrière-plan quand la modale est ouverte. */
.ofap-ot-modal-open { overflow: hidden; }

.ofap-ot-modal {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding: clamp(12px, 3vw, 40px);
	overflow-y: auto;
	background: rgba(20, 24, 40, .55);
	-webkit-backdrop-filter: blur(3px);
	backdrop-filter: blur(3px);
	opacity: 0;
	transition: opacity .22s ease;
}
.ofap-ot-modal.is-open { opacity: 1; }
.ofap-ot-modal[hidden] { display: none; }

.ofap-ot-modal__backdrop {
	position: absolute;
	inset: 0;
	cursor: pointer;
}
.ofap-ot-modal__box {
	position: relative;
	width: 100%;
	max-width: 1140px;
	margin: auto;
	transform: translateY(12px) scale(.99);
	transition: transform .22s ease;
}
.ofap-ot-modal.is-open .ofap-ot-modal__box {
	transform: translateY(0) scale(1);
}
.ofap-ot-modal__content { width: 100%; }

.ofap-ot-modal__close {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 3;
	width: 42px;
	height: 42px;
	border: none;
	border-radius: 50%;
	background: #fff;
	color: #2D2A4E;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 6px 18px -6px rgba(0,0,0,.4);
	transition: transform .15s ease;
}
@media (hover: hover) and (pointer: fine) {
	.ofap-ot-modal__close:hover { transform: rotate(90deg); }
}

@media (prefers-reduced-motion: reduce) {
	.ofap-ot-modal,
	.ofap-ot-modal__box { transition: none; }
}
