﻿/* =====================================================================
   ViSoft - Trang đăng nhập (chỉ nạp ở Login.aspx, không nằm trong css.axd)
   Màu thương hiệu lấy theo logo: xanh #1a6fd6 / cam #f37021
   ===================================================================== */
:root {
    --lg-blue: #1a6fd6;
    --lg-blue-2: #3b8cff;
    --lg-orange: #f37021;
    --lg-navy: #071226;
    --lg-text: #0f172a;
    --lg-muted: #64748b;
    --lg-font: "Be Vietnam Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

html, body.lg { height: 100%; }
body.lg {
    margin: 0; font-family: var(--lg-font); color: var(--lg-text);
    background: var(--lg-navy) !important; overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ---------- Nền: ảnh đèo Mã Pí Lèng (Hà Giang) - Unsplash License, dùng thương mại miễn phí ---------- */
.lg-bg { position: fixed; inset: 0; overflow: hidden; z-index: 0; background: var(--lg-navy); }
.lg-photo { /* zoom chậm kiểu Ken Burns */
    position: absolute; inset: -2%; background: url("/Web/Resources/Images/login-bg-hagiang.jpg") center 40% / cover no-repeat;
    /* ảnh gốc có sương hoàng hôn -> tăng tương phản/màu cho rõ nét */
    filter: contrast(1.22) saturate(1.3) brightness(1.02);
    animation: lgKen 40s ease-in-out infinite alternate; will-change: transform;
}
@keyframes lgKen { from { transform: scale(1); } to { transform: scale(1.08) translate(-1%, -1%); } }
.lg-bg::after { /* phủ tối để khung đăng nhập & chữ luôn dễ đọc */
    content: ""; position: absolute; inset: 0;
    background:
        radial-gradient(ellipse 70% 60% at 50% 50%, rgba(7,18,38,0), rgba(7,18,38,.18) 100%),
        linear-gradient(180deg, rgba(7,18,38,0) 0%, rgba(7,18,38,0) 55%, rgba(7,18,38,.40) 100%);
}
.lg-place { /* chú thích địa danh góc dưới */
    position: fixed; left: 18px; bottom: 14px; z-index: 1; color: rgba(255,255,255,.8);
    font-size: 12.5px; letter-spacing: .02em; text-shadow: 0 1px 3px rgba(0,0,0,.5);
}
.lg-place .fa { color: var(--lg-orange); margin-right: 6px; }

/* ---------- Thời tiết thực (login-weather.js): các lớp phủ nằm trong .lg-bg, dưới lớp phủ tối ---------- */
.lg-wx { position: absolute; inset: 0; pointer-events: none; display: block; }
.lg-wx-canvas { width: 100%; height: 100%; }
.lg-wx-dim { background: linear-gradient(180deg, rgba(30,41,59,.38), rgba(15,23,42,.22)); }
.lg-wx-cold { background: linear-gradient(180deg, rgba(186,214,255,.20), rgba(15,23,42,.20)); }
.lg-wx-fog {
    inset: -10% -30%; opacity: .55; filter: blur(18px);
    background:
        radial-gradient(ellipse 40% 22% at 20% 70%, rgba(255,255,255,.55), transparent 70%),
        radial-gradient(ellipse 45% 20% at 65% 60%, rgba(255,255,255,.45), transparent 70%),
        radial-gradient(ellipse 35% 18% at 90% 78%, rgba(255,255,255,.5), transparent 70%);
    animation: lgFog 60s linear infinite alternate;
}
.lg-wx-fog2 { opacity: .4; animation-duration: 85s; animation-direction: alternate-reverse; top: -25%; }
.lg-wx-cloud { opacity: .35; top: -40%; }
@keyframes lgFog { from { transform: translateX(-8%); } to { transform: translateX(8%); } }
.lg-wx-sun {
    background: radial-gradient(circle at 82% 12%, rgba(255,220,150,.38) 0, rgba(255,190,110,.14) 18%, transparent 42%);
    animation: lgSun 8s ease-in-out infinite alternate;
}
@keyframes lgSun { from { opacity: .75; } to { opacity: 1; } }
.lg-wx-flash { background: rgba(225,235,255,.0); }
.lg-wx-flash.on { animation: lgFlash .9s ease-out; }
@keyframes lgFlash { 0% { background: rgba(225,235,255,0); } 8% { background: rgba(225,235,255,.55); } 16% { background: rgba(225,235,255,.08); } 24% { background: rgba(225,235,255,.4); } 100% { background: rgba(225,235,255,0); } }
.lg-wx-cap::before { content: "·"; margin: 0 7px; opacity: .7; }

/* ---------- Bố cục: khung luôn ở giữa màn hình ---------- */
.lg-stage {
    position: relative; z-index: 1; min-height: 100vh; min-height: 100dvh;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 28px 16px 28px; box-sizing: border-box;
}

/* ---------- Card trắng ---------- */
.lg-card {
    position: relative; width: 100%; max-width: 420px; box-sizing: border-box;
    padding: 40px 36px 30px; border-radius: 22px; overflow: hidden;
    background: rgba(255,255,255,.94); /* trình duyệt không hỗ trợ blur: gần như đặc */
    border: 1px solid rgba(255,255,255,.55);
    box-shadow: 0 30px 80px rgba(0,0,0,.40), inset 0 1px 0 rgba(255,255,255,.6);
    animation: lgRise .7s cubic-bezier(.2,.8,.2,1) both;
}
/* Kính mờ: hòa vào ảnh nền, chữ vẫn đọc rõ */
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
    .lg-card { background: rgba(255,255,255,.72); -webkit-backdrop-filter: blur(16px) saturate(1.5); backdrop-filter: blur(16px) saturate(1.5); }
    .lg-field input.lg-input { background: rgba(255,255,255,.55); border-color: rgba(148,163,184,.45); }
    .lg-head { border-top-color: rgba(15,23,42,.10); }
}
@keyframes lgRise { from { opacity: 0; transform: translateY(28px) scale(.98); } to { opacity: 1; transform: none; } }

/* ---------- Logo: nằm trong card, lớn, sạch (kiểu Microsoft/Atlassian/Stripe) ---------- */
.lg-logo { display: block; margin: 0 auto 18px; text-align: center; animation: lgLogoIn .8s .1s cubic-bezier(.2,.8,.2,1) both; }
.lg-logo img { display: inline-block; width: 190px; max-width: 100%; height: auto; opacity: .78; transition: opacity .3s ease, transform .3s ease; }
.lg-logo:hover img { opacity: 1; transform: scale(1.03); }
@keyframes lgLogoIn { from { opacity: 0; transform: translateY(-10px); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }

/* ---------- Tiêu đề ---------- */
.lg-head { text-align: center; margin-bottom: 24px; padding-top: 20px; border-top: 1px solid #eef1f6; }
.lg-head h1 { margin: 0; font-size: 21px; font-weight: 700; letter-spacing: -.01em; }
.lg-head h1 b { background: linear-gradient(90deg, var(--lg-blue), var(--lg-orange)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lg-head p { margin: 6px 0 0; color: var(--lg-muted); font-size: 14px; }
.lg-head p b { color: var(--lg-blue); font-weight: 600; }

/* ---------- Ô nhập ---------- */
.lg-field { position: relative; margin-bottom: 14px; animation: lgRise .6s both; }
.lg-field.d1 { animation-delay: .25s; }
.lg-field.d2 { animation-delay: .32s; }
.lg-field > .fa { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: #94a3b8; font-size: 16px; transition: color .2s; z-index: 1; }
.lg-field input.lg-input {
    width: 100%; height: 52px; box-sizing: border-box; padding: 18px 46px 4px 44px;
    font-size: 16px; color: var(--lg-text); background: #f5f7fb;
    border: 1.5px solid #e2e8f0; border-radius: 14px; outline: none;
    transition: border-color .2s, box-shadow .2s, background-color .2s;
}
.lg-field label { /* nhãn nổi */
    position: absolute; left: 44px; top: 50%; transform: translateY(-50%);
    font-size: 15px; color: #94a3b8; pointer-events: none; font-weight: 500;
    transition: top .18s ease, font-size .18s ease, color .18s ease;
}
.lg-field input.lg-input:focus { border-color: var(--lg-blue); background: #fff; box-shadow: 0 0 0 4px rgba(26,111,214,.15); }
.lg-field input.lg-input:focus ~ .fa, .lg-field.has-value > .fa { color: var(--lg-blue); }
.lg-field input.lg-input:focus ~ label,
.lg-field input.lg-input:not(:placeholder-shown) ~ label,
.lg-field input.lg-input:-webkit-autofill ~ label { top: 15px; font-size: 11.5px; color: var(--lg-blue); font-weight: 600; letter-spacing: .02em; }
.lg-field input.lg-input:-webkit-autofill { -webkit-box-shadow: 0 0 0 40px #fff inset; -webkit-text-fill-color: var(--lg-text); }
.lg-eye {
    position: absolute; right: 6px; top: 50%; transform: translateY(-50%); z-index: 1;
    width: 40px; height: 40px; border: 0; border-radius: 10px; background: transparent; color: #94a3b8; cursor: pointer;
}
.lg-eye:hover, .lg-eye:focus { color: var(--lg-blue); background: rgba(26,111,214,.08); outline: none; }
.lg-caps { display: none; margin: -6px 2px 12px; font-size: 12.5px; color: #b45309; }
.lg-caps.on { display: block; }

/* ---------- Nút đăng nhập ---------- */
.lg-btn-wrap {
    position: relative; margin-top: 8px; border-radius: 14px; overflow: hidden;
    box-shadow: 0 10px 24px rgba(26,111,214,.35); transition: box-shadow .2s, transform .15s;
    animation: lgRise .6s .4s both;
}
.lg-btn-wrap:hover { box-shadow: 0 14px 30px rgba(26,111,214,.45); }
.lg-btn-wrap:active { transform: translateY(1px); }
.lg-btn-wrap:focus-within { box-shadow: 0 0 0 4px rgba(26,111,214,.25), 0 10px 24px rgba(26,111,214,.35); }
.lg-btn-wrap input.lg-btn {
    display: block; width: 100%; height: 52px; margin: 0; border: 0; border-radius: 14px; cursor: pointer;
    font-family: inherit; font-size: 15.5px; font-weight: 700; letter-spacing: .08em; color: #fff;
    background: linear-gradient(135deg, var(--lg-blue) 0%, var(--lg-blue-2) 55%, #2f7cf0 100%);
    transition: filter .2s; -webkit-appearance: none; outline: none;
}
.lg-btn-wrap input.lg-btn:hover { filter: brightness(1.06); }
.lg-btn-wrap::after { /* vệt sáng khi hover */
    content: ""; position: absolute; top: 0; bottom: 0; left: -60%; width: 40%; pointer-events: none;
    background: linear-gradient(100deg, transparent, rgba(255,255,255,.35), transparent); transform: skewX(-20deg);
}
.lg-btn-wrap:hover::after { animation: lgBtnShine .9s ease; }
@keyframes lgBtnShine { to { left: 130%; } }
/* trạng thái đang đăng nhập */
.lg-btn-wrap.loading input.lg-btn { color: transparent; pointer-events: none; }
.lg-btn-wrap.loading::before {
    content: ""; position: absolute; z-index: 1; left: 50%; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px;
    border: 2.5px solid rgba(255,255,255,.45); border-top-color: #fff; border-radius: 50%; animation: lgSpinner .7s linear infinite;
}
@keyframes lgSpinner { to { transform: rotate(360deg); } }

/* ---------- Thông báo lỗi (ResponseMessage.Alert vào #message) ---------- */
#message .alert { border-radius: 12px; border: 0; margin: 0 0 14px; font-size: 13.5px; animation: lgShake .4s; }
@keyframes lgShake { 0%,100% { transform: none; } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

/* ---------- Phụ ---------- */
.lg-promo {
    display: flex; align-items: center; gap: 10px; margin-top: 18px; padding: 11px 14px; border-radius: 12px;
    background: linear-gradient(90deg, rgba(243,112,33,.10), rgba(243,112,33,.04));
    border: 1px solid rgba(243,112,33,.22); color: #9a3f0c; font-size: 13.5px; font-weight: 600; text-decoration: none !important;
    transition: transform .15s, background-color .2s; animation: lgRise .6s .5s both;
}
.lg-promo:hover { transform: translateY(-1px); color: #7c2d06; }
.lg-promo .lg-badge { background: var(--lg-orange); color: #fff; font-size: 10.5px; font-weight: 700; padding: 3px 7px; border-radius: 6px; letter-spacing: .04em; }
.lg-promo .fa-angle-right { margin-left: auto; font-size: 16px; }

.lg-foot { margin-top: 22px; text-align: center; color: rgba(255,255,255,.65); font-size: 13px; line-height: 1.9; animation: lgRise .6s .6s both; }
.lg-foot a { color: #fff; font-weight: 600; text-decoration: none; }
.lg-foot a:hover { color: #ffb27a; }
.lg-foot .lg-hot { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); }
.lg-foot .lg-hot .fa { color: var(--lg-orange); }

/* ---------- Mobile ---------- */
@media (max-width: 480px) {
    .lg-stage { padding: 20px 14px; }
    .lg-card { padding: 32px 22px 22px; border-radius: 20px; }
    .lg-logo img { width: 170px; }
    .lg-head h1 { font-size: 20px; }
    .lg-place { display: none; }
}
@media (max-height: 640px) and (min-width: 481px) { .lg-stage { justify-content: flex-start; } }

/* Người dùng tắt hiệu ứng chuyển động */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}
