/*
 * 居中玻璃卡片样式，参考 MIT 开源项目 GlassmorphismLoginPage
 * https://github.com/codetoanbug/GlassmorphismLoginPage
 */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #0b1220;
    color: #0f172a;
}

/* 未配置后台背景图时，用渐变兜底 */
body.login-plain {
    background:
        radial-gradient(1200px 600px at 12% 8%, #1d4ed8 0%, transparent 60%),
        radial-gradient(900px 520px at 88% 92%, #7c3aed 0%, transparent 55%),
        #0b1220;
}

.page {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 20px 88px;
    overflow: hidden;
}

.page::before,
.page::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.55;
    pointer-events: none;
}

.page::before {
    width: 420px;
    height: 420px;
    top: -120px;
    left: -120px;
    background: #2563eb;
}

.page::after {
    width: 460px;
    height: 460px;
    bottom: -140px;
    right: -140px;
    background: #7c3aed;
}

/* 有背景图时不叠色块 */
body:not(.login-plain) .page::before,
body:not(.login-plain) .page::after {
    display: none;
}

.form-box {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    padding: 44px 40px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.65);
    border-radius: 20px;
    box-shadow: 0 24px 60px rgba(2, 6, 23, 0.35);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    animation: login-in 0.5s ease-out both;
}

@keyframes login-in {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

.login-logo {
    width: 52px;
    height: 52px;
    margin: 0 auto 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    color: #fff;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.35);
}

.login-logo svg {
    width: 26px;
    height: 26px;
}

.form-box .header {
    text-align: center;
    margin-bottom: 30px;
}

.form-box .header h1 {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin: 0 0 8px;
}

.form-box .header p {
    color: #64748b;
    font-size: 14px;
    margin: 0;
}

.field {
    margin-bottom: 20px;
}

.field label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 6px;
    color: #334155;
}

.field input {
    width: 100%;
    height: 48px;
    padding: 0 16px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 10px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: rgba(255, 255, 255, 0.92);
    color: #0f172a;
}

.field input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

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

.field .input-wrap input {
    padding-right: 44px;
}

.toggle-pw {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    background: none;
    border: none;
    cursor: pointer;
    color: #94a3b8;
    transition: color 0.2s;
    padding: 4px;
}

.toggle-pw:hover {
    color: #0f172a;
}

.toggle-pw svg {
    width: 20px;
    height: 20px;
    pointer-events: none;
}

.validateImg {
    width: 100%;
    height: 48px;
    display: block;
    border-radius: 10px;
    cursor: pointer;
    object-fit: cover;
    background: #e2e8f0;
}

.row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.row .remember {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    cursor: pointer;
}

.row .remember input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #2563eb;
    cursor: pointer;
}

.row a {
    font-size: 14px;
    font-weight: 500;
    color: #2563eb;
    text-decoration: none;
}

.row a:hover {
    text-decoration: underline;
}

.login-btn {
    width: 100%;
    height: 48px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #2563eb, #4f46e5);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: filter 0.2s, box-shadow 0.2s, transform 0.1s;
}

.login-btn:hover {
    filter: brightness(1.06);
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.35);
}

.login-btn:active {
    transform: translateY(1px);
}

.footer {
    position: fixed;
    left: 0;
    bottom: 0;
    width: 100%;
    padding-bottom: 10px;
    text-align: center;
    line-height: 30px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.85);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

.footer a {
    color: inherit;
    text-decoration: none;
}

.padding-5 {
    padding: 5px !important;
}

@media (max-width: 480px) {
    .page {
        padding: 24px 16px 64px;
    }

    .form-box {
        padding: 32px 22px;
    }
}
