@import url("https://fonts.googleapis.com/css2?family=Fraunces:wght@500;600;700&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap");

:root {
	--mecdm-auth-ink: #1e1633;
	--mecdm-auth-muted: #6a6780;
	--mecdm-auth-purple: #5b4a9e;
	--mecdm-auth-purple-light: #7c6bc4;
	--mecdm-auth-gold: #f0c040;
	/* Shared glass tint — used identically on both sides of the card. */
	--mecdm-glass: rgba(255, 255, 255, 0.12);
	--mecdm-glass-strong: rgba(255, 255, 255, 0.16);
	--mecdm-glass-border: rgba(255, 255, 255, 0.24);
}

body.mecdm-login-page {
	margin: 0;
	color: #fff;
	font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	/* Rich purple backdrop with the four MECDM puzzle colours as ambient glows
	   so the frosted glass card reads clearly on top. */
	background:
		radial-gradient(circle at 14% 18%, rgba(124, 107, 196, 0.55), transparent 42%),
		radial-gradient(circle at 86% 16%, rgba(240, 192, 64, 0.30), transparent 40%),
		radial-gradient(circle at 18% 88%, rgba(21, 181, 111, 0.26), transparent 42%),
		radial-gradient(circle at 88% 84%, rgba(229, 81, 72, 0.26), transparent 42%),
		linear-gradient(150deg, #241b3b 0%, #3a2c66 48%, #4a3d82 100%);
	background-attachment: fixed;
}

body.mecdm-login-page .web-footer,
body.mecdm-login-page .navbar {
	display: none !important;
}

/* ── Shell: centre the glass card on the backdrop ────────────────────── */
.mecdm-auth-shell {
	min-height: 100vh;
	padding: 36px;
	display: flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
}

/* ── The glass show-box ──────────────────────────────────────────────── */
.mecdm-auth-grid {
	position: relative;
	width: min(1060px, 100%);
	min-height: clamp(540px, 76vh, 640px);
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0;
	background: var(--mecdm-glass);
	border: 1px solid var(--mecdm-glass-border);
	border-radius: 28px;
	box-shadow: 0 40px 100px -30px rgba(10, 6, 30, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.18);
	backdrop-filter: blur(26px) saturate(135%);
	-webkit-backdrop-filter: blur(26px) saturate(135%);
	overflow: hidden;
	animation: mecdm-rise 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.mecdm-auth-story,
.mecdm-auth-card {
	position: relative;
	min-height: 100%;
	overflow: hidden;
	box-sizing: border-box;
}

/* ── Left: brand + mission copy (transparent over the shared glass) ──── */
.mecdm-auth-story {
	padding: clamp(34px, 4vw, 56px);
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: flex-start;
	gap: 22px;
	background: transparent;
}

/* Two drifting blobs behind the glass content. */
.mecdm-auth-story::before,
.mecdm-auth-story::after {
	content: "";
	position: absolute;
	border-radius: 50%;
	filter: blur(50px);
	pointer-events: none;
	z-index: 0;
	mix-blend-mode: screen;
	opacity: 0.6;
}

.mecdm-auth-story::before {
	width: 300px;
	height: 300px;
	top: -90px;
	left: -70px;
	background: radial-gradient(circle, rgba(240, 192, 64, 0.5), transparent 70%);
	animation: mecdm-float-a 14s ease-in-out infinite;
}

.mecdm-auth-story::after {
	width: 320px;
	height: 320px;
	bottom: -110px;
	left: 30%;
	background: radial-gradient(circle, rgba(124, 107, 196, 0.55), transparent 70%);
	animation: mecdm-float-b 17s ease-in-out infinite;
}

.mecdm-auth-brand,
.mecdm-auth-copy,
.mecdm-auth-points,
.mecdm-auth-metrics {
	position: relative;
	z-index: 1;
	width: 100%;
}

.mecdm-auth-brand {
	animation: mecdm-rise 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.08s both;
}

/* Smaller, tasteful logo chip (was oversized). */
.mecdm-auth-brand img {
	display: block;
	width: auto;
	height: auto;
	max-width: 148px;
	max-height: 74px;
	object-fit: contain;
	background: #ffffff;
	padding: 8px 12px;
	border-radius: 14px;
	box-shadow: 0 14px 30px rgba(10, 6, 30, 0.3);
}

.mecdm-auth-copy {
	max-width: 420px;
	animation: mecdm-rise 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.16s both;
}

.mecdm-auth-kicker {
	margin: 0 0 12px;
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, 0.72);
}

.mecdm-auth-copy h2 {
	margin: 0;
	font-family: "Fraunces", serif;
	font-size: clamp(2rem, 3.2vw, 2.9rem);
	line-height: 1.04;
	letter-spacing: -0.02em;
	color: #fff;
}

.mecdm-auth-lead {
	margin: 16px 0 0;
	max-width: 400px;
	font-size: 0.95rem;
	line-height: 1.65;
	color: rgba(255, 255, 255, 0.82);
}

.mecdm-auth-points {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 10px;
	animation: mecdm-rise 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.22s both;
}

.mecdm-auth-point {
	padding: 13px 12px 15px;
	border: 1px solid rgba(255, 255, 255, 0.16);
	border-radius: 16px;
	background: rgba(255, 255, 255, 0.10);
	transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.mecdm-auth-point:hover {
	transform: translateY(-3px);
	background: rgba(255, 255, 255, 0.16);
	border-color: rgba(255, 255, 255, 0.3);
}

.mecdm-auth-point span {
	display: inline-block;
	width: 10px;
	height: 10px;
	margin-bottom: 10px;
	border-radius: 999px;
	background: linear-gradient(135deg, var(--mecdm-auth-gold), #fff3cf);
	box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.06);
}

.mecdm-auth-point p {
	margin: 0;
	font-size: 0.82rem;
	line-height: 1.4;
	color: rgba(255, 255, 255, 0.92);
	font-weight: 500;
}

.mecdm-auth-metrics {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 10px;
	animation: mecdm-rise 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.28s both;
}

.mecdm-auth-metric {
	padding: 14px 12px;
	border-radius: 16px;
	background: rgba(16, 12, 32, 0.22);
	border: 1px solid rgba(255, 255, 255, 0.12);
	transition: transform 0.2s ease, background 0.2s ease;
}

.mecdm-auth-metric:hover {
	transform: translateY(-3px);
	background: rgba(16, 12, 32, 0.32);
}

.mecdm-auth-metric strong {
	display: block;
	font-family: "Fraunces", serif;
	font-size: 1.45rem;
	line-height: 1.05;
	color: #fff;
}

.mecdm-auth-metric span {
	display: block;
	margin-top: 5px;
	font-size: 0.7rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, 0.66);
	font-weight: 600;
}

/* ── Right: login form on the matching glass ─────────────────────────── */
.mecdm-auth-panel {
	display: flex;
	align-items: stretch;
}

.mecdm-auth-card {
	width: 100%;
	padding: clamp(34px, 4vw, 56px);
	display: flex;
	flex-direction: column;
	justify-content: center;
	/* Same glass colour as the left — slightly stronger for form legibility. */
	background: var(--mecdm-glass-strong);
	border-left: 1px solid rgba(255, 255, 255, 0.14);
	animation: mecdm-rise 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.12s both;
}

.mecdm-auth-card > * {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: 360px;
	margin-left: auto;
	margin-right: auto;
}

.mecdm-auth-card-head {
	margin-bottom: 22px;
}

.mecdm-auth-eyebrow {
	margin: 0 0 8px;
	font-size: 0.74rem;
	font-weight: 700;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--mecdm-auth-gold);
}

