:root {
    color-scheme: light;
    --text: #172d4b;
    --muted: #4d6582;
    --card: #fffffff5;
    --line: #c8d9ee;
    --field: #f5f9ff;
    --accent: #2865c7;
    --button: linear-gradient(135deg,#3378dc,#2054b4);
    --backdrop: radial-gradient(ellipse at 50% 46%,#fbfdff 0,#dfedfd 42%,#add2f8 100%);
    --wave: #ffffff76;
    --shadow: 0 22px 76px #39689c32;
}
:root[data-theme="dark"] {
    color-scheme: dark;
    --text: #eef6ff;
    --muted: #b6c9e3;
    --card: #14243bf4;
    --line: #405b7e;
    --field: #102039;
    --accent: #92c4ff;
    --button: linear-gradient(135deg,#367cdf,#245abc);
    --backdrop: radial-gradient(ellipse at 50% 46%,#243c60 0,#152849 44%,#0b1528 100%);
    --wave: #a2ccff20;
    --shadow: 0 22px 76px #030a1780;
}
* { box-sizing: border-box; }
body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    place-items: center;
    padding: 80px 20px 40px;
    position: relative;
    isolation: isolate;
    overflow-x: hidden;
    color: var(--text);
    background: var(--backdrop);
    font: 16px/1.6 "Noto Sans Thai Variable","Noto Sans Thai",Tahoma,"Segoe UI",sans-serif;
}
body::before,body::after {
    content: "";
    position: fixed;
    z-index: -1;
    width: 72vw;
    height: 56vh;
    border: 1px solid var(--wave);
    border-radius: 50%;
    background: linear-gradient(130deg,var(--wave),transparent 49%);
    box-shadow: 0 0 75px var(--wave), inset 0 0 44px var(--wave);
    pointer-events: none;
}
body::before { left: -27vw; top: -24vh; transform: rotate(-19deg); }
body::after { right: -24vw; bottom: -31vh; transform: rotate(-25deg); }
.login-theme {
    position: absolute;
    top: 22px;
    right: 22px;
    border: 1px solid var(--line);
    background: var(--card);
    color: var(--text);
    padding: 7px 14px;
    border-radius: 999px;
}
.login-card {
    width: min(100%,410px);
    padding: clamp(24px,5vw,36px);
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 24px;
    box-shadow: var(--shadow);
}
.login-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; font-weight: 800; }
.login-mark {
    display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px;
    background: linear-gradient(145deg,#74aeff,#2b65c6); color: #fff;
    box-shadow: inset 0 1px 1px #fffd,0 3px 0 #235399,0 6px 12px #266cc441;
}
h1 { margin: 0; font-size: 28px; line-height: 1.25; }
.login-intro { margin: 6px 0 20px; color: var(--muted); font-size: 14px; }
form { display: grid; gap: 14px; }
label { display: grid; gap: 6px; font-size: 14px; font-weight: 650; }
input,button { font: inherit; }
input {
    width: 100%; min-width: 0; border: 1px solid var(--line); color: var(--text);
    background: var(--field); border-radius: 10px; padding: 10px 12px;
}
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.password-field { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 6px; }
.password-toggle {
    color: var(--muted); border: 1px solid var(--line); background: var(--field);
    border-radius: 9px; padding: 0 12px; font-size: 13px;
}
.login-submit {
    background: var(--button); color: #fff; border: 0; border-radius: 10px;
    padding: 11px 16px; margin-top: 5px; font-weight: 750; box-shadow: 0 8px 19px #275ebc3a;
}
.login-submit:hover { filter: brightness(1.06); }
.login-error { margin: 0; color: var(--text); border-left: 3px solid var(--accent); padding-left: 10px; }
