/* AG Tài khoản – Đăng nhập / Đăng ký khách lẻ. Author: August - https://augustcsgo.com */

.ag-acc {
	--agc: #0f9d6c;
	--agc-d: #0b6b4a;
	--agc-l: #4cc38a;
	--agc-y: #f7b731;
	max-width: 980px;
	margin: 10px auto 40px;
	font-size: 16px;
	line-height: 1.5;
	color: #1f2937;
}

.ag-acc *,
.ag-acc *::before,
.ag-acc *::after {
	box-sizing: border-box;
}

/* Ẩn tiêu đề "Tài khoản" thừa của Flatsome trên trang đăng nhập */
body.ag-acc-auth .page-title,
body.ag-acc-auth .woocommerce-MyAccount-navigation {
	display: none;
}

.ag-acc__card {
	display: grid;
	grid-template-columns: 1fr;
	overflow: hidden;
	background: #fff;
	border: 1px solid rgba(15, 157, 108, 0.14);
	border-radius: 22px;
	box-shadow: 0 18px 50px rgba(11, 107, 74, 0.12);
}

@media (min-width: 850px) {
	.ag-acc__card {
		grid-template-columns: 0.9fr 1.1fr;
	}
}

/* ---------- Cột thương hiệu ---------- */
.ag-acc__brand {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 14px;
	padding: 28px 26px;
	overflow: hidden;
	color: #fff;
	background: linear-gradient(150deg, var(--agc-d) 0%, var(--agc) 55%, var(--agc-l) 100%);
}

.ag-acc__brand::before,
.ag-acc__brand::after {
	content: "";
	position: absolute;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.09);
	pointer-events: none;
}

.ag-acc__brand::before {
	top: -60px;
	right: -60px;
	width: 200px;
	height: 200px;
}

.ag-acc__brand::after {
	bottom: -80px;
	left: -50px;
	width: 220px;
	height: 220px;
}

.ag-acc__logo {
	position: relative;
	z-index: 1;
	width: 84px;
	height: 84px;
	padding: 6px;
	object-fit: contain;
	background: #fff;
	border-radius: 50%;
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
}

.ag-acc__hello {
	position: relative;
	z-index: 1;
	margin: 4px 0 0;
	font-size: 24px;
	font-weight: 800;
	line-height: 1.3;
	color: #fff;
}

.ag-acc__perks {
	position: relative;
	z-index: 1;
	display: grid;
	gap: 10px;
	margin: 4px 0 0 !important;
	padding: 0 !important;
	list-style: none;
}

.ag-acc__perks li {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin: 0 !important;
	font-size: 15px;
	font-weight: 600;
	list-style: none;
}

.ag-acc__perks svg {
	flex: 0 0 26px;
	width: 26px;
	height: 26px;
	padding: 4px;
	color: var(--agc);
	background: #fff;
	border-radius: 50%;
}

