/**
 * XQBase — giao diện card đăng nhập, dùng CHUNG cho:
 *   - trang view=login  (bọc trong .xq-lg-stage, nền gradient)
 *   - popup ở explorer  (card trần trong .xq-modal)
 *
 * ⚠ CỐ Ý KHÔNG scope theo wrapper (.xqbase-login/.xqbase-explorer) và KHÔNG dùng
 * var(--xq-blue): modal có thể bị portal ra document.body, khi đó cả scope lẫn
 * biến CSS đều mất sạch (MEMORY: đã dính 3 lần — v2.8.2, v2.9.0, v2.18.2).
 * Mọi màu hardcode; prefix .xq-lg-* đủ hẹp để không đụng ai.
 */

/* ── Nền trang login (chỉ view=login dùng) ───────────────────────────────── */
.xq-lg-stage {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    padding: 2.6rem 1rem 2rem;
    min-height: 620px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(1.5px 1.5px at 12% 22%, rgba(255,255,255,.85), transparent),
        radial-gradient(1px 1px at 26% 68%, rgba(255,255,255,.6), transparent),
        radial-gradient(1.5px 1.5px at 78% 18%, rgba(255,255,255,.8), transparent),
        radial-gradient(1px 1px at 88% 62%, rgba(255,255,255,.7), transparent),
        radial-gradient(1px 1px at 62% 88%, rgba(255,255,255,.55), transparent),
        radial-gradient(900px 620px at 76% 32%, rgba(34,211,238,.55), transparent 70%),
        linear-gradient(125deg, #0a49b5 0%, #1071d8 42%, #19a8e0 72%, #22d3ee 100%);
}
.xq-lg-stage::before {
    content: ""; position: absolute; top: -38%; left: -14%; width: 78%; aspect-ratio: 1;
    border-radius: 50%; border: 1px solid rgba(255,255,255,.16);
    box-shadow: 0 0 0 34px rgba(255,255,255,.05), 0 0 0 90px rgba(255,255,255,.035);
    pointer-events: none;
}
.xq-lg-stage::after {
    content: ""; position: absolute; bottom: -46%; right: -18%; width: 70%; aspect-ratio: 1;
    border-radius: 50%; border: 1px solid rgba(255,255,255,.14);
    box-shadow: 0 0 0 40px rgba(255,255,255,.045);
    pointer-events: none;
}
.xq-lg-stage .xq-lg-logo {
    width: 200px; max-width: 60%; height: auto; margin-bottom: 1.4rem;
    position: relative; z-index: 1;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,.25));
}
.xq-lg-stage .xq-lg-card { position: relative; z-index: 1; }
.xq-lg-copy {
    position: relative; z-index: 1; margin-top: 1.5rem;
    color: rgba(255,255,255,.9); font-size: .8rem; text-align: center;
    text-shadow: 0 1px 3px rgba(0,0,0,.25);
}

/* ── Card (dùng chung cả trang lẫn popup) ────────────────────────────────── */
.xq-lg-card {
    width: min(420px, 100%);
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 18px 50px rgba(4,30,80,.28);
    padding: 1.6rem 1.5rem 1.1rem;
    font-size: .9rem;
    box-sizing: border-box;
}
/* Trong popup: để .xq-modal trong suốt và cho CHÍNH card lo nền + bo góc 18px,
   nếu không card bo 18px sẽ nằm lọt trong hộp bo 8px của .xq-modal → hở 4 góc. */
.xq-modal.xq-lg-modal {
    width: min(440px, 94vw);
    background: transparent;
    box-shadow: none;
    overflow: visible;
}
.xq-lg-modal .xq-lg-card { width: 100%; }

.xq-lg-badge {
    width: 82px; height: 82px; margin: 0 auto .9rem; border-radius: 50%;
    background: #eaf4fe; display: flex; align-items: center; justify-content: center;
}
.xq-lg-badge svg { width: 44px; height: 44px; }

