/* Exit dialog (« Fenêtre de sortie »): templates/exit-intent.php, opened by exit-intent.js with showModal().
 * Desktop only (exit-intent.js gate: ≥ 1000 px, fine pointer). Self-contained tokens, white paper card in both page
 * schemes, accent per world (data-world). On product pages the card splits: a paper panel with the real lead photo,
 * its soft floor shadow and the model name as an outlined backdrop word (the site's technology band), then the help.
 * Contrast on #fff: ink #121316 18.6:1, muted #575a61 7.0:1, b2c accent ink #4a6600 7.3:1, b2b olive #55521c 8.05:1.
 * Lime fill #d4ff3a carries #0a0b0d (17:1); the Pro cream #fefee2 carries #0a0b0d (19.2:1) and, being 1.02:1 on the
 * white card, a 1.5 px olive rim (--gx-rim, 7.85:1 against the cream) with the olive raised edge. Focus ring #121316 2 px.
 * Motion (prefers-reduced-motion: no-preference only; transform and opacity only): the card rises .5s, the photo
 * settles then floats (7 s loop), the backdrop word drifts, the body lines enter in sequence (--i, 55 ms apart), the
 * status dot breathes when open, the WhatsApp button carries a light sweep on hover, chips lift. Reduced motion: all
 * of it is off; the dialog opens and closes at once. */