.ag-acc__perks li.is-gift {
	padding: 10px 12px;
	color: #3b2a00;
	background: var(--agc-y);
	border-radius: 14px;
	box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.ag-acc__perks li.is-gift svg {
	color: #c2410c;
}

.ag-acc__hot {
	position: relative;
	z-index: 1;
	margin: auto 0 0;
	padding-top: 6px;
	font-size: 14px;
	opacity: 0.95;
}

.ag-acc__hot a {
	font-weight: 800;
	color: #fff;
	text-decoration: underline;
}

@media (max-width: 849px) {
	.ag-acc__brand {
		flex-direction: row;
		flex-wrap: wrap;
		align-items: center;
		padding: 18px;
	}

	.ag-acc__logo {
		width: 56px;
		height: 56px;
	}

	.ag-acc__hello {
		flex: 1 1 0;
		margin: 0;
		font-size: 19px;
	}

	.ag-acc__perks,
	.ag-acc__hot {
		flex: 1 1 100%;
	}

	.ag-acc__perks li:not(.is-gift) {
		display: none;
	}
}

/* ---------- Cột form ---------- */
.ag-acc__main {
	padding: 26px 28px 30px;
}

@media (max-width: 549px) {
	.ag-acc__main {
		padding: 18px 16px 22px;
	}
}

.ag-acc__tabs {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 6px;
	margin-bottom: 18px;
	padding: 5px;
	background: #eef7f2;
	border-radius: 14px;
}

.ag-acc__tab {
	min-height: 46px;
	margin: 0 !important;
	padding: 0 10px;
	font-size: 16px;
	font-weight: 800;
	text-transform: none;
	letter-spacing: 0;
	color: #4b5563;
	background: transparent;
	border: 0;
	border-radius: 10px;
	cursor: pointer;
	transition: background-color 0.2s, color 0.2s, box-shadow 0.2s;
}

.ag-acc[data-panel="login"] .ag-acc__tab[data-go="login"],
.ag-acc[data-panel="forgot"] .ag-acc__tab[data-go="login"],
.ag-acc[data-panel="register"] .ag-acc__tab[data-go="register"] {
	color: var(--agc-d);
	background: #fff;
	box-shadow: 0 3px 10px rgba(11, 107, 74, 0.12);
}

.ag-acc__panel {
	display: none;
	margin: 0;
	animation: ag-acc-in 0.25s ease;
}

.ag-acc[data-panel="login"] .ag-acc__panel[data-panel="login"],
.ag-acc[data-panel="register"] .ag-acc__panel[data-panel="register"],
.ag-acc[data-panel="forgot"] .ag-acc__panel[data-panel="forgot"] {
	display: block;
}

@keyframes ag-acc-in {
	from { opacity: 0; transform: translateY(6px); }
	to { opacity: 1; transform: none; }
}

.ag-acc__title {
	margin: 0 0 14px;
	font-size: 22px;
	font-weight: 800;
	color: var(--agc-d);
}

.ag-acc__desc {
	margin: -4px 0 14px;
	font-size: 15px;
	color: #4b5563;
}

.ag-acc__gift {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: -4px 0 14px;
	padding: 10px 12px;
	font-size: 15px;
	font-weight: 700;
	color: #7c2d12;
	background: #fff7e6;
	border: 1.5px dashed var(--agc-y);
	border-radius: 12px;
}

.ag-acc__gift svg {
	flex: 0 0 auto;
	color: #ea580c;
}

.ag-acc__field {
	display: block;
	margin: 0 0 14px;
}

.ag-acc__label {
	display: block;
	margin-bottom: 6px;
	font-size: 15px;
	font-weight: 700;
	color: #1f2937;
}

.ag-acc__label em {
	font-size: 13px;
	font-style: normal;
	font-weight: 500;
	color: #6b7280;
}

.ag-acc__input {
	position: relative;
	display: flex;
	align-items: center;
}

.ag-acc__input > svg {
	position: absolute;
	top: 50%;
	left: 14px;
	z-index: 1;
	color: #9ca3af;
	pointer-events: none;
	transform: translateY(-50%);
	transition: color 0.2s;
}

.ag-acc__input:focus-within > svg {
	color: var(--agc);
}

.ag-acc .ag-acc__input input {
	width: 100%;
	height: 52px;
	margin: 0;
	padding: 0 48px 0 44px;
	font-size: 17px;
	color: #111827;
	background: #f9fafb;
	border: 1.5px solid #e5e7eb;
	border-radius: 12px;
	box-shadow: none;
	transition: border-color 0.2s, background-color 0.2s, box-shadow 0.2s;
}

.ag-acc--change .ag-acc__input input {
	padding-left: 14px;
}

.ag-acc .ag-acc__input input:focus {
	background: #fff;
	border-color: var(--agc);
	outline: none;
	box-shadow: 0 0 0 4px rgba(15, 157, 108, 0.14);
}

.ag-acc__eye {
	position: absolute;
	top: 50%;
	right: 6px;
	width: 40px;
	height: 40px;
	min-height: 0;
	margin: 0 !important;
	padding: 0;
	background: transparent no-repeat center / 22px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%239ca3af' d='M12 5c5 0 9 4.5 10 7-1 2.5-5 7-10 7S3 14.5 2 12c1-2.5 5-7 10-7zm0 3a4 4 0 1 0 0 8 4 4 0 0 0 0-8zm0 2a2 2 0 1 1 0 4 2 2 0 0 1 0-4z'/%3E%3C/svg%3E");
	border: 0;
	border-radius: 10px;
	transform: translateY(-50%);
	cursor: pointer;
}

.ag-acc__eye.is-on {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%230f9d6c' d='M3.3 2 2 3.3l3 3C3.6 7.6 2.6 9.9 2 12c1 2.5 5 7 10 7 1.8 0 3.4-.6 4.8-1.4l3.9 3.9 1.3-1.3zM12 16a4 4 0 0 1-3.9-4.9l1.6 1.6A2 2 0 0 0 11.3 14l1.6 1.6c-.3.3-.6.4-.9.4zm0-11c5 0 9 4.5 10 7-.5 1.2-1.6 2.9-3.2 4.3l-2.9-2.9A4 4 0 0 0 10.6 8.1L8.3 5.8C9.4 5.3 10.7 5 12 5z'/%3E%3C/svg%3E");
}

.ag-acc__row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	margin: -2px 0 16px;
}

.ag-acc__check {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	font-size: 15px;
	font-weight: 500;
	cursor: pointer;
}

.ag-acc__check input {
	width: 18px;
	height: 18px;
	margin: 0;
	accent-color: var(--agc);
}

