:root {
    --login-blue: #0876bb;
    --login-blue-dark: #0565a6;
    --login-yellow: #ffd53f;
    --login-ink: #075f9d;
    --login-font: "Segoe UI", "Noto Sans", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

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

body.loginv2-body {
    margin: 0;
    min-height: 100vh;
    padding: 18px;
    font-family: var(--login-font);
    font-synthesis: none;
    color: #163247;
    background: #f4f7f9;
}

.loginv2-shell {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 62%) minmax(360px, 38%);
    min-height: calc(100vh - 36px);
    overflow: hidden;
    border: 1px solid #d9e1e7;
    border-radius: 22px;
    background: linear-gradient(90deg, #fff 0%, #e4f1f9 48%, #d5e9f6 62%, var(--login-blue) 62%);
    box-shadow: 0 12px 38px rgba(19, 65, 91, .13);
}

.loginv2-brand { position: relative; z-index: 1; }
.loginv2-auth { position: relative; z-index: 2; }

.loginv2-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    padding: 72px 15% 150px 8%;
}

.loginv2-brand::after {
    content: "";
    position: absolute;
    right: -9%;
    bottom: -18%;
    width: 46%;
    aspect-ratio: 1;
    border-radius: 50%;
    background: rgba(126, 190, 228, .14);
}

.loginv2-brand__content {
    position: relative;
    z-index: 1;
    width: min(620px, 100%);
    text-align: center;
}

/* Logo ngang VPĐT (assets/icon/vpdt/logo-horizontal.svg, tỉ lệ 2016:340). */
.loginv2-brand__logo {
    display: block;
    width: min(480px, 100%);
    height: auto;
    margin: 0 auto 26px;
}

.loginv2-brand__unit {
    margin: 0 0 26px;
    max-width: 100%;
    color: var(--login-ink);
    font-size: clamp(23px, 1.85vw, 35px);
    font-weight: 800;
    line-height: 1.2;
    overflow-wrap: anywhere;
    text-transform: uppercase;
}

.loginv2-brand__hint {
    margin: 0 auto;
    max-width: 680px;
    color: #74828c;
    font-size: 15px;
    font-style: italic;
    line-height: 1.65;
}

.loginv2-feature-banner {
    width: min(620px, 100%);
    margin: 26px auto 0;
    padding: 16px 18px;
    border: 1px solid rgba(8, 118, 187, .16);
    border-radius: 14px;
    color: #164663;
    background: rgba(255, 255, 255, .72);
    box-shadow: 0 8px 22px rgba(2, 103, 164, .08);
    text-align: left;
}

.loginv2-feature-banner__heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    font-size: 15px;
}

.loginv2-feature-banner__heading strong {
    color: var(--login-ink);
    font-size: 16px;
    font-weight: 800;
}

.loginv2-feature-banner__eyebrow {
    color: #1d9ad6;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.loginv2-feature-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 16px;
}

.loginv2-feature-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    min-width: 0;
    color: #0876bb;
    font-size: 13px;
    line-height: 1.3;
}

.loginv2-feature-item > .ui-icon {
    flex: 0 0 auto;
    margin-top: 1px;
}

.loginv2-feature-item > .ui-icon svg {
    width: 17px;
    height: 17px;
}

.loginv2-feature-item span {
    min-width: 0;
}

.loginv2-feature-item b,
.loginv2-feature-item small {
    display: block;
}

.loginv2-feature-item b {
    color: #164663;
    font-size: 13px;
    font-weight: 800;
}

.loginv2-feature-item small {
    margin-top: 2px;
    color: #647d8c;
    font-size: 11px;
    line-height: 1.35;
}

/* Khối QR tải app bên trái — trang đăng nhập DMKT (login.php); ẩn khi admin chưa nhập link cửa hàng. */
.loginv2-app {
    display: flex;
    align-items: center;
    gap: 18px;
    width: min(620px, 100%);
    margin: 26px auto 0;
    padding: 16px 18px;
    border: 1px solid rgba(8, 118, 187, .16);
    border-radius: 14px;
    background: rgba(255, 255, 255, .72);
    box-shadow: 0 8px 22px rgba(2, 103, 164, .08);
    text-align: left;
}