.mecdm-auth-card-head h3 {
	margin: 0;
	font-family: "Fraunces", serif;
	font-size: 1.85rem;
	line-height: 1.05;
	color: #fff;
}

.mecdm-auth-subcopy {
	margin: 12px 0 0;
	font-size: 0.92rem;
	line-height: 1.6;
	color: rgba(255, 255, 255, 0.74);
}

.mecdm-auth-status {
	display: none;
	margin-bottom: 16px;
	padding: 13px 14px;
	border-radius: 14px;
	font-size: 0.9rem;
	line-height: 1.5;
}

.mecdm-auth-status.is-visible { display: block; }
.mecdm-auth-status.is-error { background: rgba(229, 81, 72, 0.22); color: #ffe1de; }
.mecdm-auth-status.is-success { background: rgba(21, 181, 111, 0.22); color: #d6ffec; }
.mecdm-auth-status.is-info { background: rgba(255, 255, 255, 0.14); color: #fff; }

.mecdm-auth-form[hidden] { display: none !important; }

.mecdm-field { margin-bottom: 16px; }

.mecdm-field label {
	display: block;
	margin-bottom: 8px;
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	color: rgba(255, 255, 255, 0.9);
}

.mecdm-field-label-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 8px;
}

/* Inputs stay solid white for maximum readability on the glass. */
.mecdm-field input {
	width: 100%;
	min-height: 52px;
	padding: 0 16px;
	border-radius: 14px;
	border: 1px solid rgba(255, 255, 255, 0.4);
	background: #ffffff;
	font: inherit;
	font-size: 0.96rem;
	color: var(--mecdm-auth-ink);
	box-sizing: border-box;
	transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.mecdm-field input::placeholder { color: #9a96ab; }

.mecdm-field input:focus {
	outline: none;
	border-color: var(--mecdm-auth-gold);
	box-shadow: 0 0 0 4px rgba(240, 192, 64, 0.28);
	transform: translateY(-1px);
}

.mecdm-inline-button,
.mecdm-secondary-link {
	padding: 0;
	border: 0;
	background: transparent;
	font: inherit;
	font-size: 0.88rem;
	font-weight: 700;
	color: rgba(255, 255, 255, 0.92);
	cursor: pointer;
}

.mecdm-inline-button:hover,
.mecdm-secondary-link:hover { color: var(--mecdm-auth-gold); }

.mecdm-primary-button {
	width: 100%;
	min-height: 52px;
	margin-top: 8px;
	border: 0;
	border-radius: 14px;
	background: linear-gradient(135deg, #6d5cb8 0%, #7c6bc4 50%, #8b5cf6 100%);
	box-shadow: 0 18px 38px -18px rgba(10, 6, 30, 0.7);
	font: inherit;
	font-size: 0.98rem;
	font-weight: 700;
	letter-spacing: 0.02em;
	color: #fff;
	cursor: pointer;
	transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.mecdm-primary-button:hover {
	transform: translateY(-2px);
	box-shadow: 0 24px 46px -18px rgba(10, 6, 30, 0.78);
}

.mecdm-primary-button:disabled { cursor: wait; opacity: 0.72; transform: none; }

.mecdm-auth-links {
	display: flex;
	flex-wrap: wrap;
	gap: 10px 16px;
	margin-top: 18px;
	padding-top: 16px;
	border-top: 1px solid rgba(255, 255, 255, 0.16);
}

.mecdm-auth-links [data-switch-view="login"] { display: none; }

.mecdm-auth-shell[data-view="forgot"] .mecdm-auth-links [data-switch-view="forgot"],
.mecdm-auth-shell[data-view="email-link"] .mecdm-auth-links [data-switch-view="email-link"] { display: none; }

.mecdm-auth-shell[data-view="forgot"] .mecdm-auth-links [data-switch-view="login"],
.mecdm-auth-shell[data-view="email-link"] .mecdm-auth-links [data-switch-view="login"] { display: inline-flex; }

/* ── Animations ──────────────────────────────────────────────────────── */
@keyframes mecdm-rise {
	from { opacity: 0; transform: translateY(18px); }
	to { opacity: 1; transform: translateY(0); }
}

@keyframes mecdm-float-a {
	0%, 100% { transform: translate(0, 0) scale(1); }
	50% { transform: translate(24px, 28px) scale(1.12); }
}

@keyframes mecdm-float-b {
	0%, 100% { transform: translate(0, 0) scale(1); }
	50% { transform: translate(-26px, -22px) scale(1.1); }
}

@media (prefers-reduced-motion: reduce) {
	.mecdm-auth-grid,
	.mecdm-auth-brand,
	.mecdm-auth-copy,
	.mecdm-auth-points,
	.mecdm-auth-metrics,
	.mecdm-auth-card,
	.mecdm-auth-story::before,
	.mecdm-auth-story::after { animation: none !important; }
}

/* ── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 980px) {
	.mecdm-auth-grid {
		grid-template-columns: 1fr;
		min-height: auto;
		width: min(480px, 100%);
	}

	.mecdm-auth-card {
		border-left: 0;
		border-top: 1px solid rgba(255, 255, 255, 0.14);
	}

	.mecdm-auth-card > * { max-width: 100%; }
}

@media (max-width: 520px) {
	.mecdm-auth-shell { padding: 18px; }
	.mecdm-auth-story { padding: 30px 24px; gap: 18px; }
	.mecdm-auth-copy h2 { font-size: 2rem; }
	.mecdm-auth-points,
	.mecdm-auth-metrics { grid-template-columns: 1fr 1fr; }
	.mecdm-auth-card { padding: 30px 24px; }
}
