/* Login page */

body.mb-platform-login-page {
	--mb-login-primary: #0080ff;
	--mb-login-secondary: #24b1b1;
	--mb-login-navy: #071f49;
	--mb-login-text: #52627a;
	--mb-login-muted: #7b8aa0;
	--mb-login-border: #c8dcf4;
	--mb-login-surface: #ffffff;
	--mb-login-page: #f7fbff;
	--mb-login-image: none;
	background: var(--mb-login-page);
}

body.mb-platform-login-page .content-area,
body.mb-platform-login-page #primary {
	width: 100%;
	margin-top: 0;
	margin-bottom: 0;
}

body.mb-platform-login-page #primary {
	box-sizing: border-box;
	padding: clamp(32px, 4vw, 60px) 24px clamp(48px, 6vw, 78px);
}

body.mb-platform-login-page #main,
body.mb-platform-login-page article.page,
body.mb-platform-login-page .entry-content-wrap,
body.mb-platform-login-page .entry-content {
	width: 100%;
	max-width: none;
	margin: 0;
	padding: 0;
	background: transparent;
	box-shadow: none;
}

body.mb-platform-login-page .entry-header,
body.mb-platform-login-page .entry-title {
	display: none;
}

/* Logged-out dashboard reset */
body.mb-platform-login-page .kadence-llms-dash-wrap .llms-student-dashboard {
	box-sizing: border-box;
	width: 100%;
	max-width: none;
	min-height: 0;
	padding-right: 0 !important;
	padding-left: 0 !important;
}

