*,
*::before,
*::after {
    box-sizing: border-box;
}

:root {
    --bch-navy: #202a78;
    --bch-navy-deep: #131b5a;
    --bch-blue: #1677b8;
    --bch-cyan: #28a9df;
    --bch-ink: #17235c;
    --bch-muted: #52647c;
    --bch-line: #cbdfea;
    --bch-surface: rgba(255, 255, 255, .92);
}

html,
body {
    min-height: 100%;
    margin: 0;
    overflow-x: hidden;
    background: #edf7fb;
}

body,
button,
input,
select,
textarea {
    font-family: 'Sarabun', sans-serif !important;
}

body {
    color: var(--bch-ink);
}

.login-page {
    position: relative;
    isolation: isolate;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    padding: clamp(56px, 7.8vh, 84px) clamp(14px, 1.7vw, 24px) clamp(12px, 1.8vh, 20px);
    overflow: hidden;
    background-image:
        linear-gradient(90deg, rgba(238, 248, 252, .9), rgba(255, 255, 255, .82) 43%, rgba(238, 248, 252, .72)),
        url('/img/BCH_Background.webp');
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
}

.login-page::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(circle at 50% 30%, rgba(255, 255, 255, .74), transparent 23rem),
        linear-gradient(180deg, rgba(255, 255, 255, .08), rgba(226, 241, 249, .2));
    pointer-events: none;
}

.top-accent {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    z-index: 2;
    height: 8px;
    background: linear-gradient(90deg, var(--bch-navy) 0 58%, var(--bch-blue) 58% 75%, var(--bch-cyan) 75% 100%);
    box-shadow: 0 3px 14px rgba(32, 42, 120, .18);
}

.page-shell {
    position: relative;
    z-index: 1;
    width: min(1296px, 100%);
    min-height: calc(100dvh - clamp(56px, 7.8vh, 84px) - clamp(12px, 1.8vh, 20px));
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: clamp(10px, 2.4vh, 24px);
}

.login-header {
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 11px 14px;
    border: 1px solid rgba(208, 226, 237, .88);
    border-radius: 12px;
    background: rgba(255, 255, 255, .9);
    box-shadow: 0 18px 44px rgba(30, 74, 110, .12);
    backdrop-filter: blur(13px);
    -webkit-backdrop-filter: blur(13px);
}

.brand-block {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 14px;
    color: inherit;
    text-decoration: none;
}

.brand-logo {
    width: 56px;
    height: 56px;
    flex: 0 0 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid #d5e5ef;
    border-radius: 10px;
    background: #fff;
}

.brand-logo img {
    width: 100%;
    height: 100%;
    padding: 7px;
    object-fit: contain;
}

.brand-copy {
    min-width: 0;
}

.brand-title,
.brand-subtitle {
    display: block;
    overflow-wrap: anywhere;
}

.brand-title {
    color: var(--bch-navy);
    font-size: 18px;
    font-weight: 800;
    line-height: 1.25;
}

.brand-subtitle {
    margin-top: 2px;
    color: var(--bch-muted);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.3;
}

.home-link {
    min-height: 46px;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 17px;
    border: 1px solid #bfd5e6;
    border-radius: 9px;
    background: rgba(255, 255, 255, .8);
    color: var(--bch-navy);
    font-size: 15px;
    font-weight: 800;
    text-decoration: none;
    transition: transform .18s ease, background-color .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.brand-block:hover,
.brand-block:focus,
.home-link:hover,
.home-link:focus,
.back-link:hover,
.back-link:focus {
    text-decoration: none;
}

.home-link:hover,
.home-link:focus-visible {
    transform: translateY(-1px);
    border-color: var(--bch-navy);
    background: #fff;
    box-shadow: 0 12px 24px rgba(32, 42, 120, .12);
    color: var(--bch-navy-deep);
}

.brand-block:focus-visible,
.home-link:focus-visible,
.password-toggle:focus-visible,
.btn-login-primary:focus-visible,
.back-link:focus-visible {
    outline: 3px solid rgba(40, 169, 223, .42);
    outline-offset: 3px;
}

.login-main {
    min-height: 0;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(8px, 2vh, 20px) 0;
}

.login-box {
    position: relative;
    width: min(510px, 100%);
    padding: clamp(30px, 3.5vw, 38px);
    overflow: hidden;
    border: 1px solid rgba(208, 226, 237, .94);
    border-radius: 12px;
    background: var(--bch-surface);
    box-shadow: 0 26px 68px rgba(31, 78, 117, .18);
    backdrop-filter: blur(13px);
    -webkit-backdrop-filter: blur(13px);
}

.login-box::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 6px;
    background: linear-gradient(90deg, var(--bch-navy), var(--bch-blue), var(--bch-cyan));
}

