/* ==========================================================================
   TRANG ĐĂNG NHẬP — theo phong cách BĐS Tây Bắc Củ Chi
   Đè lên giao diện mặc định của WordPress, giữ nguyên mọi chức năng.
   Bảng màu lấy từ tokens.css: đỏ #ca252b, vàng #e8a200.
   ========================================================================== */

/* ---------------------------------------------------------------
   1. NỀN — ảnh bìa thật của website + lớp phủ đỏ thương hiệu
   --------------------------------------------------------------- */
body.login {
	position: relative;
	min-height: 100vh;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;   /* để dòng hỗ trợ nằm DƯỚI khung, không bị đẩy sang phải */
	align-items: center;
	justify-content: flex-start;
	overflow-x: hidden;
	font-family: var(--font, "Be Vietnam Pro", system-ui, sans-serif);
	background-color: #1a1414;
	background-image: var(--login-bg);
	background-size: cover;
	background-position: center;
	background-attachment: fixed;
	animation: bds-login-zoom 26s ease-in-out infinite alternate;
}

/* Lớp phủ tối + đỏ cho chữ trắng nổi rõ và đúng chất thương hiệu */
body.login::before {
	content: "";
	position: fixed;
	inset: 0;
	z-index: 0;
	pointer-events: none;
	background:
		linear-gradient(150deg, rgba(26, 20, 20, .90) 0%, rgba(120, 22, 26, .78) 55%, rgba(202, 37, 43, .66) 100%),
		radial-gradient(120vw 80vh at 85% 10%, rgba(232, 162, 0, .18), transparent 62%);
}

/* Vệt sáng vàng chuyển động nhẹ cho sinh động */
body.login::after {
	content: "";
	position: fixed;
	inset: 0;
	z-index: 0;
	pointer-events: none;
	background: radial-gradient(46vw 46vw at 12% 88%, rgba(232, 162, 0, .16), transparent 62%);
	animation: bds-login-glow 14s ease-in-out infinite alternate;
}

/* Nền tự phóng rất chậm (Ken Burns) */
@keyframes bds-login-zoom {
	from { background-size: 100% auto; }
	to   { background-size: 108% auto; }
}
@keyframes bds-login-glow {
	from { transform: translate3d(0, 0, 0) scale(1); opacity: .55; }
	to   { transform: translate3d(3%, -4%, 0) scale(1.15); opacity: 1; }
}

/* ---------------------------------------------------------------
   2. KHUNG ĐĂNG NHẬP
   --------------------------------------------------------------- */
#login {
	position: relative;
	z-index: 2;
	width: 100%;
	max-width: 432px;
	padding: 28px 18px 14px;
	/* margin auto thay cho justify-content: nội dung luôn canh giữa, mà khi cao hơn
	   màn hình thì vẫn cuộn lên xem được phần trên (justify-content sẽ cắt mất). */
	margin: auto auto 0;
}

/* Logo thương hiệu ở trên cùng */
#login h1 {
	margin: 0 0 20px;
	text-align: center;
}

#login h1 a {
	display: block;
	width: 100%;
	/* Logo thương hiệu có tỉ lệ 2,6:1 (ngang, thấp) nên khung phải đủ CAO,
	   nếu để khung thấp như logo cũ thì chữ trong logo bị teo nhỏ khó đọc. */
	max-width: 300px;
	height: 116px;
	box-sizing: border-box;
	margin: 0 auto;
	padding: 14px 20px;
	/* Thẻ trắng bo góc đặt sau logo: logo PNG nền trắng nên trên nền đỏ sẽ
	   thành một khối trắng thô nếu không bo lại cho có chủ đích. */
	background-color: #fff;
	background-image: var(--login-logo);
	background-repeat: no-repeat;
	background-position: center;
	background-size: contain;
	border-radius: 14px;
	box-shadow: 0 16px 36px -14px rgba(0, 0, 0, .6);
	animation: bds-login-rise .6s cubic-bezier(.22, 1, .36, 1) both;
}

#login h1 a:focus {
	box-shadow: none;
	outline: 2px solid rgba(255, 255, 255, .8);
	outline-offset: 6px;
	border-radius: 8px;
}

@keyframes bds-login-rise {
	from { opacity: 0; transform: translateY(14px); }
	to   { opacity: 1; transform: translateY(0); }
}

/* Thẻ trắng chứa biểu mẫu */
#login form {
	display: flex;
	flex-direction: column;
	margin-top: 0;
	padding: 30px 32px 26px;
	background: #fff;
	border: 1px solid rgba(255, 255, 255, .5);
	border-radius: 18px;
	box-shadow:
		0 30px 70px -22px rgba(0, 0, 0, .62),
		0 3px 10px rgba(0, 0, 0, .18);
	animation: bds-login-card .55s cubic-bezier(.22, 1, .36, 1) .06s both;
}

