* { box-sizing: border-box; }
html { background: #050a12; }
body {
    margin: 0;
    color: #fff;
    background: #050a12;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
button, input { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
}
.icon-definitions {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}
.icon {
    display: block;
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.login-screen {
    position: relative;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    min-height: 100svh;
    width: 100%;
    overflow-x: hidden;
    background: #050a12;
    font-family: Geist, Sarabun, sans-serif;
}
.login-screen::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(90deg, rgba(1, 5, 12, .38) 0%, rgba(1, 5, 12, .12) 53%, transparent 77%);
}
.login-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 70% center;
    pointer-events: none;
}
.login-nav {
    position: relative;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 84px;
    flex: none;
    width: 100%;
    max-width: 1700px;
    margin: 0 auto;
    gap: 24px;
    padding: 20px clamp(24px, 4.4vw, 64px);
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: 20px;
    min-width: 0;
    text-decoration: none;
    white-space: nowrap;
    font-family: Geist, Sarabun, sans-serif;
    font-size: 1.16rem;
    font-weight: 650;
    letter-spacing: -.035em;
}
.brand-logo-wrap {
    display: flex;
    align-items: center;
    width: 128px;
    height: 64px;
    flex: none;
}
.brand-logo {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: brightness(0) invert(1);
}
.brand-system {
    padding-left: 20px;
    border-left: 1px solid rgba(255,255,255,.25);
    font-size: .84rem;
    font-weight: 500;
    line-height: 24px;
    letter-spacing: .12em;
}
.desktop-nav {
    display: flex;
    gap: clamp(22px, 3vw, 52px);
    margin-left: auto;
}
.desktop-nav a {
    text-decoration: none;
    font-size: .91rem;
    font-weight: 500;
    color: rgba(255,255,255,.82);
    transition: color .2s ease, transform .2s ease, background-color .2s ease;
}
.desktop-nav a:hover,
.desktop-nav a:focus-visible { color: #fff; }
.mobile-menu-button { display: none; }
.mobile-menu { display: none; }
.login-main {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 100%;
    flex: 1;
    max-width: 1700px;
    margin: 0 auto;
    padding: 48px clamp(24px, 8.4vw, 145px) 40px;
}
.login-footer {
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 14px;
    flex: none;
    width: 100%;
    max-width: 1700px;
    margin: 0 auto;
    padding: 12px clamp(24px, 4.4vw, 64px) 24px;
    color: rgba(255,255,255,.65);
    font-size: .72rem;
    line-height: 20px;
    text-shadow: 0 1px 4px rgba(0,0,0,.6);
}
.login-footer::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: -28px 0 0;
    pointer-events: none;
    background: linear-gradient(180deg, transparent, rgba(5,10,18,.78) 65%);
}
.developer-name { color: rgba(255,255,255,.82); }
.login-version {
    padding-left: 14px;
    border-left: 1px solid rgba(255,255,255,.2);
    white-space: nowrap;
}
.login-content {
    width: min(100%, 475px);
    padding: 35px 0 60px;
}
.login-heading {
    margin: 0;
    font-family: Sarabun, Geist, sans-serif;
    font-size: clamp(3.35rem, 5.6vw, 5.6rem);
    line-height: 1.08;
    font-weight: 700;
    letter-spacing: -.055em;
    text-wrap: nowrap;
    animation: fadeSlideUp .8s ease .2s both;
}
.login-subheading {
    margin: 9px 0 0;
    font-family: Geist, sans-serif;
    font-size: clamp(1.1rem, 2vw, 1.48rem);
    font-weight: 400;
    letter-spacing: .26em;
    animation: fadeSlideUp .8s ease .4s both;
}
.login-form {
    display: grid;
    gap: 18px;
    margin-top: 36px;
    animation: fadeSlideUp .8s ease .6s both;
}
.field-wrap {
    position: relative;
}
.field-wrap input {
    width: 100%;
    height: 68px;
    padding: 0 58px 0 70px;
    border: 1px solid rgba(255,255,255,.26);
    border-radius: 8px;
    outline: none;
    color: #fff;
    background: rgba(9,16,28,.66);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.025);
    font-size: 1.08rem;
    transition: border-color .2s, background-color .2s, box-shadow .2s;
}
.field-wrap input::placeholder { color: rgba(240,245,252,.66); }
.field-wrap input:focus {
    border-color: rgba(255,255,255,.7);
    background: rgba(8,17,28,.84);
    box-shadow: 0 0 0 3px rgba(255,255,255,.13);
}
.field-wrap input:-webkit-autofill,
.field-wrap input:-webkit-autofill:hover,
.field-wrap input:-webkit-autofill:focus {
    -webkit-text-fill-color: #fff !important;
    caret-color: #fff;
    -webkit-box-shadow: 0 0 0 1000px #091523 inset !important;
    box-shadow: 0 0 0 1000px #091523 inset !important;
    transition: background-color 5000s ease-in-out 0s;
}
.field-icon {
    position: absolute;
    left: 24px;
    top: 50%;
    width: 24px;
    height: 24px;
    transform: translateY(-50%);
    color: rgba(243,247,251,.78);
    pointer-events: none;
}
.password-toggle {
    position: absolute;
    top: 50%;
    right: 17px;
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    transform: translateY(-50%);
    color: rgba(245,248,253,.8);
    background: transparent;
    border: 0;
    border-radius: 6px;
}
.password-toggle:hover { color: #fff; }
.password-toggle .eye-off-icon { display: none; }
.password-toggle[aria-pressed="true"] .eye-icon { display: none; }
.password-toggle[aria-pressed="true"] .eye-off-icon { display: block; }
.login-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    min-height: 68px;
    margin-top: 8px;
    padding: 12px 20px;
    color: #fff;
    background: #c91320;
    border: 1px solid #d71e2c;
    border-radius: 8px;
    font-size: 1.16rem;
    font-weight: 700;
    box-shadow: 0 12px 35px rgba(0,0,0,.16);
    transition: transform .2s ease, background-color .2s ease, box-shadow .2s ease;
}
.login-submit .icon { width: 19px; height: 19px; }
.login-submit:hover:not(:disabled) {
    transform: scale(1.025);
    background: #df1c2a;
    box-shadow: 0 15px 35px rgba(125,0,15,.3);
}
.login-submit:disabled { opacity: .72; cursor: progress; }
.login-submit.is-success { background: #12835d; border-color: #12835d; }
.payslip-link {
    display: block;
    width: max-content;
    max-width: 100%;
    margin: 23px auto 0;
    color: rgba(255,255,255,.88);
    font-size: 1rem;
    text-align: center;
    text-underline-offset: 5px;
    transition: color .2s ease;
    animation: fadeSlideUp .8s ease .9s both;
}
.payslip-link:hover { color: #fff; }
.login-error {
    margin-top: 24px;
    padding: 12px 16px;
    border: 1px solid rgba(255,153,153,.65);
    border-radius: 8px;
    color: #fff;
    background: rgba(116,13,22,.94);
    font-size: .96rem;
}
.login-screen :focus-visible {
    outline: 3px solid rgba(255,255,255,.9);
    outline-offset: 3px;
}
@keyframes fadeSlideUp {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}
@media (max-width: 640px) {
    .login-screen::before {
        background: linear-gradient(180deg, rgba(1,5,12,.05) 0%, rgba(1,5,12,.4) 37%, rgba(1,5,12,.8) 74%, rgba(1,5,12,.82) 100%);
    }
    .login-video { object-position: 70% center; }
    .login-nav {
        height: 76px;
        padding: 0 22px;
    }
    .brand {
        gap: 12px;
        font-size: .9rem;
        letter-spacing: -.03em;
    }
    .brand-logo-wrap { width: 98px; height: 49px; }
    .brand-system { padding-left: 12px; font-size: .72rem; line-height: 22px; letter-spacing: .09em; }
    .desktop-nav { display: none; }
    .mobile-menu-button {
        position: relative;
        z-index: 50;
        display: grid;
        width: 40px;
        height: 40px;
        flex: none;
        place-items: center;
        margin-left: auto;
        color: #fff;
        background: rgba(4,13,23,.36);
        border: 1px solid rgba(255,255,255,.25);
        border-radius: 8px;
        transition: transform .2s;
    }
    .mobile-menu-button:active { transform: scale(.9); }
    .mobile-menu-button .icon {
        position: absolute;
        width: 22px;
        height: 22px;
        transition: transform .3s, opacity .3s;
    }
    .mobile-menu-button .close-icon { opacity: 0; transform: rotate(-90deg) scale(.6); }
    .mobile-menu-button[aria-expanded="true"] .menu-icon { opacity: 0; transform: rotate(90deg) scale(.6); }
    .mobile-menu-button[aria-expanded="true"] .close-icon { opacity: 1; transform: rotate(0) scale(1); }
    .mobile-menu {
        position: absolute;
        z-index: 20;
        inset: 0 0 auto;
        display: block;
        height: 0;
        overflow: hidden;
        opacity: 0;
        pointer-events: none;
        background: rgba(0,0,0,.98);
        backdrop-filter: blur(20px);
        transition: height .5s cubic-bezier(.16,1,.3,1), opacity .5s cubic-bezier(.16,1,.3,1);
    }
    .mobile-menu.is-open {
        height: 100svh;
        opacity: 1;
        pointer-events: auto;
    }
    .mobile-menu-content {
        display: flex;
        height: 100%;
        flex-direction: column;
        justify-content: center;
        align-items: flex-start;
        gap: 24px;
        padding: 80px 32px 32px;
        opacity: 0;
        transform: translateY(32px);
        transition: opacity .35s ease .1s, transform .35s ease .1s;
    }
    .mobile-menu.is-open .mobile-menu-content { opacity: 1; transform: translateY(0); }
    .mobile-menu-content a {
        color: rgba(255,255,255,.9);
        font-size: 2rem;
        font-weight: 600;
        text-decoration: none;
    }
    .mobile-menu-content a:hover { color: #fff; }
    .mobile-menu-content button {
        margin-top: 8px;
        padding: 12px 28px;
        border: 0;
        border-radius: 999px;
        color: #111;
        background: #fff;
        font-size: 1rem;
        font-weight: 600;
    }
    .login-main {
        padding: 24px 24px 42px;
    }
    .login-footer {
        flex-direction: column;
        gap: 0;
        padding: 10px 18px 14px;
        font-size: .69rem;
        line-height: 18px;
        text-align: center;
    }
    .login-version { padding-left: 0; border-left: 0; }
    .login-content { width: 100%; max-width: 450px; margin: 0 auto; padding: 32px 0; }
    .login-heading { font-size: clamp(2.75rem, 11vw, 4rem); }
    .login-subheading { font-size: 1.05rem; }
    .login-form { margin-top: 30px; gap: 15px; }
    .field-wrap input { height: 64px; font-size: 1rem; }
    .login-submit { min-height: 64px; font-size: 1.1rem; }
}
@media (max-width: 360px) {
    .brand { font-size: .79rem; }
    .brand-logo-wrap { width: 88px; height: 44px; }
    .brand-system { font-size: .68rem; }
    .login-main { padding-left: 18px; padding-right: 18px; }
    .login-heading { font-size: 2.55rem; }
}
@media (max-width: 640px) and (max-height: 620px) {
    .login-main { padding-top: 12px; padding-bottom: 8px; }
    .login-content { padding: 12px 0; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}

/* 29/9/2569 เว็บแอป TD-HR: ปุ่มพนักงาน → เมนูของฉัน (ESS) ใต้ปุ่มเข้าสู่ระบบ คั่นด้วย "หรือ" · กระจกเข้มขอบขาวให้เข้าชุดกับช่องกรอก (เจ้าของเลือกแบบ ข) */
.login-or {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 22px 0 0;
    color: rgba(255,255,255,.7);
    font-size: .9rem;
    animation: fadeSlideUp .8s ease .8s both;
}
.login-or::before, .login-or::after { content: ""; flex: 1; height: 1px; background: rgba(255,255,255,.22); }
.ess-entry {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-top: 16px;
    min-height: 68px;
    padding: 12px 22px 12px 24px;
    color: #fff;
    text-decoration: none;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.62);
    border-radius: 8px;
    transition: border-color .2s, background-color .2s;
    animation: fadeSlideUp .8s ease .85s both;
}
.ess-entry:hover { border-color: rgba(255,255,255,.9); background: rgba(8,17,28,.84); }
.ess-entry-icon { display: grid; flex: 0 0 24px; place-items: center; color: rgba(243,247,251,.85); }
.ess-entry-icon .icon { width: 24px; height: 24px; }
.ess-entry-text { display: grid; flex: 1; min-width: 0; gap: 1px; }
.ess-entry-text b { font-size: 1.08rem; font-weight: 700; }
.ess-entry-text small { color: rgba(240,245,252,.68); font-size: .86rem; }
.ess-entry-arrow { flex: 0 0 20px; width: 20px; height: 20px; }
.ess-entry + .payslip-link { margin-top: 18px; }
