@font-face {
    font-family: "Source Han Sans Local";
    src: url("../fonts/SourceHanSans.ttf") format("truetype");
    font-display: swap;
}

:root {
    color-scheme: light;
    --login-ink: #183248;
    --login-muted: #637687;
    --login-paper: #f7f6f0;
    --login-line: rgba(35, 73, 94, 0.16);
    --login-accent: #176b73;
    --login-accent-dark: #0d5057;
    --login-gold: #c9984b;
}

* {
    box-sizing: border-box;
}

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

body.login-page {
    min-height: 100dvh;
    color: var(--login-ink);
    background: #dce6e2;
    font-family: "Source Han Sans Local", "Microsoft YaHei", sans-serif;
    text-rendering: optimizeLegibility;
}

button,
input {
    font: inherit;
}

.login-shell {
    min-height: 100dvh;
    display: grid;
    grid-template-columns: minmax(420px, 1.08fr) minmax(440px, 0.92fr);
}

.login-story {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: clamp(34px, 5vw, 76px);
    color: #f8fbfa;
    background:
        linear-gradient(145deg, rgba(7, 54, 61, 0.96), rgba(15, 93, 94, 0.9)),
        #0e5d62;
}

.login-story::before,
.login-story::after {
    content: "";
    position: absolute;
    z-index: -1;
    border-radius: 50%;
    pointer-events: none;
}

.login-story::before {
    width: min(52vw, 720px);
    aspect-ratio: 1;
    right: -24%;
    top: -22%;
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow:
        0 0 0 42px rgba(255, 255, 255, 0.035),
        0 0 0 112px rgba(255, 255, 255, 0.025);
}

.login-story::after {
    width: 360px;
    height: 360px;
    left: -170px;
    bottom: -180px;
    background: rgba(217, 174, 99, 0.18);
    filter: blur(3px);
}

.login-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    width: fit-content;
    color: rgba(255, 255, 255, 0.94);
    font-size: 1rem;
    font-weight: 750;
    letter-spacing: 0.08em;
}

.login-brand__mark {
    width: 42px;
    height: 42px;
    display: inline-grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.1);
}

.login-story__content {
    max-width: 680px;
    margin: auto 0;
    padding: 72px 0;
}

.login-eyebrow {
    margin: 0 0 18px;
    color: #f3d49d;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.22em;
}

.login-story h1 {
    margin: 0;
    font-family: "Source Han Sans Local", "Microsoft YaHei", sans-serif;
    font-size: clamp(2.6rem, 5.1vw, 5.6rem);
    font-weight: 850;
    line-height: 1.12;
    letter-spacing: -0.045em;
}

.login-story__lead {
    max-width: 34rem;
    margin: 28px 0 0;
    color: rgba(244, 251, 249, 0.78);
    font-size: clamp(1rem, 1.35vw, 1.18rem);
    line-height: 1.9;
}

.login-story__features {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 24px;
    margin-top: 36px;
    color: rgba(255, 255, 255, 0.84);
    font-size: 0.92rem;
}

.login-story__features span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.login-story__features i {
    color: #f0c981;
}

.login-story__note {
    margin: 0;
    color: rgba(255, 255, 255, 0.58);
    font-size: 0.8rem;
    letter-spacing: 0.12em;
}

