/**
 * MY HOME CLASS – Connexion
 * Reprend les couleurs et polices du thème (variables de repli si utilisé seul).
 */

.mhc-cx {
	--cx-orange: var(--mhc-orange, #d5570a);
	--cx-orange-deep: var(--mhc-orange-deep, #b04606);
	--cx-orange-soft: var(--mhc-orange-soft, #fbeadf);
	--cx-blue: var(--mhc-blue, #004aad);
	--cx-blue-soft: var(--mhc-blue-soft, #e5eefa);
	--cx-green: var(--mhc-green, #365907);
	--cx-ink: var(--mhc-ink, #16120f);
	--cx-muted: var(--mhc-muted, #6a635c);
	--cx-line: var(--mhc-line, #e7e1d9);
	--cx-tint: var(--mhc-tint, #f8f4ee);
	--cx-display: var(--mhc-display, "Oswald", "Arial Narrow", sans-serif);
	--cx-body: var(--mhc-body, "Source Sans 3", -apple-system, "Segoe UI", Arial, sans-serif);
	background: var(--cx-tint);
	font-family: var(--cx-body);
	color: var(--cx-ink);
}

.mhc-cx *,
.mhc-cx *::before,
.mhc-cx *::after {
	box-sizing: border-box;
}

.mhc-cx-grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	min-height: calc(100vh - 64px);
}

/* Panneau de gauche : la maison du logo */
.mhc-cx-side {
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: center;
	padding: clamp(40px, 6vw, 88px);
	background: var(--cx-blue);
	color: #fff;
	overflow: hidden;
}

.mhc-cx-house {
	position: absolute;
	right: -90px;
	bottom: -70px;
	width: min(330px, 46%);
	height: auto;
	opacity: 0.95;
}

.mhc-cx-house path {
	fill: none;
	stroke: var(--cx-orange);
	stroke-width: 12;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.mhc-cx-house .mhc-cx-cap {
	fill: #fff;
	stroke: none;
}

.mhc-cx-eyebrow {
	margin: 0 0 14px;
	font-family: var(--cx-display);
	font-size: 0.85rem;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--cx-orange-soft);
}

.mhc-cx-side h2 {
	position: relative;
	margin: 0 0 26px;
	font-family: var(--cx-display);
	font-weight: 600;
	font-size: clamp(2.4rem, 4.6vw, 3.8rem);
	line-height: 1;
	color: #fff;
}

.mhc-cx-side h2 em {
	display: block;
	font-family: var(--cx-body);
	font-style: italic;
	font-weight: 700;
	letter-spacing: -0.02em;
	color: #ffd2b5;
}

.mhc-cx-side ul {
	position: relative;
	z-index: 1;
	display: grid;
	gap: 12px;
	max-width: 420px;
	margin: 0 0 26px;
	padding: 0;
	list-style: none;
}

.mhc-cx-side li {
	display: flex;
	gap: 12px;
	align-items: flex-start;
	font-size: 1.05rem;
	font-weight: 600;
}

.mhc-cx-side li::before {
	content: "";
	flex: none;
	width: 22px;
	height: 22px;
	margin-top: 2px;
	border-radius: 50%;
	background: var(--cx-orange) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 13px no-repeat;
}

.mhc-cx-help {
	position: relative;
	max-width: 380px;
	margin: 0;
	font-size: 0.95rem;
	color: rgba(255, 255, 255, 0.82);
}

/* Formulaire */
.mhc-cx-main {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: clamp(28px, 5vw, 64px) 20px;
}

.mhc-cx-card {
	width: 100%;
	max-width: 440px;
	padding: clamp(26px, 4vw, 40px);
	border-radius: 18px;
	background: #fff;
	border: 1px solid var(--cx-line);
	box-shadow: 0 1px 2px rgba(22, 18, 15, 0.05), 0 16px 40px rgba(22, 18, 15, 0.07);
}

.mhc-cx-card h1 {
	margin: 0 0 8px;
	font-family: var(--cx-display);
	font-weight: 600;
	font-size: 2rem;
	line-height: 1.1;
	color: var(--cx-ink);
}

.mhc-cx-lead {
	margin: 0 0 22px;
	color: var(--cx-muted);
}

.mhc-cx-field {
	margin-bottom: 16px;
}

.mhc-cx-field label {
	display: block;
	margin-bottom: 6px;
	font-weight: 700;
	font-size: 0.95rem;
}

.mhc-cx-field input {
	width: 100%;
	min-height: 50px;
	padding: 12px 14px;
	border: 1.5px solid var(--cx-line);
	border-radius: 12px;
	background: #fff;
	font: 500 1.05rem var(--cx-body);
	color: var(--cx-ink);
}

.mhc-cx-field input:focus {
	border-color: var(--cx-blue);
	outline: none;
	box-shadow: 0 0 0 3px var(--cx-blue-soft);
}

.mhc-cx-pass {
	position: relative;
}

.mhc-cx-pass input {
	padding-right: 96px;
}

.mhc-cx-toggle {
	position: absolute;
	top: 50%;
	right: 6px;
	transform: translateY(-50%);
	min-height: 38px;
	padding: 6px 12px;
	border: 0;
	border-radius: 8px;
	background: var(--cx-tint);
	font: 700 0.85rem var(--cx-body);
	color: var(--cx-ink);
	cursor: pointer;
}

.mhc-cx-code {
	font-family: "Courier New", monospace !important;
	font-size: 1.7rem !important;
	font-weight: 700 !important;
	letter-spacing: 0.4em;
	text-align: center;
}

.mhc-cx-row {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: center;
	gap: 10px;
	margin: 4px 0 20px;
	font-size: 0.95rem;
}

.mhc-cx-row a,
.mhc-cx-alt a {
	color: var(--cx-blue);
	font-weight: 600;
}

.mhc-cx-check {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
}

.mhc-cx-check input {
	width: 18px;
	height: 18px;
	accent-color: var(--cx-blue);
}

.mhc-cx-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 52px;
	padding: 12px 22px;
	border: 2px solid transparent;
	border-radius: 999px;
	background: var(--cx-orange);
	color: #fff;
	font: 700 1.05rem var(--cx-body);
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.18s ease;
}

.mhc-cx-btn:hover {
	background: var(--cx-orange-deep);
	color: #fff;
}

.mhc-cx-btn[disabled] {
	opacity: 0.6;
	cursor: progress;
}

.mhc-cx-btn-ghost {
	background: transparent;
	border-color: var(--cx-ink);
	color: var(--cx-ink);
}

.mhc-cx-btn-ghost:hover {
	background: var(--cx-ink);
	color: #fff;
}

.mhc-cx-or {
	display: flex;
	align-items: center;
	gap: 14px;
	margin: 20px 0;
	color: var(--cx-muted);
	font-size: 0.9rem;
}

.mhc-cx-or::before,
.mhc-cx-or::after {
	content: "";
	flex: 1;
	height: 1px;
	background: var(--cx-line);
}

.mhc-cx-alt {
	margin: 18px 0 0;
	text-align: center;
	font-size: 0.95rem;
	color: var(--cx-muted);
}

.mhc-cx-resend {
	margin-top: 14px;
	text-align: center;
}

.mhc-cx-link {
	background: none;
	border: 0;
	padding: 6px;
	color: var(--cx-blue);
	font: 700 0.95rem var(--cx-body);
	text-decoration: underline;
	cursor: pointer;
}

.mhc-cx-link[disabled] {
	color: var(--cx-muted);
	text-decoration: none;
	cursor: default;
}

.mhc-cx-alert {
	margin: 0 0 18px;
	padding: 13px 16px;
	border-radius: 12px;
	border-left: 5px solid var(--cx-green);
	background: #ebf1e1;
	font-weight: 600;
}

.mhc-cx-alert-error {
	border-left-color: #b3261e;
	background: #fbeaea;
	color: #7d1a14;
}

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

.mhc-cx :focus-visible {
	outline: 3px solid var(--cx-blue);
	outline-offset: 2px;
}

@media (max-width: 860px) {
	.mhc-cx-grid {
		grid-template-columns: 1fr;
		min-height: 0;
	}

	.mhc-cx-side {
		padding: 28px 22px 30px;
	}

	.mhc-cx-side h2 {
		font-size: 2.2rem;
		margin-bottom: 0;
	}

	.mhc-cx-side ul,
	.mhc-cx-help,
	.mhc-cx-house {
		display: none;
	}

	.mhc-cx-main {
		padding: 22px 16px 96px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.mhc-cx-btn {
		transition: none;
	}
}

/* Dans l'enveloppe MY HOME CLASS : les boutons-liens gardent leurs couleurs. */
body.macfr-app .mhc-cx a.mhc-cx-btn {
	color: #fff;
	text-decoration: none;
}

body.macfr-app .mhc-cx a.mhc-cx-btn-ghost {
	color: var(--cx-ink);
}

body.macfr-app .mhc-cx a.mhc-cx-btn-ghost:hover {
	color: #fff;
}