.ag-acc__link {
	min-height: 0;
	margin: 0 !important;
	padding: 0;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.4;
	text-transform: none;
	letter-spacing: 0;
	color: var(--agc);
	background: none;
	border: 0;
	box-shadow: none;
	cursor: pointer;
}

.ag-acc__link:hover {
	color: var(--agc-d);
	background: none;
	text-decoration: underline;
}

.ag-acc__btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 54px;
	margin: 4px 0 0 !important;
	padding: 0 20px;
	font-size: 17px;
	font-weight: 800;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	color: #fff;
	background: linear-gradient(90deg, var(--agc-d), var(--agc) 55%, var(--agc-l));
	border: 0;
	border-radius: 14px;
	box-shadow: 0 10px 22px rgba(15, 157, 108, 0.28);
	cursor: pointer;
	transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
}

.ag-acc__btn:hover {
	color: #fff;
	filter: brightness(1.05);
	box-shadow: 0 12px 26px rgba(15, 157, 108, 0.34);
}

.ag-acc__btn:active {
	transform: translateY(1px) scale(0.99);
}

.ag-acc__btn.is-loading {
	pointer-events: none;
	opacity: 0.8;
}

.ag-acc__btn.is-loading::after {
	content: "";
	width: 18px;
	height: 18px;
	margin-left: 10px;
	border: 2.5px solid rgba(255, 255, 255, 0.5);
	border-top-color: #fff;
	border-radius: 50%;
	animation: ag-acc-spin 0.7s linear infinite;
}

@keyframes ag-acc-spin {
	to { transform: rotate(360deg); }
}

.ag-acc__switch {
	margin: 16px 0 0;
	font-size: 15px;
	text-align: center;
	color: #4b5563;
}

.ag-acc__fine {
	margin: 10px 0 0;
	font-size: 13px;
	text-align: center;
	color: #9ca3af;
}

.ag-acc__alert {
	margin: 0 0 16px;
	padding: 12px 14px;
	font-size: 15px;
	border-radius: 12px;
}

.ag-acc__alert p {
	margin: 0;
}

.ag-acc__alert p + p {
	margin-top: 4px;
}

.ag-acc__alert.is-error {
	color: #991b1b;
	background: #fef2f2;
	border: 1px solid #fecaca;
}

.ag-acc__alert.is-ok {
	color: #065f46;
	background: #ecfdf5;
	border: 1px solid #a7f3d0;
}

.ag-acc__turnstile,
.ag-acc-turnstile {
	margin: 0 0 14px;
}

/* ---------- Đổi mật khẩu tạm ---------- */
.ag-acc--change {
	max-width: 520px;
	margin: 0 auto;
}

.ag-acc__change {
	padding: 26px 24px;
	background: #fff;
	border: 1px solid rgba(15, 157, 108, 0.16);
	border-radius: 18px;
	box-shadow: 0 12px 34px rgba(11, 107, 74, 0.1);
}

/* ===== Popup đăng nhập của Flatsome (#login-form-popup) ===== */
#login-form-popup.lightbox-content {
	width: calc(100vw - 32px) !important;
	max-width: 860px !important;
	padding: 0 !important;
	background: transparent !important;
	box-shadow: none !important;
}
#login-form-popup .woocommerce { margin: 0; }
#login-form-popup .ag-acc { max-width: none; margin: 0; }
#login-form-popup .ag-acc__card { border: 0; border-radius: 24px; box-shadow: 0 30px 80px rgba(15, 23, 42, 0.35); }
#login-form-popup .ag-acc__brand { padding: 30px 28px; }
#login-form-popup .ag-acc__main { padding: 28px 30px 26px; }
#login-form-popup .ag-acc__tab { white-space: nowrap; }
#login-form-popup .ag-acc__input input { min-width: 0; }
.mfp-content #login-form-popup + .mfp-close,
#login-form-popup .mfp-close {
	top: 10px !important;
	right: 10px !important;
	width: 36px;
	height: 36px;
	line-height: 36px;
	color: #374151 !important;
	background: #f3f4f6;
	border-radius: 50%;
	opacity: 1;
}

@media (max-width: 849px) {
	#login-form-popup.lightbox-content { max-width: 460px !important; }
	/* Điện thoại: bỏ cột thương hiệu cho gọn, chỉ giữ dải quà tặng nhỏ */
	#login-form-popup .ag-acc__brand { flex-wrap: nowrap; gap: 12px; padding: 14px 16px; }
	#login-form-popup .ag-acc__logo { width: 44px; height: 44px; }
	#login-form-popup .ag-acc__hello { font-size: 16px; }
	#login-form-popup .ag-acc__perks,
	#login-form-popup .ag-acc__hot { display: none; }
	#login-form-popup .ag-acc__main { padding: 16px 16px 20px; }
}
