/**
 * ThemeWP Auth Flatsome v1.0.3
 * Brand: #0F6E56 + #1d8fb5
 * Scope: .twpaf
 */

.twpaf {
	--twpaf-primary: #0F6E56;
	--twpaf-primary-dark: #0a5642;
	--twpaf-secondary: #1d8fb5;
	--twpaf-text: #1f2937;
	--twpaf-muted: #6b7280;
	--twpaf-line: #e5e7eb;
	--twpaf-bg: #ffffff;
	--twpaf-bg-soft: #f8fafc;
	--twpaf-radius: 16px;
	--twpaf-radius-sm: 10px;
	--twpaf-shadow: 0 24px 56px -28px rgba(15, 110, 86, 0.25), 0 8px 24px -16px rgba(0, 0, 0, 0.08);

	box-sizing: border-box;
	max-width: 1080px;
	margin: 24px auto;
	color: var(--twpaf-text);
	font-family: inherit;
}

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

/* ─── Card ───────────────────────────────────────────── */
.twpaf__card {
	background: var(--twpaf-bg);
	border-radius: var(--twpaf-radius);
	box-shadow: var(--twpaf-shadow);
	overflow: hidden;
	display: grid;
	grid-template-columns: 1fr 1fr;
	min-height: 620px;
	position: relative;
}

.twpaf--login-only .twpaf__card {
	grid-template-columns: 1fr;
	max-width: 480px;
	margin: 0 auto;
}