.login-panel {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: clamp(28px, 5vw, 74px);
    background:
        radial-gradient(circle at 88% 8%, rgba(23, 107, 115, 0.12), transparent 28%),
        linear-gradient(180deg, #fbfaf5, var(--login-paper));
}

.login-card {
    width: min(100%, 460px);
    padding: clamp(28px, 4vw, 48px);
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 28px 80px rgba(31, 61, 73, 0.13);
}

.login-card__kicker {
    display: block;
    margin-bottom: 8px;
    color: var(--login-accent);
    font-size: 0.8rem;
    font-weight: 850;
    letter-spacing: 0.14em;
}

.login-card__heading h2 {
    margin: 0;
    font-size: clamp(1.9rem, 3vw, 2.5rem);
    line-height: 1.25;
    letter-spacing: -0.035em;
}

.login-card__heading p {
    margin: 12px 0 0;
    color: var(--login-muted);
    line-height: 1.7;
}

.login-messages {
    display: grid;
    gap: 8px;
    margin-top: 22px;
}

.login-message {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 11px 13px;
    border: 1px solid rgba(14, 116, 144, 0.18);
    border-radius: 12px;
    color: #155e75;
    background: #ecfeff;
    font-size: 0.88rem;
    line-height: 1.55;
}

.login-message--danger,
.login-message--error {
    color: #9f1239;
    border-color: rgba(190, 24, 93, 0.2);
    background: #fff1f2;
}

.login-message--success {
    color: #166534;
    border-color: rgba(22, 101, 52, 0.18);
    background: #f0fdf4;
}

.login-form {
    display: grid;
    gap: 20px;
    margin-top: 30px;
}

.login-field {
    display: grid;
    gap: 8px;
}

.login-field label {
    color: #29485a;
    font-size: 0.88rem;
    font-weight: 800;
}

.login-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.login-input-wrap > i {
    position: absolute;
    left: 16px;
    color: #78909c;
    pointer-events: none;
}

.login-input-wrap input {
    width: 100%;
    min-height: 52px;
    padding: 12px 16px 12px 46px;
    border: 1px solid var(--login-line);
    border-radius: 14px;
    outline: none;
    color: var(--login-ink);
    background: rgba(249, 251, 250, 0.92);
    transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.login-input-wrap--password input {
    padding-right: 76px;
}

.login-input-wrap input:focus {
    border-color: rgba(23, 107, 115, 0.72);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(23, 107, 115, 0.12);
}

.login-password-toggle {
    position: absolute;
    right: 8px;
    min-width: 58px;
    min-height: 38px;
    border: 0;
    border-radius: 10px;
    color: var(--login-accent);
    background: transparent;
    cursor: pointer;
    font-size: 0.84rem;
    font-weight: 800;
}

.login-password-toggle:hover,
.login-password-toggle:focus-visible {
    background: rgba(23, 107, 115, 0.09);
    outline: none;
}

.login-submit {
    min-height: 54px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 4px;
    border: 0;
    border-radius: 14px;
    color: #fff;
    background: var(--login-accent);
    box-shadow: 0 14px 30px rgba(23, 107, 115, 0.24);
    cursor: pointer;
    font-weight: 850;
    transition: transform 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.login-submit:hover {
    background: var(--login-accent-dark);
    box-shadow: 0 18px 34px rgba(13, 80, 87, 0.26);
    transform: translateY(-1px);
}

.login-submit:focus-visible {
    outline: 3px solid rgba(201, 152, 75, 0.42);
    outline-offset: 3px;
}

.login-submit:disabled {
    cursor: wait;
    opacity: 0.72;
    transform: none;
}

.login-register {
    margin: 24px 0 0;
    color: var(--login-muted);
    text-align: center;
    font-size: 0.9rem;
}

.login-register a {
    color: var(--login-accent-dark);
    font-weight: 850;
    text-underline-offset: 3px;
}

.login-copyright {
    margin: 24px 0 0;
    color: #829099;
    font-size: 0.75rem;
}

@media (max-width: 900px) {
    .login-shell {
        grid-template-columns: 1fr;
    }

    .login-story {
        min-height: 280px;
        padding: 30px clamp(22px, 7vw, 54px);
    }

    .login-story__content {
        padding: 48px 0 28px;
    }

    .login-story h1 {
        font-size: clamp(2.2rem, 9vw, 3.8rem);
    }

    .login-story__features,
    .login-story__note {
        display: none;
    }

    .login-panel {
        padding: 24px 18px calc(28px + env(safe-area-inset-bottom));
    }
}

@media (max-width: 520px) {
    .login-story {
        min-height: 220px;
    }

    .login-story__content {
        padding: 30px 0 10px;
    }

    .login-story__lead {
        display: none;
    }

    .login-card {
        padding: 26px 20px;
        border-radius: 22px;
    }

    .login-input-wrap input {
        min-height: 54px;
        font-size: 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
