:root {
	--primary: #4f46e5;
	--primary-hover: #4338ca;
	--primary-light: #eef2ff;
	--primary-ring: rgba(79, 70, 229, 0.2);
	--accent-green: #009C4D;
	--accent-emerald: #10b981;
	--bg-dark: #0f172a;
	--bg-card: #ffffff;
	--text-main: #1e293b;
	--text-muted: #64748b;
	--text-light: #94a3b8;
	--border-color: #e2e8f0;
	--shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
	--shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
	--shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
	--shadow-glow: 0 0 40px rgba(79, 70, 229, 0.25);
	--radius-lg: 16px;
	--radius-md: 10px;
	--radius-sm: 6px;
}

* {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

html, body {
	height: 100%;
	margin: 0;
	padding: 0;
}

body.login-page {
	height: 100vh;
	max-height: 100vh;
	overflow: hidden;
	background: #ffffff;
	color: var(--text-main);
}

/* Khung bọc toàn trang chia 50-50 đúng nửa màn hình và KHÔNG scroll */
.login-wrapper {
	display: flex;
	height: 100vh;
	max-height: 100vh;
	width: 100vw;
	overflow: hidden;
}

/* =========================================================
   PHẦN BÊN TRÁI: LOGO & THƯƠNG HIỆU HỆ THỐNG (50% MÀN HÌNH)
   ========================================================= */
.login-left-pane {
	flex: 1;
	width: 50%;
	height: 100vh;
	max-height: 100vh;
	background: linear-gradient(145deg, #090d16 0%, #0f172a 45%, #1e1b4b 100%);
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 2.25rem 3.5rem;
	color: #ffffff;
	overflow: hidden;
}

/* Hiệu ứng đốm sáng trang trí */
.left-pane-bg-decor {
	position: absolute;
	inset: 0;
	pointer-events: none;
	overflow: hidden;
}

.glow-orb {
	position: absolute;
	border-radius: 50%;
	filter: blur(80px);
	opacity: 0.45;
	animation: floatGlow 10s ease-in-out infinite alternate;
}

.orb-1 {
	width: 320px;
	height: 320px;
	background: #4f46e5;
	top: -50px;
	left: -50px;
}

.orb-2 {
	width: 280px;
	height: 280px;
	background: #009C4D;
	bottom: -40px;
	right: -40px;
	animation-delay: -3s;
}

.orb-3 {
	width: 220px;
	height: 220px;
	background: #06b6d4;
	top: 45%;
	left: 30%;
	animation-delay: -6s;
	opacity: 0.25;
}

@keyframes floatGlow {
	0% {
		transform: translateY(0) scale(1);
	}
	100% {
		transform: translateY(25px) scale(1.1);
	}
}

.left-pane-content {
	position: relative;
	z-index: 2;
	max-width: 465px;
	width: 100%;
	display: flex;
	flex-direction: column;
	gap: 1.15rem;
}

/* Khung logo bên trái */
.logo-box {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 76px;
	height: 76px;
	background: rgba(255, 255, 255, 0.08);
	backdrop-filter: blur(16px);
	-webkit-backdrop-filter: blur(16px);
	border: 1px solid rgba(255, 255, 255, 0.15);
	border-radius: 20px;
	box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.2);
	transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.logo-box:hover {
	transform: translateY(-3px) scale(1.02);
	box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45), 0 0 20px rgba(0, 156, 77, 0.3);
}

.brand-logo {
	width: 48px;
	height: 48px;
	object-fit: contain;
	filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.2));
}

.brand-title {
	font-size: clamp(1.25rem, 1.7vw, 1.55rem);
	font-weight: 800;
	line-height: 1.35;
	letter-spacing: -0.01em;
	color: #ffffff;
	white-space: nowrap;
	padding-top: 4px;
	padding-bottom: 2px;
	text-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}

.brand-desc {
	font-size: 0.95rem;
	line-height: 1.5;
	color: #cbd5e1;
	font-weight: 400;
}

/* Danh sách tính năng nổi bật bên trái */
.brand-features {
	display: flex;
	flex-direction: column;
	gap: 0.65rem;
	margin-top: 0.15rem;
	width: 100%;
}

