/* REDTCH enterprise login. Frappe's native authentication flow stays intact. */
:root {
	--redtch-red: #d71920;
	--redtch-red-dark: #b70f16;
	--redtch-ink: #161922;
	--redtch-muted: #747986;
	--redtch-line: #d9dce3;
}

body:has(.for-login) {
	min-height: 100vh;
	margin: 0;
	background: #fff;
	color: var(--redtch-ink);
	overflow-x: hidden;
}

body:has(.for-login)::before {
	content: "";
	position: fixed;
	inset: 0 0 auto;
	z-index: 20;
	height: 4px;
	background: var(--redtch-red);
}

body:has(.for-login) .navbar,
body:has(.for-login) .web-footer,
body:has(.for-login) .page-breadcrumbs,
body:has(.for-login) .page-header-wrapper,
body:has(.for-login) section.for-signup.signup-disabled {
	display: none !important;
}

body:has(.for-login) .page-content-wrapper {
	display: block;
	min-height: 100vh;
	padding: 0;
}

body:has(.for-login) #page-login,
body:has(.for-login) #page-login > .page-content-wrapper,
body:has(.for-login) #page-login > .page-content-wrapper > main.container,
body:has(.for-login) #page-login .page_content {
	width: 100%;
	max-width: none;
	min-height: 100vh;
	margin: 0;
	padding: 0;
}

body:has(.for-login) section.for-login:not(.hide) {
	position: relative;
	display: grid;
	grid-template-columns: minmax(0, 58%) minmax(390px, 42%);
	align-items: center;
	min-height: 100vh;
	direction: ltr;
	background: #fff;
	isolation: isolate;
}

body:has(.for-login) section.for-login:not(.hide)::before {
	content: "Built for clarity.\A Ready for growth.";
	position: absolute;
	inset: 0 38% 0 0;
	z-index: -1;
	display: flex;
	align-items: flex-end;
	padding: clamp(42px, 6vw, 96px);
	padding-right: clamp(110px, 11vw, 190px);
	clip-path: polygon(0 0, 100% 0, 87% 100%, 0 100%);
	background:
		linear-gradient(90deg, rgb(8 11 17 / 50%), rgb(8 11 17 / 12%)),
		url("/assets/red_theme/images/redtch.svg?v=20261118-2") no-repeat clamp(42px, 5vw, 82px) clamp(42px, 5vw, 76px) / clamp(110px, 11vw, 170px) auto,
		url("/assets/red_theme/images/accounting-office-login.webp?v=20261118-2") center / cover no-repeat;
	color: #fff;
	font-family: "Cairo", "Inter", sans-serif;
	font-size: clamp(1.8rem, 3vw, 3.6rem);
	font-weight: 800;
	line-height: 1.18;
	letter-spacing: -0.025em;
	text-align: left;
	text-shadow: none;
	white-space: pre-line;
}

html[lang^="ar"] body:has(.for-login) section.for-login:not(.hide)::before {
	content: "وضوح في كل رقم.\A نمو بثقة.";
	direction: rtl;
	text-align: right;
}

body:has(.for-login) section.for-login:not(.hide) > .login-content {
	grid-column: 2;
	width: min(480px, calc(100% - 64px));
	max-width: 480px;
	margin-inline: auto;
	padding: clamp(28px, 3.2vw, 52px);
	border: 0;
	border-radius: 0;
	background: transparent;
	box-shadow: none;
	direction: ltr;
	text-align: left;
}

html[lang^="ar"] body:has(.for-login) section.for-login:not(.hide) > .login-content {
	direction: rtl;
	text-align: right;
}

body:has(.for-login) .login-content .page-card-head {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
	margin-bottom: 30px;
	text-align: center;
}

body:has(.for-login) .login-content .app-logo {
	width: clamp(68px, 7vw, 92px);
	height: 68px;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	content: url("/assets/red_theme/images/redtch.svg?v=20261118-2");
	object-fit: contain;
}

body:has(.for-login) .login-content .page-card-head h4 {
	margin: 0;
	color: transparent;
	font-family: "Cairo", "Inter", sans-serif;
	font-size: 0;
	font-weight: 800;
	line-height: 1.3;
}

