body.login-body {
    /* สีของระบบไอที — ม่วงลาเวนเดอร์ (ชุดเดียวกับ app.css) */
    --g-hi: #9d8ff8; --g-mid: #6d5ce8; --g-deep: #3b2f86; --g-ink: #2a2168;
    --g-soft: #ebe8fd; --g-chip-1: #efecff; --g-chip-2: #dcd6fd; --g-ring: rgba(109, 92, 232, .2);
    --g-shadow: rgba(30, 20, 90, .6);
    --g-bg-glow: rgba(196, 187, 255, .55); --g-bg-dark: rgba(30, 20, 90, .6);
    --g-bg-1: #8d7ff4; --g-bg-2: #6d5ce8; --g-bg-3: #4a3cb8; --g-bg-4: #2a2168;
    position: relative;
    background:
        radial-gradient(circle at 8% 12%, var(--g-bg-glow) 0, transparent 46%),
        radial-gradient(circle at 92% 0%, var(--g-bg-dark) 0, transparent 50%),
        linear-gradient(125deg, var(--g-bg-1) 0%, var(--g-bg-2) 42%, var(--g-bg-3) 72%, var(--g-bg-4) 100%);
    background-attachment: fixed;
    flex-direction: column;
}
/* ลายจุดจาง ๆ ครึ่งล่างขวา */
body.login-body::before {
    content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
    background: radial-gradient(rgba(255, 255, 255, .22) 1.1px, transparent 1.6px) 0 0 / 16px 16px;
    -webkit-mask-image: linear-gradient(135deg, transparent 45%, #000 100%);
            mask-image: linear-gradient(135deg, transparent 45%, #000 100%);
}

.gate-shell {
    position: relative; z-index: 1;
    width: 100%; max-width: 980px;
    display: grid; grid-template-columns: 1fr 1.08fr;
    min-height: 560px;
    border-radius: 18px; overflow: hidden;
    background: #fff;
    box-shadow: 0 50px 90px -28px var(--g-shadow), 0 12px 28px rgba(20, 12, 50, .22);
}
@media (prefers-reduced-motion: no-preference) {
    .gate-shell { animation: gate-rise .5s ease-out both; }
    .gate-art-float { animation: gate-float 5s ease-in-out infinite alternate; }
}
@keyframes gate-rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes gate-float { to { transform: translateY(-8px); } }

/* ---- ฝั่งซ้าย ---- */
.gate-hero {
    position: relative; isolation: isolate; overflow: hidden;
    display: flex; flex-direction: column; gap: 18px;
    padding: 34px 38px 38px;
    color: #fff;
    background: linear-gradient(160deg, var(--g-hi) 0%, var(--g-mid) 45%, var(--g-deep) 100%);
    box-shadow: 18px 0 36px -14px var(--g-shadow);
}
.gate-hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
.gate-org { display: flex; align-items: center; gap: 12px; }
.gate-org-logo {
    width: 54px; height: 54px; flex: none; border-radius: 50%;
    display: grid; place-items: center; background: #fff;
    box-shadow: 0 8px 20px rgba(20, 12, 50, .35);
}
.gate-org-logo img { width: 46px; height: 46px; border-radius: 50%; object-fit: contain; }
.gate-org-text { display: grid; line-height: 1.35; }
.gate-org-text strong { font-size: 1rem; font-weight: 600; color: #fff; }
.gate-org-text small { font-size: .82rem; opacity: .95; }

.gate-art { flex: 1; display: grid; place-items: center; min-height: 190px; }
.gate-art svg { width: 100%; max-width: 330px; height: auto; filter: drop-shadow(0 24px 30px rgba(20, 12, 50, .35)); }

.gate-hello p { margin: 0; color: #fff; }
.gate-hello-1 { font-size: clamp(1.8rem, 3.6vw, 2.4rem); font-weight: 300; line-height: 1.15; }
.gate-hello-2 { font-size: clamp(2rem, 4.2vw, 2.8rem); font-weight: 700; line-height: 1.2; }
.gate-hello .gate-hello-sub { margin-top: 10px; max-width: 340px; font-size: .9rem; line-height: 1.7; text-shadow: 0 1px 2px rgba(20, 12, 50, .35); }

/* ---- ฝั่งขวา ---- */
.gate-panel {
    display: flex; flex-direction: column; justify-content: center;
    padding: 44px 56px;
    background: linear-gradient(180deg, #fbfaff 0%, var(--g-soft) 100%);
}
.gate-panel-inner { width: 100%; max-width: 360px; margin: 0 auto; display: grid; gap: 16px; }
.gate-panel-head h1 { margin: 0; font-size: 1.35rem; font-weight: 700; color: var(--g-ink); }
.gate-panel-head p { margin: 2px 0 0; color: #4c4a68; font-size: .88rem; }

.gate-note {
    display: flex; align-items: center; gap: 8px; margin: 0;
    padding: 9px 12px; border-radius: 8px;
    background: #fff; color: var(--g-mid); font-size: .86rem;
    box-shadow: 0 4px 12px rgba(30, 20, 60, .06);
}
.gate-note.is-error { color: #b42318; background: #fff1f0; }
.gate-note.is-ok { color: #1b7a43; background: #ecfbf2; }
.gate-note[hidden] { display: none; }

.gate-form { display: grid; gap: 12px; }
.gate-field {
    display: flex; align-items: stretch; gap: 12px; margin: 0;
    padding: 6px 12px 6px 6px; border-radius: 8px;
    background: #fff; border: 1px solid transparent;
    box-shadow: 0 6px 18px -4px rgba(30, 20, 60, .14);
    cursor: text; font-weight: 400;
    transition: box-shadow .18s ease, border-color .18s ease;
}
.gate-field:focus-within { border-color: var(--g-mid); box-shadow: 0 0 0 3px var(--g-ring), 0 8px 20px -4px rgba(30, 20, 60, .18); }
.gate-field-icon {
    width: 36px; flex: none; display: grid; place-items: center; border-radius: 6px;
    background: linear-gradient(180deg, var(--g-chip-1), var(--g-chip-2)); color: var(--g-mid);
}
.gate-field-body { flex: 1; display: grid; padding: 2px 0; }
.gate-field-label { font-size: .78rem; color: var(--g-mid); font-weight: 600; }
.gate-field input {
    width: 100%; min-height: 0; border: 0; padding: 0; border-radius: 0; box-shadow: none;
    background: transparent; color: var(--g-ink); font: inherit; font-size: .95rem; font-weight: 500;
}
.gate-field input:focus { outline: none; box-shadow: none; border: 0; }
.gate-field input::placeholder { color: #8f8ca8; font-weight: 400; }

.gate-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: .85rem; color: #4c4a68; }
.gate-check { display: inline-flex; align-items: center; gap: 6px; font-weight: 400; font-size: .85rem; color: #4c4a68; margin: 0; cursor: pointer; }
.gate-check input { accent-color: var(--g-mid); width: auto; min-height: 0; }
.gate-row small { font-size: .8rem; color: #6d6a88; text-align: right; }

/* ปุ่มหน้าตาเป็นลิงก์ (ลืมรหัสผ่าน / ยกเลิก) */
.gate-link {
    width: auto; min-height: 0; padding: 0; border: 0; background: none; box-shadow: none;
    font: inherit; font-size: .85rem; font-weight: 600; color: var(--g-mid); cursor: pointer;
}
.gate-link:hover { text-decoration: underline; background: none; color: var(--g-deep); }

/* ป๊อปอัปลืมรหัสผ่าน */
.gate-dialog {
    width: min(420px, calc(100vw - 32px)); padding: 28px 28px 24px;
    border: 0; border-radius: 16px;
    background: linear-gradient(180deg, #fbfaff 0%, var(--g-soft) 100%);
    box-shadow: 0 40px 80px -24px var(--g-shadow);
}
.gate-dialog::backdrop { background: rgba(20, 12, 50, .45); backdrop-filter: blur(2px); }
.gate-dialog .gate-form { gap: 14px; }
.gate-dialog-hint { margin: 0; font-size: .8rem; color: #6d6a88; }
.gate-dialog-actions { display: flex; align-items: center; justify-content: flex-end; gap: 16px; }
.gate-dialog-actions .gate-btn { width: auto; margin: 0; padding: 11px 18px; }
.gate-dialog-actions .gate-btn:hover svg { transform: none; }

.gate-btn {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%; margin-top: 6px; padding: 13px;
    border: 1px solid var(--g-chip-1); border-radius: 8px;
    background: #fff; color: var(--g-ink);
    font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
    box-shadow: 0 10px 24px -8px rgba(30, 20, 60, .3);
    transition: transform .15s ease, box-shadow .15s ease, color .15s ease;
}
.gate-btn svg { transition: transform .15s ease; }
.gate-btn:hover { color: var(--g-mid); transform: translateY(-1px); box-shadow: 0 16px 30px -10px rgba(30, 20, 60, .4); }
.gate-btn:hover svg { transform: translateX(3px); }
.gate-btn:focus-visible { outline: 3px solid var(--g-ring); outline-offset: 2px; }

.gate-foot {
    position: relative; z-index: 1;
    margin: 18px 0 0; text-align: center; font-size: .82rem;
    color: #fff; opacity: .95; text-shadow: 0 1px 3px rgba(20, 12, 50, .45);
}

@media (max-width: 820px) {
    .gate-shell { grid-template-columns: 1fr; min-height: 0; }
    .gate-hero { padding: 24px 22px 26px; box-shadow: none; }
    .gate-art { min-height: 0; }
    .gate-art svg { max-width: 210px; }
    .gate-hello .gate-hello-sub { display: none; }
    .gate-panel { padding: 28px 22px 30px; }
}
