:root {
    color-scheme: light;
    --page: #eef0e9;
    --paper: #fdfdf9;
    --ink: #202c25;
    --muted: #6f7b73;
    --line: #e0e4dc;
    --field: #f6f7f2;
    --pine: #24382e;
    --pine-light: #30493b;
    --brass: #a4814f;
    --danger: #8e4038;
}

* {
    box-sizing: border-box;
}

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

body {
    font: 14px/1.55 "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;
    color: var(--ink);
    background: var(--page);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

button,
input {
    font: inherit;
}

.login-page {
    position: relative;
    isolation: isolate;
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    place-items: center;
    padding: 32px 20px;
    overflow: hidden;
    background:
        radial-gradient(760px 540px at 10% -12%, rgba(164, 129, 79, .13), transparent 64%),
        radial-gradient(820px 640px at 106% 112%, rgba(49, 82, 64, .13), transparent 62%),
        linear-gradient(145deg, #f1f2ec 0%, #eceee7 48%, #eef1ea 100%);
}

.login-page::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(36, 56, 46, .035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(36, 56, 46, .035) 1px, transparent 1px);
    background-size: 48px 48px;
    -webkit-mask-image: radial-gradient(ellipse 76% 66% at 50% 46%, #000 10%, transparent 76%);
    mask-image: radial-gradient(ellipse 76% 66% at 50% 46%, #000 10%, transparent 76%);
}

.login-page::after {
    content: "";
    position: fixed;
    z-index: -1;
    width: 520px;
    height: 520px;
    left: -280px;
    bottom: -300px;
    pointer-events: none;
    border: 1px solid rgba(36, 56, 46, .08);
    border-radius: 50%;
    box-shadow:
        0 0 0 72px rgba(255, 255, 255, .11),
        0 0 0 144px rgba(36, 56, 46, .022);
}

.login-card {
    position: relative;
    width: min(404px, 100%);
    padding: 42px 40px 38px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .82);
    border-radius: 24px;
    background: linear-gradient(165deg, rgba(255, 255, 252, .97), rgba(251, 251, 246, .93));
    box-shadow:
        0 40px 90px -42px rgba(23, 38, 30, .42),
        0 12px 28px -22px rgba(23, 38, 30, .24),
        inset 0 1px 0 rgba(255, 255, 255, .95);
    backdrop-filter: blur(18px);
    animation: card-in .6s cubic-bezier(.22, .8, .3, 1) both;
}

.login-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 3px;
    background: linear-gradient(90deg, transparent 4%, rgba(164, 129, 79, .72) 35%, rgba(83, 112, 94, .55) 68%, transparent 96%);
    opacity: .72;
}

.login-mark {
    width: 46px;
    height: 46px;
    margin: 0 auto 20px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    color: #f3edda;
    background: linear-gradient(150deg, #2c4838, #1e3027);
    box-shadow:
        0 12px 26px -14px rgba(30, 48, 39, .72),
        inset 0 1px 0 rgba(255, 255, 255, .12);
}

.login-mark svg {
    width: 23px;
    height: 23px;
    display: block;
}

.login-card h1 {
    margin: 0;
    text-align: center;
    font-family: "Iowan Old Style", "Palatino Linotype", "Songti SC", "STSong", "SimSun", serif;
    font-size: 28px;
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: .16em;
    text-indent: .16em;
    color: #24332b;
}

.login-form {
    display: grid;
    gap: 18px;
    margin-top: 32px;
}

.login-field > span {
    display: block;
    margin: 0 0 7px 2px;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: .08em;
    color: var(--muted);
}

.field-box {
    position: relative;
}

.field-icon {
    position: absolute;
    top: 50%;
    left: 15px;
    width: 18px;
    height: 18px;
    color: #8b978f;
    pointer-events: none;
    transform: translateY(-50%);
    transition: color .18s ease;
}

.field-box input {
    width: 100%;
    height: 50px;
    padding: 0 44px;
    border: 1px solid var(--line);
    border-radius: 12px;
    outline: none;
    color: var(--ink);
    background: var(--field);
    caret-color: var(--pine);
    transition:
        border-color .18s ease,
        box-shadow .18s ease,
        background-color .18s ease;
}

.field-box input::placeholder {
    color: #a4aea7;
}

.field-box:hover input {
    border-color: #cfd6cd;
}

.field-box:focus-within input {
    border-color: #7d9787;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(54, 85, 67, .09);
}

.field-box:focus-within .field-icon {
    color: var(--pine);
}

.field-box input:-webkit-autofill,
.field-box input:-webkit-autofill:hover,
.field-box input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--ink);
    -webkit-box-shadow: 0 0 0 100px #f6f7f2 inset;
    transition: background-color 9999s ease-out;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 8px;
    width: 34px;
    height: 34px;
    padding: 0;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 8px;
    color: #8b978f;
    background: transparent;
    cursor: pointer;
    transform: translateY(-50%);
    transition: color .18s ease, background-color .18s ease;
}

.password-toggle:hover {
    color: var(--pine);
    background: rgba(36, 56, 46, .06);
}

.password-toggle:focus-visible {
    outline: 2px solid #789180;
    outline-offset: 1px;
}

.password-toggle svg {
    width: 18px;
    height: 18px;
    display: block;
}

.password-toggle .eye-off,
.password-toggle.is-visible .eye-on {
    display: none;
}

.password-toggle.is-visible .eye-off {
    display: block;
}

.login-alert {
    display: flex;
    gap: 9px;
    align-items: flex-start;
    margin-top: 24px;
    padding: 10px 12px;
    border: 1px solid #ecd4cf;
    border-radius: 11px;
    color: var(--danger);
    background: #fcf4f2;
    font-size: 13px;
    line-height: 1.5;
}

.login-alert svg {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    margin-top: 2px;
}

.login-alert + .login-form {
    margin-top: 18px;
}

.login-submit {
    position: relative;
    width: 100%;
    height: 50px;
    margin-top: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    border-radius: 12px;
    color: #f8f5ea;
    background: var(--pine);
    box-shadow: 0 14px 26px -16px rgba(32, 54, 42, .85);
    cursor: pointer;
    letter-spacing: .14em;
    text-indent: .14em;
    transition:
        background-color .18s ease,
        box-shadow .18s ease,
        transform .18s ease;
}

.login-submit:hover {
    background: var(--pine-light);
    box-shadow: 0 17px 30px -16px rgba(32, 54, 42, .9);
    transform: translateY(-1px);
}

.login-submit:active {
    transform: translateY(0);
    box-shadow: 0 8px 18px -14px rgba(32, 54, 42, .8);
}

.login-submit:focus-visible {
    outline: 2px solid #506f5c;
    outline-offset: 3px;
}

.login-submit svg {
    width: 16px;
    height: 16px;
    margin-left: -1px;
    transition: transform .18s ease;
}

.login-submit:hover svg {
    transform: translateX(2px);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

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

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

    .login-card {
        padding: 34px 24px 30px;
        border-radius: 20px;
    }

    .login-card h1 {
        font-size: 26px;
    }

    .login-form {
        margin-top: 28px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .login-card {
        animation: none;
    }

    .login-submit,
    .login-submit svg,
    .field-box input,
    .password-toggle {
        transition: none;
    }
}
