/* 充电桩管理系统 - 登录页 */
:root {
    --bg-deep: #061018;
    --bg-mid: #0c1f2c;
    --teal: #2dd4bf;
    --teal-bright: #5eead4;
    --cyan: #22d3ee;
    --ink: #e2f6f3;
    --muted: #8ba8b0;
    --field: rgba(8, 28, 38, 0.72);
    --line: rgba(45, 212, 191, 0.28);
    --footer-h: 44px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

.login-page {
    min-height: 100%;
    min-height: 100dvh;
    font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
    color: var(--ink);
    background: var(--bg-deep);
    position: relative;
    overflow-x: hidden;
}

.login-stage {
    position: relative;
    z-index: 1;
    min-height: calc(100vh - var(--footer-h) - var(--safe-bottom));
    min-height: calc(100dvh - var(--footer-h) - var(--safe-bottom));
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    grid-template-rows: 1fr;
    align-items: center;
    gap: clamp(16px, 3vw, 48px);
    padding:
        max(24px, env(safe-area-inset-top, 0px))
        clamp(20px, 5vw, 7vw)
        calc(56px + var(--safe-bottom));
    box-sizing: border-box;
}

.stage-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse 80% 60% at 18% 42%, rgba(34, 211, 238, 0.18), transparent 55%),
        radial-gradient(ellipse 70% 50% at 78% 30%, rgba(45, 212, 191, 0.12), transparent 50%),
        linear-gradient(160deg, #061018 0%, #0a1c28 45%, #07141d 100%);
}

.grid-lines {
    position: absolute;
    inset: 0;
    opacity: 0.22;
    background-image:
        linear-gradient(rgba(45, 212, 191, 0.12) 1px, transparent 1px),
        linear-gradient(90deg, rgba(45, 212, 191, 0.12) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse 70% 60% at 30% 50%, #000 20%, transparent 75%);
    animation: gridDrift 28s linear infinite;
}

.glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(40px);
}

.glow-a {
    width: 280px;
    height: 280px;
    left: 12%;
    top: 18%;
    background: rgba(34, 211, 238, 0.25);
    animation: glowPulse 4.5s ease-in-out infinite;
}

.glow-b {
    width: 360px;
    height: 360px;
    right: 8%;
    bottom: 10%;
    background: rgba(45, 212, 191, 0.16);
    animation: glowPulse 6s ease-in-out infinite reverse;
}

.energy-beam {
    position: absolute;
    left: 8%;
    right: 42%;
    top: 52%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--teal-bright), transparent);
    opacity: 0.55;
    animation: beamSweep 3.2s ease-in-out infinite;
}

.login-visual {
    position: relative;
    z-index: 1;
    grid-column: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    padding: 0 clamp(8px, 2vw, 24px);
}

.charger-art {
    display: block;
    width: min(340px, 100%);
    max-height: min(420px, 52vh);
    height: auto;
    opacity: 0.92;
    filter: drop-shadow(0 0 24px rgba(45, 212, 191, 0.35));
    animation: floatPile 5.5s ease-in-out infinite;
}

.screen-pulse {
    animation: screenFlicker 2.8s ease-in-out infinite;
}

.bolt-draw {
    stroke-dasharray: 40;
    stroke-dashoffset: 40;
    animation: boltDraw 2.4s ease-in-out infinite;
}

.cable {
    stroke-dasharray: 8 10;
    animation: cableFlow 1.4s linear infinite;
}

.login-content {
    position: relative;
    z-index: 2;
    grid-column: 2;
    width: 100%;
    max-width: 420px;
    justify-self: end;
    margin-right: clamp(0px, 2vw, 24px);
}

.brand {
    margin-bottom: clamp(20px, 3vw, 28px);
}

.brand-mark {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: linear-gradient(145deg, rgba(45, 212, 191, 0.25), rgba(8, 28, 38, 0.6));
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
    box-shadow: 0 0 24px rgba(45, 212, 191, 0.2);
}