@keyframes bds-login-card {
	from { opacity: 0; transform: translateY(22px) scale(.985); }
	to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Đường chỉ đỏ trên đỉnh thẻ (order âm để luôn nằm trên cùng) */
#login form::before {
	order: -2;
	content: "";
	display: block;
	height: 4px;
	margin: -30px -32px 24px;
	border-radius: 18px 18px 0 0;
	background: linear-gradient(90deg, var(--c-primary, #ca252b), var(--c-accent, #e8a200));
}

/* Lời chào — WordPress chèn hook login_form vào GIỮA biểu mẫu,
   nên phải kéo lên đầu bằng order. */
.bds-login__lead {
	order: -1;
	margin: 0 0 10px;
}

.bds-login__lead h2 {
	margin: 0 0 6px;
	font-size: 21px;
	font-weight: 700;
	line-height: 1.25;
	color: var(--c-dark, #333);
}

.bds-login__lead p {
	margin: 0 0 18px;
	font-size: 13.5px;
	line-height: 1.55;
	color: var(--c-muted, #666);
}

.bds-login__lead strong {
	color: var(--c-primary, #ca252b);
	font-weight: 600;
}

/* ---------------------------------------------------------------
   3. Ô NHẬP LIỆU
   --------------------------------------------------------------- */
#login form > p > label {
	display: block;
	margin-bottom: 6px;
	font-size: 13.5px;
	font-weight: 600;
	color: var(--c-dark, #333);
}

.login form .input,
.login input[type="text"],
.login input[type="password"],
.login input[type="email"] {
	width: 100%;
	padding: 12px 14px;
	font-family: inherit;
	font-size: 15px;
	color: var(--c-dark, #333);
	background: #fbfbfc;
	border: 1.5px solid var(--c-border, #e3e3e3);
	border-radius: 10px;
	box-shadow: none;
	transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}

.login input:focus {
	background: #fff;
	border-color: var(--c-primary, #ca252b);
	box-shadow: 0 0 0 3.5px rgba(202, 37, 43, .14);
	outline: none;
}

.login .form-invalid input {
	border-color: var(--c-danger, #d93025);
	box-shadow: 0 0 0 3.5px rgba(217, 48, 37, .12);
}

/* Nút con mắt xem mật khẩu */
.login .wp-pwd {
	position: relative;
}

.login .wp-pwd .button.wp-hide-pw {
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	min-height: 0;
	top: 50%;
	right: 4px;
	transform: translateY(-50%);
	color: var(--c-muted, #666);
	background: transparent;
	border: 0;
	box-shadow: none;
}

.login .wp-pwd .button.wp-hide-pw:hover {
	color: var(--c-primary, #ca252b);
	background: transparent;
}

.login .wp-pwd .button.wp-hide-pw:focus {
	color: var(--c-primary, #ca252b);
	border-color: transparent;
	box-shadow: none;
}

/* ---------------------------------------------------------------
   4. NÚT ĐĂNG NHẬP
   --------------------------------------------------------------- */
.wp-core-ui .button-primary,
.login .button-primary,
#wp-submit {
	float: none;
	display: block;
	width: 100%;
	height: 47px;
	margin-top: 6px;
	font-family: inherit;
	font-size: 15.5px;
	font-weight: 600;
	line-height: 47px;
	letter-spacing: .2px;
	color: #fff;
	text-shadow: none;
	background: linear-gradient(135deg, #ca252b 0%, #a81d22 100%);
	border: 0;
	border-radius: 10px;
	box-shadow: 0 12px 24px -10px rgba(202, 37, 43, .85);
	transition: transform .18s cubic-bezier(.22, 1, .36, 1), box-shadow .18s ease, filter .18s ease;
}

.wp-core-ui .button-primary:hover,
.login .button-primary:hover,
#wp-submit:hover {
	transform: translateY(-2px);
	filter: brightness(1.07);
	background: linear-gradient(135deg, #ca252b 0%, #a81d22 100%);
	box-shadow: 0 18px 30px -10px rgba(202, 37, 43, .9);
}

.wp-core-ui .button-primary:focus,
#wp-submit:focus {
	box-shadow: 0 0 0 3.5px rgba(202, 37, 43, .3), 0 12px 24px -10px rgba(202, 37, 43, .85);
	outline: none;
}

.wp-core-ui .button-primary:active,
#wp-submit:active {
	transform: translateY(0);
}

/* ---------------------------------------------------------------
   5. GHI NHỚ ĐĂNG NHẬP
   --------------------------------------------------------------- */
.login .forgetmenot {
	float: none;
	margin: 14px 0 6px;
	font-size: 13.5px;
}

/* Phải đủ mạnh để thắng quy tắc nhãn phía trên, nếu không ô tick sẽ rớt xuống dòng riêng */
#login .forgetmenot label {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	font-weight: 500;
	color: var(--c-text, #333);
	cursor: pointer;
	line-height: 1.4;
}

#login .forgetmenot input[type="checkbox"] {
	display: inline-block;
	flex-shrink: 0;
	margin: 0;
}

.login input[type="checkbox"] {
	width: 18px;
	height: 18px;
	margin: 0;
	border: 1.5px solid var(--c-border, #e3e3e3);
	border-radius: 5px;
	background: #fff;
	box-shadow: none;
	transition: background-color .15s ease, border-color .15s ease;
}

.login input[type="checkbox"]:checked {
	background: var(--c-primary, #ca252b);
	border-color: var(--c-primary, #ca252b);
}

.login input[type="checkbox"]:checked::before {
	content: "";
	display: block;
	width: 4px;
	height: 8px;
	margin: 2px 0 0 6px;
	border: solid #fff;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}

/* ---------------------------------------------------------------
   6. LIÊN KẾT DƯỚI KHUNG
   --------------------------------------------------------------- */
#login #nav,
#login #backtoblog,
.language-switcher {
	position: relative;
	z-index: 2;
	padding: 0;
	margin: 14px 0 0;
	font-size: 14px;
	text-align: center;
	text-shadow: none;
}

#login #nav a,
#login #backtoblog a,
#login .privacy-policy-page-link a,
.language-switcher a {
	color: rgba(255, 255, 255, .88);
	text-decoration: none;
	font-weight: 500;
	transition: color .16s ease;
}

#login #nav a:hover,
#login #backtoblog a:hover,
.language-switcher a:hover {
	color: #fff;
	text-decoration: underline;
}

/* Quên mật khẩu — cho thành nút phụ dễ thấy */
#login #nav {
	margin-top: 18px;
}

#login #nav a {
	display: inline-block;
	padding: 9px 20px;
	border: 1.5px solid rgba(255, 255, 255, .38);
	border-radius: 999px;
	background: rgba(255, 255, 255, .08);
	backdrop-filter: blur(3px);
	transition: background-color .18s ease, border-color .18s ease;
}

#login #nav a:hover {
	background: rgba(255, 255, 255, .18);
	border-color: rgba(255, 255, 255, .7);
	text-decoration: none;
}

/* Trình chọn ngôn ngữ: site chỉ dùng tiếng Việt nên ẩn cho gọn.
   Muốn hiện lại thì xoá khối này. */
body.login .language-switcher {
	display: none;
}

/* ---------------------------------------------------------------
   7. DÒNG HỖ TRỢ (hotline)
   --------------------------------------------------------------- */
.bds-login__help {
	position: relative;
	z-index: 2;
	width: 100%;
	max-width: 432px;
	margin: 20px auto auto;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding-top: 16px;
	border-top: 1px solid rgba(255, 255, 255, .16);
	font-size: 13px;
	line-height: 1.5;
	text-align: center;
	color: rgba(255, 255, 255, .82);
}

.bds-login__help svg {
	flex-shrink: 0;
	color: var(--c-accent, #e8a200);
}

.bds-login__help a {
	color: #fff;
	font-weight: 600;
	text-decoration: none;
	border-bottom: 1px solid rgba(255, 255, 255, .45);
}

.bds-login__help a:hover {
	color: var(--c-accent, #e8a200);
	border-color: var(--c-accent, #e8a200);
}

/* Nút trợ giúp "?" của WordPress cạnh ô ghi nhớ */
#login .forgetmenot .wp-tooltip {
	display: inline-flex;
	align-items: center;
	margin-left: 2px;
}

#login .forgetmenot .wp-tooltip .wp-tooltip__button {
	display: grid;
	place-items: center;
	width: 20px;
	height: 20px;
	color: var(--c-muted, #666);
	background: transparent;
	border: 0;
	opacity: .75;
}

#login .forgetmenot .wp-tooltip .wp-tooltip__button:hover {
	color: var(--c-primary, #ca252b);
	opacity: 1;
}

/* ---------------------------------------------------------------
   8. THÔNG BÁO (lỗi / thành công)
   --------------------------------------------------------------- */
#login_error,
.login .message,
.login .success,
.login .notice {
	margin: 0 0 18px;
	padding: 13px 16px;
	font-size: 13.5px;
	line-height: 1.55;
	background: #fff;
	border: 0;
	border-left: 4px solid var(--c-primary, #ca252b);
	border-radius: 10px;
	box-shadow: 0 12px 26px -14px rgba(0, 0, 0, .5);
	animation: bds-login-rise .4s cubic-bezier(.22, 1, .36, 1) both;
}

.login .success {
	border-left-color: #1a7f37;
}

.login .message {
	border-left-color: var(--c-accent, #e8a200);
}

#login_error strong {
	color: var(--c-primary, #ca252b);
}

/* ---------------------------------------------------------------
   9. ĐIỆN THOẠI
   --------------------------------------------------------------- */
@media screen and (max-width: 480px) {
	body.login {
		align-items: flex-start;
		background-attachment: scroll;
	}

	#login {
		padding: 30px 16px 30px;
	}

	#login h1 a {
		max-width: 264px;
		height: 102px;
		padding: 12px 16px;
	}

	#login form {
		padding: 26px 22px 22px;
	}

	#login form::before {
		margin: -26px -22px 20px;
	}

	.bds-login__lead h2 {
		font-size: 19px;
	}
}

/* ---------------------------------------------------------------
   10. TÔN TRỌNG AI KHÔNG MUỐN CHUYỂN ĐỘNG
   --------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
	body.login,
	body.login::after,
	#login h1 a,
	#login form,
	#login_error,
	.login .message,
	.login .success {
		animation: none !important;
	}

	#wp-submit,
	.bds-login__help a {
		transition: none !important;
	}
}
