/* ==========================================================================
   Trang đăng nhập (làm lại 08/11/2026) — đơn giản: nền sáng nhẹ, hình minh họa SVG nội tuyến bên trái, một thẻ đăng nhập.
   Cùng thư viện với app: Tabler + token HL (skin-hl.css), font ui-preferences (data-ui-font="sf"), sáng/tối theo localStorage app.theme.
   Màu hình minh họa là biến --li-* (đổi theo màu nhấn và chế độ tối). Không Tailwind/CDN. mobile-controls.css nạp sau (ô nhập ≥16px).
   ========================================================================== */
html[data-ui-skin="hl"] { --ui-font-size: 14px; }
html, body.login-page { min-height: 100%; }
body.login-page {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  min-height: 100vh; min-height: 100dvh; margin: 0; padding: 56px 20px max(24px, env(safe-area-inset-bottom)); overflow-x: hidden;
  -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%;
  background:
    radial-gradient(640px 420px at 8% 0%, color-mix(in srgb, var(--hl-accent) 10%, transparent), transparent 70%),
    radial-gradient(560px 380px at 100% 100%, color-mix(in srgb, #f6c453 12%, transparent), transparent 70%),
    var(--hl-canvas);
}

/* Biến màu hình minh họa */
.login-page {
  --li-halo: color-mix(in srgb, var(--hl-accent) 9%, var(--hl-surface));
  --li-ground: color-mix(in srgb, var(--hl-accent) 12%, transparent);
  --li-shelf: #c7d8cf; --li-box: #f1d6a8; --li-box-light: #f7e6c6; --li-box-edge: #d7ab6c;
  --li-binder-1: var(--hl-accent); --li-binder-2: #7cc3a2; --li-binder-3: #f29e6b; --li-binder-label: rgb(255 255 255 / .75);
  --li-paper: #ffffff; --li-paper-line: #d0e1d8;
  --li-coin: #f6c453; --li-coin-top: #fbd97c; --li-coin-edge: #d69a1f;
  --li-wallet: var(--hl-accent); --li-wallet-flap: color-mix(in srgb, var(--hl-accent) 78%, #000); --li-wallet-clasp: color-mix(in srgb, var(--hl-accent) 60%, #fff);
  --li-leaf: #67bf8b; --li-leaf-2: #4fa774; --li-pot: #ec9f78;
  --li-ok: #3fa66b; --li-ok-bg: #e5f6ec; --li-bell: var(--hl-accent); --li-bell-bg: var(--hl-accent-soft);
  --li-spark: #f2b84b; --li-deco: color-mix(in srgb, var(--hl-accent) 22%, transparent);
}
[data-bs-theme="dark"] .login-page {
  --li-halo: color-mix(in srgb, var(--hl-accent) 14%, var(--hl-surface));
  --li-ground: rgb(0 0 0 / .28);
  --li-shelf: #4a5568; --li-box: #9a7a4c; --li-box-light: #b39363; --li-box-edge: #6e5532;
  --li-binder-2: #3f9a74; --li-binder-3: #c47a4c;
  --li-paper: #d9dee6; --li-paper-line: #9aa6b8;
  --li-coin: #d8a83c; --li-coin-top: #e9c15f; --li-coin-edge: #a87814;
  --li-leaf: #4f9e70; --li-leaf-2: #3f8660; --li-pot: #b9785a;
  --li-ok-bg: #1f3a2b; --li-spark: #d9a23c; --li-deco: color-mix(in srgb, var(--hl-accent) 30%, transparent);
}

/* Họa tiết góc */
.login-deco { position: absolute; z-index: 0; color: var(--li-deco); pointer-events: none; }
.login-deco--tl { top: 28px; left: 28px; width: 150px; height: 150px; }
.login-deco--br { right: 0; bottom: 18px; width: 260px; height: 170px; }
@media (max-width: 767.98px) { .login-deco--tl { width: 96px; height: 96px; top: 12px; left: 12px; } .login-deco--br { width: 160px; height: 104px; } }

.login-theme { position: absolute; top: 14px; right: 14px; z-index: 2; color: var(--hl-text-muted); }
.login-theme svg { width: 20px; height: 20px; }
.login-theme-sun, [data-bs-theme="dark"] .login-theme-moon { display: none; }
[data-bs-theme="dark"] .login-theme-sun { display: block; }

/* Bố cục: hình minh họa | thẻ đăng nhập (từ 860px); màn hẹp: hình nhỏ phía trên thẻ. */
.login-wrap { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr; justify-items: center; gap: 8px; width: 100%; max-width: 940px; }
@media (min-width: 860px) { .login-wrap { grid-template-columns: minmax(0, 1.1fr) minmax(360px, 400px); align-items: center; gap: 48px; } }

.login-art { display: grid; justify-items: center; text-align: center; max-width: 460px; }
.login-illus { display: block; width: min(100%, 440px); height: auto; overflow: visible; }
.login-art-title { margin: 6px 0 6px; color: var(--hl-text); font-size: 26px; font-weight: 700; line-height: 1.2; letter-spacing: -.02em; text-wrap: balance; }/* 11/11/2026: 5 phân hệ — xuống dòng cân, không lẻ một chữ */
.login-art-text { max-width: 380px; margin: 0; color: var(--hl-text-muted); font-size: 14.5px; line-height: 1.6; }
@media (max-width: 859.98px) {
  .login-illus { width: min(72vw, 260px); }
  .login-art-title, .login-art-text { display: none; }
}

/* Hình minh họa */
.li-halo { fill: var(--li-halo); }
.li-ground { fill: var(--li-ground); }
.li-shelf rect { fill: var(--li-shelf); }
.li-box rect { fill: var(--li-box); stroke: var(--li-box-edge); stroke-width: 1.5; }
.li-box--light rect { fill: var(--li-box-light); }
.li-box-tape { fill: none; stroke: var(--li-box-edge); stroke-width: 2.4; stroke-linecap: round; }
.li-binder { fill: var(--li-binder-1); } .li-binder--2 { fill: var(--li-binder-2); } .li-binder--3 { fill: var(--li-binder-3); }
.li-binder-label { fill: none; stroke: var(--li-binder-label); stroke-width: 2.4; stroke-linecap: round; }
.li-paper { fill: var(--li-paper); stroke: var(--li-paper-line); stroke-width: 1.5; }
.li-paper-line { fill: none; stroke: var(--li-paper-line); stroke-width: 1.5; }
.li-coin rect { fill: var(--li-coin); stroke: var(--li-coin-edge); stroke-width: 1.4; }
.li-coin ellipse { fill: var(--li-coin-top); stroke: var(--li-coin-edge); stroke-width: 1.4; }
.li-wallet > rect:first-child { fill: var(--li-wallet); }
.li-wallet-flap { fill: var(--li-wallet-flap); }
.li-wallet-clasp { fill: var(--li-wallet-clasp); }
.li-wallet-dot { fill: var(--li-wallet); }
.li-leaf { fill: var(--li-leaf); } .li-leaf--2 { fill: var(--li-leaf-2); }
.li-pot { fill: var(--li-pot); }
.li-badge--ok circle { fill: var(--li-ok-bg); stroke: var(--li-ok); stroke-width: 1.5; }
.li-badge--ok path { fill: none; stroke: var(--li-ok); stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }
.li-badge--bell circle { fill: var(--li-bell-bg); stroke: var(--li-bell); stroke-width: 1.5; }
.li-badge--bell path { fill: none; stroke: var(--li-bell); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.li-spark { fill: var(--li-spark); }
@media (prefers-reduced-motion: no-preference) {
  .li-wallet, .li-badge { animation: login-float 5s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
  .li-badge--bell { animation-delay: -1.6s; } .li-badge--ok { animation-delay: -3.2s; }
  @keyframes login-float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -6px; } }
}

/* Thẻ đăng nhập */
.login-card {
  width: 100%; max-width: 400px; padding: 28px 30px 24px; border: 1px solid var(--hl-border); border-radius: 16px; background: var(--hl-surface);
  box-shadow: 0 1px 2px rgb(0 0 0 / .04), 0 18px 40px color-mix(in srgb, var(--hl-accent) 10%, rgb(0 0 0 / .06));
  animation: login-in .35s ease-out both;
}
[data-bs-theme="dark"] .login-card { box-shadow: 0 18px 40px rgb(0 0 0 / .38); }
@media (max-width: 575.98px) { .login-card { padding: 22px 18px 18px; border-radius: 14px; } }

.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.login-brand-logo { display: grid; flex: none; place-items: center; width: 44px; height: 44px; padding: 5px; border: 1px solid var(--hl-border); border-radius: 12px; background: #fff; }
.login-brand-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
/* 10/11/2026: logo ĐẦY ĐỦ HTX Hồ Long (huy hiệu tròn) — lớn hơn biểu tượng cũ, nền trắng cả khi giao diện tối (logo xanh đậm). */
.login-brand-logo--full { width: 72px; height: 72px; padding: 4px; border-radius: 50%; border-color: color-mix(in srgb, var(--hl-accent) 25%, var(--hl-border)); }
@media (max-width: 575.98px) { .login-brand-logo--full { width: 60px; height: 60px; } }
.login-brand-text { display: grid; min-width: 0; line-height: 1.3; }
.login-brand-text strong { overflow: hidden; color: var(--hl-text); font-size: 14.5px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.login-brand-text small { color: var(--hl-text-muted); font-size: 12.5px; }

.login-title { margin: 0 0 4px; color: var(--hl-text); font-size: 22px; font-weight: 700; line-height: 1.25; letter-spacing: -.015em; }
.login-sub { margin: 0 0 20px; color: var(--hl-text-muted); }

.login-alert { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 16px; padding: 10px 12px; font-weight: 500; }
.login-alert svg { flex: none; width: 18px; height: 18px; margin-top: 1px; }

.login-form { display: grid; gap: 14px; }
.login-form .form-label { margin-bottom: 6px; color: var(--hl-text); font-weight: 600; }
.login-field { position: relative; }
.login-field .form-control { height: 44px; padding-left: 40px; border-color: var(--hl-border-strong); border-radius: 10px; background: var(--hl-surface); }
.login-field.has-action .form-control { padding-right: 44px; }
/* 26/11/2026: ô trống khi bấm Đăng nhập (login.php đặt aria-invalid; thông báo tiếng Việt ở #loginCheck — không dùng bong bóng trình duyệt) */
.login-field .form-control[aria-invalid="true"] { border-color: var(--tblr-danger); }
.login-field-icon { position: absolute; top: 50%; left: 12px; width: 18px; height: 18px; color: var(--hl-text-muted); transform: translateY(-50%); pointer-events: none; }
.login-field:focus-within .login-field-icon { color: var(--hl-accent-ink); }
.login-field-action { position: absolute; top: 50%; right: 4px; display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--hl-text-muted); transform: translateY(-50%); }
.login-field-action:hover { color: var(--hl-accent-ink); background: var(--hl-accent-soft-hover); }
.login-field-action:focus-visible { outline: 2px solid var(--hl-accent); outline-offset: 1px; }
.login-field-action svg { width: 18px; height: 18px; }

.login-submit { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; margin-top: 4px; border-radius: 10px; font-size: 15px; font-weight: 600; }
.login-submit svg { width: 18px; height: 18px; }
.login-submit:disabled { cursor: wait; opacity: .85; }

.login-help { margin: 16px 0 0; color: var(--hl-text-muted); font-size: 12.5px; text-align: center; }
.login-foot { position: relative; z-index: 1; margin: 0; color: var(--hl-text-muted); font-size: 12px; }

/* Ô nhập/nút chạm trên điện thoại cao ≥44px (cỡ chữ 16px do mobile-controls.css). */
@media (max-width: 767.98px) {
  .login-field .form-control, .login-submit { height: 46px; }
  .login-field-action { width: 40px; height: 40px; }
}

.login-shake { animation: login-shake .45s ease-in-out; }
@keyframes login-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes login-shake { 0%, 100% { transform: translateX(0); } 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
@media (prefers-reduced-motion: reduce) { .login-card, .login-shake { animation: none; } }