.brand-mark .bolt {
    width: 14px;
    height: 22px;
    background: var(--teal-bright);
    clip-path: polygon(55% 0, 10% 55%, 42% 55%, 35% 100%, 90% 42%, 55% 42%);
    animation: boltBlink 2.2s ease-in-out infinite;
}

.brand-name {
    margin: 0;
    font-family: "Orbitron", "Noto Sans SC", sans-serif;
    font-size: clamp(24px, 3.2vw, 40px);
    font-weight: 700;
    letter-spacing: 0.08em;
    line-height: 1.25;
    color: #f0fdfa;
    text-shadow: 0 0 30px rgba(45, 212, 191, 0.35);
}

.login-form {
    padding: clamp(20px, 3vw, 28px);
    border: 1px solid var(--line);
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(12, 36, 48, 0.78), rgba(6, 20, 28, 0.88));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.form-item {
    position: relative;
    margin-bottom: 16px;
}

.form-item > i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--teal);
    font-size: 15px;
    z-index: 2;
    opacity: 0.85;
    pointer-events: none;
}

.form-item .form-control {
    width: 100%;
    height: 46px;
    min-height: 44px;
    padding: 8px 12px 8px 40px;
    border: 1px solid rgba(45, 212, 191, 0.22);
    border-radius: 10px;
    box-shadow: none;
    font-size: 16px;
    color: var(--ink);
    background: var(--field);
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
}

.form-item .form-control::placeholder {
    color: #6b8790;
}

.form-item .form-control:focus {
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.18);
    outline: none;
}

.captcha-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.captcha-item .form-control {
    flex: 1 1 auto;
    min-width: 0;
    margin-right: 0;
}

.captcha-img {
    flex: 0 0 110px;
    height: 46px;
    display: block;
}

.captcha-img .imgcode {
    width: 110px;
    height: 46px;
    border-radius: 10px;
    border: 1px solid rgba(45, 212, 191, 0.22);
    cursor: pointer;
    object-fit: cover;
}

.remember-row {
    margin: 2px 0 16px;
}

.remember-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-weight: normal;
    color: var(--muted);
    font-size: 14px;
    cursor: pointer;
    min-height: 44px;
}

.remember-label input {
    margin: 0;
    width: 16px;
    height: 16px;
}

.btn-login {
    display: block;
    width: 100%;
    height: 46px;
    min-height: 44px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(90deg, #0d9488, #0891b2);
    color: #ecfeff;
    font-size: 16px;
    letter-spacing: 0.35em;
    cursor: pointer;
    transition: transform .2s, box-shadow .2s, filter .2s;
    box-shadow: 0 8px 24px rgba(8, 145, 178, 0.35);
    touch-action: manipulation;
}

.btn-login:hover,
.btn-login:focus {
    filter: brightness(1.08);
    color: #fff;
    outline: none;
    box-shadow: 0 10px 28px rgba(45, 212, 191, 0.4);
}

.btn-login:active {
    transform: translateY(1px);
}

.register-link {
    margin-top: 14px;
    text-align: center;
    font-size: 13px;
    color: var(--muted);
}

.register-link a {
    color: var(--teal-bright);
}

.login-footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 3;
    min-height: var(--footer-h);
    padding: 8px 12px calc(8px + var(--safe-bottom));
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.35em 0.55em;
    text-align: center;
    background: rgba(4, 12, 18, 0.72);
    color: #6b8790;
    font-size: 12px;
    letter-spacing: 0.06em;
    border-top: 1px solid rgba(45, 212, 191, 0.1);
    box-sizing: border-box;
}

.login-footer .footer-sep {
    opacity: 0.55;
}

.login-footer .beian-link {
    color: #6b8790;
    text-decoration: none;
}

.login-footer .beian-link:hover {
    color: #94a3b8;
    text-decoration: underline;
}

label.error {
    position: static !important;
    display: block;
    margin-top: 6px;
    color: #fb7185;
    font-size: 12px;
    font-weight: normal;
}

