/*
 * Wamda Login — v9.11.0
 * تصميم مينيمال متناسق، حقول مجمّعة، زر دخول مضغوط، زر تثبيت التطبيق.
 * كل الألوان تأتي من متغيرات --wlg-* المحقونة من إعدادات الإضافة.
 */

/* ==========================================================
 * 1) تصفير واجهة ووردبريس
 * ========================================================== */

body.wamda-login-body {
	background: var(--wlg-bg, #f4f6f8) !important;
	color: var(--wlg-text, #0f172a);
	font-family: var(--wlg-font, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif) !important;
	min-height: 100vh;
	margin: 0 !important;
	padding: 0 !important;
	-webkit-font-smoothing: antialiased;
}

body.wamda-login-body::before {
	content: "";
	position: fixed;
	inset: 0;
	background-image: var(--wlg-bg-image, none);
	background-size: cover;
	background-position: center;
	opacity: var(--wlg-bg-image-opacity, 1);
	pointer-events: none;
	z-index: 0;
}

body.wamda-login-body h1,
body.wamda-login-body #login h1,
body.wamda-login-body h1.wp-login-logo,
body.wamda-login-body .wp-login-logo,
body.wamda-login-body #login h1 a,
body.wamda-login-body .login h1,
body.wamda-login-body #backtoblog,
body.wamda-login-body #nav,
body.wamda-login-body .privacy-policy-page-link,
body.wamda-login-body .language-switcher,
body.wamda-login-body .login-action-login #login h1 {
	display: none !important;
}

/* إبقاء عناوين واجهتنا ظاهرة */
body.wamda-login-body h1.wlg-title,
body.wamda-login-body h2.wlg-aside-title {
	display: block !important;
}

body.wamda-login-body #login {
	display: block !important;
	position: static !important;
	width: 100% !important;
	max-width: none !important;
	height: auto !important;
	overflow: visible !important;
	clip: auto !important;
	padding: 0 !important;
	margin: 0 !important;
	background: transparent !important;
	box-shadow: none !important;
}

/* ==========================================================
 * 2) الهيكل
 * ========================================================== */

.wlg-page {
	position: relative;
	z-index: 1;
	min-height: 100vh;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 32px 20px;
	box-sizing: border-box;
}

.wlg-shell {
	width: 100%;
	max-width: 400px;
	display: flex;
}

.wlg-main {
	flex: 1;
	min-width: 0;
}

