/* ============================================================
   登录页 - AI 科技感主题（深空 + 玻璃拟态 + 霓虹光效）
   仅作用于 LoginLayout，作用域以 .lgn- 前缀隔离
   ============================================================ */

/* ---------- 全屏深空背景 ---------- */
.lgn-page {
    position: relative;
    min-height: 100vh;
    width: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    /* 深空径向渐变：中心稍亮，外圈深邃 */
    background:
        radial-gradient(ellipse 80% 60% at 50% 35%, #1b2a6b 0%, #0a1230 45%, #04081c 100%),
        #04081c;
    color: #e6ecff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Microsoft YaHei", Roboto, "Helvetica Neue", Arial, sans-serif;
    isolation: isolate;
}

/* ---------- 1) 网格点阵底纹（科技感） ---------- */
.lgn-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(110, 160, 255, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(110, 160, 255, 0.08) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, #000 40%, transparent 100%);
    -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, #000 40%, transparent 100%);
    z-index: 0;
    pointer-events: none;
    animation: lgn-grid-fade 14s ease-in-out infinite alternate;
}

@keyframes lgn-grid-fade {
    from { opacity: 0.55; }
    to   { opacity: 0.95; }
}

/* ---------- 2) 浮动光晕（aurora） ---------- */
.lgn-aurora {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.55;
    z-index: 0;
    pointer-events: none;
}

.lgn-aurora--a {
    width: 520px; height: 520px;
    left: -120px; top: -160px;
    background: radial-gradient(circle, #4f7bff 0%, transparent 70%);
    animation: lgn-drift-a 18s ease-in-out infinite alternate;
}
.lgn-aurora--b {
    width: 460px; height: 460px;
    right: -100px; bottom: -140px;
    background: radial-gradient(circle, #8b5cf6 0%, transparent 70%);
    animation: lgn-drift-b 22s ease-in-out infinite alternate;
}
.lgn-aurora--c {
    width: 360px; height: 360px;
    right: 18%; top: 18%;
    background: radial-gradient(circle, #22d3ee 0%, transparent 70%);
    opacity: 0.35;
    animation: lgn-drift-c 26s ease-in-out infinite alternate;
}

@keyframes lgn-drift-a {
    from { transform: translate(0,0) scale(1); }
    to   { transform: translate(60px, 40px) scale(1.15); }
}
@keyframes lgn-drift-b {
    from { transform: translate(0,0) scale(1); }
    to   { transform: translate(-50px, -30px) scale(1.1); }
}
@keyframes lgn-drift-c {
    from { transform: translate(0,0) scale(1); }
    to   { transform: translate(-40px, 50px) scale(0.9); }
}

/* ---------- 3) 扫描线（极轻） ---------- */
.lgn-scanlines {
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0.02) 0px,
        rgba(255, 255, 255, 0.02) 1px,
        transparent 1px,
        transparent 4px
    );
    z-index: 0;
    pointer-events: none;
    mix-blend-mode: overlay;
}

/* ---------- 4) 中央玻璃卡 ---------- */
.lgn-card {
    position: relative;
    z-index: 2;
    width: 420px;
    max-width: calc(100vw - 32px);
    padding: 38px 40px 30px;
    border-radius: 18px;
    background: linear-gradient(
        145deg,
        rgba(20, 28, 60, 0.72) 0%,
        rgba(12, 18, 42, 0.78) 100%
    );
    border: 1px solid rgba(130, 170, 255, 0.22);
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.04) inset,
        0 25px 60px -20px rgba(0, 0, 0, 0.7),
        0 0 60px -10px rgba(99, 122, 255, 0.35);
    animation: lgn-card-in 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes lgn-card-in {
    from { opacity: 0; transform: translateY(18px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* 卡顶发光描边（霓虹顶边） */
.lgn-card::before {
    content: "";
    position: absolute;
    top: -1px; left: 24px; right: 24px;
    height: 2px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        #6ea4ff 30%,
        #b388ff 50%,
        #22d3ee 70%,
        transparent 100%);
    border-radius: 2px;
    opacity: 0.9;
}

/* ---------- 5) 标题与副标题 ---------- */
.lgn-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
}

.lgn-logo {
    height: 56px;
    width: auto;
    max-width: 220px;
    object-fit: contain;
    border-radius: 10px;
    filter: drop-shadow(0 6px 18px rgba(99, 122, 255, 0.45));
    animation: lgn-logo-in 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes lgn-logo-in {
    from { opacity: 0; transform: translateY(-10px) scale(0.92); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.lgn-title {
    margin: 0 !important;
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 1px;
    background: linear-gradient(90deg, #c2d4ff 0%, #ffffff 50%, #b5c8ff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 0 24px rgba(139, 170, 255, 0.25);
}

.lgn-subtitle {
    text-align: center;
    font-size: 12px;
    color: rgba(180, 200, 255, 0.65);
    letter-spacing: 4px;
    margin: 6px 0 28px;
    text-transform: uppercase;
    font-weight: 500;
}

/* ---------- 6) 表单字段 ---------- */
.lgn-field {
    margin-bottom: 18px;
}

.lgn-label {
    display: block;
    font-size: 12px;
    color: rgba(180, 200, 255, 0.8);
    margin-bottom: 6px;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.lgn-input {
    width: 100%;
    height: 44px;
    padding: 0 14px 0 42px;
    color: #eaf0ff;
    font-size: 14px;
    background: rgba(10, 16, 38, 0.55);
    border: 1px solid rgba(120, 160, 255, 0.18);
    border-radius: 10px;
    outline: none;
    transition: border-color .2s ease, box-shadow .25s ease, background .2s ease;
}

.lgn-input::placeholder {
    color: rgba(160, 180, 220, 0.45);
}

.lgn-input:hover {
    border-color: rgba(140, 180, 255, 0.35);
    background: rgba(14, 22, 50, 0.65);
}

.lgn-input:focus {
    border-color: rgba(140, 180, 255, 0.7);
    background: rgba(14, 22, 50, 0.85);
    box-shadow:
        0 0 0 4px rgba(99, 122, 255, 0.15),
        0 0 18px rgba(99, 122, 255, 0.35);
}

.lgn-field-wrap {
    position: relative;
}

.lgn-field-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(150, 180, 255, 0.6);
    font-size: 14px;
    pointer-events: none;
}

.lgn-input:focus ~ .lgn-field-icon {
    color: #8ab4ff;
}

/* ---------- 7) 错误提示 ---------- */
.lgn-error {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 4px 0 16px;
    padding: 10px 12px;
    font-size: 13px;
    color: #ffb4c0;
    background: rgba(255, 70, 100, 0.12);
    border: 1px solid rgba(255, 90, 120, 0.4);
    border-radius: 8px;
    animation: lgn-shake 0.45s ease;
}

@keyframes lgn-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.lgn-error--placeholder {
    /* 保持高度，避免错误出现时按钮跳动 */
    height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    overflow: hidden;
}

/* ---------- 8) 主按钮 ---------- */
.lgn-btn {
    position: relative;
    width: 100%;
    height: 46px;
    margin-top: 6px;
    border: 0;
    border-radius: 10px;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 6px;
    background: linear-gradient(135deg, #4f7bff 0%, #6b5cff 50%, #8b5cf6 100%);
    background-size: 200% 200%;
    background-position: 0% 50%;
    cursor: pointer;
    overflow: hidden;
    box-shadow:
        0 10px 28px -8px rgba(99, 122, 255, 0.55),
        0 0 0 1px rgba(255, 255, 255, 0.06) inset;
    transition: background-position .5s ease, transform .15s ease, box-shadow .3s ease;
}

.lgn-btn:hover {
    background-position: 100% 50%;
    box-shadow:
        0 14px 36px -8px rgba(139, 92, 246, 0.65),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset,
        0 0 24px rgba(99, 122, 255, 0.55);
}

.lgn-btn:active {
    transform: translateY(1px) scale(0.995);
}

/* 按钮扫光 */
.lgn-btn::after {
    content: "";
    position: absolute;
    top: 0; left: -120%;
    width: 60%; height: 100%;
    background: linear-gradient(
        120deg,
        transparent 0%,
        rgba(255, 255, 255, 0.28) 50%,
        transparent 100%);
    transform: skewX(-25deg);
    transition: left 0.7s ease;
}

.lgn-btn:hover::after {
    left: 130%;
}

/* ---------- 9) 底部备案与版本 ---------- */
.lgn-footer {
    margin: 26px 0 0;
    padding-top: 18px;
    border-top: 1px dashed rgba(140, 175, 255, 0.2);
    text-align: center;
    font-size: 12px;
    color: rgba(160, 185, 235, 0.6);
    line-height: 1.9;
}

.lgn-footer a {
    color: rgba(190, 210, 255, 0.75);
    text-decoration: none;
    transition: color .2s;
}

.lgn-footer a:hover {
    color: #c2d4ff;
    text-shadow: 0 0 12px rgba(140, 180, 255, 0.6);
}

.lgn-version {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 10px;
    border-radius: 20px;
    background: rgba(99, 122, 255, 0.12);
    border: 1px solid rgba(99, 122, 255, 0.25);
    color: #b9caff;
    font-size: 11px;
    letter-spacing: 1px;
}

.lgn-version::before {
    content: "";
    width: 6px; height: 6px;
    border-radius: 50%;
    background: #4ade80;
    box-shadow: 0 0 8px #4ade80;
    animation: lgn-pulse 1.6s ease-in-out infinite;
}

@keyframes lgn-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.85); }
}

/* ---------- 10) 响应式 ---------- */
@media (max-width: 480px) {
    .lgn-card {
        padding: 30px 22px 22px;
        border-radius: 14px;
    }
    .lgn-title {
        font-size: 20px;
    }
    .lgn-subtitle {
        margin-bottom: 22px;
    }
}
