/* Mail Gate – front */

.mgate,
.mgate * {
	box-sizing: border-box;
}

/* Page plein écran ------------------------------------------------------ */

body.mgate-page {
	margin: 0;
	background: var(--mgate-bg, #0e69a2);
}

.mgate-stage {
	position: relative;
	min-height: 100vh;
	min-height: 100dvh;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 32px 16px;
	background:
		radial-gradient(120% 70% at 10% 0%, color-mix(in srgb, var(--mgate-accent, #c2f2dd) 28%, transparent), transparent 60%),
		radial-gradient(110% 70% at 100% 100%, color-mix(in srgb, var(--mgate-mid, #159fbd) 70%, transparent), transparent 65%),
		var(--mgate-bg, #0e69a2);
	color: var(--mgate-fg, #fff);
	overflow: hidden;
	isolation: isolate;
}

.mgate-backdrop {
	position: absolute;
	inset: -40px;
	z-index: -1;
	background-size: cover;
	background-position: center;
	filter: blur(48px) saturate(1.2);
	opacity: 0.22;
}

.mgate-footer {
	margin: 24px 0 0;
	font: 13px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	opacity: 0.7;
}

.mgate-footer a {
	color: inherit;
	text-decoration: none;
}

.mgate-logo {
	display: inline-flex;
	margin: 0 0 18px;
	padding: 8px 14px;
	border-radius: 18px;
	background: #fff;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}

.mgate-logo img {
	display: block;
	height: 96px;
	width: auto;
}

/* Carte ----------------------------------------------------------------- */

.mgate {
	--mgate-radius: 18px;
	width: 100%;
	max-width: 440px;
	margin: 0 auto;
	color: var(--mgate-fg, #fff);
	font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	text-align: left;
}

.mgate--embed {
	margin: 2em auto;
}

.mgate-card {
	background: var(--mgate-bg, #0e69a2);
	border: 1px solid rgba(var(--mgate-fg-rgb, 255, 255, 255), 0.12);
	border-radius: var(--mgate-radius);
	overflow: hidden;
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

.mgate--page .mgate-card {
	background: rgba(var(--mgate-fg-rgb, 255, 255, 255), 0.06);
	backdrop-filter: blur(18px);
	-webkit-backdrop-filter: blur(18px);
}

.mgate-cover img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 1 / 1;
	object-fit: cover;
}

.mgate-body {
	padding: 22px 22px 24px;
}

.mgate .mgate-title {
	margin: 0;
	color: inherit;
	font-size: 1.45rem;
	line-height: 1.2;
	font-weight: 750;
	letter-spacing: -0.01em;
}

.mgate-subtitle {
	margin: 4px 0 0;
	opacity: 0.72;
	font-size: 0.95rem;
}

.mgate-desc {
	margin-top: 12px;
	font-size: 0.95rem;
	opacity: 0.88;
}

.mgate-desc p {
	margin: 0 0 0.6em;
}

.mgate-flow {
	margin-top: 18px;
}

.mgate-flow-label {
	margin: 0 0 8px;
	font-size: 0.8rem;
	font-weight: 650;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	opacity: 0.7;
}

/* Étapes « suivre » ----------------------------------------------------- */

.mgate-steps {
	list-style: none;
	margin: 0 0 16px;
	padding: 0;
	display: grid;
	gap: 8px;
}

.mgate-step {
	margin: 0;
	padding: 0;
}

.mgate-step-btn {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 11px 14px;
	border-radius: 12px;
	background: rgba(var(--mgate-fg-rgb, 255, 255, 255), 0.07);
	border: 1px solid rgba(var(--mgate-fg-rgb, 255, 255, 255), 0.1);
	border-left: 4px solid var(--mgate-accent, #c2f2dd);
	color: inherit !important;
	text-decoration: none !important;
	font-weight: 600;
	font-size: 0.95rem;
	transition: background 0.15s, transform 0.15s;
}

.mgate-step-btn:hover {
	background: rgba(var(--mgate-fg-rgb, 255, 255, 255), 0.12);
	transform: translateY(-1px);
}

.mgate-step-btn:focus-visible,
.mgate-submit:focus-visible,
.mgate-share-btn:focus-visible {
	outline: 3px solid var(--mgate-accent, #c2f2dd);
	outline-offset: 2px;
}

.mgate-step-num {
	flex: none;
	display: grid;
	place-items: center;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	background: var(--mgate-accent, #c2f2dd);
	color: var(--mgate-on-accent, #0b2a3c);
	font-size: 0.8rem;
	font-weight: 700;
}

.mgate-step-label {
	flex: 1;
}

.mgate-step-check {
	flex: none;
	width: 22px;
	height: 22px;
	display: grid;
	place-items: center;
	border-radius: 50%;
	border: 2px solid rgba(var(--mgate-fg-rgb, 255, 255, 255), 0.3);
	color: transparent;
	font-size: 0.75rem;
	font-weight: 800;
	transition: all 0.2s;
}

.mgate-step.is-done .mgate-step-check {
	background: #22c55e;
	border-color: #22c55e;
	color: #fff;
}

.mgate-step.is-done .mgate-step-btn {
	opacity: 0.75;
}

.mgate-step.is-missing .mgate-step-btn {
	animation: mgate-shake 0.4s;
	border-color: var(--mgate-accent, #c2f2dd);
}

@keyframes mgate-shake {
	25% { transform: translateX(-4px); }
	75% { transform: translateX(4px); }
}

/* Formulaire ------------------------------------------------------------ */

.mgate-form {
	display: grid;
	gap: 6px;
	margin: 0;
}

.mgate-hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.mgate-sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

.mgate-label {
	font-size: 0.85rem;
	font-weight: 600;
	margin-top: 4px;
	opacity: 0.85;
}

.mgate .mgate-input {
	width: 100%;
	margin: 0;
	padding: 12px 14px;
	border-radius: 10px;
	border: 1px solid rgba(var(--mgate-fg-rgb, 255, 255, 255), 0.22);
	background: rgba(var(--mgate-fg-rgb, 255, 255, 255), 0.06);
	color: inherit;
	font: inherit;
	box-shadow: none;
}

.mgate .mgate-input::placeholder {
	color: inherit;
	opacity: 0.45;
}

.mgate .mgate-input:focus {
	outline: none;
	border-color: var(--mgate-accent, #c2f2dd);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--mgate-accent, #c2f2dd) 35%, transparent);
}

.mgate-consent {
	display: flex;
	gap: 10px;
	align-items: flex-start;
	margin: 8px 0 4px;
	font-size: 0.8rem;
	line-height: 1.45;
	opacity: 0.85;
	cursor: pointer;
}

.mgate-consent input {
	flex: none;
	margin: 2px 0 0;
	width: 16px;
	height: 16px;
	accent-color: var(--mgate-accent, #c2f2dd);
}

.mgate-consent a {
	color: inherit;
	text-decoration: underline;
}

.mgate .mgate-submit {
	display: inline-flex;
	justify-content: center;
	align-items: center;
	width: 100%;
	margin-top: 6px;
	padding: 14px 20px;
	border: 0;
	border-radius: 999px;
	background: var(--mgate-accent, #c2f2dd);
	color: var(--mgate-on-accent, #fff) !important;
	font: inherit;
	font-weight: 700;
	text-decoration: none !important;
	cursor: pointer;
	transition: filter 0.15s, transform 0.15s, opacity 0.15s;
}

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

.mgate .mgate-submit[aria-disabled="true"],
.mgate .mgate-submit:disabled {
	opacity: 0.45;
	cursor: not-allowed;
	transform: none;
}

.mgate-hint {
	margin: 4px 0 0;
	text-align: center;
	font-size: 0.78rem;
	opacity: 0.6;
}

.mgate-error {
	margin: 6px 0 0;
	padding: 10px 12px;
	border-radius: 10px;
	background: rgba(239, 68, 68, 0.15);
	border: 1px solid rgba(239, 68, 68, 0.5);
	font-size: 0.88rem;
}

/* Résultat & partage ---------------------------------------------------- */

.mgate-result {
	outline: none;
	text-align: center;
}

.mgate-result p {
	margin: 0 0 10px;
}

.mgate-result-title {
	font-size: 1.15rem;
	font-weight: 750;
}

.mgate-share {
	margin-top: 20px;
	padding-top: 16px;
	border-top: 1px solid rgba(var(--mgate-fg-rgb, 255, 255, 255), 0.12);
}

.mgate-share-label {
	font-size: 0.85rem;
	opacity: 0.75;
}

.mgate-share-list {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
}

.mgate .mgate-share-btn {
	display: inline-block;
	padding: 8px 14px;
	border: 1px solid rgba(var(--mgate-fg-rgb, 255, 255, 255), 0.28);
	border-radius: 999px;
	background: rgba(var(--mgate-fg-rgb, 255, 255, 255), 0.08);
	color: var(--mgate-fg, #fff) !important;
	font: inherit;
	font-size: 0.85rem;
	font-weight: 600;
	text-decoration: none !important;
	cursor: pointer;
	transition: transform 0.15s, background 0.15s, color 0.15s;
}

.mgate .mgate-share-btn:hover,
.mgate .mgate-share-app {
	background: var(--mgate-accent, #c2f2dd);
	border-color: var(--mgate-accent, #c2f2dd);
	color: var(--mgate-on-accent, #0b2a3c) !important;
}

.mgate .mgate-share-btn:hover {
	transform: translateY(-1px);
}

.mgate .mgate-share-btn[aria-busy="true"] {
	opacity: 0.6;
	cursor: progress;
}

.mgate-share-hint {
	margin-top: 12px;
	padding: 10px 12px;
	border-radius: 10px;
	background: rgba(var(--mgate-fg-rgb, 255, 255, 255), 0.08);
	font-size: 0.82rem;
	line-height: 1.45;
}

.mgate-share-hint input {
	width: 100%;
	margin-top: 6px;
	padding: 6px 8px;
	border-radius: 6px;
	border: 1px solid rgba(var(--mgate-fg-rgb, 255, 255, 255), 0.25);
	background: transparent;
	color: inherit;
	font: inherit;
	font-size: 0.8rem;
}

@media (prefers-reduced-motion: reduce) {
	.mgate *,
	.mgate *::before {
		transition: none !important;
		animation: none !important;
	}
}