.feature-item {
	display: flex;
	align-items: center;
	gap: 0.85rem;
	background: rgba(255, 255, 255, 0.04);
	border: 1px solid rgba(255, 255, 255, 0.08);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	padding: 0.65rem 0.9rem;
	border-radius: var(--radius-md);
	transition: background 0.25s, transform 0.25s;
	width: 100%;
}

.feature-item:hover {
	background: rgba(255, 255, 255, 0.08);
	transform: translateX(3px);
}

.feature-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	background: linear-gradient(135deg, rgba(79, 70, 229, 0.35), rgba(0, 156, 77, 0.35));
	border: 1px solid rgba(255, 255, 255, 0.15);
	border-radius: 10px;
	color: #38bdf8;
	font-size: 1rem;
	flex-shrink: 0;
}

.feature-text h3 {
	font-size: 0.9rem;
	font-weight: 600;
	color: #ffffff;
	margin-bottom: 0.15rem;
}

.feature-text p {
	font-size: 0.8rem;
	color: #94a3b8;
	line-height: 1.35;
}

/* =========================================================
   PHẦN BÊN PHẢI: KHUNG ĐĂNG NHẬP (50% MÀN HÌNH - NỀN TRẮNG 100% CAO)
   ========================================================= */
.login-right-pane {
	flex: 1;
	width: 50%;
	height: 100vh;
	max-height: 100vh;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 2rem 4rem;
	background: #ffffff;
	overflow: hidden;
}

.login-card {
	width: 100%;
	max-width: 365px;
	background: transparent;
	padding: 0;
	border: none;
	box-shadow: none;
}

/* Logo ẩn trên desktop, chỉ hiện ở mobile */
.mobile-brand-header {
	display: none;
	text-align: center;
	margin-bottom: 1.5rem;
}

.mobile-logo-box {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 64px;
	height: 64px;
	background: #f1f5f9;
	border-radius: 16px;
	margin-bottom: 0.75rem;
}

.mobile-logo-box img {
	width: 40px;
	height: 40px;
}

.mobile-brand-header h2 {
	font-size: 1.25rem;
	font-weight: 700;
	color: var(--primary);
	line-height: 1.4;
	padding-top: 4px;
}

.login-header {
	margin-bottom: 2rem;
}

.login-header h2 {
	font-size: 1.75rem;
	font-weight: 700;
	color: var(--text-main);
	letter-spacing: -0.02em;
	line-height: 1.35;
	padding-top: 4px;
	margin-bottom: 0.4rem;
}

.login-header p {
	font-size: 0.92rem;
	color: var(--text-muted);
}

/* Form Styles */
.form-group {
	margin-bottom: 1.35rem;
}

.form-group label {
	display: block;
	font-size: 0.875rem;
	font-weight: 600;
	color: #334155;
	margin-bottom: 0.45rem;
}

.input-wrapper {
	position: relative;
	display: flex;
	align-items: center;
}

.input-icon {
	position: absolute;
	left: 14px;
	color: #94a3b8;
	font-size: 1rem;
	pointer-events: none;
	transition: color 0.2s ease;
}

.form-control {
	width: 100%;
	padding: 0.8rem 1rem 0.8rem 2.65rem;
	font-size: 0.95rem;
	color: var(--text-main);
	background: #f8fafc;
	border: 1.5px solid #e2e8f0;
	border-radius: var(--radius-md);
	outline: none;
	transition: all 0.2s ease;
}

.form-control::placeholder {
	color: #94a3b8;
	font-size: 0.9rem;
}

.form-control:focus {
	background: #ffffff;
	border-color: var(--primary);
	box-shadow: 0 0 0 4px var(--primary-ring);
}

.input-wrapper:focus-within .input-icon {
	color: var(--primary);
}

/* Nút ẩn/hiện mật khẩu */
.toggle-password {
	position: absolute;
	right: 12px;
	background: transparent;
	border: none;
	color: #94a3b8;
	cursor: pointer;
	padding: 6px;
	border-radius: var(--radius-sm);
	font-size: 1rem;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: color 0.2s ease, background 0.2s ease;
}

