/* หน้าเข้าสู่ระบบบัญชีร่วม (/login = /app/auth/login.php) — ธีมเดียวกับทั้งเว็บ (คราม-ทอง · Sarabun)
 * หลวงพี่สั่ง ๑๐ ต.ค. ๒๕๖๙ "ออกแบบให้เข้ากับ Theme ใหม่ ใส่โลโก้" · CSP ของหน้านี้ห้ามโหลดของนอกเว็บ: ฟอนต์/ภาพ/สคริปต์อยู่ในเว็บเองทั้งหมด
 * แผงซ้าย = ภาพต้อนรับ (assets/game/login · bin/gen-login-art.php) · แผงขวา = ฟอร์ม · มือถือภาพเป็นแถบบน
 * โหมดสว่าง/มืด: <html data-ui> จาก js/theme-boot.js (คีย์ pt_cinema_theme ชุดเดียวกับทั้งเว็บ) */

:root {
	--lg-bg: #f5f7fc;
	--lg-card: #ffffff;
	--lg-ink: #141a33;
	--lg-ink2: #333c5c;
	--lg-muted: #5d6683;
	--lg-line: rgba(20, 26, 51, .14);
	--lg-field: #f7f8fc;
	--lg-field-line: rgba(20, 26, 51, .2);
	--lg-primary: #1e1b4b;
	--lg-primary-hover: #312e81;
	--lg-primary-ink: #ffffff;
	--lg-link: #4338ca;
	--lg-gold: #f5bf45;
	--lg-gold-ink: #92400e;
	--lg-err-bg: #fff1f2;
	--lg-err-line: #fecdd3;
	--lg-err-ink: #9f1239;
	--lg-shadow: 0 24px 60px -30px rgba(20, 26, 51, .35);
	color-scheme: light;
}
html[data-ui="dark"] {
	--lg-bg: #0a0f1e;
	--lg-card: #131c38;
	--lg-ink: #f3f6ff;
	--lg-ink2: #dbe2f5;
	--lg-muted: #aab4d0;
	--lg-line: rgba(255, 255, 255, .12);
	--lg-field: #0f1730;
	--lg-field-line: rgba(255, 255, 255, .18);
	--lg-primary: #ffffff;
	--lg-primary-hover: #f5bf45;
	--lg-primary-ink: #0a0f1e;
	--lg-link: #a5b4fc;
	--lg-gold-ink: #fde68a;
	--lg-err-bg: rgba(244, 63, 94, .12);
	--lg-err-line: rgba(244, 63, 94, .4);
	--lg-err-ink: #fecdd3;
	--lg-shadow: 0 24px 60px -30px rgba(0, 0, 0, .9);
	color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0; min-height: 100vh; min-height: 100dvh;
	font-family: "Sarabun", system-ui, sans-serif; font-size: 16px; line-height: 1.65;
	color: var(--lg-ink); background: var(--lg-bg);
}
a { color: var(--lg-link); font-weight: 700; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
::selection { background: rgba(245, 191, 69, .35); }
:focus-visible { outline: 3px solid var(--lg-gold); outline-offset: 3px; }

/* ── โครง ๒ แผง ── */
.lg-shell { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }

/* แผงซ้าย: ภาพต้อนรับ — มืดเสมอทั้ง ๒ โหมด (ตัวหนังสือขาวบนภาพ) */
.lg-art { position: relative; isolation: isolate; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; padding: 36px 44px 44px; background: #0f1730; color: #fff; }
.lg-art-img { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }
.lg-art::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(10, 15, 30, .55) 0%, rgba(10, 15, 30, 0) 22%, rgba(10, 15, 30, 0) 42%, rgba(10, 15, 30, .82) 72%, rgba(10, 15, 30, .96) 100%); }
.lg-brand { display: inline-flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; align-self: flex-start; }
.lg-brand img { width: 44px; height: 44px; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .45)); }
.lg-brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.lg-brand-name { font-size: 20px; font-weight: 800; }
.lg-brand-sub { font-size: 11px; font-weight: 700; letter-spacing: .18em; color: #c7d2fe; }
.lg-art-copy { max-width: 460px; }
.lg-art-eyebrow { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 10px; padding: 4px 12px; border-radius: 999px; background: rgba(245, 191, 69, .18); border: 1px solid rgba(245, 191, 69, .4); color: #fde68a; font-size: 13px; font-weight: 800; }
.lg-art-title { margin: 0; font-size: clamp(30px, 3.4vw, 44px); font-weight: 800; line-height: 1.3; text-shadow: 0 2px 20px rgba(0, 0, 0, .45); }
.lg-art-title span { color: var(--lg-gold); }
.lg-art-lead { margin: 10px 0 0; color: #dbe2f5; font-size: 16px; line-height: 1.7; }
.lg-perks { display: grid; gap: 8px; margin: 22px 0 0; padding: 0; list-style: none; }
.lg-perks li { display: flex; align-items: center; gap: 12px; color: #eef2ff; font-weight: 600; font-size: 15px; }
.lg-perks svg { flex: none; width: 34px; height: 34px; padding: 8px; border-radius: 10px; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .18); color: var(--lg-gold); }

/* แผงขวา: ฟอร์ม */
.lg-panel { position: relative; display: flex; flex-direction: column; justify-content: center; padding: 32px clamp(20px, 5vw, 64px); }
.lg-tools { position: absolute; z-index: 5; top: 20px; right: 20px; display: flex; gap: 8px; }
.lg-icon-btn { display: inline-grid; place-items: center; width: 42px; height: 42px; padding: 0; border-radius: 999px; border: 1px solid var(--lg-line); background: var(--lg-card); color: var(--lg-ink2); cursor: pointer; text-decoration: none; }
.lg-icon-btn:hover { border-color: var(--lg-link); color: var(--lg-link); }
.lg-icon-btn svg { width: 18px; height: 18px; }
.lg-ico-sun { display: none; color: #f5bf45; }
html[data-ui="dark"] .lg-ico-sun { display: block; }
html[data-ui="dark"] .lg-ico-moon { display: none; }

.lg-card { width: 100%; max-width: 440px; margin: 0 auto; }
.lg-card h1 { margin: 0; font-size: clamp(28px, 3vw, 34px); font-weight: 800; line-height: 1.3; letter-spacing: -.01em; }
.lg-card h2 { margin: 0 0 4px; font-size: 22px; font-weight: 800; }
.lg-lead { margin: 6px 0 26px; color: var(--lg-muted); }
.lg-error { display: flex; gap: 10px; margin: 0 0 20px; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--lg-err-line); background: var(--lg-err-bg); color: var(--lg-err-ink); font-size: 15px; line-height: 1.6; }
.lg-error svg { flex: none; width: 20px; height: 20px; margin-top: 2px; }

.lg-card form { margin: 0; }
.lg-field { margin-top: 16px; }
.lg-field label { display: block; margin: 0 0 6px; font-weight: 700; font-size: 15px; color: var(--lg-ink2); }
.lg-input-wrap { position: relative; }
.lg-input-wrap > svg { position: absolute; left: 14px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: var(--lg-muted); pointer-events: none; }
.lg-card input[type="email"], .lg-card input[type="password"], .lg-card input[type="text"] {
	display: block; width: 100%; min-height: 52px; padding: 12px 14px 12px 44px;
	font: inherit; color: var(--lg-ink); background: var(--lg-field);
	border: 1.5px solid var(--lg-field-line); border-radius: 12px;
	transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.lg-card input:focus { outline: none; border-color: var(--lg-link); box-shadow: 0 0 0 4px rgba(99, 102, 241, .18); background: var(--lg-card); }
.lg-card input.lg-has-reveal { padding-right: 52px; }
.lg-reveal { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 10px; background: transparent; color: var(--lg-muted); cursor: pointer; }
.lg-reveal:hover { color: var(--lg-link); }
.lg-reveal svg { width: 18px; height: 18px; }
.lg-reveal .lg-eye-off, .lg-reveal[aria-pressed="true"] .lg-eye { display: none; }
.lg-reveal[aria-pressed="true"] .lg-eye-off { display: block; }
.lg-row { display: flex; justify-content: flex-end; margin-top: 8px; font-size: 15px; }

.lg-btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 52px; margin-top: 22px; padding: 12px 18px; font: inherit; font-weight: 800; font-size: 16px; border-radius: 12px; cursor: pointer; text-decoration: none; transition: transform .15s ease, background-color .15s ease, border-color .15s ease, box-shadow .15s ease; }
.lg-btn:active { transform: scale(.98); }
.lg-btn-primary { border: 0; background: var(--lg-primary); color: var(--lg-primary-ink); box-shadow: 0 14px 28px -16px rgba(30, 27, 75, .7); }
.lg-btn-primary:hover { background: var(--lg-primary-hover); }
html[data-ui="dark"] .lg-btn-primary:hover { color: #3b2600; }
.lg-btn-google { margin-top: 0; border: 1.5px solid var(--lg-field-line); background: var(--lg-card); color: var(--lg-ink); }
.lg-btn-google:hover { border-color: var(--lg-link); box-shadow: 0 10px 22px -16px rgba(20, 26, 51, .5); }
.lg-btn-google svg { width: 20px; height: 20px; }
.lg-btn-ghost { border: 1.5px solid var(--lg-field-line); background: transparent; color: var(--lg-ink2); margin-top: 12px; }
.lg-btn-ghost:hover { border-color: var(--lg-link); color: var(--lg-link); }

.lg-divider { display: flex; align-items: center; gap: 14px; margin: 22px 0 4px; color: var(--lg-muted); font-size: 14px; font-weight: 600; }
.lg-divider::before, .lg-divider::after { content: ""; flex: 1; height: 1px; background: var(--lg-line); }
.lg-signup { margin: 22px 0 0; text-align: center; color: var(--lg-muted); }
.lg-note { margin: 12px 0 0; color: var(--lg-muted); font-size: 14px; line-height: 1.6; }
.lg-foot { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; margin: 30px 0 0; padding-top: 18px; border-top: 1px solid var(--lg-line); color: var(--lg-muted); font-size: 13px; text-align: center; }
.lg-foot svg { width: 16px; height: 16px; color: var(--lg-gold-ink); }

/* แท็บเล็ต/มือถือ: ภาพเป็นแถบบน */
@media (max-width: 900px) {
	.lg-shell { grid-template-columns: minmax(0, 1fr); }
	.lg-art { min-height: 300px; padding: 20px 20px 24px; justify-content: space-between; }
	.lg-art-img { object-position: 50% 26%; }
	.lg-art::after { background: linear-gradient(180deg, rgba(10, 15, 30, .5) 0%, rgba(10, 15, 30, 0) 30%, rgba(10, 15, 30, .2) 55%, rgba(10, 15, 30, .9) 100%); }
	.lg-art-title { font-size: 26px; }
	.lg-art-lead, .lg-perks { display: none; }
	.lg-panel { justify-content: flex-start; padding: 28px 20px 40px; }
	.lg-tools { top: 16px; right: 16px; }
	.lg-tools .lg-icon-btn { background: rgba(10, 15, 30, .45); border-color: rgba(255, 255, 255, .25); color: #fff; backdrop-filter: blur(6px); }
}
@media (prefers-reduced-motion: reduce) { .lg-btn, .lg-card input { transition: none; } }