.loginv2-app__qr {
    flex: 0 0 132px;
    width: 132px;
    height: 132px;
    padding: 4px;
    border-radius: 8px;
    background: #fff;
}

.loginv2-app__qr svg { display: block; width: 100%; height: 100%; }
.loginv2-app__text { min-width: 0; }

.loginv2-app__title {
    display: block;
    margin-top: 3px;
    color: var(--login-ink);
    font-size: 17px;
    font-weight: 800;
}

.loginv2-app__hint {
    margin: 4px 0 10px;
    color: #647d8c;
    font-size: 13px;
    line-height: 1.4;
}

.loginv2-app__links { display: flex; flex-wrap: wrap; gap: 8px; }

.loginv2-brand__footer {
    position: absolute;
    z-index: 1;
    right: 13%;
    bottom: 38px;
    left: 7%;
    color: #1d9ad6;
    font-size: 15px;
    font-style: italic;
    line-height: 1.4;
    text-align: center;
}

.loginv2-auth {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: clamp(86px, 11vh, 150px) clamp(40px, 5vw, 90px) 60px;
    color: #fff;
    background: linear-gradient(135deg, var(--login-blue) 0%, var(--login-blue-dark) 100%);
}

.loginv2-auth::before {
    content: "";
    position: absolute;
    top: -18%;
    bottom: -18%;
    left: -145px;
    width: 235px;
    border-radius: 50%;
    background: #e0eef7;
    transform: rotate(-13deg);
    box-shadow: 22px 0 50px rgba(0, 87, 148, .12);
}

.loginv2-form {
    position: relative;
    z-index: 1;
    width: min(430px, 100%);
    margin: 0;
}

.loginv2-form__title {
    margin: 0 0 20px;
    max-width: 100%;
    font-size: clamp(23px, 1.85vw, 31px);
    font-weight: 800;
    line-height: 1.16;
    overflow-wrap: anywhere;
    text-align: center;
    text-transform: uppercase;
}

.loginv2-form__welcome {
    margin: 0 0 24px;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
}

.loginv2-alert {
    display: flex;
    gap: 9px;
    align-items: flex-start;
    margin: 0 0 14px;
    padding: 11px 13px;
    border: 1px solid rgba(255, 255, 255, .45);
    border-radius: 8px;
    color: #8b200e;
    background: #fff1ec;
    font-size: 14px;
    line-height: 1.4;
}

.loginv2-field {
    display: flex;
    align-items: center;
    height: 46px;
    margin-bottom: 14px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .52);
    border-radius: 7px;
    background: #eff5ff;
    color: #77899a;
    box-shadow: 0 2px 6px rgba(0, 55, 96, .08);
}

.loginv2-field:focus-within {
    border-color: #ffdf65;
    box-shadow: 0 0 0 3px rgba(255, 213, 63, .22);
}

.loginv2-field > .ui-icon {
    flex: 0 0 auto;
    width: 42px;
    text-align: center;
}

.loginv2-field .ui-icon svg,
.loginv2-alert .ui-icon svg,
.loginv2-button .ui-icon svg { width: 19px; height: 19px; }

.loginv2-field input {
    width: 100%;
    height: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    color: #20384b;
    background: transparent;
    font-family: inherit;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.25;
}

.loginv2-field input::placeholder { color: #7b8995; opacity: 1; }

.loginv2-password-toggle {
    display: grid;
    place-items: center;
    align-self: stretch;
    width: 52px;
    border: 0;
    border-left: 1px solid #dfe7ef;
    color: #7d8fa0;
    background: rgba(255,255,255,.65);
    cursor: pointer;
}

.loginv2-password-toggle svg { width: 20px; height: 20px; }
.loginv2-password-toggle .eye-closed { display: none; }
.loginv2-password-toggle.is-visible .eye-open { display: none; }
.loginv2-password-toggle.is-visible .eye-closed { display: block; }

.loginv2-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: 100%;
    min-height: 46px;
    padding: 10px 18px;
    border: 0;
    border-radius: 22px;
    color: #594800;
    background: var(--login-yellow);
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.25;
    cursor: pointer;
    transition: transform .15s ease, filter .15s ease;
}

.loginv2-button:hover { filter: brightness(1.04); transform: translateY(-1px); }
.loginv2-button:focus-visible { outline: 3px solid rgba(255,255,255,.72); outline-offset: 3px; }
.loginv2-button:disabled { cursor: wait; opacity: .72; transform: none; }