.toggle-password:hover {
	color: var(--text-main);
	background: #f1f5f9;
}

/* Hành động bổ sung */
.form-actions {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 1.5rem;
	font-size: 0.875rem;
}

.remember-me {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	color: var(--text-muted);
	cursor: pointer;
	user-select: none;
}

.remember-me input {
	accent-color: var(--primary);
	width: 16px;
	height: 16px;
	cursor: pointer;
}

.forgot-password {
	color: var(--primary);
	text-decoration: none;
	font-weight: 500;
	transition: color 0.2s ease;
}

.forgot-password:hover {
	color: var(--primary-hover);
	text-decoration: underline;
}

/* Nút bấm đăng nhập */
.btn-submit {
	width: 100%;
	padding: 0.85rem 1.25rem;
	background: linear-gradient(135deg, var(--primary) 0%, #4338ca 100%);
	color: #ffffff;
	border: none;
	border-radius: var(--radius-md);
	font-size: 1rem;
	font-weight: 600;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.6rem;
	box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
	transition: all 0.25s ease;
}

.btn-submit:hover {
	background: linear-gradient(135deg, #4338ca 0%, #3730a3 100%);
	box-shadow: 0 6px 20px rgba(79, 70, 229, 0.45);
	transform: translateY(-1px);
}

.btn-submit:active {
	transform: translateY(1px);
	box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}

.btn-submit.loading {
	pointer-events: none;
	opacity: 0.85;
}

/* Gợi ý vai trò tài khoản */
.account-hint-cards {
	margin-top: 2rem;
	padding-top: 1.5rem;
	border-top: 1px dashed var(--border-color);
}

.hint-title {
	font-size: 0.8rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	color: var(--text-light);
	margin-bottom: 0.65rem;
	text-align: center;
}

.hint-badges {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	flex-wrap: wrap;
}

.badge-role {
	font-size: 0.78rem;
	font-weight: 500;
	padding: 0.35rem 0.65rem;
	border-radius: 6px;
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	background: #f1f5f9;
	color: #475569;
	border: 1px solid #e2e8f0;
	transition: all 0.2s ease;
}

.badge-role:hover {
	background: var(--primary-light);
	color: var(--primary);
	border-color: rgba(79, 70, 229, 0.2);
}

.badge-role i {
	font-size: 0.85rem;
}

/* Khối 2 nút cài đặt ứng dụng Android & iOS */
.app-install-section {
	margin-top: 1.5rem;
	padding-top: 1.25rem;
	border-top: 1px solid #f1f5f9;
}

.install-title {
	font-size: 0.8rem;
	font-weight: 600;
	color: #64748b;
	margin-bottom: 0.75rem;
	text-align: center;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.4rem;
}

.install-title i {
	color: var(--primary);
}

.install-buttons {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.75rem;
}

.btn-install {
	display: flex;
	align-items: center;
	gap: 0.65rem;
	padding: 0.6rem 0.85rem;
	background: #0f172a;
	color: #ffffff;
	border: 1px solid #1e293b;
	border-radius: var(--radius-md);
	text-decoration: none;
	cursor: pointer;
	text-align: left;
	transition: all 0.25s ease;
	box-shadow: 0 2px 6px rgba(15, 23, 42, 0.12);
}

.btn-install i {
	font-size: 1.45rem;
	flex-shrink: 0;
	transition: transform 0.2s ease;
}

.btn-install:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.btn-install:hover i {
	transform: scale(1.15);
}

.btn-install .install-text {
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.btn-install .sub {
	font-size: 0.68rem;
	color: #94a3b8;
	text-transform: uppercase;
	letter-spacing: 0.02em;
	line-height: 1.2;
}

.btn-install .name {
	font-size: 0.84rem;
	font-weight: 700;
	color: #f8fafc;
	line-height: 1.25;
	white-space: nowrap;
}

/* Phong cách nút iOS */
.btn-ios {
	background: linear-gradient(145deg, #1e293b, #0f172a);
	border-color: rgba(255, 255, 255, 0.1);
}

.btn-ios i {
	color: #ffffff;
}

.btn-ios:hover {
	border-color: rgba(255, 255, 255, 0.25);
	box-shadow: 0 6px 18px rgba(15, 23, 42, 0.35);
}

/* Phong cách nút Android */
.btn-android {
	background: linear-gradient(145deg, #092c20, #061e16);
	border-color: rgba(16, 185, 129, 0.2);
}

.btn-android i {
	color: #34d399;
}

.btn-android:hover {
	border-color: rgba(16, 185, 129, 0.4);
	box-shadow: 0 6px 18px rgba(16, 185, 129, 0.25);
}

/* Kiểu dáng riêng cho nút cài đặt ở CỘT BÊN TRÁI */
.left-pane-install {
	border-top: 1px solid rgba(255, 255, 255, 0.1);
	margin-top: 0.5rem;
	padding-top: 1rem;
}

.left-pane-install .install-title {
	color: #cbd5e1;
	justify-content: flex-start;
	text-align: left;
	font-size: 0.82rem;
}

.left-pane-install .install-title i {
	color: #38bdf8;
}

.left-pane-install .btn-install {
	background: rgba(255, 255, 255, 0.05);
	border: 1px solid rgba(255, 255, 255, 0.12);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
}

.left-pane-install .btn-ios:hover {
	background: rgba(255, 255, 255, 0.14);
	border-color: rgba(255, 255, 255, 0.3);
}

.left-pane-install .btn-android {
	background: rgba(16, 185, 129, 0.12);
	border-color: rgba(16, 185, 129, 0.25);
}

.left-pane-install .btn-android:hover {
	background: rgba(16, 185, 129, 0.24);
	border-color: rgba(16, 185, 129, 0.45);
}

/* Khối cài đặt trên mobile (mặc định ẩn trên màn hình lớn) */
.mobile-only-install {
	display: none;
}

/* =========================================================
   MODAL LOADING OVERLAY
   ========================================================= */
.modal-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100vw;
	height: 100vh;
	background: rgba(15, 23, 42, 0.6);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
	display: flex;
	justify-content: center;
	align-items: center;
	z-index: 99999;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.2s ease, visibility 0.2s ease;
}

.modal-overlay.active {
	opacity: 1;
	visibility: visible;
}

.modal-box {
	background: #ffffff;
	padding: 2rem 2.5rem;
	border-radius: var(--radius-lg);
	box-shadow: var(--shadow-lg);
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 1.25rem;
	min-width: 260px;
	border: 1px solid var(--border-color);
}

.spinner {
	width: 44px;
	height: 44px;
	border: 3.5px solid #e2e8f0;
	border-top: 3.5px solid var(--primary);
	border-radius: 50%;
	animation: spin 0.75s linear infinite;
}

@keyframes spin {
	0% { transform: rotate(0deg); }
	100% { transform: rotate(360deg); }
}

.modal-text {
	color: var(--text-main);
	font-size: 0.95rem;
	font-weight: 600;
}

/* =========================================================
   RESPONSIVE DESIGN (TABLET & MOBILE)
   ========================================================= */
@media (max-width: 1024px) {
	.login-left-pane {
		padding: 2.5rem 2rem;
	}
	.brand-title {
		font-size: 1.55rem;
		white-space: nowrap;
	}
	.login-right-pane {
		padding: 2rem 1.5rem;
	}
}

@media (max-width: 860px) {
	.login-wrapper {
		flex-direction: column;
		min-height: 100vh;
	}

	.login-left-pane {
		display: none; /* Ẩn pane lớn trên điện thoại và dùng mobile-brand-header */
	}

	.login-right-pane {
		flex: 1;
		width: 100%;
		min-height: 100vh;
		padding: 2.5rem 1.5rem;
		background: #ffffff;
	}

	.mobile-brand-header {
		display: block;
	}

	.mobile-brand-header h2 {
		font-size: clamp(1.05rem, 4.2vw, 1.3rem);
		white-space: nowrap;
	}

	.login-card {
		box-shadow: none;
		padding: 0;
	}

	.mobile-only-install {
		display: block;
	}
}