.wlg-card {
	background: var(--wlg-card-bg, #fff);
	border: 1px solid var(--wlg-border, #e6e9ee);
	border-radius: calc(var(--wlg-radius, 18px) + 6px);
	box-shadow: var(--wlg-shadow, 0 18px 50px rgba(15, 23, 42, 0.07));
	padding: 34px 30px 26px;
	box-sizing: border-box;
	animation: wlg-in 0.45s ease both;
}

/* التخطيط المينيمال بلا إطار */
body.wlg-layout-bare .wlg-card {
	background: transparent;
	border: 0;
	box-shadow: none;
	padding: 0;
}

body.wlg-layout-bare .wlg-shell {
	max-width: 372px;
}

@keyframes wlg-in {
	from {
		opacity: 0;
		transform: translateY(14px);
	}

	to {
		opacity: 1;
		transform: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.wlg-card {
		animation: none;
	}
}

/* ==========================================================
 * 3) الرأس (الشعار + العناوين)
 * ========================================================== */

.wlg-header {
	text-align: center;
	margin-bottom: 26px;
}

.wlg-logo {
	display: flex;
	justify-content: center;
	margin-bottom: 16px;
}

.wlg-logo-img {
	width: var(--wlg-logo-width, 130px);
	max-width: 100%;
	height: auto;
	max-height: 78px;
	object-fit: contain;
	display: block;
}

.wlg-logo-mark {
	width: 54px;
	height: 54px;
	border-radius: 17px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: var(--wlg-accent, #14b8a6);
	color: var(--wlg-on-accent, #fff);
	box-shadow: 0 10px 24px rgba(var(--wlg-accent-rgb, 20, 184, 166), 0.28);
}

.wlg-title {
	margin: 0 0 6px;
	font-size: 25px;
	line-height: 1.35;
	font-weight: 800;
	color: var(--wlg-heading, #0f172a);
	letter-spacing: -0.2px;
}

.wlg-subtitle {
	margin: 0;
	font-size: 14px;
	line-height: 1.7;
	color: var(--wlg-muted, #6b7280);
}

/* ==========================================================
 * 4) النموذج
 * ========================================================== */

body.wamda-login-body #loginform,
body.wamda-login-body #lostpasswordform,
body.wamda-login-body #registerform,
body.wamda-login-body #resetpassform {
	display: flex !important;
	flex-direction: column;
	gap: 14px;
	background: transparent !important;
	border: 0 !important;
	box-shadow: none !important;
	padding: 0 !important;
	margin: 0 !important;
	overflow: visible !important;
}

body.wamda-login-body #loginform p,
body.wamda-login-body #lostpasswordform p,
body.wamda-login-body #registerform p,
body.wamda-login-body #resetpassform p {
	margin: 0 !important;
	padding: 0 !important;
	float: none !important;
	width: auto !important;
	clear: none !important;
	font-size: 13px;
	color: var(--wlg-muted, #6b7280);
}

/* إخفاء تسميات ووردبريس والاعتماد على الأيقونة + النص الداخلي */
body.wamda-login-body #loginform label:not(.wlg-keep),
body.wamda-login-body #lostpasswordform label:not(.wlg-keep),
body.wamda-login-body #registerform label:not(.wlg-keep) {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	overflow: hidden !important;
	clip: rect(0 0 0 0) !important;
	white-space: nowrap !important;
}

/* --- مجموعة الحقول المدمجة --- */

.wlg-group {
	background: var(--wlg-field-bg, #f7f8fa);
	border: 1px solid var(--wlg-field-border, #e6e9ee);
	border-radius: var(--wlg-radius, 18px);
	overflow: hidden;
	transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.wlg-group:focus-within {
	border-color: var(--wlg-accent, #14b8a6);
	box-shadow: 0 0 0 4px rgba(var(--wlg-accent-rgb, 20, 184, 166), 0.13);
}

.wlg-group .wlg-field + .wlg-field {
	border-top: 1px solid var(--wlg-field-border, #e6e9ee);
}

.wlg-field {
	position: relative;
	display: flex;
	align-items: center;
	gap: 10px;
	padding-inline: 15px;
	background: transparent;
}

.wlg-field-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: var(--wlg-placeholder, #9aa3af);
	flex: 0 0 auto;
	transition: color 0.18s ease;
}

.wlg-field:focus-within .wlg-field-icon {
	color: var(--wlg-accent, #14b8a6);
}

body.wamda-login-body .wlg-field input[type="text"],
body.wamda-login-body .wlg-field input[type="email"],
body.wamda-login-body .wlg-field input[type="password"] {
	flex: 1 1 auto;
	width: 100% !important;
	min-width: 0;
	height: 52px !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	background: transparent !important;
	box-shadow: none !important;
	outline: none !important;
	font-family: inherit;
	font-size: 15px !important;
	line-height: 52px !important;
	color: var(--wlg-text, #0f172a) !important;
}

body.wamda-login-body .wlg-field input::placeholder {
	color: var(--wlg-placeholder, #9aa3af);
	opacity: 1;
}

/* حاوية كلمة المرور الأصلية */
body.wamda-login-body .wlg-field .wp-pwd {
	flex: 1 1 auto;
	display: flex;
	align-items: center;
	gap: 6px;
	min-width: 0;
	position: static;
}

body.wamda-login-body .wlg-field .wp-pwd input {
	padding-inline-end: 0 !important;
}

body.wamda-login-body button.wp-hide-pw {
	position: static !important;
	width: 34px !important;
	height: 34px !important;
	min-height: 34px !important;
	padding: 0 !important;
	margin: 0 !important;
	border: 0 !important;
	border-radius: 10px;
	background: transparent !important;
	color: var(--wlg-placeholder, #9aa3af) !important;
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: color 0.18s ease, background 0.18s ease;
	flex: 0 0 auto;
}

body.wamda-login-body button.wp-hide-pw:hover {
	color: var(--wlg-accent, #14b8a6) !important;
	background: rgba(var(--wlg-accent-rgb, 20, 184, 166), 0.1) !important;
}

body.wamda-login-body button.wp-hide-pw .dashicons {
	display: none !important;
}

.wlg-caps {
	margin: 2px 2px 0;
	font-size: 12px;
	font-weight: 600;
	color: #b45309;
}

/* --- صف تذكرني / نسيت كلمة المرور --- */

body.wamda-login-body .forgetmenot,
.wlg-meta {
	display: flex !important;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
	float: none !important;
	width: 100% !important;
	margin: 0 !important;
	line-height: 1 !important;
}

.wlg-remember {
	display: inline-flex !important;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	color: var(--wlg-muted, #6b7280);
}

body.wamda-login-body .wlg-remember label,
body.wamda-login-body .forgetmenot label {
	position: static !important;
	width: auto !important;
	height: auto !important;
	clip: auto !important;
	overflow: visible !important;
	margin: 0 !important;
	padding: 0 !important;
	font-size: 13px !important;
	line-height: 1.2 !important;
	color: var(--wlg-muted, #6b7280) !important;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
}

body.wamda-login-body .wlg-remember input[type="checkbox"] {
	-webkit-appearance: none;
	appearance: none;
	width: 17px !important;
	height: 17px !important;
	min-width: 17px;
	margin: 0 !important;
	padding: 0 !important;
	border: 1.6px solid var(--wlg-field-border, #d7dbe2) !important;
	border-radius: 5px !important;
	background: var(--wlg-card-bg, #fff) !important;
	box-shadow: none !important;
	cursor: pointer;
	position: relative;
	transition: background 0.15s ease, border-color 0.15s ease;
}

body.wamda-login-body .wlg-remember input[type="checkbox"]:checked {
	background: var(--wlg-accent, #14b8a6) !important;
	border-color: var(--wlg-accent, #14b8a6) !important;
}

body.wamda-login-body .wlg-remember input[type="checkbox"]:checked::after {
	content: "";
	position: absolute;
	inset-inline-start: 5px;
	top: 1.5px;
	width: 4px;
	height: 9px;
	border: solid var(--wlg-on-accent, #fff);
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}

body.wamda-login-body .wlg-remember input[type="checkbox"]::before {
	content: none !important;
}

.wlg-lost-link {
	font-size: 13px !important;
	font-weight: 600;
	color: var(--wlg-accent, #14b8a6) !important;
	text-decoration: none !important;
	margin-inline-start: auto;
}

.wlg-lost-link:hover {
	text-decoration: underline !important;
}

/* --- زر الدخول --- */

body.wamda-login-body #wp-submit,
body.wamda-login-body .button-primary {
	position: static !important;
	float: none !important;
	display: block !important;
	width: 100% !important;
	height: 46px !important;
	min-height: 46px !important;
	line-height: 44px !important;
	padding: 0 20px !important;
	margin: 4px 0 0 !important;
	border: 0 !important;
	border-radius: 999px !important;
	background: var(--wlg-accent, #14b8a6) !important;
	color: var(--wlg-on-accent, #fff) !important;
	font-family: inherit;
	font-size: 15px !important;
	font-weight: 700 !important;
	letter-spacing: 0.2px;
	text-shadow: none !important;
	box-shadow: 0 8px 20px rgba(var(--wlg-accent-rgb, 20, 184, 166), 0.28) !important;
	cursor: pointer;
	transition: transform 0.15s ease, box-shadow 0.18s ease, background 0.18s ease;
	box-sizing: border-box !important;
}

body.wamda-login-body #wp-submit:hover {
	background: var(--wlg-accent-hover, #0f9d8f) !important;
	transform: translateY(-1px);
	box-shadow: 0 12px 26px rgba(var(--wlg-accent-rgb, 20, 184, 166), 0.34) !important;
}

body.wamda-login-body #wp-submit:active {
	transform: translateY(0);
}

body.wamda-login-body #wp-submit.is-loading {
	opacity: 0.75;
	pointer-events: none;
}

/* ==========================================================
 * 5) زر تحميل التطبيق (PWA)
 * ========================================================== */

.wlg-app {
	margin-top: 16px;
}

.wlg-app-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 9px;
	width: 100%;
	height: 44px;
	padding: 0 16px;
	border: 1px solid var(--wlg-field-border, #e6e9ee);
	border-radius: 999px;
	background: var(--wlg-card-bg, #fff);
	color: var(--wlg-text, #0f172a);
	font-family: inherit;
	font-size: 13.5px;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
	box-sizing: border-box;
	transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
}

.wlg-app-btn:hover {
	border-color: var(--wlg-accent, #14b8a6);
	color: var(--wlg-accent, #14b8a6);
	background: rgba(var(--wlg-accent-rgb, 20, 184, 166), 0.06);
}

.wlg-app-btn svg {
	flex: 0 0 auto;
}

.wlg-app-hint {
	margin: 8px 0 0;
	font-size: 12px;
	line-height: 1.7;
	text-align: center;
	color: var(--wlg-muted, #6b7280);
}

/* ==========================================================
 * 6) الرسائل
 * ========================================================== */

body.wamda-login-body #login_error,
body.wamda-login-body .login .message,
body.wamda-login-body .login .notice,
body.wamda-login-body .wlg-notice {
	display: block;
	margin: 0 0 16px !important;
	padding: 12px 14px !important;
	border: 1px solid var(--wlg-border, #e6e9ee) !important;
	border-inline-start: 3px solid var(--wlg-accent, #14b8a6) !important;
	border-radius: 12px !important;
	background: var(--wlg-card-bg, #fff) !important;
	box-shadow: none !important;
	font-size: 13.5px;
	line-height: 1.7;
	color: var(--wlg-text, #0f172a);
}

body.wamda-login-body #login_error {
	border-inline-start-color: #ef4444 !important;
	color: #b91c1c;
}

body.wamda-login-body #login_error a,
body.wamda-login-body .login .message a {
	color: inherit;
}

/* ==========================================================
 * 7) الروابط الإضافية والتذييل
 * ========================================================== */

.wlg-divider {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 22px 0 14px;
	font-size: 12px;
	font-weight: 600;
	color: var(--wlg-muted, #6b7280);
}

.wlg-divider::before,
.wlg-divider::after {
	content: "";
	flex: 1;
	height: 1px;
	background: var(--wlg-border, #e6e9ee);
}

.wlg-extras {
	display: grid;
	gap: 8px;
}

.wlg-extra {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 11px 14px;
	border: 1px solid var(--wlg-border, #e6e9ee);
	border-radius: 13px;
	background: var(--wlg-card-bg, #fff);
	color: var(--wlg-text, #0f172a);
	font-size: 13.5px;
	font-weight: 600;
	text-decoration: none;
	transition: border-color 0.18s ease, color 0.18s ease, transform 0.15s ease;
}

.wlg-extra:hover {
	border-color: var(--wlg-accent, #14b8a6);
	color: var(--wlg-accent, #14b8a6);
	transform: translateY(-1px);
}

.wlg-extra span {
	flex: 1;
}

.wlg-extra-arrow {
	opacity: 0.5;
}

body.wamda-login-rtl .wlg-extra-arrow {
	transform: scaleX(-1);
}

.wlg-footer {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 18px;
	flex-wrap: wrap;
	margin-top: 22px;
	padding-top: 16px;
	border-top: 1px solid var(--wlg-border, #e6e9ee);
}

.wlg-footer-link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 13px;
	font-weight: 600;
	color: var(--wlg-muted, #6b7280);
	text-decoration: none;
	transition: color 0.18s ease;
}

.wlg-footer-link:hover {
	color: var(--wlg-accent, #14b8a6);
}

body.wamda-login-rtl .wlg-footer-link svg {
	transform: scaleX(-1);
}

.wlg-note {
	margin: 14px 0 0;
	font-size: 12px;
	line-height: 1.8;
	text-align: center;
	color: var(--wlg-muted, #6b7280);
}

/* ==========================================================
 * 8) تخطيط الشاشة المقسومة
 * ========================================================== */

body.wlg-layout-split .wlg-shell {
	max-width: 880px;
	background: var(--wlg-card-bg, #fff);
	border: 1px solid var(--wlg-border, #e6e9ee);
	border-radius: calc(var(--wlg-radius, 18px) + 8px);
	box-shadow: var(--wlg-shadow, 0 18px 50px rgba(15, 23, 42, 0.07));
	overflow: hidden;
}

body.wlg-layout-split .wlg-card {
	border: 0;
	box-shadow: none;
	border-radius: 0;
	background: transparent;
}

.wlg-aside {
	flex: 0 0 42%;
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 10px;
	padding: 44px 34px;
	background: var(--wlg-accent, #14b8a6);
	color: var(--wlg-on-accent, #fff);
}

.wlg-aside-title {
	margin: 0;
	font-size: 27px;
	font-weight: 800;
	color: inherit;
}

.wlg-aside-text {
	margin: 0;
	font-size: 14px;
	line-height: 1.8;
	opacity: 0.9;
}

/* ==========================================================
 * 9) موبايل
 * ========================================================== */

@media (max-width: 782px) {
	.wlg-page {
		padding: 22px 16px;
		align-items: flex-start;
		padding-top: 42px;
	}

	.wlg-card {
		padding: 26px 20px 20px;
	}

	body.wlg-layout-split .wlg-shell {
		flex-direction: column;
		max-width: 400px;
	}

	.wlg-aside {
		flex: none;
		padding: 26px 22px;
		text-align: center;
	}

	.wlg-title {
		font-size: 22px;
	}

	body.wamda-login-body .wlg-field input[type="text"],
	body.wamda-login-body .wlg-field input[type="email"],
	body.wamda-login-body .wlg-field input[type="password"] {
		font-size: 16px !important;
	}
}

/* ==========================================================
 * 10) خلفية الشعار
 * ========================================================== */

.wlg-logo-plate {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 16px 22px;
	border-radius: calc(var(--wlg-radius, 18px) - 2px);
	box-sizing: border-box;
	max-width: 100%;
}

.wlg-logo-bg-light {
	background: var(--wlg-card-bg, #fff);
	border: 1px solid var(--wlg-border, #e6e9ee);
	box-shadow: 0 10px 26px rgba(15, 23, 42, 0.07);
}

.wlg-logo-bg-dark {
	background: var(--wlg-heading, #0f172a);
	box-shadow: 0 12px 28px rgba(15, 23, 42, 0.18);
}

.wlg-logo-bg-accent {
	background: var(--wlg-accent, #14b8a6);
	box-shadow: 0 12px 28px rgba(var(--wlg-accent-rgb, 20, 184, 166), 0.3);
}

.wlg-logo-bg-soft {
	background: var(--wlg-field-bg, #f1f3f6);
	border: 1px solid var(--wlg-border, #e6e9ee);
}

.wlg-logo-bg-none {
	padding: 0;
	background: transparent;
	border: 0;
	box-shadow: none;
}

.wlg-logo-plate .wlg-logo-mark {
	box-shadow: none;
}

.wlg-logo-bg-dark .wlg-logo-mark,
.wlg-logo-bg-accent .wlg-logo-mark {
	background: transparent;
	color: #fff;
}

/* ==========================================================
 * 11) توحيد الخط مع إعدادات الإضافة
 * ========================================================== */

body.wamda-login-body,
body.wamda-login-body input,
body.wamda-login-body button,
body.wamda-login-body select,
body.wamda-login-body textarea,
body.wamda-login-body label,
body.wamda-login-body a,
body.wamda-login-body p,
body.wamda-login-body span,
body.wamda-login-body div,
body.wamda-login-body h1,
body.wamda-login-body h2,
body.wamda-login-body h3,
body.wamda-login-body .wlg-title,
body.wamda-login-body .wlg-subtitle,
body.wamda-login-body #wp-submit,
body.wamda-login-body .button,
body.wamda-login-body .button-primary {
	font-family: var(--wlg-font, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif) !important;
}

body.wamda-login-body input::placeholder {
	font-family: var(--wlg-font, inherit) !important;
}


/* ==========================================================
 * 12) فوتر الدعم الفني (v9.14.0)
 * ========================================================== */

.wlg-support {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	margin-top: 18px;
	padding-top: 16px;
	border-top: 1px solid var(--wlg-border, #e6e9ee);
	text-align: center;
}

.wlg-support-btn {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 8px 15px;
	border-radius: 999px;
	font-family: var(--wlg-font, sans-serif);
	font-size: 12.5px;
	font-weight: 700;
	color: #128C7E;
	background: rgba(37, 211, 102, 0.10);
	border: 1px solid rgba(37, 211, 102, 0.28);
	text-decoration: none;
	transition: background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.wlg-support-btn:hover {
	background: rgba(37, 211, 102, 0.18);
	box-shadow: 0 4px 12px rgba(37, 211, 102, 0.22);
	transform: translateY(-1px);
	color: #128C7E;
}

.wlg-support-btn svg {
	flex: 0 0 auto;
}

.wlg-support-brand {
	font-family: var(--wlg-font, sans-serif);
	font-size: 11.5px;
	font-weight: 600;
	letter-spacing: 0.2px;
	color: var(--wlg-muted, #6b7280);
	text-decoration: none;
	transition: color 0.18s ease;
}

a.wlg-support-brand:hover {
	color: var(--wlg-accent, #14b8a6);
}