.login-box::after {
    content: "";
    position: absolute;
    top: -95px;
    right: -90px;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(40, 169, 223, .12), transparent 68%);
    pointer-events: none;
}

.login-box-head {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 11px;
    margin-bottom: 18px;
}

.login-security-mark {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    background: rgba(40, 169, 223, .11);
    color: var(--bch-navy);
    font-size: 20px;
}

.login-security-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    color: var(--bch-navy);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .045em;
    line-height: 1.25;
    text-transform: uppercase;
}

.login-security-copy small {
    margin-top: 3px;
    color: #738397;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .025em;
}

.login-title {
    position: relative;
    z-index: 1;
    margin: 0 0 5px;
    color: var(--bch-ink);
    font-size: clamp(31px, 2.1vw, 38px);
    font-weight: 800;
    line-height: 1.15;
}

.login-subtitle {
    position: relative;
    z-index: 1;
    margin: 0 0 24px;
    color: var(--bch-muted);
    font-size: 15px;
    line-height: 1.5;
}

#account {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 17px;
}

.validation-summary:empty,
.field-validation:empty {
    display: none;
}

.validation-summary {
    margin: 0;
    padding: 11px 13px;
    border: 1px solid rgba(196, 45, 63, .25);
    border-radius: 8px;
    background: rgba(220, 53, 69, .07);
    font-size: 13px;
    font-weight: 600;
}

.validation-summary ul {
    margin: 0;
    padding-left: 18px;
}

.field-group {
    margin: 0;
}

.form-label {
    width: 100%;
    margin-bottom: 8px;
    color: #24366d;
    font-size: 15px;
    font-weight: 800;
}

.label-en {
    color: #6d7f93;
    font-size: 12px;
    font-weight: 600;
}

.field-required {
    float: right;
    margin-top: 2px;
    color: #c42d3f;
    font-size: 12px;
    font-weight: 700;
}

.field-control,
.password-field {
    position: relative;
}

.field-icon {
    position: absolute;
    top: 50%;
    left: 15px;
    z-index: 2;
    transform: translateY(-50%);
    color: #6f8296;
    font-size: 17px;
    pointer-events: none;
}

.form-control {
    min-height: 50px;
    padding: 11px 48px 11px 44px;
    border: 1px solid var(--bch-line);
    border-radius: 8px;
    background: rgba(255, 255, 255, .97);
    color: var(--bch-ink);
    box-shadow: none;
    font-size: 15px;
}

.form-control::placeholder {
    color: #94a2b2;
}

.form-control:hover {
    border-color: #aecbdb;
}

.form-control:focus {
    border-color: rgba(32, 42, 120, .5);
    background: #fff;
    box-shadow: 0 0 0 .2rem rgba(40, 169, 223, .14);
    color: var(--bch-ink);
    outline: 0;
}

.form-control.is-invalid {
    border-color: rgba(196, 45, 63, .58);
    background-image: none;
}

.field-help,
.field-validation {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    line-height: 1.35;
}

.field-help {
    color: #7a8999;
}

.field-validation,
.text-danger {
    color: #b52638 !important;
    font-weight: 700;
}

.password-toggle {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 3;
    width: 48px;
    height: 100%;
    border: 0;
    border-radius: 0 8px 8px 0;
    background: transparent;
    color: #6f8296;
    font-size: 18px;
}

