@import url("../modules/auth-error-modal.css");
@import url("../modules/auth-nav.css");
@import url("../modules/spaced-password-input.css");
@import url("../modules/spaced-email-input.css");

body.login-body {
    --bg-card: var(--bg-elevated, rgba(10, 14, 22, 0.88));
    /* 滚轮展开页脚时，主区与卡片同步上移（与 .site-footer transition 时长/缓动一致） */
    --login-footer-sync-lift: clamp(96px, 18vh, 200px);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
}

body.login-body .site-main {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    padding-top: 0;
}

.login-page-main {
    position: relative;
    flex: 1;
    width: 100%;
    min-height: calc(100vh - var(--header-h));
    min-height: calc(100dvh - var(--header-h));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: calc(var(--header-h) + clamp(12px, 2.5vw, 20px)) 16px clamp(32px, 6vw, 56px);
    overflow: hidden;
    transform: translateY(0);
    transition: transform 0.38s var(--ease-out, cubic-bezier(0.16, 1, 0.3, 1));
}

body.login-body.login-footer-visible .login-page-main {
    transform: translateY(calc(-1 * var(--login-footer-sync-lift)));
}

/* 与 404 页一致：光晕限制在主区域内（absolute），不再用全屏 fixed */
.login-page-main .bg-glow {
    position: absolute;
    top: -180px;
    left: 50%;
    transform: translateX(-50%);
    width: min(1400px, 200%);
    height: 900px;
    pointer-events: none;
    background:
        radial-gradient(circle at 30% 30%, rgba(52, 227, 244, 0.1), transparent 32%),
        radial-gradient(circle at 70% 28%, rgba(30, 107, 255, 0.12), transparent 34%);
    filter: blur(60px);
    z-index: 0;
}

.login-card {
    position: relative;
    z-index: 2;
    width: min(100%, 92vw);
    max-width: 1100px;
    min-height: 560px;
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    border-radius: 28px;
    border: 1px solid var(--line-accent);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02)),
        var(--bg-card);
    box-shadow:
        0 24px 56px rgba(0, 0, 0, 0.45),
        0 0 40px rgba(37, 184, 255, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    overflow: hidden;
    animation: not-found-in 0.75s var(--ease-out, cubic-bezier(0.16, 1, 0.3, 1)) forwards;
}

@media (max-width: 700px) {
    .login-card {
        grid-template-columns: 1fr;
        max-width: 440px;
        min-height: 0;
    }
}

.img-section {
    background:
        radial-gradient(circle at 70% 40%, rgba(52, 227, 244, 0.15), transparent 50%),
        radial-gradient(circle at 30% 60%, rgba(30, 107, 255, 0.12), transparent 50%),
        linear-gradient(180deg, rgba(5, 7, 11, 0.4), rgba(5, 7, 11, 0.9)),
        url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 600'><defs><pattern id='grid' width='40' height='40' patternUnits='userSpaceOnUse'><path d='M 40 0 L 0 0 0 40' fill='none' stroke='rgba(52,227,244,0.06)' stroke-width='0.5'/></pattern></defs><rect width='400' height='600' fill='url(%23grid)'/><circle cx='320' cy='180' r='80' fill='none' stroke='rgba(52,227,244,0.1)' stroke-width='1'/><circle cx='320' cy='180' r='120' fill='none' stroke='rgba(52,227,244,0.05)' stroke-width='1'/><circle cx='100' cy='420' r='60' fill='none' stroke='rgba(30,107,255,0.1)' stroke-width='1'/></svg>");
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: flex-end;
    padding: 2rem;
    min-height: 0;
}

@media (max-width: 700px) {
    .img-section {
        display: none;
    }
}

.img-section {
    position: relative;
    overflow: hidden;
}
.img-section__bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 40% bottom;
    z-index: 0;
    height: 120%;
}
.login-form-section {
    padding: 2.5rem 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 0;
    overflow-y: auto;
    box-sizing: border-box;
}

@media (max-width: 700px) {
    .login-form-section {
        padding: 2rem 1.5rem;
    }
}