body:has(.for-login) .login-content .page-card-head h4::after {
	content: "Login to REDTCH";
	color: var(--redtch-ink);
	font-size: clamp(1.55rem, 2.1vw, 2rem);
}

html[lang^="ar"] body:has(.for-login) .login-content .page-card-head h4::after {
	content: "تسجيل الدخول إلى REDTCH";
}

body:has(.for-login) .login-content .page-card-subtitle {
	margin-top: 10px;
	color: transparent;
	font-size: 0;
}

body:has(.for-login) .login-content .page-card-subtitle::after {
	content: "Access your account to continue";
	color: var(--redtch-muted);
	font-size: 0.92rem;
	font-weight: 400;
}

html[lang^="ar"] body:has(.for-login) .login-content .page-card-subtitle::after {
	content: "أدخل بيانات حسابك للمتابعة";
}

body:has(.for-login) .login-content .form-group {
	margin-bottom: 14px;
}

body:has(.for-login) .login-content .form-group label {
	color: #393e49;
	font-family: "Cairo", "Inter", sans-serif;
	font-weight: 600;
}

body:has(.for-login) .login-content .form-control {
	min-height: 48px;
	padding-inline: 14px;
	border: 1px solid var(--redtch-line);
	border-radius: 6px;
	background: #fff;
	color: var(--redtch-ink);
	font-family: "Cairo", "Inter", sans-serif;
	font-size: 0.94rem;
	box-shadow: none;
	transition: border-color 160ms ease;
}

body:has(.for-login) .login-content .form-control:focus {
	border-color: var(--redtch-red);
	box-shadow: none;
}

body:has(.for-login) .login-content .es-button[data-variant="solid"] {
	min-height: 48px;
	margin-top: 8px;
	border: 0;
	border-radius: 6px;
	background: var(--redtch-red);
	color: #fff;
	font-family: "Cairo", "Inter", sans-serif;
	font-size: 1rem;
	font-weight: 700;
	box-shadow: none;
}

body:has(.for-login) .login-content .es-button[data-variant="solid"]:hover:not(:disabled) {
	background: var(--redtch-red-dark);
}

body:has(.for-login) .login-content a {
	color: var(--redtch-red);
	font-family: "Cairo", "Inter", sans-serif;
	font-weight: 600;
	text-decoration: none;
}

body:has(.for-login) .login-content a:hover {
	color: var(--redtch-red-dark);
	text-decoration: underline;
}

body:has(.for-login) .login-content .page-card-actions,
body:has(.for-login) .login-content .forgot-password-message {
	font-family: "Cairo", "Inter", sans-serif;
}

@media (max-width: 900px) {
	body:has(.for-login) section.for-login:not(.hide) {
		grid-template-columns: minmax(0, 45%) minmax(390px, 55%);
	}

	body:has(.for-login) section.for-login:not(.hide)::before {
		inset-inline-end: 50%;
		padding: 38px 82px 38px 38px;
		background-position: center, 32px 40px, center;
		background-size: auto, 150px auto, cover;
		font-size: 2.2rem;
	}
}

@media (max-width: 700px) {
	body:has(.for-login) {
		background:
			linear-gradient(rgb(8 11 17 / 63%), rgb(8 11 17 / 72%)),
			url("/assets/red_theme/images/accounting-office-login.webp?v=20261118-2") center / cover fixed;
	}

	body:has(.for-login) section.for-login:not(.hide) {
		display: flex;
		align-items: center;
		justify-content: center;
		padding: 28px 16px;
		background: transparent;
	}

	body:has(.for-login) section.for-login:not(.hide)::before {
		display: none;
	}

	body:has(.for-login) section.for-login:not(.hide) > .login-content {
		width: min(100%, 500px);
		margin: 0;
		padding: 30px 24px;
		border: 1px solid var(--redtch-line);
		border-radius: 10px;
		background: rgb(255 255 255 / 96%);
		box-shadow: none;
	}

	body:has(.for-login) .login-content .page-card-head {
		margin-bottom: 28px;
	}

	body:has(.for-login) .login-content .app-logo {
		width: 72px;
		height: 56px;
	}
}

@media (prefers-reduced-motion: reduce) {
	body:has(.for-login) *,
	body:has(.for-login) *::before,
	body:has(.for-login) *::after {
		transition: none !important;
	}
}