.password-toggle:hover {
    color: var(--bch-navy);
}

.remember-row {
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.form-check {
    min-height: 24px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-check-input {
    width: 19px;
    height: 19px;
    margin: 0;
    border-color: #adc8d9;
}

.form-check-input:checked {
    border-color: var(--bch-navy);
    background-color: var(--bch-navy);
}

.form-check-input:focus {
    border-color: var(--bch-navy);
    box-shadow: 0 0 0 .2rem rgba(40, 169, 223, .14);
}

.form-check-label {
    margin: 0;
    color: #2f416f;
    font-size: 14px;
    font-weight: 500;
}

.secure-note {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #6d7f93;
    font-size: 11px;
    font-weight: 600;
}

.secure-note i {
    color: #15956f;
}

.btn-login-primary {
    width: 100%;
    min-height: 58px;
    margin-top: 2px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 1px solid var(--bch-navy);
    border-radius: 9px;
    background: linear-gradient(135deg, var(--bch-navy), #2b4099);
    box-shadow: 0 16px 32px rgba(32, 42, 120, .2);
    color: #fff;
    font-size: 17px;
    font-weight: 800;
    transition: transform .18s ease, background .18s ease, box-shadow .18s ease;
}

.btn-login-primary:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, var(--bch-navy-deep), var(--bch-navy));
    box-shadow: 0 20px 38px rgba(32, 42, 120, .26);
}

.btn-login-primary:active {
    transform: translateY(0);
}

.back-link {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    color: var(--bch-muted);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
}

.back-link:hover {
    color: var(--bch-navy);
}

@media (min-width: 992px) and (max-height: 850px) {
    .login-page {
        padding-top: 42px;
        padding-bottom: 10px;
    }

    .page-shell {
        min-height: calc(100dvh - 52px);
        gap: clamp(8px, 2vh, 16px);
    }

    .login-header {
        min-height: 66px;
        padding: 8px 12px;
    }

    .brand-logo {
        width: 48px;
        height: 48px;
        flex-basis: 48px;
    }

    .brand-title {
        font-size: 16px;
    }

    .brand-subtitle {
        font-size: 12px;
    }

    .home-link {
        min-height: 42px;
        font-size: 14px;
    }

    .login-main {
        padding: 4px 0;
    }

    .login-box {
        padding: 27px 32px;
    }

    .login-box-head {
        margin-bottom: 12px;
    }

    .login-security-mark {
        width: 38px;
        height: 38px;
        flex-basis: 38px;
    }

    .login-title {
        font-size: 30px;
    }

    .login-subtitle {
        margin-bottom: 18px;
        font-size: 14px;
    }

    #account {
        gap: 13px;
    }

    .form-control {
        min-height: 46px;
    }

    .btn-login-primary {
        min-height: 52px;
    }
}

@media (max-width: 767.98px) {
    .login-page {
        min-height: 100dvh;
        padding: 30px 14px 14px;
        overflow: visible;
        background-position: 57% center;
    }

    .page-shell {
        min-height: auto;
        gap: 18px;
    }

    .login-header {
        align-items: stretch;
        flex-direction: column;
        gap: 14px;
    }

    .home-link {
        width: 100%;
    }

    .brand-title {
        font-size: 16px;
    }

    .brand-subtitle {
        font-size: 12px;
    }

    .login-main {
        padding: 0;
    }

    .login-box {
        padding: 30px 22px;
    }

    .remember-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }
}

@media (max-width: 420px) {
    .login-page {
        padding-right: 10px;
        padding-left: 10px;
    }

    .brand-logo {
        width: 48px;
        height: 48px;
        flex-basis: 48px;
    }

    .login-header,
    .login-box {
        border-radius: 9px;
    }

    .login-title {
        font-size: 29px;
    }

    .login-subtitle,
    .form-check-label {
        font-size: 14px;
    }

    .login-box-head {
        margin-bottom: 15px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}
