/* Login, forgot-password and reset pages.
 *
 * Applied over Frappe's markup via web_include_css rather than overriding
 * www/login.html. Colours arrive as custom properties set by portal.js from
 * Merchant Portal Settings.
 */

:root {
	--mo-primary: #0e2a38;
	--mo-accent: #2e86ab;
	--mo-on-accent: #fff;
	--mo-on-primary: #fff;
	--mo-line: #e2e8ec;
	--mo-muted: #6b7a85;
	--mo-field: #f7f9fa;
}

body.mo-portal { margin: 0; background: #fff; -webkit-font-smoothing: antialiased; }
body.mo-portal .mo-split { display: flex; min-height: 100vh; }
body.mo-portal.mo-layout-split-right .mo-split { flex-direction: row-reverse; }

/* ------------------------------------------------------------- brand panel */
.mo-aside {
	flex: 0 0 46%;
	position: relative;
	overflow: hidden;
	background: var(--mo-primary);
	color: var(--mo-on-primary);
	padding: 48px 52px;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
}
.mo-aside.mo-has-bg { background-size: cover; background-position: center; }

/* Decorative rings behind the brand panel. */
.mo-aside::after,
.mo-aside::before {
	content: "";
	position: absolute;
	top: 50%;
	border-radius: 50%;
	pointer-events: none;
	border: 1px solid rgba(255, 255, 255, 0.065);
}
.mo-aside::after {
	right: -22%; width: 560px; height: 560px; margin-top: -280px;
	box-shadow:
		inset 0 0 0 1px rgba(255, 255, 255, 0.035),
		0 0 0 60px rgba(255, 255, 255, 0.018),
		0 0 0 120px rgba(255, 255, 255, 0.014);
}
.mo-aside::before {
	right: -22%; width: 200px; height: 560px; margin-top: -280px; margin-right: 180px;
	border-color: rgba(255, 255, 255, 0.05);
}

.mo-aside-logo, .mo-aside-body, .mo-stats { position: relative; z-index: 1; }
.mo-aside-logo img { height: 46px; display: block; }
.mo-aside-name {
	font-size: 16px; font-weight: 600; letter-spacing: 2.6px; text-transform: uppercase;
}
.mo-aside-body { max-width: 430px; }
.mo-aside-head {
	font-size: 29px; line-height: 1.28; font-weight: 500;
	letter-spacing: -0.5px; margin: 0 0 14px; white-space: pre-line;
}
.mo-aside-sub { font-size: 14.5px; line-height: 1.6; opacity: 0.72; margin: 0; }

.mo-stats {
	display: flex; gap: 40px; padding-top: 24px; flex-wrap: wrap;
	border-top: 1px solid rgba(255, 255, 255, 0.12);
}
.mo-stat-value { font-size: 19px; font-weight: 600; letter-spacing: -0.2px; }
.mo-stat-label {
	font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase;
	opacity: 0.62; margin-top: 4px;
}

/* -------------------------------------------------------------- form side */
.mo-main {
	flex: 1; display: flex; align-items: center; justify-content: center;
	padding: 40px 32px; background: #fff;
}
.mo-main-inner { width: 100%; max-width: 372px; }
.mo-mobile-logo { display: none; margin-bottom: 30px; }
.mo-mobile-logo img { height: 40px; }
.mo-mobile-logo .mo-aside-name { color: var(--mo-primary); }

body.mo-portal .page-card,
body.mo-portal .login-content {
	box-shadow: none !important; border: 0 !important; border-radius: 0 !important;
	padding: 0 !important; margin: 0 !important;
	width: 100% !important; max-width: none !important; background: transparent !important;
}

body.mo-portal .page-card-head h4,
body.mo-portal .page-card-head .h4 {
	font-size: 23px; font-weight: 600; letter-spacing: -0.3px;
	color: var(--mo-primary); margin: 0 0 6px;
}
.mo-form-note { font-size: 13.5px; color: var(--mo-muted); margin: 0 0 26px; }

body.mo-portal .form-group, body.mo-portal .form-message { margin-bottom: 16px; }
body.mo-portal label, body.mo-portal .control-label {
	font-size: 11px; font-weight: 600; letter-spacing: 0.9px;
	text-transform: uppercase; color: var(--mo-muted); margin-bottom: 6px;
}
body.mo-portal .form-control,
body.mo-portal input[type="text"],
body.mo-portal input[type="email"],
body.mo-portal input[type="password"] {
	height: 44px; border: 1px solid var(--mo-line); border-radius: 5px;
	background: var(--mo-field); font-size: 14.5px; padding: 0 13px;
	color: var(--mo-primary); box-shadow: none;
	transition: border-color .13s ease, box-shadow .13s ease, background .13s ease;
}
body.mo-portal .form-control:focus {
	background: #fff; border-color: var(--mo-accent);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--mo-accent) 22%, transparent);
	outline: 0;
}
body.mo-portal .form-control::placeholder { color: #a8b4bc; }

body.mo-portal .btn-primary, body.mo-portal .btn-login {
	width: 100%; height: 44px; border: 0; border-radius: 5px;
	background: var(--mo-primary); color: var(--mo-on-primary);
	font-size: 14px; font-weight: 600; letter-spacing: .3px; margin-top: 4px;
	transition: background .13s ease, transform .08s ease;
}
body.mo-portal .btn-primary:hover, body.mo-portal .btn-primary:focus {
	background: var(--mo-accent); color: var(--mo-on-accent); box-shadow: none;
}
body.mo-portal .btn-primary:active { transform: translateY(1px); }

body.mo-portal .page-card a { color: var(--mo-accent); font-size: 13px; }
body.mo-portal .page-card a:hover { text-decoration: underline; }

body.mo-portal .mo-support {
	margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--mo-line);
	font-size: 12px; color: var(--mo-muted); line-height: 1.6;
}
body.mo-portal .mo-secure {
	display: flex; align-items: center; gap: 7px; margin-top: 9px;
	font-size: 11.5px; color: #8b979f;
}
body.mo-portal .mo-secure svg { flex: 0 0 auto; }

body.mo-no-signup .page-card a[href*="signup"],
body.mo-no-signup .sign-up-link { display: none !important; }
body.mo-no-forgot .page-card a[href*="forgot"],
body.mo-no-forgot .forgot-password-message { display: none !important; }

/* ------------------------------------------------------------ centred mode */
body.mo-layout-centred .mo-split { display: block; position: relative; min-height: 100vh; }
body.mo-layout-centred .mo-aside {
	position: absolute; inset: 0; flex: none; padding: 0;
	align-items: center; justify-content: center;
}
body.mo-layout-centred .mo-aside-body,
body.mo-layout-centred .mo-stats { display: none; }
body.mo-layout-centred .mo-aside-logo { display: none; }
body.mo-layout-centred .mo-main {
	position: relative; z-index: 2; background: transparent; min-height: 100vh;
}
body.mo-layout-centred .mo-main-inner {
	background: #fff; border-radius: 10px; padding: 38px 36px 32px;
	box-shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
	max-width: 404px;
}
body.mo-layout-centred .mo-mobile-logo { display: block; text-align: center; }
body.mo-layout-centred .mo-mobile-logo img { margin: 0 auto; }

/* ------------------------------------------------------------- responsive */
@media (max-width: 900px) {
	body.mo-portal .mo-split, body.mo-portal.mo-layout-split-right .mo-split {
		flex-direction: column;
	}
	body.mo-portal:not(.mo-layout-centred) .mo-aside { display: none; }
	.mo-mobile-logo { display: block; }
	.mo-main { align-items: flex-start; padding-top: 56px; }
	body.mo-layout-centred .mo-main { align-items: center; padding-top: 24px; }
}
@media (prefers-reduced-motion: reduce) { body.mo-portal * { transition: none !important; } }