.gp-exit {
	--gx-paper: #fff;
	--gx-panel: #ecebe7;
	--gx-ink: #121316;
	--gx-muted: #575a61;
	--gx-line: rgba(18, 19, 22, .12);
	--gx-field: rgba(18, 19, 22, .5);
	--gx-hover: rgba(18, 19, 22, .06);
	--gx-fill: #d4ff3a;
	--gx-on-fill: #0a0b0d;
	--gx-fill-edge: #4a6600;
	--gx-accent-ink: #4a6600;
	--gx-tint: #f3ffd0;
	--gx-rim: transparent; /* the lime fill reads on white by its hue; the Pro cream needs a rim (below) */
	--gx-ok: #16a34a;
	--gx-danger: #b42318;
	--gx-ring: #121316;
	--gx-radius: 28px;
	--gx-radius-s: 12px;
	--gx-ease-out: cubic-bezier(.16, 1, .3, 1);
	--gx-ease-in-out: cubic-bezier(.76, 0, .24, 1);
	--gx-spring: cubic-bezier(.34, 1.56, .64, 1);
	/* « GP Registered » (main.css) draws ® as a superscript; it is first here too because this window has its own stacks. */
	--gx-display: "GP Registered", "League Spartan", "Arial Narrow", Arial, sans-serif;
	--gx-body: "GP Registered", "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
	color-scheme: light;
	box-sizing: border-box;
	width: min(480px, calc(100vw - 32px));
	max-width: none;
	max-height: calc(100dvh - 32px);
	margin: auto;
	padding: 0;
	overflow: auto;
	overscroll-behavior: contain;
	border: 0;
	border-radius: var(--gx-radius);
	background: var(--gx-paper);
	color: var(--gx-ink);
	font-family: var(--gx-body);
	font-size: 1rem;
	line-height: 1.5;
	text-align: left;
	box-shadow: 0 40px 100px -20px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255, 255, 255, .06), 0 2px 8px rgba(0, 0, 0, .12);
}
.gp-exit[open] { display: grid; }
.gp-exit--split { width: min(860px, calc(100vw - 48px)); }
.gp-exit--split[open] { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); }
.gp-exit[data-world="b2b"] {
	--gx-panel: #121316;
	--gx-fill: #fefee2; /* the Pro cream, as --gp-pro in the theme (this card keeps its own tokens) */
	--gx-on-fill: #0a0b0d;
	--gx-fill-edge: #55521c;
	--gx-accent-ink: #55521c;
	--gx-tint: #fefee2;
	--gx-rim: #55521c;
}
.gp-exit *, .gp-exit *::before, .gp-exit *::after { box-sizing: border-box; }
.gp-exit::backdrop { background: rgba(5, 6, 8, .55); backdrop-filter: blur(6px) saturate(.9); -webkit-backdrop-filter: blur(6px) saturate(.9); }
.gp-exit:focus, .gp-exit:focus-visible { outline: none; } /* the dialog itself takes focus on open (autofocus); controls keep their ring */
.gp-exit ::selection { background: var(--gx-fill); color: var(--gx-on-fill); }
.gp-exit :focus-visible { outline: 2px solid var(--gx-ring); outline-offset: 2px; border-radius: 4px; }
.gp-exit [hidden] { display: none !important; }
.gp-exit .screen-reader-text { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Close ×, 44 × 44, top right, above both columns */
.gp-exit__x { position: absolute; top: 12px; right: 12px; z-index: 3; margin: 0; }
.gp-exit__close { display: grid; place-items: center; width: 44px; height: 44px; margin: 0; padding: 0; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .9); color: var(--gx-ink); cursor: pointer; box-shadow: 0 1px 0 var(--gx-line), 0 0 0 1px var(--gx-line); }
.gp-exit__close:hover { background: #fff; }
.gp-exit__close:focus-visible { outline-offset: -3px; border-radius: 50%; }
.gp-exit__close svg { display: block; }

/* Media panel (product pages): real lead photo on the paper of the technology band */
.gp-exit__media { position: relative; display: grid; place-items: center; min-height: 100%; padding: 40px 28px; overflow: hidden; container-type: inline-size; background: radial-gradient(120% 80% at 50% 38%, #f7f6f2 0%, var(--gx-panel) 62%); isolation: isolate; }
.gp-exit[data-world="b2b"] .gp-exit__media { background: radial-gradient(120% 80% at 50% 38%, #2a2c31 0%, var(--gx-panel) 64%); }
.gp-exit__ghost { position: absolute; inset: 44% auto auto 50%; z-index: -1; width: min-content; translate: -50% -50%; color: transparent; font-family: var(--gx-display); font-size: 29cqi; font-weight: 800; line-height: .84; letter-spacing: -.02em; text-align: center; text-transform: uppercase; -webkit-text-stroke: 1.5px rgba(18, 19, 22, .12); pointer-events: none; user-select: none; }
.gp-exit[data-world="b2b"] .gp-exit__ghost { -webkit-text-stroke-color: rgba(255, 255, 255, .12); }
.gp-exit__halo { position: absolute; inset: 22% 14% 30%; z-index: -1; border-radius: 50%; background: radial-gradient(closest-side, color-mix(in srgb, var(--gx-fill) 55%, transparent), transparent); filter: blur(28px); opacity: .55; }
.gp-exit__photo { position: relative; display: block; width: min(100%, 300px); height: auto; aspect-ratio: 1; object-fit: contain; mix-blend-mode: multiply; } /* multiply drops a white photo background; a drop shadow would outline it */
.gp-exit[data-world="b2b"] .gp-exit__photo { mix-blend-mode: normal; border-radius: 20px; filter: drop-shadow(0 24px 24px rgba(0, 0, 0, .35)); }
.gp-exit__floor { position: absolute; top: calc(50% + 124px); left: 50%; z-index: -1; width: 50%; height: 24px; translate: -50% 0; border-radius: 50%; background: radial-gradient(closest-side, rgba(0, 0, 0, .28), transparent); filter: blur(4px); }

/* Body */
.gp-exit__body { position: relative; padding: 36px 36px 28px; }
.gp-exit--split .gp-exit__body { padding: 44px 40px 32px; }
.gp-exit__eyebrow { margin: 0 52px 10px 0; color: var(--gx-accent-ink); font-family: var(--gx-body); font-size: .78rem; font-weight: 700; letter-spacing: .14em; line-height: 1.2; text-transform: uppercase; }
.gp-exit__title { margin: 0 44px 12px 0; color: var(--gx-ink); font-family: var(--gx-display); font-size: clamp(1.6rem, 1.1rem + 1.1vw, 2.15rem); font-weight: 800; line-height: .98; letter-spacing: -.01em; text-transform: uppercase; text-wrap: balance; }
.gp-exit__text { margin: 0; max-width: 46ch; color: var(--gx-muted); font-size: 1.02rem; line-height: 1.5; text-wrap: pretty; }

/* Live status (exit-intent.js: is-open / is-closed); the plain hours stay without JS */
.gp-exit__live { display: inline-flex; align-items: center; gap: 9px; margin: 16px 0 0; padding: 6px 12px 6px 10px; border-radius: 999px; background: #f3f3f0; color: var(--gx-ink); font-size: .86rem; font-weight: 600; line-height: 1.3; }
.gp-exit__dot { position: relative; flex: none; width: 8px; height: 8px; border-radius: 50%; background: #9a9da3; }
.gp-exit__live.is-open { background: #e9f9ee; }
.gp-exit__live.is-open .gp-exit__dot { background: var(--gx-ok); }
.gp-exit__live.is-closed .gp-exit__dot { background: #c2410c; }
.gp-exit__dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: inherit; opacity: 0; }

/* Prefilled WhatsApp message, as the chat bubble it becomes */
.gp-exit__chat { display: flex; justify-content: flex-end; margin: 18px 0 0; }
.gp-exit__bubble { position: relative; max-width: 88%; margin: 0; padding: 10px 14px 10px; border-radius: 18px 18px 4px 18px; background: var(--gx-tint); color: var(--gx-ink); font-size: .92rem; line-height: 1.45; box-shadow: 0 1px 0 rgba(18, 19, 22, .06); }
.gp-exit__ticks { display: inline-flex; vertical-align: -1px; margin-left: 8px; color: #34b7f1; }

/* Actions */
.gp-exit__actions { display: grid; gap: 10px; margin: 18px 0 0; }
.gp-exit__btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .6em; min-height: 54px; margin: 0; padding: .85em 1.3em .8em; overflow: hidden; border: 0; border-radius: 16px; font-family: var(--gx-display); font-size: 1rem; font-weight: 800; line-height: 1.1; letter-spacing: .03em; text-align: center; text-decoration: none; text-transform: uppercase; cursor: pointer; isolation: isolate; }
.gp-exit__btn .gp-exit__ico { flex: none; width: 22px; height: 22px; margin-top: -2px; }
.gp-exit__btn--primary { background: var(--gx-fill); color: var(--gx-on-fill); box-shadow: inset 0 0 0 1.5px var(--gx-rim), 0 4px 0 var(--gx-fill-edge), 0 14px 30px -12px color-mix(in srgb, var(--gx-fill) 80%, transparent); }
.gp-exit__btn--primary::after { content: ""; position: absolute; inset: 0 auto 0 -60%; z-index: -1; width: 45%; background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .55), transparent); transform: skewX(-18deg) translateX(0); opacity: 0; }
.gp-exit__btn--ghost { min-height: 50px; background: var(--gx-paper); color: var(--gx-ink); font-family: var(--gx-body); font-size: 1.02rem; font-weight: 700; letter-spacing: .01em; text-transform: none; box-shadow: inset 0 0 0 1.5px var(--gx-line); }
.gp-exit__btn--ghost:hover { box-shadow: inset 0 0 0 1.5px var(--gx-ink); }
.gp-exit__btn:focus-visible { outline-offset: 3px; border-radius: 16px; }
.gp-exit__btn:disabled { opacity: .55; cursor: not-allowed; }

/* Self-help chips */
.gp-exit__more { margin: 22px 0 0; padding-top: 18px; border-top: 1px solid var(--gx-line); }
.gp-exit__more-label { margin: 0 0 10px; color: var(--gx-muted); font-size: .8rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.gp-exit__links { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.gp-exit__links li { margin: 0; padding: 0; }
.gp-exit__links a { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px 0 11px; border-radius: 999px; background: #f3f3f0; color: var(--gx-ink); font-size: .9rem; font-weight: 600; text-decoration: none; }
.gp-exit__links a .gp-exit__ico { width: 18px; height: 18px; color: var(--gx-accent-ink); }
.gp-exit__links a:hover { background: var(--gx-tint); }
.gp-exit__links a:focus-visible { border-radius: 999px; }

/* Free-shipping line (real threshold) */
.gp-exit__policy { display: flex; align-items: center; gap: 10px; margin: 18px 0 0; color: var(--gx-muted); font-size: .88rem; font-weight: 600; line-height: 1.4; }
.gp-exit__policy .gp-exit__ico { flex: none; color: var(--gx-ink); }

/* Newsletter form. The form also carries .gp-news (newsletter.php binds it), whose theme rules (site.css: two-column
   grid, dark-scheme field and status colours) are overridden here with one more class. */
.gp-exit .gp-exit__code { margin: 14px 0 0; color: var(--gx-ink); font-size: .94rem; line-height: 1.45; }
.gp-exit .gp-exit__form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; margin: 18px 0 0; }
.gp-exit .gp-exit__form > * { grid-column: 1 / -1; min-width: 0; }
.gp-exit .gp-exit__label { margin: 0; color: var(--gx-ink); font-size: .94rem; font-weight: 600; line-height: 1.3; }
.gp-exit .gp-exit__form .gp-exit__input { display: block; width: 100%; min-width: 0; height: 50px; min-height: 50px; margin: 0; padding: 0 14px; border: 1.5px solid var(--gx-field); border-radius: var(--gx-radius-s); background: var(--gx-paper); color: var(--gx-ink); font: inherit; font-size: 1rem; }
.gp-exit .gp-exit__form .gp-exit__input:focus-visible { outline: 2px solid var(--gx-ring); outline-offset: 1px; border-radius: var(--gx-radius-s); }
.gp-exit .gp-exit__form .gp-exit__input[aria-invalid="true"] { border-color: var(--gx-danger); }
.gp-exit .gp-exit__check { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 10px; align-items: start; }
.gp-exit .gp-exit__check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--gx-ink); cursor: pointer; }
.gp-exit .gp-exit__check input[aria-invalid="true"] { outline: 2px solid var(--gx-danger); outline-offset: 2px; }
.gp-exit .gp-exit__check input[aria-invalid="true"]:focus-visible { outline-color: var(--gx-ring); }
.gp-exit .gp-exit__check label { color: var(--gx-ink); font-size: .88rem; line-height: 1.4; cursor: pointer; }
.gp-exit .gp-exit__fine { margin: 0; color: var(--gx-muted); font-size: .82rem; line-height: 1.45; }
.gp-exit .gp-exit__fine a { min-height: 24px; font-size: inherit; }
.gp-exit .gp-exit__submit { width: 100%; }
.gp-exit .gp-exit__form[aria-busy="true"] .gp-exit__submit { cursor: progress; }
.gp-exit .gp-exit__status { margin: 0; color: var(--gx-ink); font-size: .94rem; font-weight: 600; line-height: 1.45; }
.gp-exit .gp-exit__status:empty { display: block; } /* stays in the accessibility tree, so the first message is announced (the theme hides it) */
.gp-exit .gp-exit__status.is-ok { color: var(--gx-accent-ink); }
.gp-exit .gp-exit__status.is-error { color: var(--gx-danger); }

/* Note and end button (newsletter variant only) */
.gp-exit__note { margin: 18px 0 0; color: var(--gx-muted); font-size: .82rem; line-height: 1.45; }
.gp-exit__end { display: flex; justify-content: center; margin: 6px 0 0; }
.gp-exit__endbtn { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; margin: 0; padding: 0 14px; border: 0; border-radius: 10px; background: transparent; color: var(--gx-ink); font-family: var(--gx-body); font-size: .94rem; font-weight: 600; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .2em; cursor: pointer; }
.gp-exit__endbtn:hover { background: var(--gx-hover); }

/* Motion: only when the visitor has not asked for less. Transform and opacity only. */
@media (prefers-reduced-motion: no-preference) {
	.gp-exit { transition: opacity .22s var(--gx-ease-in-out), transform .22s var(--gx-ease-in-out), overlay .22s allow-discrete, display .22s allow-discrete; }
	.gp-exit:not([open]) { opacity: 0; transform: translateY(10px) scale(.98); }
	.gp-exit[open] { opacity: 1; transform: none; transition-duration: .5s; transition-timing-function: var(--gx-ease-out); }
	@starting-style {
		.gp-exit[open] { opacity: 0; transform: translateY(24px) scale(.96); }
	}
	.gp-exit::backdrop { opacity: 0; transition: opacity .35s ease, overlay .35s allow-discrete, display .35s allow-discrete; }
	.gp-exit[open]::backdrop { opacity: 1; }
	@starting-style {
		.gp-exit[open]::backdrop { opacity: 0; }
	}

	/* Photo settles in, then breathes; the backdrop word drifts slowly */
	.gp-exit[open] .gp-exit__photo { animation: gpx-photo-in .9s var(--gx-ease-out) .08s both, gpx-float 7s ease-in-out 1s infinite; }
	.gp-exit[open] .gp-exit__floor { animation: gpx-floor 7s ease-in-out 1s infinite; }
	.gp-exit[open] .gp-exit__ghost { animation: gpx-ghost 1.2s var(--gx-ease-out) both, gpx-drift 18s ease-in-out 1.2s infinite alternate; }
	.gp-exit[open] .gp-exit__halo { animation: gpx-halo 1.4s ease .2s both; }

	/* Body lines enter in sequence */
	.gp-exit[open] .gp-exit__body > * { animation: gpx-rise .6s var(--gx-ease-out) both; animation-delay: calc(.12s + var(--i, 0) * 55ms); }
	.gp-exit[open] .gp-exit__bubble { animation: gpx-pop .55s var(--gx-spring) both; animation-delay: calc(.35s + var(--i, 0) * 55ms); transform-origin: 100% 100%; }

	/* Living details */
	.gp-exit__live.is-open .gp-exit__dot::after { animation: gpx-ping 2.2s ease-out infinite; }
	.gp-exit__close svg { transition: transform .3s var(--gx-ease-out); }
	.gp-exit__close:hover svg { transform: rotate(90deg); }
	.gp-exit__btn { transition: transform .2s var(--gx-ease-out), box-shadow .2s var(--gx-ease-out), background-color .2s ease; }
	.gp-exit__btn--primary:hover { transform: translateY(-2px); box-shadow: inset 0 0 0 1.5px var(--gx-rim), 0 6px 0 var(--gx-fill-edge), 0 20px 34px -12px color-mix(in srgb, var(--gx-fill) 85%, transparent); }
	.gp-exit__btn--primary:active { transform: translateY(3px); box-shadow: inset 0 0 0 1.5px var(--gx-rim), 0 1px 0 var(--gx-fill-edge), 0 6px 14px -8px color-mix(in srgb, var(--gx-fill) 80%, transparent); }
	.gp-exit__btn--primary:hover::after { animation: gpx-sweep .9s var(--gx-ease-out); }
	.gp-exit__btn .gp-exit__ico { transition: transform .3s var(--gx-spring); }
	.gp-exit__btn:hover .gp-exit__ico { transform: scale(1.12) rotate(-6deg); }
	.gp-exit__btn--ghost:hover { transform: translateY(-1px); }
	.gp-exit__links a { transition: transform .2s var(--gx-ease-out), background-color .2s ease; }
	.gp-exit__links a:hover { transform: translateY(-2px); }
	.gp-exit__links a .gp-exit__ico { transition: transform .3s var(--gx-spring); }
	.gp-exit__links a:hover .gp-exit__ico { transform: scale(1.15); }

	@keyframes gpx-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
	@keyframes gpx-pop { from { opacity: 0; transform: scale(.6) translateY(8px); } to { opacity: 1; transform: none; } }
	@keyframes gpx-photo-in { from { opacity: 0; transform: translateY(26px) scale(.92) rotate(-3deg); } to { opacity: 1; transform: none; } }
	@keyframes gpx-float { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-8px) rotate(.6deg); } }
	@keyframes gpx-floor { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(.88); opacity: .75; } }
	@keyframes gpx-ghost { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: none; } }
	@keyframes gpx-drift { from { transform: translateX(0); } to { transform: translateX(-36px); } }
	@keyframes gpx-halo { from { opacity: 0; transform: scale(.6); } to { opacity: .55; transform: none; } }
	@keyframes gpx-ping { 0% { opacity: .55; transform: scale(1); } 80%, 100% { opacity: 0; transform: scale(2.8); } }
	@keyframes gpx-sweep { from { opacity: 1; transform: skewX(-18deg) translateX(0); } to { opacity: 0; transform: skewX(-18deg) translateX(420%); } }
}

/* Windows high contrast: keep the card edge and the button shapes. */
@media (forced-colors: active) {
	.gp-exit { border: 2px solid CanvasText; }
	.gp-exit__btn, .gp-exit__links a, .gp-exit__live { border: 2px solid ButtonText; }
	.gp-exit__photo { mix-blend-mode: normal; }
}
