/* ─────────────────────────────────────────────────────────────────────────────
   Login page override — Fintomous split-panel design
   Overrides frappe/www/login.html styles for the ERPNext Sorosh fork.
   Figma ref: project-management/docs/ui/src/app/components/Login.tsx
   ───────────────────────────────────────────────────────────────────────────── */

/* ── Break out of Frappe's .container constraints ── */
body.login-page,
body[data-path="login"] {
	background: #ffffff;
	overflow: hidden;
}

body.login-page .container.page-container,
body[data-path="login"] .container.page-container,
body.login-page .page-container,
body[data-path="login"] .page-container {
	max-width: 100% !important;
	width: 100% !important;
	padding: 0 !important;
	margin: 0 !important;
}

/* ── Wrapper: full-viewport flex ── */
.fl-login-wrapper {
	position: fixed;
	inset: 0;
	display: flex;
	min-height: 100vh;
	width: 100vw;
	background: #ffffff;
	z-index: 9000;
}

/* ─────────────────────────────────────────────────────────────────────────────
   LEFT PANEL
   ───────────────────────────────────────────────────────────────────────────── */
.fl-login-left {
	width: 50%;
	display: flex;
	flex-direction: column;
	justify-content: center;
	padding: 48px 80px;
	background: #ffffff;
	overflow-y: auto;
	position: relative;
	z-index: 1;
}

/* ── Logo ── */
.fl-logo {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 48px;
}

