:root {
    --login-navy: #123b5d;
    --login-blue: #0b6fa4;
    --login-blue-dark: #08557f;
    --login-red: #a52a2a;
    --login-border: #d7e1e8;
    --login-text: #203444;
    --login-muted: #607482;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
    margin: 0;
    color: var(--login-text);
    background: #eef3f6;
    font-family: "Roboto", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
}

img { max-width: 100%; }

a { color: var(--login-blue); text-decoration: none; }
a:hover, a:focus { color: var(--login-blue-dark); text-decoration: underline; }

.main {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 48px 24px 78px;
    overflow: hidden;
    background-image: linear-gradient(135deg, rgba(8, 45, 73, .92), rgba(17, 91, 128, .78)), url("../images/login-bg.jpg");
    background-position: center;
    background-size: cover;
}

.main::before {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: linear-gradient(120deg, rgba(255, 255, 255, .05), transparent 45%);
    content: "";
    pointer-events: none;
}

.login-box {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(300px, .92fr) minmax(420px, 1.08fr);
    width: min(1040px, 100%);
    min-height: 570px;
    overflow: hidden;
    background: #fff;
    border: 1px solid rgba(255, 255, 255, .65);
    border-radius: 8px;
    box-shadow: 0 22px 55px rgba(3, 27, 45, .28);
}

.left, .right { float: none; width: auto; height: auto; }

.left {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 48px 44px 40px;
    color: #fff;
    background: linear-gradient(160deg, rgba(18, 59, 93, .98), rgba(11, 111, 164, .88));
}

.left .title {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-bottom: 22px;
    border-bottom: 1px solid rgba(255, 255, 255, .25);
}

.left .title img { width: 46px; height: 46px; object-fit: contain; }

.left .title span {
    position: static;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: .06em;
    line-height: 1.35;
}

.left .image {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 32px 0 20px;
}

.left .image img {
    width: min(100%, 340px);
    max-height: 300px;
    object-fit: contain;
    filter: drop-shadow(0 14px 18px rgba(0, 0, 0, .16));
}

.right {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 56px clamp(38px, 6vw, 78px) 42px;
    background: #fff;
}

.right .title { width: 100%; max-width: 460px; margin: 0 auto; text-align: left; }

.right .title::before {
    display: block;
    width: 54px;
    height: 4px;
    margin-bottom: 18px;
    border-radius: 2px;
    background: var(--login-red);
    content: "";
}

.right .title span {
    position: static;
    display: block;
    padding: 0;
    color: var(--login-navy);
    font-size: 26px;
    font-weight: 700;
    line-height: 1.25;
}

.right .title::after {
    display: block;
    margin-top: 9px;
    color: var(--login-muted);
    content: "Cổng thông tin điều hành nhiệm vụ";
    font-size: 14px;
    font-weight: 400;
}

.right > form,
.right > .alert,
.right > .text-center,
.right > div:not(.bottom) { width: 100%; max-width: 460px; margin-right: auto; margin-left: auto; }

.right .form-box { width: 100%; max-width: 460px; margin: 28px auto 0; padding: 0; }
.right .form-group { position: relative; margin-bottom: 18px; }

.right .form-group > .fa,
.right .form-group > .fas {
    position: absolute;
    top: 46px;
    left: 17px;
    z-index: 2;
    color: var(--login-blue);
    font-size: 16px;
    pointer-events: none;
}

.right .field-label {
    display: block;
    margin-bottom: 7px;
    color: var(--login-navy);
    font-size: 14px;
    font-weight: 600;
}

.right input[type="text"],
.right input[type="password"],
.right input[type="number"] {
    width: 100%;
    min-height: 52px;
    padding: 13px 48px;
    color: var(--login-text);
    background: #fbfdfe;
    border: 1px solid var(--login-border);
    border-radius: 5px;
    outline: none;
    font-size: 15px;
    transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}

.right input[type="text"]:focus,
.right input[type="password"]:focus,
.right input[type="number"]:focus {
    background: #fff;
    border-color: var(--login-blue);
    box-shadow: 0 0 0 3px rgba(11, 111, 164, .12);
}

.right .password-field { position: relative; }
.right .password-field input { padding-right: 52px; }

.right .password-toggle {
    position: absolute;
    top: 54px;
    right: 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    min-height: 42px;
    padding: 0;
    color: var(--login-muted);
    background: transparent;
    border: 0;
    border-radius: 4px;
    transform: translateY(-50%);
}

.right .password-toggle:hover,
.right .password-toggle:focus { color: var(--login-blue); background: #edf5f9; outline: none; }

.right .login-submit,
.right button[type="submit"] {
    width: 100%;
    min-height: 52px;
    padding: 13px 18px;
    color: #fff;
    background: var(--login-blue);
    border: 1px solid var(--login-blue);
    border-radius: 5px;
    box-shadow: 0 5px 12px rgba(11, 111, 164, .2);
    cursor: pointer;
    font-size: 15px;
    font-weight: 700;
    transition: background-color .2s ease, border-color .2s ease, transform .2s ease;
}

.right .login-submit:hover,
.right .login-submit:focus,
.right button[type="submit"]:hover,
.right button[type="submit"]:focus { background: var(--login-blue-dark); border-color: var(--login-blue-dark); }
.right .login-submit:active, .right button[type="submit"]:active { transform: translateY(1px); }

.ghiNhoDN { display: flex; align-items: center; gap: 8px; margin: 2px 0 20px; }
.ghiNhoDN input[type="checkbox"] { width: 17px !important; height: 17px; margin: 0; accent-color: var(--login-blue); }
.ghiNhoDN label { margin: 0; color: var(--login-muted); cursor: pointer; font-size: 14px; }

.right .form-group p { margin: 14px 0 0; color: var(--login-muted); text-align: center; font-size: 13px; }
.right .form-group p a { color: var(--login-blue); }

.right .bottom { width: 100%; max-width: 460px; margin: 28px auto 0; padding: 18px 0 0; text-align: center; border-top: 1px solid #e4ebef; }
.right .bottom > div { padding: 0; border: 0; color: var(--login-muted); font-size: 13px; }

.login-alert { margin-top: 22px; padding: 12px 14px; color: #194d6b; background: #eef7fb; border: 1px solid #c9e3ef; border-radius: 5px; }
.login-message { max-width: 460px; margin: 18px auto 0; padding: 10px 12px; color: #8b2525; background: #fff4f3; border: 1px solid #f0c9c6; border-radius: 5px; }

footer { position: absolute; right: 0; bottom: 0; left: 0; z-index: 1; padding: 13px 20px; color: rgba(255, 255, 255, .88); background: rgba(5, 34, 55, .72); text-align: center; font-size: 13px; }
footer a { color: #fff; }

@media (max-width: 820px) {
    .main { align-items: flex-start; padding: 28px 16px 72px; }
    .login-box { grid-template-columns: 1fr; min-height: 0; max-width: 580px; }
    .left { min-height: 245px; padding: 28px 28px 20px; }
    .left .image { padding: 18px 0 0; }
    .left .image img { max-height: 145px; }
    .right { padding: 36px 28px 30px; }
}

@media (max-width: 480px) {
    .main { padding: 14px 10px 65px; }
    .login-box { border-radius: 6px; }
    .left { min-height: 205px; padding: 22px 20px 16px; }
    .left .title span { font-size: 14px; }
    .left .title img { width: 38px; height: 38px; }
    .right { padding: 30px 20px 24px; }
    .right .title span { font-size: 23px; }
    .right .form-box { margin-top: 24px; }
}

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