@keyframes floatPile {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes glowPulse {
    0%, 100% { opacity: 0.55; transform: scale(1); }
    50% { opacity: 0.9; transform: scale(1.08); }
}

@keyframes beamSweep {
    0%, 100% { opacity: 0.2; transform: scaleX(0.7); }
    50% { opacity: 0.7; transform: scaleX(1); }
}

@keyframes screenFlicker {
    0%, 100% { opacity: 0.85; }
    50% { opacity: 1; }
}

@keyframes boltDraw {
    0% { stroke-dashoffset: 40; opacity: 0.4; }
    45% { stroke-dashoffset: 0; opacity: 1; }
    100% { stroke-dashoffset: 0; opacity: 0.7; }
}

@keyframes cableFlow {
    to { stroke-dashoffset: -36; }
}

@keyframes boltBlink {
    0%, 100% { opacity: 0.75; }
    50% { opacity: 1; filter: drop-shadow(0 0 6px #5eead4); }
}

@keyframes gridDrift {
    from { background-position: 0 0; }
    to { background-position: 48px 48px; }
}

/* 平板竖屏 / 小屏笔记本 */
@media (max-width: 1024px) {
    .login-stage {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto;
        justify-items: center;
        align-content: center;
        gap: 20px;
        padding-top: max(20px, env(safe-area-inset-top, 0px));
        padding-bottom: calc(64px + var(--safe-bottom));
    }

    .login-visual {
        grid-column: 1;
        grid-row: 1;
        padding: 0;
    }

    .charger-art {
        width: min(220px, 48vw);
        max-height: 28vh;
        opacity: 0.8;
    }

    .login-content {
        grid-column: 1;
        grid-row: 2;
        justify-self: center;
        margin-right: 0;
        max-width: min(420px, 100%);
    }

    .brand {
        text-align: center;
    }

    .brand-mark {
        margin-left: auto;
        margin-right: auto;
    }

    .energy-beam {
        display: none;
    }

    .glow-a {
        width: 200px;
        height: 200px;
        left: 50%;
        transform: translateX(-50%);
    }

    .glow-b {
        width: 260px;
        height: 260px;
    }
}

/* 手机横屏 / 小平板 */
@media (max-width: 768px) and (orientation: landscape) {
    .login-stage {
        grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
        grid-template-rows: 1fr;
        gap: 16px;
        padding: 16px clamp(16px, 4vw, 32px) calc(52px + var(--safe-bottom));
        align-items: center;
    }

    .login-visual {
        grid-column: 1;
        grid-row: 1;
    }

    .charger-art {
        width: min(160px, 28vw);
        max-height: 60vh;
    }

    .login-content {
        grid-column: 2;
        grid-row: 1;
        max-width: 100%;
    }

    .brand {
        text-align: left;
        margin-bottom: 16px;
    }

    .brand-mark {
        margin-left: 0;
        margin-right: auto;
        width: 40px;
        height: 40px;
        margin-bottom: 12px;
    }

    .brand-name {
        font-size: clamp(20px, 4vw, 28px);
    }

    .login-form {
        padding: 18px;
    }

    .form-item {
        margin-bottom: 12px;
    }
}

/* 手机竖屏 */
@media (max-width: 576px) {
    .login-stage {
        padding-left: 16px;
        padding-right: 16px;
        gap: 16px;
    }

    .charger-art {
        width: min(180px, 52vw);
        max-height: 24vh;
    }

    .brand-name {
        font-size: 22px;
        letter-spacing: 0.04em;
    }

    .login-form {
        padding: 20px 16px 18px;
        border-radius: 14px;
    }

    .captcha-item {
        flex-wrap: wrap;
    }

    .captcha-item .form-control {
        flex: 1 1 100%;
    }

    .captcha-img {
        flex: 0 0 auto;
        width: 100%;
        height: auto;
    }

    .captcha-img .imgcode {
        width: 100%;
        max-width: 140px;
        height: 44px;
    }

    .btn-login {
        letter-spacing: 0.2em;
    }

    .login-footer {
        font-size: 11px;
        line-height: 1.4;
    }
}

/* 超小屏 */
@media (max-width: 360px) {
    .brand-name {
        font-size: 20px;
    }

    .charger-art {
        width: min(150px, 60vw);
    }
}
