* {
    box-sizing: border-box;
}

:root {
    --gold: #e3c372;
    --gold-deep: #d5b15d;
    --gold-shadow: rgba(219, 183, 99, 0.38);
    --white: #ffffff;
    --white-soft: rgba(255, 255, 255, 0.86);
    --white-faint: rgba(255, 255, 255, 0.72);
    --button-blue: #194f85;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    overflow: hidden;
    font-family: "Inter", "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
    color: var(--white);
    background: #315f90;
}

.login-screen {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 32px;
    isolation: isolate;
    background: url("/static/images/login-bg.png") center center / cover no-repeat;
}

.login-screen::before {
    content: none;
}

.login-scene {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: -2;
}

.login-grid {
    display: none;
}

.login-glow {
    display: none;
}

.login-center {
    position: relative;
    z-index: 1;
    width: min(1140px, 100%);
    display: grid;
    justify-items: center;
    gap: 92px;
    transform: translateY(-50px);
}

.hero-copy {
    display: inline-grid;
    justify-items: start;
    text-align: left;
    justify-self: center;
    animation: rise-in 1.56s cubic-bezier(0.21, 1, 0.25, 1) both;
}

.login-title,
.login-kicker,
.login-subtitle {
    opacity: 0;
    transform: translateY(32px);
    animation: text-float-up 1s cubic-bezier(0.21, 1, 0.25, 1) forwards;
}

.login-title {
    margin: 0;
    display: flex;
    flex-wrap: nowrap;
    align-items: baseline;
    justify-content: flex-start;
    column-gap: 22px;
    row-gap: 10px;
    font-size: clamp(38px, 4.7vw, 78px);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.06;
    animation-delay: 0.08s;
}

.title-main {
    display: inline-flex;
    align-items: baseline;
    flex-wrap: nowrap;
    justify-content: flex-start;
    font-family: "Inter", Arial, sans-serif;
    white-space: nowrap;
}

.brand-light {
    color: var(--white);
}

.brand-gold {
    color: var(--gold);
    text-shadow: 0 3px 18px rgba(227, 195, 114, 0.08);
}

.brand-space {
    width: 0.34em;
}

.title-side {
    display: inline-block;
    color: var(--white);
    font-size: clamp(22px, 1.95vw, 42px);
    letter-spacing: 0.04em;
    font-weight: 700;
    white-space: nowrap;
}

.login-kicker {
    margin: 20px 0 0;
    color: var(--white);
    font-size: clamp(16px, 1.25vw, 26px);
    letter-spacing: 0.38em;
    font-weight: 700;
    animation-delay: 0.35s;
}

.login-subtitle {
    margin: 16px 0 0;
    color: var(--white-faint);
    font-size: clamp(14px, 0.98vw, 21px);
    letter-spacing: 0.05em;
    font-weight: 400;
    animation-delay: 0.6s;
    font-family: "Inter", Arial, sans-serif;
}

.login-button {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 280px;
    min-height: 96px;
    padding: 0 54px;
    border-radius: 8px;
    border: 1px solid rgba(255, 238, 194, 0.75);
    background: linear-gradient(180deg, #ead089 0%, var(--gold) 55%, var(--gold-deep) 100%);
    color: var(--button-blue);
    font-size: clamp(20px, 1.5vw, 30px);
    font-weight: 800;
    text-decoration: none;
    letter-spacing: 0.06em;
    box-shadow:
        0 16px 38px rgba(10, 27, 45, 0.2),
        0 0 0 0 rgba(227, 195, 114, 0.42);
    opacity: 0;
    transform: translateY(28px) scale(0.98);
    animation:
        button-in 1.18s cubic-bezier(0.21, 1, 0.25, 1) 0.9s forwards,
        button-pulse 2.5s ease-in-out 2s infinite;
    overflow: hidden;
    transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

.login-button::before {
    content: "";
    position: absolute;
    inset: -2px auto -2px -34%;
    width: 28%;
    transform: skewX(-24deg);
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.08) 18%, rgba(255, 255, 255, 0.52) 52%, rgba(255, 255, 255, 0.08) 82%, transparent 100%);
    mix-blend-mode: screen;
}

.login-button::after {
    content: "";
    position: absolute;
    inset: 10px;
    border-radius: 6px;
    border: 1px solid rgba(255, 247, 214, 0.3);
    pointer-events: none;
}

.login-button:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow:
        0 24px 48px rgba(10, 27, 45, 0.28),
        0 0 0 10px rgba(227, 195, 114, 0.12);
    filter: saturate(1.06) brightness(1.03);
}

.login-button:active {
    transform: translateY(-1px) scale(0.995);
}

.login-button:focus-visible {
    outline: 3px solid rgba(255, 244, 208, 0.88);
    outline-offset: 5px;
}

@keyframes rise-in {
    from {
        transform: translateY(24px);
    }

    to {
        transform: translateY(0);
    }
}

@keyframes text-float-up {
    from {
        opacity: 0;
        transform: translateY(38px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes button-in {
    from {
        opacity: 0;
        transform: translateY(34px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes button-pulse {
    0%,
    100% {
        box-shadow:
            0 16px 38px rgba(10, 27, 45, 0.2),
            0 0 0 0 rgba(227, 195, 114, 0.28);
    }

    50% {
        box-shadow:
            0 22px 52px rgba(10, 27, 45, 0.28),
            0 0 0 14px rgba(227, 195, 114, 0.08);
    }
}

@keyframes button-shimmer-sweep {
    from {
        left: -34%;
    }

    to {
        left: 124%;
    }
}

.login-button::before {
    animation: button-shimmer-sweep 3.2s ease-in-out 2s infinite;
}

@media (max-width: 980px) {
    .login-center {
        gap: 62px;
        transform: translateY(-34px);
    }

    .login-title {
        flex-wrap: wrap;
        row-gap: 6px;
    }

    .hero-copy {
        justify-items: center;
        text-align: center;
    }

    .login-title,
    .title-main {
        justify-content: center;
    }

    .title-main {
        flex-wrap: wrap;
        white-space: normal;
    }

    .title-side {
        width: 100%;
    }

    .login-kicker {
        letter-spacing: 0.46em;
    }
}

@media (max-width: 640px) {
    body {
        overflow: auto;
    }

    .login-screen {
        padding: 24px 18px 40px;
    }

    .login-grid {
        left: -18%;
        right: -18%;
        top: 32%;
        bottom: -26%;
        background-size: 34px 34px, 34px 34px, 34px 34px;
    }

    .login-center {
        gap: 42px;
        transform: translateY(-20px);
    }

    .login-title {
        font-size: clamp(30px, 9vw, 44px);
    }

    .title-side {
        font-size: clamp(20px, 5.4vw, 26px);
    }

    .login-kicker {
        margin-top: 16px;
        font-size: 15px;
        letter-spacing: 0.12em;
        line-height: 1.8;
    }

    .login-subtitle {
        font-size: 13px;
        line-height: 1.7;
    }

    .login-button {
        min-width: min(280px, 100%);
        min-height: 76px;
        padding: 0 32px;
        font-size: 22px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hero-copy,
    .login-title,
    .login-kicker,
    .login-subtitle,
    .login-button,
    .login-button::before {
        animation: none !important;
        opacity: 1;
        transform: none;
    }
}