/* ─── Notices ────────────────────────────────────────── */
.twpaf__notices {
	grid-column: 1 / -1;
	padding: 16px 36px 0;
}
.twpaf__notices:empty { display: none; }
.twpaf__notices .woocommerce-error,
.twpaf__notices .woocommerce-message,
.twpaf__notices .woocommerce-info {
	border-radius: 10px !important;
	padding: 12px 16px !important;
	margin: 0 0 12px !important;
	list-style: none !important;
	font-size: 14px !important;
	line-height: 1.5 !important;
	border-left: 4px solid !important;
}
.twpaf__notices .woocommerce-error { background: #fef2f2 !important; color: #991b1b !important; border-left-color: #ef4444 !important; }
.twpaf__notices .woocommerce-message { background: #f0fdf4 !important; color: #166534 !important; border-left-color: #22c55e !important; }
.twpaf__notices .woocommerce-info { background: #eff6ff !important; color: #1e40af !important; border-left-color: #3b82f6 !important; }
.twpaf__notices ul, .twpaf__notices li { margin: 0 !important; padding: 0 !important; list-style: none !important; }

/* ─── Left pane (Login) ──────────────────────────────── */
.twpaf__pane--login {
	padding: 44px 40px;
	display: flex;
	flex-direction: column;
	gap: 18px;
	background: var(--twpaf-bg);
}

.twpaf__brand {
	display: flex;
	align-items: center;
	gap: 10px;
}
.twpaf__brand-mark {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 10px;
	background: linear-gradient(135deg, var(--twpaf-primary) 0%, var(--twpaf-secondary) 100%);
	color: #fff;
}
.twpaf__brand-label {
	font-size: 12px;
	font-weight: 700;
	color: var(--twpaf-text);
	letter-spacing: 0.6px;
}

.twpaf__head h2 {
	font-size: 28px;
	margin: 0 0 6px;
	font-weight: 700;
	color: var(--twpaf-text);
	line-height: 1.2;
}
.twpaf__head p {
	font-size: 14px;
	color: var(--twpaf-muted);
	margin: 0;
	line-height: 1.5;
}

/* ─── Social (Google) area ───────────────────────────── */
.twpaf__social { margin: 4px 0; }

.twpaf .twpaf__social-host > * {
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	gap: 12px !important;
	padding: 12px 14px !important;
	border: 1px solid var(--twpaf-line) !important;
	border-radius: var(--twpaf-radius-sm) !important;
	background: var(--twpaf-bg) !important;
	font-size: 14px !important;
	font-weight: 500 !important;
	color: var(--twpaf-text) !important;
	text-decoration: none !important;
	width: 100% !important;
	cursor: pointer !important;
	transition: all 0.15s !important;
	box-shadow: none !important;
	min-height: 50px !important;
	list-style: none !important;
	position: relative !important;
	flex-direction: row !important;
}
.twpaf .twpaf__social-host > *:hover {
	background: var(--twpaf-bg-soft) !important;
	border-color: var(--twpaf-primary) !important;
}
.twpaf .twpaf__social-host ul,
.twpaf .twpaf__social-host ol { margin: 0; padding: 0; list-style: none; }

.twpaf .ywsl-social.ywsl-google img {
	width: 24px !important;
	height: 24px !important;
	margin: 0 !important;
	order: 1;
	position: static !important;
}

/* Override text "Đăng nhập bằng Google" — left side */
.twpaf__pane--login .ywsl-social.ywsl-google:before {
	content: 'Đăng nhập bằng Google' !important;
	position: static !important;
	color: var(--twpaf-text) !important;
	font-weight: 600 !important;
	font-style: normal !important;
	font-size: 15px !important;
	top: auto !important;
	left: auto !important;
	order: 2;
}

/* Override text "Đăng ký bằng Google" — right side */
.twpaf__social--register .ywsl-social.ywsl-google:before {
	content: 'Đăng ký bằng Google' !important;
	position: static !important;
	color: var(--twpaf-text) !important;
	font-weight: 600 !important;
	font-style: normal !important;
	font-size: 15px !important;
	top: auto !important;
	left: auto !important;
	order: 2;
}

/* ─── Divider ────────────────────────────────────────── */
.twpaf__divider {
	display: flex;
	align-items: center;
	gap: 12px;
	font-size: 13px;
	color: var(--twpaf-muted);
	margin: 4px 0;
}
.twpaf__divider::before, .twpaf__divider::after {
	content: "";
	flex: 1;
	height: 1px;
	background: var(--twpaf-line);
}
.twpaf__divider--invert { color: rgba(255,255,255,0.7); }
.twpaf__divider--invert::before, .twpaf__divider--invert::after { background: rgba(255,255,255,0.25); }

/* ─── Form fields ────────────────────────────────────── */
.twpaf__form {
	display: flex;
	flex-direction: column;
	gap: 14px;
	margin: 0;
}

.twpaf__field { position: relative; }
.twpaf__field-icon {
	position: absolute;
	left: 14px;
	top: 50%;
	transform: translateY(-50%);
	color: var(--twpaf-muted);
	pointer-events: none;
	z-index: 2;
}

/* Force input override theme */
.twpaf .twpaf__form input[type="text"],
.twpaf .twpaf__form input[type="email"],
.twpaf .twpaf__form input[type="password"],
section.twpaf .twpaf__form input.input-text {
	width: 100% !important;
	padding: 14px 14px 14px 44px !important;
	border: 1px solid var(--twpaf-line) !important;
	border-radius: var(--twpaf-radius-sm) !important;
	font-size: 14px !important;
	background: var(--twpaf-bg) !important;
	color: var(--twpaf-text) !important;
	height: auto !important;
	line-height: 1.4 !important;
	box-shadow: none !important;
	font-family: inherit !important;
	transition: border-color 0.15s, box-shadow 0.15s !important;
}
.twpaf .twpaf__form input:focus {
	outline: none !important;
	border-color: var(--twpaf-primary) !important;
	box-shadow: 0 0 0 3px rgba(15, 110, 86, 0.12) !important;
}

/* Register pane input: lighter style on dark bg */
.twpaf .twpaf__form--register input[type="text"],
.twpaf .twpaf__form--register input[type="email"],
.twpaf .twpaf__form--register input[type="password"],
section.twpaf .twpaf__form--register input.input-text {
	background: rgba(255,255,255,0.97) !important;
	border-color: transparent !important;
}
.twpaf .twpaf__form--register input:focus {
	border-color: #fff !important;
	box-shadow: 0 0 0 3px rgba(255,255,255,0.3) !important;
}

/* ─── Password toggle ────────────────────────────────── */
.twpaf__toggle-pwd {
	position: absolute;
	right: 8px;
	top: 50%;
	transform: translateY(-50%);
	background: transparent;
	border: 0;
	padding: 8px;
	color: var(--twpaf-muted);
	cursor: pointer;
	border-radius: 6px;
	display: inline-flex;
	align-items: center;
	z-index: 3;
}
.twpaf__toggle-pwd:hover { background: var(--twpaf-bg-soft); color: var(--twpaf-primary); }

/* ─── Meta (remember + forgot) ───────────────────────── */
.twpaf__meta {
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-size: 13px;
	gap: 12px;
	flex-wrap: wrap;
	margin: 2px 0;
}
.twpaf__check {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	color: var(--twpaf-muted);
	cursor: pointer;
	user-select: none;
	margin: 0;
}
.twpaf__check input {
	accent-color: var(--twpaf-primary);
	width: 16px;
	height: 16px;
	margin: 0;
}
.twpaf__forgot {
	color: var(--twpaf-primary);
	text-decoration: none;
	font-weight: 600;
}
.twpaf__forgot:hover { text-decoration: underline; }

/* ─── Buttons ────────────────────────────────────────── */
.twpaf .twpaf__btn {
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	gap: 8px !important;
	padding: 14px 20px !important;
	border-radius: var(--twpaf-radius-sm) !important;
	font-size: 15px !important;
	font-weight: 600 !important;
	cursor: pointer !important;
	transition: all 0.15s !important;
	border: none !important;
	font-family: inherit !important;
	line-height: 1.2 !important;
	margin: 4px 0 0 !important;
	width: 100% !important;
	text-transform: none !important;
	letter-spacing: 0 !important;
}
.twpaf .twpaf__btn--primary {
	background: var(--twpaf-primary) !important;
	color: #fff !important;
	box-shadow: 0 6px 18px -8px rgba(15, 110, 86, 0.6) !important;
}
.twpaf .twpaf__btn--primary:hover {
	background: var(--twpaf-primary-dark) !important;
	transform: translateY(-1px);
}
.twpaf .twpaf__btn--solid {
	background: var(--twpaf-primary) !important;
	color: #fff !important;
	box-shadow: 0 6px 18px -8px rgba(0, 0, 0, 0.3) !important;
}
.twpaf .twpaf__btn--solid:hover {
	background: var(--twpaf-primary-dark) !important;
	transform: translateY(-1px);
}

/* ─── Right pane (Register) ──────────────────────────── */
.twpaf__pane--register {
	position: relative;
	padding: 44px 40px;
	color: #fff;
	background: linear-gradient(160deg, var(--twpaf-primary) 0%, var(--twpaf-secondary) 100%);
	display: flex;
	flex-direction: column;
	justify-content: flex-start;
	gap: 16px;
	overflow: hidden;
}
.twpaf__pane-bg { position: absolute; inset: 0; pointer-events: none; }
.twpaf__blob { position: absolute; border-radius: 50%; background: rgba(255, 255, 255, 0.08); }
.twpaf__blob--a { width: 280px; height: 280px; top: -80px; right: -80px; }
.twpaf__blob--b { width: 200px; height: 200px; bottom: -60px; left: -40px; background: rgba(255, 255, 255, 0.06); }

.twpaf__pill {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 14px;
	background: rgba(255, 255, 255, 0.18);
	border-radius: 100px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 1px;
	width: fit-content;
	position: relative;
	z-index: 1;
	color: #fff;
}

.twpaf__head--invert { position: relative; z-index: 1; }
.twpaf__head--invert h2 { color: #fff !important; font-size: 26px; margin: 0 0 6px; }
.twpaf__head--invert p { color: rgba(255, 255, 255, 0.9); margin: 0; }

/* ─── Perks grid (3 horizontal icons) ───────────────── */
.twpaf__perks-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 12px;
	margin: 8px 0;
	position: relative;
	z-index: 1;
}
.twpaf__perk {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
	text-align: center;
}
.twpaf__perk-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	border-radius: 50%;
	background: rgba(255,255,255,0.18);
	color: #fff;
	border: 1px solid rgba(255,255,255,0.25);
}
.twpaf__perk-label {
	font-size: 13px;
	color: #fff;
	line-height: 1.3;
	font-weight: 500;
}

.twpaf__social--invert > * { background: #fff !important; border-color: #fff !important; }
.twpaf__social--invert > *:hover { background: #f8fafc !important; }

.twpaf__form--register { position: relative; z-index: 1; }

/* ─── WC privacy policy text styling in register pane ── */
.twpaf__pane--register .woocommerce-privacy-policy-text,
.twpaf__pane--register .woocommerce-privacy-policy-text p {
	color: rgba(255,255,255,0.85) !important;
	font-size: 13px !important;
	line-height: 1.5 !important;
	margin: 8px 0 0 !important;
	text-align: center;
}
.twpaf__pane--register .woocommerce-privacy-policy-text a {
	color: #fff !important;
	font-weight: 700 !important;
	text-decoration: underline;
}

/* ─── Modal variant ─────────────────────────────────── */
.twpaf--modal { margin: 0 auto; max-width: 100%; }
.twpaf--modal .twpaf__card { min-height: auto; }
.twpaf-popup-wrap {
	max-width: 1080px !important;
	padding: 0 !important;
	background: transparent !important;
	box-shadow: none !important;
}

/* ─── Logged-in notice ─────────────────────────────── */
.twpaf--logged-in {
	padding: 28px;
	text-align: center;
	background: var(--twpaf-bg-soft);
	border-radius: var(--twpaf-radius);
	color: var(--twpaf-muted);
}
.twpaf--logged-in a { color: var(--twpaf-primary); font-weight: 600; margin-left: 6px; }

/* ─── Responsive ────────────────────────────────────── */
@media (max-width: 880px) {
	.twpaf { margin: 16px; }
	.twpaf__card { grid-template-columns: 1fr; min-height: auto; }
	.twpaf__pane--login { padding: 32px 24px; order: 1; }
	.twpaf__pane--register { padding: 36px 24px; order: 2; }
	.twpaf__head h2 { font-size: 24px; }
	.twpaf__head--invert h2 { font-size: 22px; }
	.twpaf__notices { padding: 12px 18px 0; }
}

@media (max-width: 480px) {
	.twpaf { margin: 8px; }
	.twpaf__pane--login, .twpaf__pane--register { padding: 24px 18px; }
	.twpaf__meta { flex-direction: column; align-items: flex-start; gap: 8px; }
	.twpaf__perks-grid { gap: 8px; }
	.twpaf__perk-icon { width: 48px; height: 48px; }
	.twpaf__perk-label { font-size: 12px; }
}

/* ─── Loading state (only when user clicks) ─────────── */
.twpaf__form.is-loading { opacity: 0.7; pointer-events: none; }
.twpaf__form.is-loading .twpaf__btn--primary,
.twpaf__form.is-loading .twpaf__btn--solid {
	position: relative;
	color: transparent !important;
}
.twpaf__form.is-loading .twpaf__btn--primary::after,
.twpaf__form.is-loading .twpaf__btn--solid::after {
	content: "";
	position: absolute;
	width: 18px;
	height: 18px;
	border: 2px solid #fff;
	border-top-color: transparent;
	border-radius: 50%;
	animation: twpaf-spin 0.7s linear infinite;
}
@keyframes twpaf-spin { to { transform: rotate(360deg); } }

/* ─── v1.0.8: Suppress WooCommerce native show-password-input ──── */
/* WC frontend JS (woocommerce.js line 126) tự inject <span class="password-input">
   + <button class="show-password-input"> vào MỌI input password trong WC form,
   bao gồm form của plugin này. Ta dùng CSS để:
   1. Ẩn button WC inject
   2. Flatten span wrapper để layout không bị shift
   Plugin tự có .twpaf__toggle-pwd làm chức năng tương đương. */

.twpaf__field .password-input {
    display: contents !important;
}

.twpaf__field .show-password-input,
.twpaf__field button.show-password-input {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* ═════════════════════════════════════════════════════════
   v1.0.9: Compact + Close button + Icon alignment + Terms
   ═════════════════════════════════════════════════════════ */

/* Thu gọn từ 1080 → 960 */
.twpaf, .twpaf--v103 {
    max-width: 960px !important;
}
.twpaf .twpaf__card {
    min-height: auto !important;
}

/* Padding panes gọn lại */
.twpaf .twpaf__pane--login,
.twpaf .twpaf__pane--register {
    padding: 32px 28px !important;
    position: relative;
}

/* Typo nhỏ hơn */
.twpaf .twpaf__head h2 { font-size: 24px !important; }
.twpaf .twpaf__head--invert h2 { font-size: 22px !important; }
.twpaf .twpaf__head p { font-size: 13px !important; }

/* Form spacing */
.twpaf .twpaf__form { gap: 10px !important; }

/* Perks compact */
.twpaf .twpaf__perks-grid { gap: 8px !important; margin: 4px 0 !important; }
.twpaf .twpaf__perk-icon { width: 48px !important; height: 48px !important; }
.twpaf .twpaf__perk-label { font-size: 12px !important; }

/* Button gọn */
.twpaf .twpaf__btn { padding: 12px 18px !important; font-size: 14px !important; }

/* Brand compact */
.twpaf .twpaf__brand-mark { width: 36px !important; height: 36px !important; }
.twpaf .twpaf__pill { padding: 5px 12px !important; font-size: 10px !important; }

/* Social button compact */
.twpaf .twpaf__social-host > * { min-height: 46px !important; padding: 10px 14px !important; }

/* ─── Fix icon input lệch ─── */
.twpaf .twpaf__field {
    position: relative;
    display: block;
}

.twpaf .twpaf__field-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    line-height: 0;
}

/* Input padding đối xứng + height cố định để center align thật sự */
.twpaf .twpaf__form input[type="text"],
.twpaf .twpaf__form input[type="email"],
.twpaf .twpaf__form input[type="password"],
section.twpaf .twpaf__form input.input-text {
    padding: 0 14px 0 42px !important;
    height: 44px !important;
    line-height: 44px !important;
    box-sizing: border-box !important;
}

.twpaf .twpaf__form--register input[type="text"],
.twpaf .twpaf__form--register input[type="email"],
.twpaf .twpaf__form--register input[type="password"],
section.twpaf .twpaf__form--register input.input-text {
    padding: 0 14px !important;
}

/* Eye toggle căn giữa */
.twpaf .twpaf__toggle-pwd {
    top: 50% !important;
    transform: translateY(-50%) !important;
    right: 6px !important;
    padding: 6px !important;
    width: 32px !important;
    height: 32px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* ─── Close button X (chỉ render khi variant=modal) ─── */
.twpaf .twpaf__close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background 0.15s, transform 0.15s;
    padding: 0;
    margin: 0;
}
.twpaf .twpaf__close:hover {
    background: rgba(255, 255, 255, 0.28);
    transform: scale(1.06);
}
.twpaf .twpaf__close:active {
    transform: scale(0.96);
}

/* ─── Terms text footer (thay WC privacy mặc định) ─── */
.twpaf__terms {
    color: rgba(255, 255, 255, 0.85) !important;
    font-size: 12px !important;
    line-height: 1.55 !important;
    margin: 12px 0 0 !important;
    text-align: center !important;
    padding: 0 !important;
}
.twpaf__terms a {
    color: #fff !important;
    font-weight: 600 !important;
    text-decoration: underline !important;
}
.twpaf__terms a:hover {
    text-decoration: none !important;
}

/* Hide WC privacy text nếu vẫn render (an toàn dự phòng) */
.twpaf .woocommerce-privacy-policy-text {
    display: none !important;
}

/* ─── Turnstile compact ─── */
.twpaf .cf-turnstile {
    margin: 4px 0 !important;
}
.twpaf .cf-turnstile iframe {
    max-width: 100% !important;
}

/* ─── Responsive: mobile gọn hơn ─── */
@media (max-width: 880px) {
    .twpaf .twpaf__pane--login,
    .twpaf .twpaf__pane--register {
        padding: 24px 20px !important;
    }
    .twpaf .twpaf__head h2 { font-size: 22px !important; }
    .twpaf .twpaf__head--invert h2 { font-size: 20px !important; }
    .twpaf .twpaf__close {
        top: 12px; right: 12px;
        width: 32px; height: 32px;
    }
}

@media (max-width: 480px) {
    .twpaf .twpaf__pane--login,
    .twpaf .twpaf__pane--register {
        padding: 20px 16px !important;
    }
    .twpaf .twpaf__head h2 { font-size: 20px !important; }
    .twpaf .twpaf__perk-icon { width: 40px !important; height: 40px !important; }
    .twpaf .twpaf__perk-label { font-size: 11px !important; }
    .twpaf .twpaf__brand-mark { width: 32px !important; height: 32px !important; }
    .twpaf__terms { font-size: 11px !important; }
}

/* ═════════════════════════════════════════════════════════
   v1.0.9: Compact + Close button + Icon alignment + Terms
   ═════════════════════════════════════════════════════════ */

.twpaf, .twpaf--v103 {
    max-width: 960px !important;
}
.twpaf .twpaf__card {
    min-height: auto !important;
}
.twpaf .twpaf__pane--login,
.twpaf .twpaf__pane--register {
    padding: 32px 28px !important;
    position: relative;
}
.twpaf .twpaf__head h2 { font-size: 24px !important; }
.twpaf .twpaf__head--invert h2 { font-size: 22px !important; }
.twpaf .twpaf__head p { font-size: 13px !important; }
.twpaf .twpaf__form { gap: 10px !important; }
.twpaf .twpaf__perks-grid { gap: 8px !important; margin: 4px 0 !important; }
.twpaf .twpaf__perk-icon { width: 48px !important; height: 48px !important; }
.twpaf .twpaf__perk-label { font-size: 12px !important; }
.twpaf .twpaf__btn { padding: 12px 18px !important; font-size: 14px !important; }
.twpaf .twpaf__brand-mark { width: 36px !important; height: 36px !important; }
.twpaf .twpaf__pill { padding: 5px 12px !important; font-size: 10px !important; }
.twpaf .twpaf__social-host > * { min-height: 46px !important; padding: 10px 14px !important; }

/* Fix icon input lệch */
.twpaf .twpaf__field {
    position: relative;
    display: block;
}
.twpaf .twpaf__field-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    line-height: 0;
}
.twpaf .twpaf__form input[type="text"],
.twpaf .twpaf__form input[type="email"],
.twpaf .twpaf__form input[type="password"],
section.twpaf .twpaf__form input.input-text {
    padding: 0 14px 0 42px !important;
    height: 44px !important;
    line-height: 44px !important;
    box-sizing: border-box !important;
}
.twpaf .twpaf__form--register input[type="text"],
.twpaf .twpaf__form--register input[type="email"],
.twpaf .twpaf__form--register input[type="password"],
section.twpaf .twpaf__form--register input.input-text {
    padding: 0 14px !important;
}
.twpaf .twpaf__toggle-pwd {
    top: 50% !important;
    transform: translateY(-50%) !important;
    right: 6px !important;
    padding: 6px !important;
    width: 32px !important;
    height: 32px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Close button X */
.twpaf .twpaf__close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background 0.15s, transform 0.15s;
    padding: 0;
    margin: 0;
}
.twpaf .twpaf__close:hover {
    background: rgba(255, 255, 255, 0.28);
    transform: scale(1.06);
}
.twpaf .twpaf__close:active {
    transform: scale(0.96);
}

/* Terms text footer */
.twpaf__terms {
    color: rgba(255, 255, 255, 0.85) !important;
    font-size: 12px !important;
    line-height: 1.55 !important;
    margin: 12px 0 0 !important;
    text-align: center !important;
    padding: 0 !important;
}
.twpaf__terms a {
    color: #fff !important;
    font-weight: 600 !important;
    text-decoration: underline !important;
}
.twpaf__terms a:hover {
    text-decoration: none !important;
}
.twpaf .woocommerce-privacy-policy-text {
    display: none !important;
}

/* Turnstile compact */
.twpaf .cf-turnstile {
    margin: 4px 0 !important;
}
.twpaf .cf-turnstile iframe {
    max-width: 100% !important;
}

/* Mobile responsive */
@media (max-width: 880px) {
    .twpaf .twpaf__pane--login,
    .twpaf .twpaf__pane--register { padding: 24px 20px !important; }
    .twpaf .twpaf__head h2 { font-size: 22px !important; }
    .twpaf .twpaf__head--invert h2 { font-size: 20px !important; }
    .twpaf .twpaf__close { top: 12px; right: 12px; width: 32px; height: 32px; }
}
@media (max-width: 480px) {
    .twpaf .twpaf__pane--login,
    .twpaf .twpaf__pane--register { padding: 20px 16px !important; }
    .twpaf .twpaf__head h2 { font-size: 20px !important; }
    .twpaf .twpaf__perk-icon { width: 40px !important; height: 40px !important; }
    .twpaf .twpaf__perk-label { font-size: 11px !important; }
    .twpaf .twpaf__brand-mark { width: 32px !important; height: 32px !important; }
    .twpaf__terms { font-size: 11px !important; }
}

/* ═════════════════════════════════════════════════════════
   v1.0.10: Smaller scale + bulletproof icon alignment
   ═════════════════════════════════════════════════════════ */

/* Card max-width: thu thêm 960 → 880 */
.twpaf,
.twpaf--v103 {
    max-width: 880px !important;
}

/* Pane padding: gọn thêm */
.twpaf .twpaf__pane--login,
.twpaf .twpaf__pane--register {
    padding: 24px 24px !important;
}

/* Heading nhỏ hơn */
.twpaf .twpaf__head h2 { font-size: 22px !important; margin-bottom: 4px !important; }
.twpaf .twpaf__head--invert h2 { font-size: 20px !important; }
.twpaf .twpaf__head p { font-size: 13px !important; }

/* Form spacing */
.twpaf .twpaf__form { gap: 8px !important; }

/* Brand mark + label */
.twpaf .twpaf__brand-mark { width: 32px !important; height: 32px !important; }
.twpaf .twpaf__brand-label { font-size: 11px !important; }

/* Perks compact hơn */
.twpaf .twpaf__perks-grid { gap: 6px !important; margin: 2px 0 6px !important; }
.twpaf .twpaf__perk-icon { width: 44px !important; height: 44px !important; }
.twpaf .twpaf__perk-label { font-size: 11px !important; }

/* Pill */
.twpaf .twpaf__pill { padding: 4px 10px !important; font-size: 10px !important; }

/* Divider */
.twpaf .twpaf__divider { margin: 2px 0 !important; font-size: 12px !important; }

/* ─── BULLETPROOF ICON ALIGNMENT ─── */
/* Đổi từ absolute top:50% sang flexbox align (deterministic) */
.twpaf .twpaf__field {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
}

/* Icon vào trong flex, anchor bằng absolute để không chiếm width của input */
.twpaf .twpaf__field > .twpaf__field-icon {
    position: absolute !important;
    left: 14px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    margin: 0 !important;
    width: 18px !important;
    height: 18px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #94a3b8 !important;
    pointer-events: none !important;
    z-index: 2 !important;
    line-height: 0 !important;
}

/* Input: height cố định + line-height = height để text center thẳng với icon */
.twpaf .twpaf__form input[type="text"],
.twpaf .twpaf__form input[type="email"],
.twpaf .twpaf__form input[type="password"],
section.twpaf .twpaf__form input.input-text {
    height: 40px !important;
    line-height: 40px !important;
    padding: 0 14px 0 42px !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    vertical-align: middle !important;
    flex: 1 !important;
    width: 100% !important;
}

/* Register pane: không icon, padding thường */
.twpaf .twpaf__form--register input[type="text"],
.twpaf .twpaf__form--register input[type="email"],
.twpaf .twpaf__form--register input[type="password"],
section.twpaf .twpaf__form--register input.input-text {
    padding: 0 14px !important;
}

/* Eye toggle: position absolute, center */
.twpaf .twpaf__field > .twpaf__toggle-pwd {
    position: absolute !important;
    right: 6px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    padding: 6px !important;
    width: 30px !important;
    height: 30px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 3 !important;
}

/* Meta row gọn */
.twpaf .twpaf__meta { font-size: 12px !important; margin: 0 !important; }

/* Button nhỏ hơn */
.twpaf .twpaf__btn {
    padding: 10px 18px !important;
    font-size: 14px !important;
    min-height: 40px !important;
}

/* Social button compact */
.twpaf .twpaf__social-host > * {
    min-height: 42px !important;
    padding: 8px 14px !important;
}

/* Close button compact */
.twpaf .twpaf__close { width: 32px !important; height: 32px !important; top: 14px !important; right: 14px !important; }

/* Terms text */
.twpaf__terms { margin-top: 8px !important; font-size: 11px !important; }

/* ─── v1.0.10b: Fix icon padding for register form ─── */
/* Logic: field nào CÓ .twpaf__field-icon thì input cần padding-left 42px.
   Bất kể login hay register pane. Selector chính xác hơn. */

.twpaf .twpaf__field:has(> .twpaf__field-icon) input[type="text"],
.twpaf .twpaf__field:has(> .twpaf__field-icon) input[type="email"],
.twpaf .twpaf__field:has(> .twpaf__field-icon) input[type="password"] {
    padding: 0 14px 0 42px !important;
}

/* Field không có icon thì padding thường (override rule v1.0.10 register pane bị quá rộng) */
.twpaf .twpaf__field:not(:has(> .twpaf__field-icon)) input[type="text"],
.twpaf .twpaf__field:not(:has(> .twpaf__field-icon)) input[type="email"],
.twpaf .twpaf__field:not(:has(> .twpaf__field-icon)) input[type="password"] {
    padding: 0 14px !important;
}

/* Field có toggle password thì padding-right tăng để chừa chỗ */
.twpaf .twpaf__field:has(> .twpaf__toggle-pwd) input[type="password"] {
    padding-right: 40px !important;
}

/* ═════════════════════════════════════════════════════════
   v1.0.12: Unified Google button + larger input/button
   ═════════════════════════════════════════════════════════ */

/* ─── Force Google button đồng nhất 2 pane ─── */
.twpaf .ywsl-social,
.twpaf .ywsl-social.ywsl-google {
    width: 100% !important;
    min-height: 48px !important;
    padding: 12px 18px !important;
    border-radius: 10px !important;
    border: 1px solid #e2e8f0 !important;
    background: #fff !important;
    color: #1e293b !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    box-shadow: none !important;
    margin: 0 !important;
    cursor: pointer !important;
    transition: background 0.15s, border-color 0.15s !important;
    box-sizing: border-box !important;
    text-decoration: none !important;
}

.twpaf .ywsl-social:hover,
.twpaf .ywsl-social.ywsl-google:hover {
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
}

/* Image Google: kích thước cố định, không circle background */
.twpaf .ywsl-social img,
.twpaf .ywsl-social.ywsl-google img {
    width: 20px !important;
    height: 20px !important;
    background: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    display: inline-block !important;
    vertical-align: middle !important;
}

/* Thêm text "Đăng nhập bằng Google" / "Đăng ký bằng Google" sau img */
.twpaf .twpaf__social-host:not(.twpaf__social--register) .ywsl-social.ywsl-google::after {
    content: "Đăng nhập bằng Google";
}
.twpaf .twpaf__social-host.twpaf__social--register .ywsl-social.ywsl-google::after {
    content: "Đăng ký bằng Google";
}

/* Override invert: register pane vẫn nền trắng, không tô màu xanh */
.twpaf .twpaf__social-host.twpaf__social--invert .ywsl-social,
.twpaf .twpaf__social-host.twpaf__social--register .ywsl-social {
    background: #fff !important;
    color: #1e293b !important;
    border-color: #e2e8f0 !important;
}

/* ─── Tăng input height 40 → 44 + font 14 ─── */
.twpaf .twpaf__form input[type="text"],
.twpaf .twpaf__form input[type="email"],
.twpaf .twpaf__form input[type="password"],
section.twpaf .twpaf__form input.input-text {
    height: 44px !important;
    line-height: 44px !important;
    font-size: 14px !important;
}

/* ─── Submit button đồng đều 48px ─── */
.twpaf .twpaf__btn {
    min-height: 48px !important;
    padding: 13px 22px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
}

/* ─── Meta row (Ghi nhớ + Quên mật khẩu) tăng font 12 → 13 ─── */
.twpaf .twpaf__meta {
    font-size: 13px !important;
}
.twpaf .twpaf__meta label,
.twpaf .twpaf__meta a,
.twpaf .twpaf__meta input[type="checkbox"] + span {
    font-size: 13px !important;
}
.twpaf .twpaf__meta a {
    color: #16a34a !important;
}

/* ─── v1.0.12b: Fix duplicate text + uniform hover ─── */

/* 1. Disable ::after text — YITH đã có text sẵn, đừng inject thêm */
.twpaf .twpaf__social-host:not(.twpaf__social--register) .ywsl-social.ywsl-google::after,
.twpaf .twpaf__social-host.twpaf__social--register .ywsl-social.ywsl-google::after,
.twpaf .ywsl-social.ywsl-google::after,
.twpaf .ywsl-social::after {
    content: none !important;
    display: none !important;
}

/* 2. Force hover đồng nhất cả 2 button (specificity cao hơn theme override) */
.twpaf .twpaf__social-host .ywsl-social,
.twpaf .twpaf__social-host .ywsl-social.ywsl-google,
section.twpaf .twpaf__social-host .ywsl-social.ywsl-google {
    transition: all 0.2s ease !important;
    cursor: pointer !important;
}

.twpaf .twpaf__social-host .ywsl-social:hover,
.twpaf .twpaf__social-host .ywsl-social.ywsl-google:hover,
section.twpaf .twpaf__social-host .ywsl-social.ywsl-google:hover {
    background: #f1f5f9 !important;
    border-color: #94a3b8 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
}

.twpaf .twpaf__social-host .ywsl-social:active,
.twpaf .twpaf__social-host .ywsl-social.ywsl-google:active {
    transform: translateY(0) !important;
    box-shadow: none !important;
}

/* ═════════════════════════════════════════════════════
   v1.0.18: Font size tuning + spacing input↔meta
   ═════════════════════════════════════════════════════ */

/* Font input: 14px → 15px (đọc rõ hơn, chuẩn UX) */
.twpaf .twpaf__form input[type="text"],
.twpaf .twpaf__form input[type="email"],
.twpaf .twpaf__form input[type="password"],
section.twpaf .twpaf__form input.input-text {
    font-size: 15px !important;
}

/* Font meta (Ghi nhớ + Quên mật khẩu): 12px → 14px */
.twpaf .twpaf__meta,
.twpaf .twpaf__meta label,
.twpaf .twpaf__meta a,
.twpaf .twpaf__meta input[type="checkbox"] + span,
.twpaf .twpaf__check,
.twpaf .twpaf__forgot {
    font-size: 14px !important;
}

/* Font divider "hoặc": 12px → 14px */
.twpaf .twpaf__divider {
    font-size: 14px !important;
}
.twpaf .twpaf__divider span {
    font-size: 14px !important;
}

/* Khoảng cách input ↔ meta: tăng form gap để thoáng hơn */
.twpaf .twpaf__form {
    gap: 14px !important;
}

/* Meta thêm margin-top nhỏ để tách rõ với password field */
.twpaf .twpaf__meta {
    margin-top: 4px !important;
}
