/*
 * Takamol Theme — Login Page layouts
 */

/* ===== Hide navbar, footer, breadcrumbs ===== */
body[data-path="login"] .web-header,
body[data-path="login"] .navbar,
body[data-path="login"] .web-footer,
body[data-path="login"] .page-breadcrumbs {
	display: none !important;
}

body[data-path="login"] {
	background: var(--tt-login-form-bg, #fff) !important;
}

body[data-path="login"] .page-content-wrapper {
	min-height: 100vh;
	padding: 0 !important;
	margin: 0 !important;
}

/* ===== Base wrapper ===== */
.st-login-wrapper {
	display: flex !important;
	flex-direction: row !important;
	min-height: 100vh;
	width: 100vw;
	margin: 0;
	padding: 0;
	position: relative;
}

.st-login-wrapper.st-login-no-panel .st-login-form-col {
	flex: 1 1 100%;
}

.st-login-wrapper.st-has-bg {
	background-image: var(--tt-login-bg-image);
	background-size: cover;
	background-position: center;
}

.st-login-wrapper.st-has-bg::before {
	content: "";
	position: absolute;
	inset: 0;
	background: rgba(11, 17, 32, var(--tt-login-overlay-opacity, 0.35));
	pointer-events: none;
	z-index: 0;
}

.st-login-wrapper.st-has-bg > * {
	position: relative;
	z-index: 1;
}

/* ===== Form column ===== */
.st-login-form-col {
	flex: 1 1 50%;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 48px 80px;
	background: var(--tt-login-form-bg, #fff);
	overflow-y: auto;
	position: relative;
}

.st-login-form-col > section {
	width: 100%;
	max-width: var(--tt-login-form-max-width, 400px);
}

/* Language chips */
.st-login-langs {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	justify-content: center;
	margin-bottom: 20px;
	width: 100%;
	max-width: var(--tt-login-form-max-width, 400px);
}

.st-login-lang-chip {
	border: 1px solid #E3E8EE;
	background: #fff;
	color: #334155;
	border-radius: 999px;
	padding: 6px 12px;
	font-size: 12px;
	font-weight: 500;
	cursor: pointer;
	line-height: 1.2;
}

.st-login-lang-chip:hover {
	border-color: #C5D8F0;
	color: #0F172A;
}

.st-login-lang-chip.active {
	background: var(--tt-login-primary, #0052FF);
	border-color: var(--tt-login-primary, #0052FF);
	color: #fff;
}

/* ===== Brand panel ===== */
.st-login-panel {
	flex: 1 1 50%;
	min-height: 100vh;
	background: linear-gradient(
		160deg,
		var(--tt-login-panel-from, #EDF2FB) 0%,
		var(--tt-login-panel-to, #C5D8F0) 100%
	);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 60px 48px;
	position: relative;
	overflow: hidden;
	color: var(--tt-login-panel-text, #0F172A);
}

.st-login-panel.st-panel-align-left {
	align-items: flex-start;
	text-align: left;
}

.st-login-panel.st-panel-align-left .st-panel-content {
	text-align: left;
}

.st-login-panel.st-panel-align-top {
	justify-content: flex-start;
	padding-top: 80px;
}

.st-login-panel.st-panel-align-center {
	align-items: center;
	justify-content: center;
}

.st-login-panel:not(.st-no-decorative-bars)::before,
.st-login-panel:not(.st-no-decorative-bars)::after {
	content: "";
	position: absolute;
	width: 6px;
	border-radius: 100px;
	background: rgba(255, 255, 255, 0.5);
}

.st-login-panel:not(.st-no-decorative-bars)::before {
	height: 120px;
	top: 20%;
	right: 15%;
	transform: rotate(15deg);
}

.st-login-panel:not(.st-no-decorative-bars)::after {
	height: 80px;
	bottom: 25%;
	right: 25%;
	transform: rotate(15deg);
}

.st-panel-content {
	position: relative;
	z-index: 1;
	text-align: center;
	max-width: 520px;
}

.st-panel-icon {
	width: 120px;
	height: 120px;
	margin: 0 auto 32px;
	background: linear-gradient(135deg, #B8D4F0 0%, #8BB8E8 100%);
	border-radius: 24px;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 8px 32px rgba(0, 82, 255, 0.12);
	transform: rotate(-5deg);
	overflow: hidden;
}

.st-panel-icon img {
	width: 64px;
	height: 64px;
	object-fit: contain;
	transform: rotate(5deg);
}

.st-panel-icon svg {
	width: 48px;
	height: 48px;
	color: #fff;
	transform: rotate(5deg);
}

.st-panel-hero {
	width: 100%;
	max-width: 360px;
	margin: 0 auto 28px;
}

.st-panel-hero img {
	width: 100%;
	height: auto;
	max-height: 280px;
	border-radius: 16px;
	object-fit: cover;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}

.st-panel-content h2 {
	font-size: 26px;
	font-weight: 700;
	color: var(--tt-login-panel-text, #0F172A);
	line-height: 1.3;
	margin-bottom: 12px;
}

.st-panel-content p {
	font-size: 14px;
	color: var(--tt-login-panel-text, #5A6B7F);
	opacity: 0.85;
	line-height: 1.7;
	margin-bottom: 0;
}

.st-login-footer {
	margin-top: 24px;
	text-align: center;
	font-size: 12px;
	color: #475569;
	max-width: 400px;
	line-height: 1.5;
}

.st-float-bar {
	position: absolute;
	width: 5px;
	border-radius: 100px;
	background: rgba(255, 255, 255, 0.4);
}

.st-float-bar:nth-child(1) {
	height: 60px;
	top: 35%;
	left: 12%;
	transform: rotate(15deg);
}

.st-float-bar:nth-child(2) {
	height: 100px;
	bottom: 15%;
	left: 20%;
	transform: rotate(15deg);
}

.st-float-bar:nth-child(3) {
	height: 40px;
	top: 55%;
	right: 10%;
	transform: rotate(15deg);
}

/* ===== Layout: split_left (default) ===== */
.st-layout-split_left {
	flex-direction: row !important;
}

/* ===== Layout: split_right ===== */
.st-layout-split_right {
	flex-direction: row !important;
}

/* ===== Layout: centered_card ===== */
.st-layout-centered_card {
	justify-content: center;
	align-items: center;
	background: linear-gradient(
		160deg,
		var(--tt-login-panel-from, #EDF2FB) 0%,
		var(--tt-login-panel-to, #C5D8F0) 100%
	);
}

.st-layout-centered_card .st-login-panel {
	display: none !important;
}

.st-layout-centered_card .st-login-form-col {
	flex: 0 1 auto;
	min-height: auto;
	width: min(100%, calc(var(--tt-login-form-max-width, 400px) + 96px));
	margin: 48px 24px;
	padding: 40px 40px;
	border-radius: var(--tt-login-card-radius, 12px);
	box-shadow: 0 16px 48px rgba(10, 37, 64, 0.1);
	background: var(--tt-login-form-bg, #fff);
}

/* ===== Layout: centered_brand ===== */
.st-layout-centered_brand {
	justify-content: center;
	align-items: center;
	background: linear-gradient(
		160deg,
		var(--tt-login-panel-from, #EDF2FB) 0%,
		var(--tt-login-panel-to, #C5D8F0) 100%
	);
}

.st-layout-centered_brand .st-login-panel {
	position: absolute;
	inset: 0;
	flex: none;
	min-height: 0;
	z-index: 0;
	pointer-events: none;
}

.st-layout-centered_brand .st-login-form-col {
	flex: 0 1 auto;
	min-height: auto;
	width: min(100%, calc(var(--tt-login-form-max-width, 400px) + 96px));
	margin: 48px 24px;
	padding: 40px 40px;
	border-radius: var(--tt-login-card-radius, 12px);
	box-shadow: 0 20px 60px rgba(10, 37, 64, 0.18);
	background: var(--tt-login-form-bg, #fff);
	z-index: 1;
}

.st-layout-centered_brand .st-panel-content {
	opacity: 0.15;
	transform: scale(1.2);
}

/* ===== Layout: stacked_mobile_first ===== */
.st-layout-stacked_mobile_first {
	flex-direction: column !important;
}

.st-layout-stacked_mobile_first .st-login-panel {
	flex: 0 0 auto;
	min-height: 220px;
	padding: 40px 32px;
}

.st-layout-stacked_mobile_first .st-login-form-col {
	flex: 1 1 auto;
	min-height: auto;
	padding: 40px 32px 48px;
}

.st-layout-stacked_mobile_first .st-panel-hero img {
	max-height: 160px;
}

/* ===== Logo ===== */
.st-login-form-col .page-card-head {
	padding: 0 0 8px !important;
	margin: 0 auto !important;
	text-align: center !important;
	width: 100% !important;
	max-width: 100% !important;
	/* Override stock login.bundle: align-items:flex-start left-aligns the logo */
	display: flex !important;
	flex-direction: column !important;
	align-items: center !important;
	gap: 16px !important;
}

.st-login-form-col .page-card-head img.app-logo {
	display: block !important;
	max-height: 42px !important;
	width: auto !important;
	max-width: 180px !important;
	margin: 0 auto !important;
	object-fit: contain;
}

.st-login-form-col .page-card-head h4 {
	font-size: 26px;
	font-weight: 700;
	color: #0F172A;
	letter-spacing: -0.02em;
	margin: 0 !important;
	text-align: center !important;
	width: 100%;
}

.st-login-form-col .page-card {
	max-width: 100% !important;
	width: 100% !important;
	padding: 20px 0 0;
	border-radius: 0;
	border: none;
	background: transparent;
	box-shadow: none;
	margin: 0 auto;
}

.st-login-form-col .page-card form {
	max-width: 100% !important;
	width: 100% !important;
}

.st-login-form-col .page-card .page-card-body {
	max-width: 100% !important;
}

.st-login-form-col .form-control {
	width: 100% !important;
}

/* Input fields + icons — tight, vertically centered */
.st-login-form-col .email-field,
.st-login-form-col .password-field {
	position: relative !important;
	width: 100% !important;
}

.st-login-form-col .page-card-body input[type="text"],
.st-login-form-col .page-card-body input[type="email"],
.st-login-form-col .page-card-body input[type="password"] {
	border: 1px solid #E3E8EE !important;
	border-radius: var(--tt-login-card-radius, 10px) !important;
	background: #fff !important;
	height: 48px !important;
	font-size: 14px !important;
	line-height: 1.25 !important;
	/* 12px gap + 16px icon + 12px gap before text */
	padding: 0 14px 0 40px !important;
	transition: border-color 0.15s ease, box-shadow 0.15s ease !important;
	margin-bottom: 0 !important;
	box-sizing: border-box !important;
}

.st-login-form-col .password-field input[type="password"],
.st-login-form-col .password-field input[type="text"] {
	/* Room for "Show" toggle on the right */
	padding-right: 56px !important;
}

.st-login-form-col .page-card-body input:focus {
	border-color: var(--tt-login-primary, #0052FF) !important;
	box-shadow: 0 0 0 3px rgba(0, 82, 255, 0.1) !important;
	outline: none !important;
}

.st-login-form-col .page-card-body.invalid input[type="text"],
.st-login-form-col .page-card-body.invalid input[type="email"],
.st-login-form-col .page-card-body.invalid input[type="password"] {
	border-color: #e03636 !important;
	box-shadow: 0 0 0 3px rgba(224, 54, 54, 0.1) !important;
}

.st-login-form-col .field-icon {
	position: absolute !important;
	left: 12px !important;
	right: auto !important;
	top: 50% !important;
	transform: translateY(-50%) !important;
	width: 16px !important;
	height: 16px !important;
	margin: 0 !important;
	padding: 0 !important;
	pointer-events: none !important;
	z-index: 2 !important;
	fill: #64748B !important;
	color: #64748B !important;
	display: block !important;
}

.st-login-form-col .toggle-password {
	position: absolute !important;
	right: 12px !important;
	left: auto !important;
	top: 50% !important;
	transform: translateY(-50%) !important;
	font-size: 12px !important;
	line-height: 1 !important;
	color: #64748B !important;
	font-weight: 500 !important;
	cursor: pointer !important;
	z-index: 2 !important;
	user-select: none;
}

.st-login-form-col .toggle-password:hover {
	color: var(--tt-login-primary, #0052FF) !important;
}

/* RTL: mirror icon / toggle / input padding */
html[dir="rtl"] .st-login-form-col .field-icon,
.frappe-rtl .st-login-form-col .field-icon {
	left: auto !important;
	right: 12px !important;
}

html[dir="rtl"] .st-login-form-col .page-card-body input[type="text"],
html[dir="rtl"] .st-login-form-col .page-card-body input[type="email"],
html[dir="rtl"] .st-login-form-col .page-card-body input[type="password"],
.frappe-rtl .st-login-form-col .page-card-body input[type="text"],
.frappe-rtl .st-login-form-col .page-card-body input[type="email"],
.frappe-rtl .st-login-form-col .page-card-body input[type="password"] {
	padding: 0 40px 0 14px !important;
}

html[dir="rtl"] .st-login-form-col .password-field input[type="password"],
html[dir="rtl"] .st-login-form-col .password-field input[type="text"],
.frappe-rtl .st-login-form-col .password-field input[type="password"],
.frappe-rtl .st-login-form-col .password-field input[type="text"] {
	padding-left: 56px !important;
}

html[dir="rtl"] .st-login-form-col .toggle-password,
.frappe-rtl .st-login-form-col .toggle-password {
	right: auto !important;
	left: 12px !important;
}

.st-login-form-col .forgot-password-message {
	margin-top: 0 !important;
	margin-bottom: 0 !important;
}

.st-login-form-col .forgot-password-message a {
	color: #475569 !important;
	font-size: 13px !important;
	text-decoration: none !important;
}

.st-login-form-col .forgot-password-message a:hover {
	color: var(--tt-login-primary, #0052FF) !important;
}

.st-login-form-col .btn-primary,
.st-login-form-col .btn-login:not(.btn-login-option),
.st-login-form-col .btn-forgot {
	height: 48px !important;
	border-radius: 10px !important;
	font-size: 15px !important;
	font-weight: 600 !important;
	background: var(--tt-login-primary, #0052FF) !important;
	border: none !important;
	color: #fff !important;
	box-shadow: none !important;
	transition: all 0.15s ease !important;
}

.st-login-form-col .btn-primary:hover,
.st-login-form-col .btn-login:not(.btn-login-option):hover,
.st-login-form-col .btn-forgot:hover {
	background: #0047DB !important;
	box-shadow: 0 4px 12px rgba(0, 82, 255, 0.25) !important;
	transform: translateY(-1px);
}

.st-login-form-col .btn-primary:active,
.st-login-form-col .btn-login:not(.btn-login-option):active,
.st-login-form-col .btn-forgot:active {
	transform: translateY(0);
}

.st-login-form-col .btn-default:not(.btn-login-option) {
	height: 48px !important;
	border-radius: 10px !important;
	font-weight: 500 !important;
}

.st-login-form-col .login-divider {
	color: #A3ACB9 !important;
	font-size: 13px !important;
	position: relative;
	margin: 22px 0 !important;
	text-align: center !important;
	width: 100% !important;
}

.st-login-form-col .login-divider::before,
.st-login-form-col .login-divider::after {
	content: "";
	position: absolute;
	top: 50%;
	width: 38%;
	height: 1px;
	background: #E3E8EE;
}

.st-login-form-col .login-divider::before { left: 0; }
.st-login-form-col .login-divider::after { right: 0; }

/* Social / email-link options — stock uses min-width:50% wrappers (looks off-center) */
.st-login-form-col .social-logins {
	width: 100% !important;
	text-align: center !important;
}

.st-login-form-col .social-login-buttons,
.st-login-form-col .login-with-email-link {
	display: flex !important;
	flex-direction: column !important;
	align-items: stretch !important;
	width: 100% !important;
	margin-top: 0 !important;
}

.st-login-form-col .login-button-wrapper {
	min-width: 100% !important;
	width: 100% !important;
	max-width: 100% !important;
	padding: 0 !important;
	margin: 0 0 10px 0 !important;
	flex: 1 1 100% !important;
}

.st-login-form-col .login-button-wrapper:last-child {
	margin-bottom: 0 !important;
}

.st-login-form-col .btn-login-option {
	display: flex !important;
	justify-content: center !important;
	align-items: center !important;
	text-align: center !important;
	width: 100% !important;
	height: 44px !important;
	border-radius: 10px !important;
	border: 1px solid #E3E8EE !important;
	background: #fff !important;
	font-size: 13px !important;
	font-weight: 500 !important;
	color: #334155 !important;
	box-shadow: none !important;
	transition: all 0.15s ease !important;
	margin: 0 !important;
	padding: 0 16px !important;
}

.st-login-form-col .btn-login-option:hover {
	background: #F6F9FC !important;
	border-color: #D3D9E0 !important;
	color: #0F172A !important;
	transform: none !important;
	box-shadow: none !important;
}

.st-login-form-col .sign-up-message {
	font-size: 13px !important;
	color: #475569 !important;
	margin-top: 16px !important;
}

.st-login-form-col .sign-up-message a {
	color: var(--tt-login-primary, #0052FF) !important;
	font-weight: 500 !important;
	text-decoration: none !important;
}

.st-login-form-col .sign-up-message a:hover {
	text-decoration: underline !important;
}

/* ===== Mobile — stack all layouts ===== */
@media (max-width: 768px) {
	.st-login-wrapper,
	.st-layout-split_left,
	.st-layout-split_right {
		flex-direction: column !important;
	}

	.st-layout-split_left .st-login-panel,
	.st-layout-split_right .st-login-panel,
	.st-layout-centered_card .st-login-panel,
	.st-layout-centered_brand .st-login-panel {
		display: none !important;
	}

	.st-layout-stacked_mobile_first .st-login-panel {
		display: flex !important;
		min-height: 180px;
		padding: 28px 20px;
		order: -1;
	}

	.st-layout-stacked_mobile_first .st-float-bar,
	.st-layout-stacked_mobile_first .st-login-panel:not(.st-no-decorative-bars)::before,
	.st-layout-stacked_mobile_first .st-login-panel:not(.st-no-decorative-bars)::after {
		display: none !important;
	}

	.st-login-form-col,
	.st-layout-centered_card .st-login-form-col,
	.st-layout-centered_brand .st-login-form-col {
		flex: 1 1 100%;
		width: 100%;
		min-height: 100vh;
		margin: 0;
		padding: 32px 24px;
		border-radius: 0;
		box-shadow: none;
		background: linear-gradient(180deg, #F0F4FA 0%, #fff 30%);
	}

	.st-layout-stacked_mobile_first .st-login-form-col {
		min-height: auto;
		background: var(--tt-login-form-bg, #fff);
	}

	.st-panel-hero img {
		max-height: 140px;
	}

	.st-login-langs {
		margin-bottom: 16px;
	}
}

/* ===== Dark mode ===== */
[data-theme="dark"] body[data-path="login"] {
	background: #0d1117 !important;
}

[data-theme="dark"] .st-login-form-col {
	background: #0d1117;
}

[data-theme="dark"] .st-login-form-col .page-card-head h4 {
	color: #e6edf3;
}

[data-theme="dark"] .st-login-form-col .page-card-body input[type="text"],
[data-theme="dark"] .st-login-form-col .page-card-body input[type="email"],
[data-theme="dark"] .st-login-form-col .page-card-body input[type="password"] {
	background: #161b22 !important;
	border-color: #30363d !important;
	color: #e6edf3 !important;
}

[data-theme="dark"] .st-login-form-col .page-card-body input:focus {
	border-color: #0052FF !important;
	box-shadow: 0 0 0 3px rgba(0, 82, 255, 0.2) !important;
}

[data-theme="dark"] .st-login-form-col .btn-login-option {
	background: #161b22 !important;
	border-color: #30363d !important;
	color: #e6edf3 !important;
}

[data-theme="dark"] .st-login-form-col .btn-login-option:hover {
	background: #1c2128 !important;
	border-color: #484f58 !important;
}

[data-theme="dark"] .st-login-panel,
[data-theme="dark"] .st-layout-centered_card,
[data-theme="dark"] .st-layout-centered_brand {
	background: linear-gradient(160deg, #0d1117 0%, #141d2b 40%, #0d1930 100%);
}

[data-theme="dark"] .st-panel-icon {
	background: linear-gradient(135deg, #1a3050 0%, #0d2040 100%);
}

[data-theme="dark"] .st-panel-content h2 {
	color: #e6edf3;
}

[data-theme="dark"] .st-panel-content p {
	color: #8b949e;
}

[data-theme="dark"] .st-float-bar,
[data-theme="dark"] .st-login-panel:not(.st-no-decorative-bars)::before,
[data-theme="dark"] .st-login-panel:not(.st-no-decorative-bars)::after {
	background: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .st-login-lang-chip {
	background: #161b22;
	border-color: #30363d;
	color: #e6edf3;
}

@media (max-width: 768px) {
	[data-theme="dark"] .st-login-form-col {
		background: linear-gradient(180deg, #161b22 0%, #0d1117 30%);
	}
}
