:root {
    --login-card: #313338;
    --login-field: #2B2D31;
    --login-field-border: #3F4147;
    --login-text: #F2F3F5;
    --login-muted: #B5BAC1;
    --login-subtle: #949BA4;
    --login-link: #A5B5FF;
    --login-brand: #5865F2;
    --login-brand-hover: #4752C4;
    --login-error-bg: #3B2024;
    --login-error-text: #FFB4B4;
    --login-ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* {
    box-sizing: border-box;
    font-family: "Noto Sans", sans-serif;
}

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

body {
    margin: 0;
    background:
        radial-gradient(circle at 83% 84%, rgba(0, 179, 255, 0.84) 0, rgba(0, 179, 255, 0) 24%),
        radial-gradient(circle at 64% 17%, rgba(57, 107, 255, 0.92) 0, rgba(57, 107, 255, 0) 33%),
        linear-gradient(113deg, #1C0051 0%, #210066 26%, #2230C8 67%, #168CF4 100%);
    color: var(--login-text);
    overflow: hidden;
}

a {
    color: var(--login-link);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

button,
input {
    font: inherit;
}

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

@keyframes brand-in {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes stars-drift {
    from {
        transform: translate3d(0, 0, 0);
    }
    to {
        transform: translate3d(38px, -24px, 0);
    }
}

@keyframes float-soft {
    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-12px) rotate(4deg);
    }
}

.login-bg,
.login-bg::before,
.login-bg::after {
    position: fixed;
    inset: 0;
    pointer-events: none;
}

.login-bg {
    overflow: hidden;
}

.login-bg::before {
    content: "";
    opacity: 0.82;
    background-image:
        radial-gradient(circle, rgba(255, 255, 255, 0.78) 0 2px, transparent 3px),
        radial-gradient(circle, rgba(123, 99, 255, 0.7) 0 3px, transparent 4px),
        radial-gradient(circle, rgba(255, 255, 255, 0.42) 0 1px, transparent 2px);
    background-size: 168px 148px, 272px 248px, 118px 104px;
    background-position: 22px 18px, 70px 82px, 18px 60px;
    filter: blur(0.2px);
    animation: stars-drift 18s linear infinite alternate;
}

.login-bg::after {
    content: "";
    background:
        radial-gradient(circle at 9% 43%, rgba(255, 255, 255, 0.22) 0, rgba(150, 126, 255, 0.24) 10%, rgba(150, 126, 255, 0.08) 16%, transparent 20%),
        radial-gradient(circle at 89% 42%, rgba(171, 192, 255, 0.28) 0, rgba(171, 192, 255, 0.12) 7%, transparent 13%);
    filter: blur(5px);
}

.orb,
.shape {
    position: absolute;
    display: block;
}

.orb-left {
    left: 4.5vw;
    top: 35vh;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background:
        radial-gradient(circle at 58% 52%, rgba(255, 255, 255, 0.23) 0 5px, transparent 7px),
        radial-gradient(circle at center, rgba(172, 141, 255, 0.62) 0, rgba(142, 110, 235, 0.36) 35%, rgba(142, 110, 235, 0.1) 55%, transparent 68%);
    filter: blur(2px);
    animation: float-soft 9s ease-in-out infinite;
}

.orb-top {
    left: 32vw;
    top: 15vh;
    width: 116px;
    height: 116px;
    border-radius: 44% 56% 50% 50%;
    background: radial-gradient(circle at 45% 55%, rgba(104, 60, 181, 0.6), rgba(145, 78, 226, 0.15) 48%, transparent 64%);
    filter: blur(5px);
    animation: float-soft 11s ease-in-out infinite reverse;
}

.orb-right {
    right: 6vw;
    top: 33vh;
    width: 158px;
    height: 142px;
    background: radial-gradient(circle at 42% 44%, rgba(122, 149, 255, 0.35), rgba(94, 122, 255, 0.13) 55%, transparent 70%);
    border-radius: 42% 58% 47% 53%;
    filter: blur(5px);
    transform: rotate(28deg);
    animation: float-soft 10s ease-in-out infinite;
}

.shape-star {
    left: 14.7vw;
    top: 62vh;
    width: 35px;
    height: 35px;
    background: #7B61FF;
    clip-path: polygon(50% 0, 62% 37%, 100% 50%, 62% 63%, 50% 100%, 38% 63%, 0 50%, 38% 37%);
    filter: blur(1px);
    opacity: 0.68;
    animation: float-soft 7s ease-in-out infinite;
}

.shape-plus {
    right: 5.2vw;
    top: 33vh;
    width: 43px;
    height: 43px;
    opacity: 0.42;
}

.shape-plus::before,
.shape-plus::after {
    content: "";
    position: absolute;
    inset: 18px 0 auto;
    height: 7px;
    border-radius: 999px;
    background: #A6BAFF;
}

.shape-plus::after {
    inset: 0 auto auto 18px;
    width: 7px;
    height: 43px;
}

.shape-square {
    left: 38.8vw;
    bottom: 19.2vh;
    width: 15px;
    height: 15px;
    border-radius: 3px;
    background: rgba(141, 121, 255, 0.74);
    box-shadow:
        155px -88px 0 rgba(141, 121, 255, 0.52),
        595px -26px 0 rgba(141, 121, 255, 0.45),
        878px 42px 0 rgba(141, 121, 255, 0.38);
}

.login-brand {
    position: fixed;
    top: 49px;
    left: 48px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #FFFFFF;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.01em;
    animation: brand-in 0.5s var(--login-ease) both;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    color: #FFFFFF;
}

.login-wrap {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 88px 24px 32px;
}

.login-card {
    display: grid;
    grid-template-columns: minmax(0, 416px) 240px;
    gap: 48px;
    width: min(784px, 100%);
    min-height: 412px;
    border-radius: 8px;
    background: var(--login-card);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    padding: 32px;
    animation: login-card-in 0.48s var(--login-ease) both;
}

.login-form {
    min-width: 0;
}

.login-copy {
    text-align: center;
    margin-bottom: 22px;
}

.login-copy h1 {
    margin: 0 0 8px;
    color: var(--login-text);
    font-size: 24px;
    line-height: 1.25;
    font-weight: 700;
}

.login-copy p {
    margin: 0;
    color: var(--login-muted);
    font-size: 16px;
    line-height: 1.25;
}

.login-error {
    margin: 0 0 14px;
    border-radius: 6px;
    background: var(--login-error-bg);
    color: var(--login-error-text);
    padding: 10px 12px;
    font-size: 13px;
    line-height: 1.4;
}

.login-notice {
    margin: 0 0 14px;
    border: 1px solid rgba(88, 101, 242, 0.3);
    border-radius: 6px;
    background: rgba(88, 101, 242, 0.14);
    color: #D6DDFF;
    padding: 10px 12px;
    font-size: 13px;
    line-height: 1.4;
}

.field-label {
    display: block;
    margin-bottom: 8px;
    color: var(--login-text);
    font-size: 12px;
    line-height: 1.33;
    font-weight: 700;
}

.field-label span {
    color: #F38BA8;
}

.field-input {
    display: block;
    width: 100%;
    height: 44px;
    margin-bottom: 20px;
    border: 1px solid var(--login-field-border);
    border-radius: 8px;
    outline: none;
    background: var(--login-field);
    color: var(--login-text);
    padding: 10px;
    font-size: 16px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.field-input:focus {
    border-color: #5865F2;
    box-shadow: 0 0 0 3px rgba(88, 101, 242, 0.16);
    transform: translateY(-1px);
}

.helper-link {
    display: inline-block;
    margin-top: -12px;
    margin-bottom: 20px;
    color: var(--login-link);
    font-size: 14px;
}

.login-button {
    width: 100%;
    height: 40px;
    border: none;
    border-radius: 6px;
    background: var(--login-brand);
    color: #FFFFFF;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.login-button:hover {
    background: var(--login-brand-hover);
    box-shadow: 0 9px 24px rgba(88, 101, 242, 0.28);
    transform: translateY(-1px);
}

.login-button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.login-footnote {
    margin: 12px 0 0;
    color: var(--login-subtle);
    font-size: 13px;
}

.qr-panel {
    display: flex;
    align-items: center;
    flex-direction: column;
    padding-top: 14px;
    text-align: center;
}

.qr-box {
    position: relative;
    display: block;
    width: 176px;
    height: 176px;
    border-radius: 4px;
    background: #FFFFFF;
    padding: 0;
    overflow: hidden;
    transition: transform 0.22s var(--login-ease), box-shadow 0.22s ease;
}

.qr-box img {
    display: block;
    width: 176px;
    height: 176px;
}

.qr-box:hover {
    text-decoration: none;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
    transform: translateY(-3px) scale(1.015);
}

.qr-badge {
    position: absolute;
    left: 50%;
    top: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 5px solid #FFFFFF;
    border-radius: 50%;
    background: #313338;
    color: #FFFFFF;
    font-size: 19px;
    font-weight: 800;
    transform: translate(-50%, -50%);
    transition: transform 0.2s var(--login-ease), background-color 0.2s ease;
}

.qr-box:hover .qr-badge {
    background-color: #5865F2;
    transform: translate(-50%, -50%) scale(1.06);
}

.qr-panel h2 {
    margin: 34px 0 10px;
    color: var(--login-text);
    font-size: 23px;
    line-height: 1.08;
    font-weight: 700;
}

.qr-panel p {
    max-width: 220px;
    margin: 0;
    color: var(--login-muted);
    font-size: 16px;
    line-height: 1.25;
}

.qr-link {
    margin-top: 12px;
    font-size: 14px;
}

@media (max-width: 740px) {
    html,
    body {
        min-height: 100%;
        overflow-y: auto;
    }

    body {
        display: flex;
        flex-direction: column;
    }

    .login-brand {
        position: relative;
        top: auto;
        left: auto;
        justify-content: center;
        width: 100%;
        padding: 22px 20px 0;
        font-size: 20px;
        line-height: 1.15;
    }

    .login-wrap {
        align-items: flex-start;
        min-height: auto;
        padding: 18px 20px 28px;
    }

    .login-card {
        grid-template-columns: 1fr;
        gap: 24px;
        width: min(100%, 390px);
        min-height: 0;
        padding: 26px;
    }

    .qr-panel {
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        padding-top: 26px;
    }
}

@media (max-width: 430px) {
    .login-brand {
        padding-top: 18px;
        font-size: 19px;
    }

    .brand-mark svg {
        width: 25px;
        height: auto;
    }

    .login-wrap {
        padding: 14px 16px 24px;
    }

    .login-card {
        padding: 24px 20px;
    }

    .login-copy {
        text-align: left;
    }

    .login-copy h1 {
        font-size: 23px;
    }

    .qr-box,
    .qr-box img {
        width: 160px;
        height: 160px;
    }

    .qr-panel h2 {
        margin-top: 28px;
        font-size: 22px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