.xq-lg-sub { text-align: center; font-weight: 700; font-size: 1.05rem; color: #16233d; margin: 0; }
.xq-lg-title {
    text-align: center; font-weight: 800; font-size: 2.3rem; letter-spacing: .01em;
    color: #0078D4; margin: .1rem 0 .15rem; line-height: 1.1;
}
.xq-lg-brand {
    display: flex; align-items: center; justify-content: center; gap: .6rem;
    color: #0078D4; font-weight: 700; font-size: 1rem; margin-bottom: 1.3rem;
}
.xq-lg-brand::before, .xq-lg-brand::after {
    content: ""; width: 34px; height: 2px; background: currentColor; opacity: .55; border-radius: 2px;
}

/* Ô nhập có icon — ép width vượt bootstrap (MEMORY: pattern #mt-title/#stp-fen) */
.xq-lg-field { position: relative; margin-bottom: .75rem; }
.xq-lg-field > svg.xq-lg-ico {
    position: absolute; left: .85rem; top: 50%; transform: translateY(-50%);
    width: 18px; height: 18px; color: #8a97a8; pointer-events: none; z-index: 2;
}
.xq-lg-field input.form-control {
    width: 100% !important; max-width: none !important; box-sizing: border-box !important;
    display: block !important;
    height: 48px; padding: .2rem 2.7rem !important;
    background: #f4f7fa; border: 1px solid #e3e9f0; border-radius: 10px;
    font-size: .95rem; color: #16233d;
}
.xq-lg-field input.form-control::placeholder { color: #93a1b2; }
.xq-lg-field input.form-control:focus {
    background: #fff; border-color: #0078D4; outline: none;
    box-shadow: 0 0 0 3px rgba(0,120,212,.14);
}
.xq-lg-eye {
    position: absolute; right: .5rem; top: 50%; transform: translateY(-50%);
    background: transparent; border: 0; padding: .35rem; cursor: pointer; color: #8a97a8;
    display: flex; align-items: center; z-index: 2;
}
.xq-lg-eye:hover { color: #0078D4; }
.xq-lg-eye svg { width: 19px; height: 19px; }

.xq-lg-btn {
    width: 100%; height: 48px; max-height: 48px; border: 0; border-radius: 10px; cursor: pointer;
    background: linear-gradient(90deg, #0a5fd6 0%, #1288dd 55%, #22d3ee 100%);
    color: #fff; font-weight: 700; font-size: 1rem;
    display: flex; align-items: center; justify-content: center; gap: .5rem;
    box-shadow: 0 6px 18px rgba(10,95,214,.32);
    margin-top: .35rem;
}
.xq-lg-btn:hover { filter: brightness(1.06); }
.xq-lg-btn svg { width: 17px; height: 17px; }

.xq-lg-opts {
    display: flex; align-items: center; justify-content: space-between; gap: .5rem;
    margin-top: .85rem; font-size: .86rem;
}
.xq-lg-remember { display: flex; align-items: center; gap: .45rem; color: #4a5768; }
.xq-lg-remember input { width: 16px; height: 16px; margin: 0; accent-color: #0078D4; }
.xq-lg-remember label { margin: 0; font-weight: 400; cursor: pointer; }
.xq-lg-forgot { color: #0078D4; font-weight: 600; text-decoration: none; }
.xq-lg-forgot:hover { text-decoration: underline; }

.xq-lg-foot {
    margin-top: 1rem; padding-top: .7rem; border-top: 1px solid #eef2f6;
    display: flex; align-items: center; justify-content: center; gap: .4rem;
    color: #7a8798; font-size: .8rem;
}
.xq-lg-foot svg { width: 14px; height: 14px; }

@media (max-width: 640px) {
    .xq-lg-title { font-size: 1.9rem; }
    .xq-lg-card { padding: 1.3rem 1.1rem 1rem; }
    .xq-lg-stage { padding: 1.8rem .7rem 1.4rem; min-height: 0; }
}