.loginv2-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 18px 0 14px;
    color: rgba(255,255,255,.82);
    font-size: 13px;
}
.loginv2-divider::before, .loginv2-divider::after { content: ""; flex: 1; height: 1px; background: rgba(255,255,255,.28); }
.loginv2-button--passkey { border: 1px solid rgba(255,255,255,.72); color: #fff; background: rgba(255,255,255,.1); }

/* Lối vào cổng chuyên gia thẩm định (chuyen_gia.php) — thẻ phụ, nổi bật vừa đủ, không lấn nút Đăng nhập chính. */
.loginv2-expert {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 26px;
    padding: 12px 14px;
    border: 1px solid rgba(255,255,255,.38);
    border-radius: 14px;
    color: #fff;
    background: rgba(255,255,255,.1);
    text-decoration: none;
    box-shadow: 0 6px 18px rgba(0, 45, 80, .12);
    transition: background .15s ease, border-color .15s ease, transform .15s ease;
}
.loginv2-expert:hover { background: rgba(255,255,255,.18); border-color: rgba(255,255,255,.6); transform: translateY(-1px); }
.loginv2-expert:focus-visible { outline: 3px solid rgba(255,255,255,.72); outline-offset: 3px; }
.loginv2-expert__icon {
    display: grid;
    place-items: center;
    flex: 0 0 40px;
    height: 40px;
    border-radius: 12px;
    color: #594800;
    background: var(--login-yellow);
}
.loginv2-expert__icon .ui-icon, .loginv2-expert__arrow .ui-icon { display: inline-flex; }
.loginv2-expert__icon svg { width: 21px; height: 21px; }
.loginv2-expert__text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.loginv2-expert__text strong { font-size: 15px; font-weight: 700; line-height: 1.25; }
.loginv2-expert__text small { font-size: 12.5px; color: rgba(255,255,255,.82); line-height: 1.35; }
.loginv2-expert__arrow { flex: 0 0 auto; color: rgba(255,255,255,.85); transition: transform .15s ease; }
.loginv2-expert__arrow svg { width: 20px; height: 20px; }
.loginv2-expert:hover .loginv2-expert__arrow { transform: translateX(3px); }

.loginv2-noscript { display: block; margin-top: 10px; color: #fff; font-size: 13px; text-align: center; }

@media (max-width: 900px) {
    body.loginv2-body { padding: 0; background: var(--login-blue); }
    .loginv2-shell { grid-template-columns: 1fr; min-height: 100vh; border: 0; border-radius: 0; }
    .loginv2-brand { padding: 38px 24px 34px; background: linear-gradient(135deg, #fff, #dceef8); }
    .loginv2-brand__logo { width: min(320px, 100%); margin-bottom: 16px; }
    .loginv2-brand__unit { margin-bottom: 14px; font-size: 20px; }
    .loginv2-brand__hint { font-size: 13px; }
    .loginv2-feature-banner { margin-top: 18px; padding: 14px; }
    .loginv2-feature-banner__heading { display: block; margin-bottom: 10px; }
    .loginv2-feature-banner__heading strong { display: block; margin-top: 3px; font-size: 15px; }
    .loginv2-brand__footer { display: none; }
    .loginv2-app { margin-top: 18px; padding: 14px; }
    .loginv2-app__qr { flex-basis: 104px; width: 104px; height: 104px; }
    .loginv2-auth { align-items: flex-start; min-height: 52vh; padding: 44px 24px 55px; }
    .loginv2-auth::before { display: none; }
    .loginv2-form__title { font-size: 22px; }
}

@media (max-width: 430px) {
    .loginv2-brand { padding: 26px 18px 24px; }
    .loginv2-brand__hint { display: none; }
    .loginv2-feature-grid { grid-template-columns: 1fr; gap: 8px; }
    .loginv2-app__qr { display: none; } /* đang cầm điện thoại: bấm nút cửa hàng, không cần quét */
    .loginv2-auth { padding: 34px 18px 44px; }
    .loginv2-form__welcome { font-size: 15px; }
}

@media (prefers-reduced-motion: reduce) {
    .loginv2-button, .loginv2-expert, .loginv2-expert__arrow { transition: none; }
}