.login-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.login-logo {
    font-family: "Ranchers", cursive;
    font-size: 1.5rem;
    color: var(--text-1);
    text-decoration: none;
    display: inline-block;
    margin-bottom: 0.5rem;
}

.login-logo:hover {
    color: var(--brand-aqua);
}

.login-quote {
    font-size: 0.85rem;
    color: var(--text-3);
    font-style: italic;
    letter-spacing: 0.02em;
    margin: 0;
}

.login-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-1);
    margin: 0.25rem 0 0;
}

.oauth-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 1rem;
}

.oauth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-2);
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.oauth-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.18);
    color: var(--text-1);
}

.oauth-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.oauth-icon-fa {
    font-size: 18px;
    line-height: 1;
    flex-shrink: 0;
}

.divider-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 1rem 0;
}

.divider-line {
    flex: 1;
    height: 1px;
    background: var(--line);
    border: none;
    margin: 0;
}

.divider-text {
    font-size: 0.7rem;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    flex-shrink: 0;
}

.form-group {
    margin-bottom: 0.85rem;
}

.form-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-2);
    margin-bottom: 0.3rem;
    letter-spacing: 0.02em;
}

.form-field {
    width: 100%;
    padding: 11px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-1);
    font-family: var(--font-sans);
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.form-field::placeholder {
    color: var(--text-3);
}

.form-field:focus {
    border-color: rgba(52, 227, 244, 0.4);
    box-shadow: 0 0 0 3px rgba(52, 227, 244, 0.08);
}

.password-wrap {
    position: relative;
}

.password-wrap .form-field {
    padding-right: 42px;
}

.password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-3);
    cursor: pointer;
    font-size: 0.95rem;
    padding: 4px;
    transition: color 0.2s;
}

.password-toggle:hover {
    color: var(--text-1);
}

.form-extra {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    font-size: 0.75rem;
}

.remember-row {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    color: var(--text-3);
}

.remember-row input {
    accent-color: var(--brand-aqua);
    width: 14px;
    height: 14px;
}

.forgot-link {
    color: var(--brand-aqua);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.75rem;
}

.forgot-link:hover {
    text-decoration: underline;
}

.submit-btn {
    width: 100%;
    padding: 12px;
    border-radius: 12px;
    border: none;
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    color: #03121a;
    background: linear-gradient(135deg, #e8fdff 0%, #bff8ff 14%, var(--brand-aqua) 36%, var(--brand-sky) 62%, var(--brand-blue) 100%);
    box-shadow: 0 10px 22px rgba(30, 107, 255, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.35);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.submit-btn:hover:not(:disabled) {
    box-shadow: 0 14px 28px rgba(30, 107, 255, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.submit-btn:active:not(:disabled) {
    transform: scale(0.98);
}

.submit-btn:disabled {
    opacity: 0.75;
    cursor: not-allowed;
}

.form-footer {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.75rem;
    color: var(--text-3);
}

.form-footer a {
    color: var(--brand-aqua);
    text-decoration: none;
    font-weight: 500;
}

.form-footer a:hover {
    text-decoration: underline;
}

.form-footer-divider {
    margin: 0 6px;
    color: var(--text-3);
    opacity: 0.4;
}

/* 登录页：页脚默认在视口下沿外；滚轮向下显示、向上隐藏（见页内 initLoginFooterWheel） */
body.login-body .site-footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    transform: translateY(100%);
    visibility: hidden;
    pointer-events: none;
    transition:
        transform 0.38s var(--ease-out, cubic-bezier(0.16, 1, 0.3, 1)),
        visibility 0.38s;
}

body.login-body.login-footer-visible .site-footer {
    transform: translateY(0);
    visibility: visible;
    pointer-events: auto;
}

@media (prefers-reduced-motion: reduce) {
    body.login-body .site-footer {
        transition-duration: 0.01ms;
    }

    body.login-body .login-page-main {
        transition-duration: 0.01ms;
    }

    .login-card {
        animation: none;
    }
}

.tatol-message {
    display: none;
}
