/* Pixlab Connexion — fenêtre de connexion sur fond flouté.
   Source unique : fred-toolbox/wordpress/mu-plugins/pixlab-connexion/
   Habillage par site : redéfinir les variables --pxc-* dans le thème, ex.
   :root { --pxc-accent: #26588a; --pxc-police: 'Manrope', sans-serif; } */

:root {
	/* Couleur d'accent : réglage du site, sinon palette du thème (Kadence, block themes, Elementor). */
	--pxc-accent: var(--global-palette1, var(--wp--preset--color--primary, var(--e-global-color-primary, #26588a)));
	--pxc-texte: #0e1c2f;
	--pxc-texte-doux: #5b6577;
	--pxc-voile: rgba(14, 28, 47, 0.55);
	--pxc-flou: 14px;
	--pxc-panneau: rgba(255, 255, 255, 0.94);
	--pxc-champ: #f2f4f7;
	--pxc-rayon: 28px;
	--pxc-police: inherit;
}

/* ─── Le fond ────────────────────────────────────────────────────────────── */

/* <dialog> s'affiche dans la « top layer » : au-dessus de tout, sans z-index ni
   souci d'ancêtre transformé, et centré nativement, WebKit compris. */
html.pxc-ouvert {
	overflow: hidden;
}

/* Le flou de la page elle-même : backdrop-filter seul est inégal selon les
   navigateurs sur ::backdrop, le filter sur la page est sûr partout. */
html.pxc-ouvert body > *:not(.pxc) {
	filter: blur(6px);
	transition: filter 0.2s ease;
}

dialog.pxc::backdrop {
	background: var(--pxc-voile);
	-webkit-backdrop-filter: blur(var(--pxc-flou));
	backdrop-filter: blur(var(--pxc-flou));
	animation: pxc-fondu 0.2s ease;
}

/* ─── La fenêtre ─────────────────────────────────────────────────────────── */

dialog.pxc {
	width: min(480px, calc(100vw - 32px));
	max-width: none;
	max-height: calc(100dvh - 32px);
	margin: auto;
	padding: 0;
	border: 0;
	border-radius: var(--pxc-rayon);
	background: var(--pxc-panneau);
	color: var(--pxc-texte);
	box-shadow: 0 32px 90px rgba(7, 20, 43, 0.28), 0 0 0 1px rgba(255, 255, 255, 0.5) inset;
	font-family: var(--pxc-police);
	font-size: 16px;
	line-height: 1.5;
	overflow: auto;
	overscroll-behavior: contain;
	animation: pxc-entree 0.24s cubic-bezier(0.2, 0.8, 0.2, 1);
}

dialog.pxc.pxc-sortie {
	animation: pxc-sortie 0.18s ease forwards;
}

dialog.pxc.pxc-sortie::backdrop {
	animation: pxc-fondu 0.18s ease reverse forwards;
}

dialog.pxc *,
dialog.pxc *::before,
dialog.pxc *::after {
	box-sizing: border-box;
}

.pxc-panneau {
	position: relative;
	padding: 24px 32px 32px;
}

.pxc-vue {
	display: flex;
	flex-direction: column;
	gap: 16px;
	margin: 0;
}

.pxc-vue[hidden] {
	display: none;
}

/* ─── Onglets « Se connecter » / « Mot de passe oublié » ─────────────────── */

dialog.pxc .pxc-onglets {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 4px;
	margin: 0 44px 24px 0; /* place pour la croix de fermeture */
	padding: 4px;
	border-radius: 14px;
	background: var(--pxc-champ);
}

dialog.pxc .pxc-onglets [role="tab"] {
	min-height: 44px;
	margin: 0;
	padding: 6px 10px;
	border: 0;
	border-radius: 10px;
	background: transparent;
	box-shadow: none;
	color: var(--pxc-texte-doux);
	font: inherit;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: 0;
	text-transform: none;
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease;
}

dialog.pxc .pxc-onglets [role="tab"]:hover {
	color: var(--pxc-texte);
}

dialog.pxc .pxc-onglets [aria-selected="true"] {
	background: #fff;
	color: var(--pxc-accent);
	box-shadow: 0 2px 8px rgba(14, 28, 47, 0.08);
}

dialog.pxc .pxc-intro {
	margin: 0;
	color: var(--pxc-texte-doux);
	font-size: 15px;
	text-align: center;
}

/* ─── Champs ─────────────────────────────────────────────────────────────── */

dialog.pxc .pxc-champ {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin: 0;
	color: var(--pxc-texte);
	font-size: 14px;
	font-weight: 600;
}

dialog.pxc .pxc-champ input {
	width: 100%;
	min-height: 52px;
	margin: 0;
	padding: 0 16px;
	border: 2px solid transparent;
	border-radius: 14px;
	background: var(--pxc-champ);
	box-shadow: none;
	color: var(--pxc-texte);
	font: inherit;
	font-size: 16px; /* 16px minimum : en dessous, iOS zoome au focus. */
	font-weight: 400;
	outline: 0;
	transition: border-color 0.15s ease, background-color 0.15s ease;
}

dialog.pxc .pxc-champ input:focus {
	border-color: var(--pxc-accent);
	background: #fff;
}

dialog.pxc .pxc-mdp {
	position: relative;
	display: block;
}

dialog.pxc .pxc-mdp input {
	padding-right: 52px;
}

dialog.pxc .pxc-voir {
	position: absolute;
	top: 50%;
	right: 6px;
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 10px;
	background: transparent;
	color: var(--pxc-texte-doux);
	cursor: pointer;
	transform: translateY(-50%);
}

dialog.pxc .pxc-voir:hover,
dialog.pxc .pxc-voir[aria-pressed="true"] {
	color: var(--pxc-accent);
}

/* ─── Ligne « se souvenir / oublié » ─────────────────────────────────────── */

dialog.pxc .pxc-ligne {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 8px 16px;
	font-size: 14px;
}

dialog.pxc .pxc-souvenir {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	color: var(--pxc-texte);
	font-weight: 400;
	cursor: pointer;
}

dialog.pxc .pxc-souvenir input {
	width: 18px;
	height: 18px;
	margin: 0;
	accent-color: var(--pxc-accent);
}

dialog.pxc .pxc-lien {
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	color: var(--pxc-accent);
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
}

dialog.pxc .pxc-lien:hover {
	text-decoration: underline;
}

/* ─── Bouton ─────────────────────────────────────────────────────────────── */

dialog.pxc .pxc-bouton {
	width: 100%;
	min-height: 54px;
	margin: 8px 0 0;
	padding: 0 24px;
	border: 0;
	border-radius: 999px;
	background: var(--pxc-accent);
	box-shadow: none;
	color: #fff;
	font: inherit;
	font-size: 16px;
	font-weight: 700;
	letter-spacing: 0;
	text-transform: none;
	cursor: pointer;
	transition: transform 0.15s ease, filter 0.15s ease;
}

dialog.pxc .pxc-bouton:hover {
	filter: brightness(1.08);
	transform: translateY(-1px);
}

dialog.pxc .pxc-attente .pxc-bouton {
	opacity: 0.7;
	cursor: progress;
	transform: none;
}

dialog.pxc :focus-visible {
	outline: 3px solid color-mix(in srgb, var(--pxc-accent) 45%, transparent);
	outline-offset: 2px;
}

dialog.pxc .pxc-champ input:focus-visible {
	outline: 0;
}

/* ─── Messages, pied, fermeture ──────────────────────────────────────────── */

dialog.pxc .pxc-message {
	margin: 0;
	padding: 12px 14px;
	border-radius: 12px;
	background: #fdecec;
	color: #9b1c1c;
	font-size: 14px;
}

dialog.pxc .pxc-message--ok {
	background: #e8f5ee;
	color: #17603a;
}

dialog.pxc .pxc-message[hidden] {
	display: none;
}

dialog.pxc .pxc-pied {
	margin: 4px 0 0;
	color: var(--pxc-texte-doux);
	font-size: 14px;
	text-align: center;
}

dialog.pxc .pxc-pied a {
	color: var(--pxc-accent);
	font-weight: 600;
}

dialog.pxc .pxc-fermer {
	position: absolute;
	top: 32px; /* centrée sur la barre d'onglets */
	right: 24px;
	display: grid;
	place-items: center;
	width: 36px;
	height: 36px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: rgba(14, 28, 47, 0.06);
	color: var(--pxc-texte);
	cursor: pointer;
}

dialog.pxc .pxc-fermer:hover {
	background: rgba(14, 28, 47, 0.12);
}

/* Bouton rendu par [pixlab_connexion] / [xoo_el_pop] : il prend l'apparence
   d'un lien du thème, le thème l'habille au besoin. */
button.pxc-ouvrir {
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	cursor: pointer;
}

@media (max-width: 480px) {
	.pxc-panneau {
		padding: 20px 20px 24px;
	}

	dialog.pxc .pxc-onglets [role="tab"] {
		font-size: 14px;
	}

	dialog.pxc .pxc-fermer {
		top: 28px;
		right: 18px;
	}
}

@keyframes pxc-entree {
	from { opacity: 0; transform: translateY(12px) scale(0.97); }
	to { opacity: 1; transform: none; }
}

@keyframes pxc-sortie {
	to { opacity: 0; transform: translateY(8px) scale(0.98); }
}

@keyframes pxc-fondu {
	from { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
	dialog.pxc,
	dialog.pxc::backdrop,
	html.pxc-ouvert body > * {
		animation: none;
		transition: none;
	}
}