.mb-login-shell {
	direction: ltr;
	display: grid;
	grid-template-columns: 52% 48%;
	grid-template-rows: minmax(590px, auto);
	grid-template-areas: "form visual";
	position: relative;
	isolation: isolate;
	box-sizing: border-box;
	width: min(100%, 1280px);
	min-height: 590px;
	margin: 0 auto !important;
	padding: 0 !important;
	overflow: hidden;
	background: var(--mb-login-surface, #ffffff);
	border: 1px solid rgba(7, 31, 73, 0.09);
	border-radius: 28px;
	box-shadow: 0 22px 65px rgba(7, 31, 73, 0.1);
}

.mb-login-shell::after {
	content: "";
	grid-area: visual;
	z-index: 0;
	min-width: 0;
	min-height: 100%;
	background-color: var(--mb-login-primary, #0080ff);
	background-image: linear-gradient(180deg, rgba(0, 58, 154, 0.05), rgba(36, 177, 177, 0.1)), var(--mb-login-image);
	background-repeat: no-repeat;
	background-position: center 48%;
	background-size: cover;
}

.mb-login-shell::before {
	content: "واصل من حيث توقفت";
	grid-area: visual;
	align-self: start;
	justify-self: stretch;
	z-index: 2;
	margin-top: 54px;
	padding: 0 38px;
	color: #ffffff;
	font-family: inherit;
	font-size: clamp(34px, 3.05vw, 50px);
	font-weight: 900;
	line-height: 1.3;
	text-align: center;
	text-shadow: 0 5px 18px rgba(0, 42, 110, 0.22);
	pointer-events: none;
}

.mb-login-shell .llms-person-login-form-wrapper {
	direction: rtl;
	grid-area: form;
	z-index: 1;
	box-sizing: border-box;
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 0;
	margin: 0;
	padding: 50px clamp(36px, 4.3vw, 66px) 46px;
	background: var(--mb-login-surface, #ffffff);
}

.mb-login-shell .llms-person-login-form-wrapper::after {
	content: "دروسك وتقدّمك بانتظارك";
	position: absolute;
	top: 130px;
	right: 0;
	z-index: 2;
	box-sizing: border-box;
	width: 48%;
	padding: 0 38px;
	color: rgba(255, 255, 255, 0.94);
	font-size: 18px;
	font-weight: 700;
	line-height: 1.6;
	text-align: center;
	pointer-events: none;
}

.mb-login-shell form.llms-login {
	width: 100%;
	max-width: 520px;
	margin: 0;
}

.mb-login-shell .llms-form-heading {
	margin: 0 0 30px !important;
	color: var(--mb-login-navy, #071f49);
	font-size: 0;
	font-weight: 900;
	line-height: 1.25;
	text-align: center;
}

.mb-login-shell .llms-form-heading::before {
	content: "مرحبًا بعودتك";
	display: block;
	font-size: clamp(34px, 3.2vw, 46px);
	line-height: 1.25;
}

.mb-login-shell .llms-form-heading::after {
	content: "سجّل الدخول لمتابعة دروسك واختباراتك";
	display: block;
	margin-top: 10px;
	color: var(--mb-login-text, #52627a);
	font-size: 16px;
	font-weight: 500;
	line-height: 1.75;
}

.mb-login-shell form.llms-login > .llms-form-fields {
	direction: rtl;
	display: grid !important;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 13px 18px;
	width: 100%;
}

.mb-login-shell form.llms-login .llms-form-field {
	box-sizing: border-box;
	float: none !important;
	width: 100% !important;
	max-width: none !important;
	margin: 0 !important;
}

.mb-login-shell form.llms-login .clear {
	display: none !important;
}

.mb-login-shell form.llms-login .llms-form-field:has(#llms_login) {
	order: 10;
	grid-column: 1 / -1;
}

.mb-login-shell form.llms-login .llms-form-field:has(#llms_password) {
	order: 20;
	grid-column: 1 / -1;
}

.mb-login-shell form.llms-login .llms-form-field:has(#llms_remember) {
	order: 30;
	grid-column: 1;
	display: flex;
	align-items: center;
	justify-content: flex-start;
	gap: 8px;
}

.mb-login-shell form.llms-login .llms-form-field:has(#llms_lost_password) {
	order: 31;
	grid-column: 2;
	display: flex;
	align-items: center;
	justify-content: flex-end;
}

.mb-login-shell form.llms-login .llms-form-field:has(#llms_login_button) {
	order: 40;
	grid-column: 1 / -1;
	margin-top: 6px !important;
}

.mb-login-shell .mb-login-register {
	order: 50;
	grid-column: 1 / -1;
	margin: 6px 0 0;
	color: var(--mb-login-text, #52627a);
	font-size: 14px;
	font-weight: 500;
	line-height: 1.6;
	text-align: center;
}

.mb-login-shell .mb-login-register a {
	color: var(--mb-login-primary, #0080ff);
	font-weight: 800;
	text-decoration: none;
}

.mb-login-shell .mb-login-register a:hover {
	color: var(--mb-login-secondary, #24b1b1);
	text-decoration: none;
}

.mb-login-shell form.llms-login .llms-form-field > label {
	display: block;
	float: none !important;
	width: 100%;
	margin: 0 0 8px;
	color: var(--mb-login-navy, #071f49);
	font-size: 15px;
	font-weight: 800;
	line-height: 1.5;
	text-align: right;
}

.mb-login-shell form.llms-login .llms-required {
	color: #e5484d;
}

.mb-login-shell form.llms-login input:not([type="hidden"]):not([type="submit"]):not([type="checkbox"]) {
	box-sizing: border-box;
	display: block;
	width: 100% !important;
	max-width: none !important;
	height: 56px;
	margin: 0;
	padding: 0 17px;
	color: var(--mb-login-navy, #071f49);
	background: #ffffff;
	border: 1px solid var(--mb-login-border, #c8dcf4);
	border-radius: 16px;
	box-shadow: none;
	font-family: inherit;
	font-size: 16px;
	font-weight: 500;
	line-height: 1;
	text-align: right;
	transition: border-color 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
}

.mb-login-shell form.llms-login input::placeholder {
	color: #94a3b8;
	opacity: 1;
}

.mb-login-shell form.llms-login input:not([type="hidden"]):not([type="submit"]):not([type="checkbox"]):hover {
	border-color: #9dc9f4;
}

.mb-login-shell form.llms-login input:not([type="hidden"]):not([type="submit"]):not([type="checkbox"]):focus {
	outline: 0;
	border-color: var(--mb-login-primary, #0080ff);
	background: #ffffff;
	box-shadow: 0 0 0 4px rgba(0, 128, 255, 0.12);
}

.mb-login-shell #llms_login,
.mb-login-shell #llms_password {
	direction: ltr;
	text-align: right;
}

.mb-login-shell .llms-visibility-toggle {
	margin-top: 8px;
	text-align: right;
}

.mb-login-shell .llms-visibility-toggle button {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin: 0;
	padding: 0;
	color: var(--mb-login-text, #52627a);
	background: transparent;
	border: 0;
	box-shadow: none;
	font-family: inherit;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
}

.mb-login-shell .llms-visibility-toggle button:hover {
	color: var(--mb-login-primary, #0080ff);
	background: transparent;
	box-shadow: none;
}

.mb-login-shell .llms-visibility-toggle-state {
	font-size: 0;
}

.mb-login-shell .llms-visibility-toggle button[data-toggle="1"] .llms-visibility-toggle-state::after {
	content: "إظهار كلمة المرور";
	font-size: 13px;
}

.mb-login-shell .llms-visibility-toggle button[data-toggle="0"] .llms-visibility-toggle-state::after {
	content: "إخفاء كلمة المرور";
	font-size: 13px;
}

.mb-login-shell #llms_remember {
	flex: 0 0 auto;
	width: 18px;
	height: 18px;
	margin: 0;
	accent-color: var(--mb-login-primary, #0080ff);
}

.mb-login-shell .llms-form-field:has(#llms_remember) > label {
	display: inline;
	width: auto;
	margin: 0;
	color: var(--mb-login-text, #52627a);
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
}

.mb-login-shell #llms_lost_password {
	display: contents;
}

.mb-login-shell .llms-form-field:has(#llms_lost_password) .llms-description {
	margin: 0;
	font-size: 14px;
	line-height: 1.5;
}

.mb-login-shell .llms-form-field:has(#llms_lost_password) a {
	color: var(--mb-login-primary, #0080ff);
	font-weight: 700;
	text-decoration: none;
}

.mb-login-shell .llms-form-field:has(#llms_lost_password) a:hover {
	color: var(--mb-login-secondary, #24b1b1);
	text-decoration: none;
}

.mb-login-shell #llms_login_button {
	display: flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	width: 100%;
	min-height: 56px;
	margin: 0;
	padding: 12px 24px;
	color: #ffffff;
	background: linear-gradient(135deg, var(--mb-login-primary, #0080ff), #0668f4);
	border: 0;
	border-radius: 16px;
	box-shadow: 0 12px 28px rgba(0, 128, 255, 0.24);
	font-family: inherit;
	font-size: 17px;
	font-weight: 800;
	line-height: 1.4;
	cursor: pointer;
	transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

.mb-login-shell #llms_login_button:hover {
	color: #ffffff;
	box-shadow: 0 15px 32px rgba(0, 128, 255, 0.3);
	filter: brightness(1.04);
	transform: translateY(-1px);
}

.mb-login-shell #llms_login_button:focus-visible {
	outline: 3px solid rgba(0, 128, 255, 0.24);
	outline-offset: 3px;
}

body.mb-platform-login-page .llms-notice,
body.mb-platform-login-page .llms-error,
body.mb-platform-login-page .llms-message {
	box-sizing: border-box;
	width: min(100%, 1280px);
	margin-right: auto;
	margin-left: auto;
	border-radius: 14px;
	text-align: right;
}

@media (max-width: 1100px) {
	body.mb-platform-login-page #primary {
		padding: 28px 20px 60px;
	}

	.mb-login-shell {
		grid-template-columns: 1fr;
		grid-template-rows: 330px auto;
		grid-template-areas:
			"visual"
			"form";
		width: min(100%, 780px);
		min-height: 0;
	}

	.mb-login-shell::after {
		min-height: 330px;
		background-position: center 50%;
	}

	.mb-login-shell::before {
		margin-top: 38px;
		padding: 0 34px;
		font-size: clamp(32px, 5vw, 44px);
	}

	.mb-login-shell .llms-person-login-form-wrapper::after {
		top: 96px;
		width: 100%;
		padding: 0 34px;
	}

	.mb-login-shell .llms-person-login-form-wrapper {
		padding: 42px 46px 46px;
	}
}

@media (max-width: 640px) {
	body.mb-platform-login-page {
		background: #ffffff;
	}

	body.mb-platform-login-page #primary {
		padding: 16px 12px 46px;
	}

	.mb-login-shell {
		grid-template-rows: 215px auto;
		border-radius: 22px;
		box-shadow: 0 14px 38px rgba(7, 31, 73, 0.09);
	}

	.mb-login-shell::after {
		min-height: 215px;
		background-position: center 47%;
	}

	.mb-login-shell::before,
	.mb-login-shell .llms-person-login-form-wrapper::after {
		display: none;
	}

	.mb-login-shell .llms-person-login-form-wrapper {
		padding: 30px 18px 28px;
	}

	.mb-login-shell .llms-form-heading {
		margin-bottom: 25px !important;
	}

	.mb-login-shell .llms-form-heading::before {
		font-size: 31px;
	}

	.mb-login-shell .llms-form-heading::after {
		margin-top: 7px;
		font-size: 14px;
		line-height: 1.65;
	}

	.mb-login-shell form.llms-login > .llms-form-fields {
		grid-template-columns: minmax(0, 1fr);
		gap: 14px;
	}

	.mb-login-shell form.llms-login .llms-form-field:has(#llms_login),
	.mb-login-shell form.llms-login .llms-form-field:has(#llms_password),
	.mb-login-shell form.llms-login .llms-form-field:has(#llms_remember),
	.mb-login-shell form.llms-login .llms-form-field:has(#llms_lost_password),
	.mb-login-shell form.llms-login .llms-form-field:has(#llms_login_button),
	.mb-login-shell .mb-login-register {
		grid-column: 1;
	}

	.mb-login-shell form.llms-login .llms-form-field:has(#llms_remember) {
		order: 30;
		justify-content: flex-start;
	}

	.mb-login-shell form.llms-login .llms-form-field:has(#llms_lost_password) {
		order: 31;
		justify-content: flex-start;
	}

	.mb-login-shell form.llms-login input:not([type="hidden"]):not([type="submit"]):not([type="checkbox"]) {
		height: 53px;
		padding-right: 14px;
		padding-left: 14px;
		border-radius: 14px;
		font-size: 16px;
	}

	.mb-login-shell #llms_login_button {
		min-height: 53px;
		border-radius: 14px;
	}
}

@media (max-width: 380px) {
	.mb-login-shell .llms-person-login-form-wrapper {
		padding-right: 14px;
		padding-left: 14px;
	}

	.mb-login-shell .llms-form-heading::before {
		font-size: 28px;
	}

	.mb-login-shell .llms-form-heading::after {
		font-size: 13px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.mb-login-shell form.llms-login input,
	.mb-login-shell #llms_login_button {
		transition: none;
	}
}