.fl-logo-mark {
	width: 40px;
	height: 40px;
	background: linear-gradient(135deg, #4f46e5, #9333ea);
	border-radius: 10px;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #ffffff;
	font-weight: 700;
	font-size: 20px;
	flex-shrink: 0;
	box-shadow: 0 2px 8px rgba(79, 70, 229, 0.25);
}

.fl-logo-text {
	font-size: 24px;
	font-weight: 700;
	background: linear-gradient(135deg, #4f46e5, #9333ea);
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	background-clip: text;
}

/* ── Section headings ── */
.fl-form-header {
	margin-bottom: 32px;
}

.fl-title {
	font-size: 28px;
	font-weight: 600;
	color: #171717;
	margin: 0 0 8px;
	line-height: 1.2;
}

.fl-subtitle {
	font-size: 14px;
	color: #525252;
	margin: 0;
}

/* ── Field groups ── */
.fl-field-group {
	margin-bottom: 20px;
}

.fl-label {
	display: block;
	font-size: 13px;
	font-weight: 500;
	color: #404040;
	margin-bottom: 6px;
}

.fl-input-wrap {
	position: relative;
}

/* Frappe's login.bundle.scss targets inputs inside .page-card .page-card-body with
   specificity (0,4,1): sets border:none and background:var(--control-bg) (gray).
   Our selector adds the `input` type token → (0,5,1) — beats Frappe cleanly.
   Figma: px-4 py-3 = 16px/12px padding, rounded-lg = 8px, border-neutral-300. */
.fl-login-wrapper .fl-login-left .fl-input-wrap input.fl-input.form-control {
	width: 100%;
	padding: 12px 16px;
	background: #ffffff;
	border: 1px solid #d1d5db;
	border-radius: 8px;
	font-size: 15px;
	line-height: 1.5;
	color: #171717;
	transition: border-color 0.15s, box-shadow 0.15s;
	box-shadow: none;
	height: auto;
	min-height: 48px;
	margin-bottom: 0;
}

.fl-login-wrapper .fl-login-left .fl-input-wrap input.fl-input.form-control::placeholder {
	color: #a3a3a3;
}

.fl-login-wrapper .fl-login-left .fl-input-wrap input.fl-input.form-control:focus {
	outline: none;
	border-color: #4f46e5;
	box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

/* ── Password wrap ── */
.fl-input-wrap--password .fl-input {
	padding-right: 56px;
}

.fl-toggle-pw {
	position: absolute;
	right: 14px;
	top: 50%;
	transform: translateY(-50%);
	font-size: 12px;
	font-weight: 500;
	color: #737373;
	cursor: pointer;
	user-select: none;
	transition: color 0.15s;
}

.fl-toggle-pw:hover {
	color: #404040;
}

/* ── Forgot password row ── */
.fl-forgot-row {
	text-align: right;
	margin: -8px 0 20px;
}

.fl-forgot-link {
	font-size: 13px;
	font-weight: 500;
	color: #4f46e5;
	text-decoration: none;
	transition: color 0.15s;
}

.fl-forgot-link:hover {
	color: #4338ca;
	text-decoration: none;
}

/* ── Back row ── */
.fl-back-row {
	text-align: center;
	margin-top: 16px;
}

/* ── Buttons ── */

/* Neutralize Bootstrap/Frappe .btn-primary styles on our button.
   We add btn-primary to submit buttons so login.js set_status() can find them
   via $('section:visible .btn-primary'), but we don't want Bootstrap's colors. */
.fl-login-left .btn-primary {
	border: none;
	box-shadow: none;
}
.fl-login-left .btn-primary:hover,
.fl-login-left .btn-primary:focus,
.fl-login-left .btn-primary:active {
	border: none;
	box-shadow: none;
	outline: none;
}

.fl-btn-primary {
	display: block;
	width: 100%;
	padding: 13px 24px;
	background: linear-gradient(135deg, #4f46e5, #9333ea);
	color: #ffffff;
	font-size: 14px;
	font-weight: 600;
	border: none;
	border-radius: 8px;
	cursor: pointer;
	transition: opacity 0.15s, box-shadow 0.15s;
	box-shadow: 0 4px 14px rgba(79, 70, 229, 0.3);
	text-align: center;
	margin-bottom: 0;
}

.fl-btn-primary:hover:not(:disabled) {
	opacity: 0.92;
	box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4);
}

.fl-btn-primary:disabled,
.fl-btn-primary[disabled] {
	opacity: 0.6;
	cursor: not-allowed;
	box-shadow: none;
}

.fl-btn-secondary {
	display: block;
	width: 100%;
	padding: 11px 24px;
	background: #ffffff;
	color: #404040;
	font-size: 14px;
	font-weight: 500;
	border: 1px solid #d4d4d4;
	border-radius: 8px;
	cursor: pointer;
	text-align: center;
	text-decoration: none;
	transition: background 0.15s, border-color 0.15s;
}

.fl-btn-secondary:hover {
	background: #f5f5f5;
	border-color: #a3a3a3;
	text-decoration: none;
	color: #171717;
}

/* ── Page card actions: remove default Frappe margins ── */
.fl-login-left .page-card-actions {
	padding: 0;
	border: none;
	background: none;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

/* ── Social logins divider ── */
.fl-divider {
	display: flex;
	align-items: center;
	gap: 12px;
	color: #a3a3a3;
	font-size: 12px;
	margin: 20px 0;
}

.fl-divider::before,
.fl-divider::after {
	content: "";
	flex: 1;
	border-top: 1px solid #e5e5e5;
}

.fl-login-left .social-login-buttons {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.fl-login-left .login-button-wrapper {
	width: 100%;
}

/* ── Frappe error/info messages ── */
.fl-login-left .form-message {
	padding: 12px 14px;
	border-radius: 8px;
	font-size: 13px;
	margin-bottom: 16px;
}

.fl-login-left .form-message.red {
	background: #fef2f2;
	color: #dc2626;
	border: 1px solid #fecaca;
}

.fl-login-left .form-message.green {
	background: #f0fdf4;
	color: #16a34a;
	border: 1px solid #bbf7d0;
}

/* ── Hide sign-up links (admin-only user creation) ── */
.fl-login-left .sign-up-message,
.fl-login-left .for-signup {
	display: none !important;
}

/* ── Section toggling: Frappe JS handles this via display none/block ──
   We reset Frappe's card styles so our layout shows cleanly ── */
.fl-login-left .for-login,
.fl-login-left .for-email-login,
.fl-login-left .for-forgot,
.fl-login-left .for-login-with-email-link {
	width: 100%;
}

/* Frappe's login.bundle.scss scopes .page-card with padding:45px, max-width:400px,
   and border. Reset all of it. Specificity: (0,3,0) beats Frappe's (0,2,0). */
.fl-login-left .login-content.page-card {
	box-shadow: none;
	border: none;
	padding: 0;
	background: none;
	max-width: none;
	width: 100%;
	margin: 0;
	border-radius: 0;
}

/* Frappe caps form width at 320px inside .page-card.
   Specificity: (0,3,1) beats Frappe's (0,2,1). */
.fl-login-left .login-content.page-card form {
	max-width: none;
	width: 100%;
	margin: 0;
}

.fl-login-left .page-card-head,
.fl-login-left .page-card-body {
	padding: 0;
	border: none;
}

/* ── Terms footer ── */
.fl-terms {
	margin-top: 32px;
	padding-top: 24px;
	border-top: 1px solid #e5e5e5;
	font-size: 11px;
	color: #a3a3a3;
	text-align: center;
}

.fl-terms a {
	color: #525252;
	text-decoration: underline;
	transition: color 0.15s;
}

.fl-terms a:hover {
	color: #171717;
}

/* ─────────────────────────────────────────────────────────────────────────────
   RIGHT PANEL
   ───────────────────────────────────────────────────────────────────────────── */
.fl-login-right {
	width: 50%;
	position: relative;
	overflow: hidden;
	background-image: url("https://images.unsplash.com/photo-1578601789053-1c00ea465c7b?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3w3Nzg4Nzd8MHwxfHNlYXJjaHwxfHxidXNpbmVzcyUyMHdvcmtmbG93JTIwcHJvZHVjdGl2aXR5JTIwbGFwdG9wfGVufDF8fHx8MTc3NTA1ODY5MXww&ixlib=rb-4.1.0&q=80&w=1080");
	background-size: cover;
	background-position: center;
}

.fl-right-overlay {
	position: absolute;
	inset: 0;
	background: linear-gradient(135deg, rgba(79, 70, 229, 0.75), rgba(147, 51, 234, 0.75));
	z-index: 1;
}

.fl-right-content {
	position: relative;
	z-index: 2;
	display: flex;
	flex-direction: column;
	justify-content: center;
	height: 100%;
	padding: 48px 64px;
	color: #ffffff;
}

.fl-right-badge {
	display: inline-block;
	padding: 6px 16px;
	background: rgba(255, 255, 255, 0.2);
	backdrop-filter: blur(4px);
	border-radius: 9999px;
	font-size: 13px;
	font-weight: 500;
	margin-bottom: 28px;
	width: fit-content;
}

.fl-right-title {
	font-size: 40px;
	font-weight: 700;
	line-height: 1.2;
	margin: 0 0 20px;
	color: #ffffff;
}

.fl-right-subtitle {
	font-size: 18px;
	line-height: 1.6;
	color: rgba(255, 255, 255, 0.88);
	margin: 0 0 40px;
	max-width: 380px;
}

/* ── Feature list ── */
.fl-right-features {
	list-style: none;
	padding: 0;
	margin: 0;
	display: flex;
	flex-direction: column;
	gap: 20px;
	max-width: 400px;
}

.fl-feature-item {
	display: flex;
	align-items: flex-start;
	gap: 14px;
}

.fl-feature-icon {
	width: 24px;
	height: 24px;
	background: rgba(255, 255, 255, 0.2);
	backdrop-filter: blur(4px);
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 12px;
	font-weight: 700;
	flex-shrink: 0;
	margin-top: 2px;
}

.fl-feature-title {
	font-size: 14px;
	font-weight: 600;
	margin: 0 0 2px;
	color: #ffffff;
}

.fl-feature-desc {
	font-size: 13px;
	margin: 0;
	color: rgba(255, 255, 255, 0.78);
}

/* ─────────────────────────────────────────────────────────────────────────────
   RESPONSIVE — hide right panel below 1024px
   ───────────────────────────────────────────────────────────────────────────── */
@media (max-width: 1023px) {
	.fl-login-right {
		display: none;
	}

	.fl-login-left {
		width: 100%;
		padding: 40px 32px;
	}
}

@media (max-width: 480px) {
	.fl-login-left {
		padding: 32px 20px;
	}

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