/* JFun Gaming UI - Login + Register (users/login.php, users/register.php, body.jg-auth).
   Loaded after the page CSS and jfun-game.css. Every rule is scoped under html body.jg-auth.
   Light Pastel Pink Glass (follows includes/theme_lock.php). Nothing is fixed over the form, so the page just scrolls when the keyboard is open. */
/* ---------- page shell ---------- */
html body.jg-auth {
  background: var(--jf-page-bg);
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start;
  padding-bottom: calc(var(--ui-frame-top) + env(safe-area-inset-bottom, 0px));
  overflow-x: hidden;
}
/* the shared top bar (styled only by the kit) is the first child and stretches to full width; the card is centred in the free space below it */
/* ---------- top bar (login navbar / register back link): scrolls with the page ---------- */
html body.jg-auth .back-link { position: absolute; top: calc(12px + env(safe-area-inset-top, 0px)); z-index: 100; }
html body.jg-auth .back-link {
  left: 16px; min-height: 44px; padding: 0 16px; border-radius: var(--ui-r-sm); font: 700 14px var(--jg-font-display);
  letter-spacing: 0.04em; text-transform: uppercase;
  background: var(--jf-solid); color: var(--ui-text); border: 1px solid var(--ui-input-border); box-shadow: none;
}
html body.jg-auth .back-link:hover { transform: none; background: var(--jf-solid); box-shadow: none; }
html body.jg-auth .back-link i { color: var(--ui-accent-text); }
/* ---------- logo + titles ---------- */
html body.jg-auth .logo-section { margin-bottom: 18px; }
html body.jg-auth .logo-text {
  font: 700 28px/1.1 var(--jg-font-display); letter-spacing: 0.04em;
  overflow-wrap: anywhere;
}
html body.jg-auth .logo-subtitle { font-size: var(--ui-fs-sm); color: var(--ui-muted); margin-top: 6px; overflow-wrap: anywhere; }
html body.jg-auth .section-title i { color: var(--ui-accent-text); font-size: var(--ui-fs-md); }
/* ---------- messages: left 4px accent, 13px ---------- */
html body.jg-auth .alert i { font-size: var(--ui-fs-md); }
/* register helpers */
html body.jg-auth .username-preview {
  padding: 10px 12px 10px 14px; border-radius: var(--ui-r-sm); font-size: var(--ui-fs-xs); font-style: normal; overflow-wrap: anywhere;
  color: var(--ui-ok-text); background: var(--ui-ok-bg); border-left: 4px solid var(--ui-ok);
}
html body.jg-auth .username-preview i { color: var(--ui-ok-text); }
html body.jg-auth .username-hint { overflow-wrap: anywhere; }
html body.jg-auth .username-hint i { color: var(--ui-accent-text); }
html body.jg-auth .strength-weak { background: var(--jg-bad); }
html body.jg-auth .strength-medium { background: var(--jg-warn); }
html body.jg-auth .strength-strong { background: var(--jg-ok); }
html body.jg-auth .refer-label { font: 600 12px var(--jg-font-display); letter-spacing: 0.06em; text-transform: uppercase; color: var(--ui-muted); margin-bottom: 10px; overflow-wrap: anywhere; }
html body.jg-auth .refer-label i { color: var(--ui-accent-text); font-size: var(--ui-fs-md); }
html body.jg-auth .hidden-refer {
  padding: 14px 14px 14px 18px; margin-bottom: 20px; border-radius: var(--ui-r-sm);
  background: var(--ui-ok-bg); border: 1px solid var(--ui-ok-line);
}
html body.jg-auth .hidden-refer::before { width: 4px; background: var(--jg-ok); }
html body.jg-auth .hidden-refer-text { font-size: var(--ui-fs-sm); color: var(--ui-ok-text); overflow-wrap: anywhere; }
html body.jg-auth .hidden-refer-text i { color: var(--ui-ok-text); }
/* ---------- remember / forgot ---------- */
html body.jg-auth .remember-group { margin-bottom: 18px; gap: 8px 12px; flex-wrap: wrap; }
html body.jg-auth .remember-label { min-height: 44px; font-size: var(--ui-fs-xs); color: var(--ui-muted); }
html body.jg-auth .remember-label input[type="checkbox"] { width: 22px; height: 22px; }
html body.jg-auth .forgot-link,
html body.jg-auth .forgot-link:hover {
  min-height: 44px; display: inline-flex; align-items: center; justify-content: center; padding: 0 8px;
  color: var(--ui-accent-text); font-size: var(--ui-fs-sm); text-decoration: none;
}
@media (max-width: 480px) {
html body.jg-auth .remember-group { flex-direction: row; align-items: center; }
}
/* ---------- divider + social ---------- */
html body.jg-auth .divider { margin: 20px 0; color: var(--ui-muted); }
html body.jg-auth .divider::before,
html body.jg-auth .divider::after { background: var(--border-color); }
html body.jg-auth .divider span { color: var(--ui-muted); font-family: var(--jg-font-display); letter-spacing: 0.08em; }
html body.jg-auth .social-login { gap: 12px; margin-bottom: 16px; }
html body.jg-auth .social-btn {
  width: 52px; height: 52px; min-width: 44px; min-height: 44px; border-radius: var(--ui-r-sm);
  background: var(--jf-solid); border: 1.5px solid var(--ui-input-border); color: var(--ui-text); box-shadow: none;
}
html body.jg-auth .social-btn:hover { transform: none; box-shadow: none; border-color: var(--ui-input-border); color: var(--ui-text); }
html body.jg-auth .social-btn:active { transform: scale(0.97); }
/* ---------- secondary links ---------- */
html body.jg-auth .auth-links { padding-top: 14px; font-size: var(--ui-fs-sm); color: var(--ui-muted); border-top-color: var(--jf-glass-border); }
html body.jg-auth .auth-links a,
html body.jg-auth .auth-links a:hover {
  min-height: 44px; padding: 0 12px; justify-content: center; color: var(--ui-accent-text); background: transparent; border-radius: var(--ui-r-sm);
}
/* ---------- install prompt: stays clear of the button (page has 96px bottom room) ---------- */
html body.jg-auth .jf-install { bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
/* ---------- motion ---------- */
/* login layout moved out of the inline style (scoped; legacy vars mapped to tokens; kit/page-covered rules dropped) */
:where(html body.jg-auth) * { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html body.jg-auth { font-family: 'Poppins', 'Arial', sans-serif; overflow-x: hidden; }
html body.jg-auth .alert div { flex: 1; }
html body.jg-auth .auth-links a i { font-size: var(--ui-fs-xs); }
html body.jg-auth .logo-icon { width: 90px; height: 90px; background: var(--jf-grad); border-radius: var(--ui-r-lg); display: flex; align-items: center; justify-content: center; margin: 0 auto 20px; font-size: var(--ui-fs-xl); color: var(--ui-on-accent); box-shadow: var(--ui-accent-shadow); position: relative; overflow: hidden; animation: float 3s ease-in-out infinite; }
html body.jg-auth .logo-icon::before { content: ''; position: absolute; top: -50%; right: -20%; width: 100px; height: 100px; background: var(--ui-on-accent-10); border-radius: 50%; animation: pulse 8s ease-in-out infinite; }
html body.jg-auth .logo-icon::after { content: ''; position: absolute; bottom: -30%; left: -10%; width: 80px; height: 80px; background: var(--ui-on-accent-10); border-radius: 50%; animation: pulse 12s ease-in-out infinite reverse; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes pulse { 0%, 100% { transform: scale(1); opacity: 0.1; } 50% { transform: scale(1.2); opacity: 0.15; } }
@keyframes slideIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes spin { to { transform: rotate(360deg); } }
html body.jg-auth .remember-group { display: flex; align-items: center; justify-content: space-between; margin-bottom: 25px; }
html body.jg-auth .remember-label { display: flex; align-items: center; gap: var(--ui-gap-sm, 8px); font-size: var(--ui-fs-xs); color: var(--ui-muted); cursor: pointer; }
html body.jg-auth .remember-label input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--ui-accent); cursor: pointer; }
html body.jg-auth .forgot-link { font-size: var(--ui-fs-xs); color: var(--ui-accent-text); text-decoration: none; font-weight: 600; transition: all 0.3s; }
html body.jg-auth .forgot-link:hover { text-decoration: underline; }
html body.jg-auth .divider { display: flex; align-items: center; margin: 30px 0; color: var(--ui-muted); font-size: var(--ui-fs-xs); }
html body.jg-auth .divider::before, html body.jg-auth .divider::after { content: ''; flex: 1; height: 1px; background: var(--ui-disabled-bg); }
html body.jg-auth .divider span { padding: 0 15px; font-weight: 600; color: var(--ui-muted); }
html body.jg-auth .social-login { display: flex; gap: 10px; justify-content: center; margin-bottom: 25px; }
html body.jg-auth .social-btn { width: 55px; height: 55px; border-radius: var(--jg-radius, 12px); background: var(--jf-glass-strong); border: 1px solid var(--ui-border); color: var(--ui-muted); font-size: var(--ui-fs-lg); cursor: pointer; transition: all 0.3s; display: flex; align-items: center; justify-content: center; box-shadow: var(--ui-shadow); }
html body.jg-auth .social-btn:hover { transform: translateY(-3px); border-color: var(--ui-accent); color: var(--ui-accent-text); }
@keyframes ripple-animation { to { transform: scale(4); opacity: 0; } }
@media (max-width: 768px) {
html body.jg-auth .logo-icon { width: 80px; height: 80px; font-size: var(--ui-fs-xl); }
}
@media (max-width: 480px) {
html body.jg-auth .logo-icon { width: 70px; height: 70px; font-size: var(--ui-fs-xl); }
html body.jg-auth .social-btn { width: 50px; height: 50px; font-size: var(--ui-fs-lg); }
html body.jg-auth .remember-group { flex-direction: column; gap: 10px; align-items: flex-start; }
}
/* register rules moved out of the inline style (zero-specificity scope, legacy vars mapped to tokens, duplicates of the page css/login block dropped) */
html body.jg-auth { background: var(--jf-page-bg); min-height: 100vh; font-family: 'Poppins', 'Arial', sans-serif; color: var(--jf-fg); overflow-x: hidden; }
:where(html body.jg-auth) .back-link { position: fixed; top: 20px; left: 20px; display: inline-flex; align-items: center; gap: 8px; padding: 10px 20px; background: var(--jf-glass-strong); color: var(--ui-text); text-decoration: none; font-weight: 600; font-size: var(--ui-fs-sm); border-radius: var(--ui-r-sm); transition: all 0.3s ease; border: 1px solid var(--ui-border); box-shadow: var(--ui-shadow); z-index: 1000; }
:where(html body.jg-auth) .back-link:hover { background: var(--ui-disabled-bg); transform: translateY(-2px); box-shadow: var(--ui-shadow); }
:where(html body.jg-auth) .logo-section { text-align: center; margin-bottom: 30px; position: relative; }
:where(html body.jg-auth) .logo-icon { width: 90px; height: 90px; background: var(--jf-grad); border-radius: var(--ui-r-lg); display: flex; align-items: center; justify-content: center; margin: 0 auto 20px; font-size: var(--ui-fs-xl); color: var(--ui-on-accent); box-shadow: var(--ui-accent-shadow); position: relative; overflow: hidden; }
:where(html body.jg-auth) .logo-text { font-size: var(--ui-fs-xl); font-weight: 700; color: var(--ui-text); margin-bottom: 5px; }
:where(html body.jg-auth) .logo-subtitle { font-size: var(--ui-fs-sm); color: var(--ui-muted); }
:where(html body.jg-auth) .username-preview { font-size: var(--ui-fs-xs); color: var(--ui-ok-text); margin-top: 8px; font-style: italic; display: flex; align-items: center; gap: 6px; background: var(--ui-ok-bg); padding: 8px 12px; border-radius: var(--ui-r-sm); border-left: 3px solid var(--ui-ok); }
:where(html body.jg-auth) .username-preview i { color: var(--ui-ok); }
:where(html body.jg-auth) .username-hint { display: flex; align-items: center; gap: 5px; }
:where(html body.jg-auth) .username-hint i { color: var(--ui-info-text); }
:where(html body.jg-auth) .refer-label { color: var(--ui-warn-text); font-size: var(--ui-fs-xs); font-weight: 600; margin-bottom: 15px; display: flex; align-items: center; gap: 8px; }
:where(html body.jg-auth) .refer-label i { font-size: var(--ui-fs-md); }
:where(html body.jg-auth) .hidden-refer { background: var(--ui-ok-bg); border: 1px solid var(--ui-ok-line); border-radius: var(--ui-r-md); padding: 20px; margin-bottom: 25px; text-align: center; position: relative; overflow: hidden; }
:where(html body.jg-auth) .hidden-refer::before { content: ''; position: absolute; top: 0; left: 0; width: 4px; height: 100%; background: linear-gradient(180deg, var(--ui-ok) 0%, var(--ui-ok-deep) 100%); }
:where(html body.jg-auth) .hidden-refer-text { color: var(--ui-ok-text); font-size: var(--ui-fs-sm); font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 10px; }
:where(html body.jg-auth) .hidden-refer-text i { color: var(--ui-ok); }
:where(html body.jg-auth) .strength-bar { height: 100%; width: 0; transition: width 0.3s ease; border-radius: var(--ui-r-sm); }
:where(html body.jg-auth) .strength-weak { background: linear-gradient(90deg, var(--ui-bad) 0%, var(--ui-bad-strong) 100%); color: var(--ui-on-accent); width: 33%; }
:where(html body.jg-auth) .strength-medium { background: linear-gradient(90deg, var(--ui-warn) 0%, var(--ui-warn-deep) 100%); color: var(--ui-on-accent); width: 66%; }
:where(html body.jg-auth) .strength-strong { background: linear-gradient(90deg, var(--ui-ok) 0%, var(--ui-ok-deep) 100%); color: var(--ui-on-accent); width: 100%; }
:where(html body.jg-auth) .auth-links { text-align: center; margin-top: 30px; color: var(--ui-muted); font-size: var(--ui-fs-sm); padding-top: 20px; border-top: 1px solid var(--ui-border); }
:where(html body.jg-auth) .auth-links a { color: var(--ui-accent-text); text-decoration: none; font-weight: 600; transition: all 0.3s; display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: var(--ui-r-sm); }
:where(html body.jg-auth) .auth-links a:hover { color: var(--ui-accent-text); background: var(--ui-row-hover); }
:where(html body.jg-auth) .refer-code-badge { background: var(--ui-ok-deep); color: var(--ui-on-accent); padding: 3px 10px; border-radius: var(--ui-radius-pill, 15px); }

/* J3: status/hint texts that were inline style="" (tokens only) */
html body.jg-auth .username-preview .preview-name { background: var(--ui-ok-bg); color: var(--ui-ok-text); padding: 3px 8px; border-radius: var(--ui-r-sm); }

/* Soft 3D (Offline app look). Tokens --nb* come from the kit. */
html body.jg-auth .social-btn { border: 0; border-radius: 50%; background: var(--nb); color: var(--nb-ico); box-shadow: var(--nb-out-sm); }

/* ui30 Login layout option 1 (compact / dense) + card vertically centred (auto top/bottom margin). Layout only. */
html body.jg-auth .logo-section { display: flex !important; flex-direction: row !important; align-items: center; gap: 12px; text-align: left !important; margin-bottom: 10px !important; flex-wrap: wrap; }
html body.jg-auth .logo-section .jf-logo-lg { width: 48px !important; height: 48px !important; }
html body.jg-auth .logo-subtitle { flex-basis: 100%; margin-top: 0 !important; }
html body.jg-auth .section-title { display: none !important; }
html body.jg-auth .remember-group { margin-bottom: 8px !important; flex-direction: row !important; justify-content: flex-end !important; }
html body.jg-auth .divider { margin: 10px 0 !important; }
html body.jg-auth .social-login { margin-bottom: 8px !important; gap: 8px !important; }
html body.jg-auth .social-btn { width: 44px !important; height: 44px !important; }
html body.jg-auth .auth-links { padding-top: 8px !important; }
html body.jg-auth.jg-auth-login { box-sizing: border-box !important; min-height: calc(100vh - 16px) !important; min-height: calc(100dvh - 16px) !important; }
/* ui30 Login update: inputs centred with equal side gaps; card gets a soft 3D look (existing shadow/edge tokens only). */

/* main card centred in the screen: the page is a flex column, so auto margins centre the container in the free space (horizontal centring is already auto) */
html body.jg-auth.jg-ui.jg-ui:not(.jg-admin) > div:has(> div > .logo-section) { margin-top: auto; margin-bottom: auto; }
/* main card: soft pink drop shadow only, no white highlight shadow */
html body.jg-auth.jg-ui.jg-ui:not(.jg-admin) > div > div:has(> .logo-section) { box-shadow: var(--ui-shadow); }
/* Login / Register / Forgot Password / Ask Admin: compact card (closer to the Change Password Required height, 345px) + 2-column Register fields. No kit classes here: elements and page classes only */
html body.jg-auth.jg-ui.jg-ui:not(.jg-admin) > div > div:has(> .auth-links) { min-height: 345px; }
html body.jg-auth.jg-ui.jg-ui:not(.jg-admin) > div > div:has(> .auth-links) > .logo-section { margin-bottom: var(--ui-gap-sm); }
html body.jg-auth.jg-ui.jg-ui:not(.jg-admin) > div > div:has(> .auth-links) > .logo-section img { margin-bottom: 4px; }
html body.jg-auth.jg-ui.jg-ui:not(.jg-admin) > div > div:has(> .auth-links) > .logo-section .logo-subtitle { margin-top: 0; font-size: var(--ui-fs-xs); }
html body.jg-auth.jg-ui.jg-ui:not(.jg-admin) > div > div:has(> .auth-links) > form { gap: var(--ui-gap-sm); }
html body.jg-auth.jg-ui.jg-ui:not(.jg-admin) > div > div:has(> .auth-links) input:not([type="hidden"]):not([type="checkbox"]) { min-height: 44px; height: 44px; }
html body.jg-auth.jg-ui.jg-ui:not(.jg-admin) > div > div:has(> .auth-links) .remember-group { margin-bottom: 0; }
html body.jg-auth.jg-ui.jg-ui:not(.jg-admin) > div > div:has(> .auth-links) > .auth-links { margin-top: var(--ui-gap-sm); padding-top: 4px; }
html body.jg-auth.jg-ui.jg-ui:not(.jg-admin) > div > div:has(> .auth-links) textarea { min-height: 64px; height: 64px; }
html body.jg-auth.jg-ui.jg-ui:not(.jg-admin) #registerForm { display: grid; grid-template-columns: 1fr 1fr; }
html body.jg-auth.jg-ui.jg-ui:not(.jg-admin) #registerForm > * { grid-column: 1 / -1; min-width: 0; }
html body.jg-auth.jg-ui.jg-ui:not(.jg-admin) #registerForm > :is(div:has(input[name="full_name"]), div:has(input[name="username"]), div:has(input[name="password"]), div:has(input[name="confirm_password"])) { grid-column: auto; }
html body.jg-auth.jg-ui.jg-ui:not(.jg-admin) #registerForm > :is(div:has(input[name="full_name"]), div:has(input[name="username"]), div:has(input[name="password"]), div:has(input[name="confirm_password"])) input { font-size: var(--ui-fs-xs); }
html body.jg-auth.jg-ui.jg-ui:not(.jg-admin) #registerForm .username-hint { display: none; }
html body.jg-auth.jg-ui.jg-ui:not(.jg-admin) #registerForm > div:has(> .refer-label) { padding: var(--ui-gap-sm); margin-bottom: 0; }
html body.jg-auth.jg-ui.jg-ui:not(.jg-admin) #registerForm .refer-label { margin-bottom: 4px; }
html body.jg-auth.jg-ui.jg-ui:not(.jg-admin) #registerForm .reg-hint { font-size: var(--ui-fs-xs); }
html body.jg-auth .logo-section .jf-logo-full { display: block; width: 240px; max-width: 80%; height: auto; margin: 0 auto 20px; }
