:root {
    --ink: #172338;
    --muted: #748096;
    --line: #dde3e9;
    --paper: #f7f5ef;
    --white: #fff;
    --accent: #ec744f;
    --accent-dark: #ce5735;
    --blue: #294f72;
    --ease: cubic-bezier(.22, 1, .36, 1);
}

* {
    box-sizing: border-box;
}

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

body {
    margin: 0;
    color: var(--ink);
    background: #111b29;
    font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
    -webkit-font-smoothing: antialiased;
}

button,
input {
    font: inherit;
}

button {
    color: inherit;
}

.login-shell {
    display: grid;
    grid-template-columns: minmax(420px, 1.14fr) minmax(480px, .86fr);
    min-height: 100vh;
    overflow: hidden;
}

.brand-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 100vh;
    padding: clamp(42px, 6vw, 88px);
    color: var(--white);
    background: #15283d url("../images/login-bg.jpg") center / cover no-repeat;
    isolation: isolate;
}

.brand-panel::before,
.brand-panel::after {
    content: "";
    position: absolute;
    z-index: -1;
    pointer-events: none;
}

.brand-panel::before {
    inset: 0;
    background: linear-gradient(115deg, rgba(8, 19, 33, .88) 0%, rgba(12, 30, 48, .55) 50%, rgba(10, 19, 31, .18) 100%);
}

.brand-panel::after {
    width: 330px;
    height: 330px;
    right: -110px;
    bottom: -150px;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 50%;
    box-shadow: 0 0 0 70px rgba(255, 255, 255, .04), 0 0 0 140px rgba(255, 255, 255, .025);
}

.brand-panel__shade {
    position: absolute;
    inset: 0;
    z-index: -1;
    background: radial-gradient(circle at 70% 36%, rgba(236, 116, 79, .22), transparent 27%);
}

.brand-panel__content {
    max-width: 680px;
    margin: auto 0;
    animation: reveal .9s var(--ease) both;
}

.eyebrow,
.edition,
.modal__tag {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 11px;
    letter-spacing: .24em;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    color: #ffb297;
}

.eyebrow::before {
    width: 42px;
    height: 1px;
    content: "";
    background: currentColor;
}

.brand-panel h1 {
    margin: 32px 0 24px;
    font-family: Georgia, "Songti SC", serif;
    font-size: clamp(44px, 5.3vw, 78px);
    font-weight: 400;
    line-height: 1.12;
    letter-spacing: -.04em;
}

.brand-panel__content p {
    max-width: 430px;
    margin: 0;
    color: rgba(255, 255, 255, .7);
    font-size: 15px;
    line-height: 1.9;
    letter-spacing: .08em;
}

.brand-panel__footer {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255, 255, 255, .66);
    font-size: 12px;
    letter-spacing: .12em;
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #76d9a3;
    box-shadow: 0 0 0 5px rgba(118, 217, 163, .12);
}

.account-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: 40px clamp(38px, 5vw, 78px) 26px;
    background: var(--paper);
}

.account-panel::before {
    position: absolute;
    top: 0;
    right: 0;
    width: 170px;
    height: 170px;
    content: "";
    opacity: .55;
    background-image: radial-gradient(#b9c0c8 1px, transparent 1px);
    background-size: 15px 15px;
    mask-image: linear-gradient(135deg, #000, transparent 72%);
}

.account-panel__top,
.account-panel__footer {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 13px;
    max-width: 70%;
    color: inherit;
    text-decoration: none;
}

.brand__logo-wrap {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    overflow: hidden;
    border-radius: 12px;
    background: var(--white);
    box-shadow: 0 8px 26px rgba(25, 39, 57, .09);
}

.brand__logo-wrap img {
    display: block;
    width: 84%;
    height: 84%;
    object-fit: contain;
}

.brand__name {
    overflow: hidden;
    font-family: Georgia, "Songti SC", serif;
    font-size: 17px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.edition {
    color: #9aa2ae;
}

.form-stage {
    display: grid;
    width: 100%;
    max-width: 510px;
    margin: auto;
}

.form-view {
    grid-area: 1 / 1;
    visibility: hidden;
    opacity: 0;
    transform: translateX(24px);
    transition: opacity .35s ease, transform .5s var(--ease), visibility .35s;
    pointer-events: none;
}

.form-view.is-active {
    visibility: visible;
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

.form-header {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 37px;
}

.form-index {
    margin-top: 7px;
    color: var(--accent);
    font-family: Georgia, serif;
    font-size: 13px;
    font-style: italic;
}

.form-header h2 {
    margin: 0 0 8px;
    font-family: Georgia, "Songti SC", serif;
    font-size: clamp(34px, 3.2vw, 46px);
    font-weight: 400;
    line-height: 1.15;
    letter-spacing: -.04em;
}

.form-header p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    letter-spacing: .08em;
}

.field {
    display: block;
    margin-bottom: 22px;
}

.field__label {
    display: block;
    margin: 0 0 9px 2px;
    color: #4d5a6c;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .12em;
}

.field__control {
    position: relative;
    display: flex;
    align-items: center;
}

.field__control > svg {
    position: absolute;
    left: 17px;
    width: 19px;
    fill: none;
    stroke: #8a95a5;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.7;
    pointer-events: none;
}

.field__control > svg + input {
    padding-left: 50px;
}

.field input {
    width: 100%;
    height: 56px;
    padding: 0 18px;
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: 3px;
    outline: none;
    background: rgba(255, 255, 255, .65);
    transition: border-color .2s, box-shadow .2s, background .2s;
}

.field input::placeholder {
    color: #a7afbb;
}

.field input:focus {
    border-color: var(--blue);
    background: var(--white);
    box-shadow: 0 0 0 4px rgba(41, 79, 114, .08);
}

.login-options {
    display: grid;
    gap: 12px;
    margin: -4px 0 14px;
}

.check-option,
.session-options label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #596678;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
}

.check-option input,
.session-options input {
    width: 15px;
    height: 15px;
    accent-color: var(--accent-dark);
}

.session-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.session-options label {
    min-height: 32px;
    padding: 0 11px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, .58);
}

.password-toggle {
    position: absolute;
    right: 12px;
    padding: 8px;
    color: #788496;
    border: 0;
    background: transparent;
    cursor: pointer;
    font-size: 12px;
}

.field input[type="password"] {
    padding-right: 58px;
}

.primary-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    width: 100%;
    height: 58px;
    margin-top: 8px;
    color: var(--white);
    border: 0;
    border-radius: 3px;
    background: var(--ink);
    box-shadow: 0 13px 30px rgba(23, 35, 56, .2);
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .12em;
    transition: background .2s, transform .2s, box-shadow .2s;
}

.primary-button:hover {
    background: var(--accent-dark);
    box-shadow: 0 15px 32px rgba(206, 87, 53, .24);
    transform: translateY(-2px);
}

.primary-button svg,
.back-button svg {
    width: 19px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.form-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-top: 29px;
}

.text-button,
.back-button {
    border: 0;
    background: transparent;
    cursor: pointer;
}

.form-actions--end {
    justify-content: flex-end;
}

.text-button,
.back-button {
    padding: 6px 0;
    color: var(--accent-dark);
    font-size: 12px;
    font-weight: 700;
}

.text-button:hover,
.back-button:hover {
    text-decoration: underline;
    text-underline-offset: 4px;
}

.field-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.back-button {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 20px;
}

.account-panel__footer {
    color: #9aa2ae;
    font-size: 10px;
    letter-spacing: .08em;
}

.toast {
    position: fixed;
    top: 24px;
    left: 50%;
    z-index: 1000;
    max-width: min(420px, calc(100vw - 32px));
    padding: 13px 20px;
    color: var(--white);
    border-radius: 4px;
    opacity: 0;
    background: var(--ink);
    box-shadow: 0 12px 35px rgba(0, 0, 0, .24);
    transform: translate(-50%, -16px);
    transition: .28s ease;
    pointer-events: none;
    font-size: 13px;
}

.toast.is-show {
    opacity: 1;
    transform: translate(-50%, 0);
}

.toast.is-error {
    background: #a53f32;
}

.toast.is-success {
    background: #277451;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 900;
    display: grid;
    visibility: hidden;
    place-items: center;
    opacity: 0;
    transition: .25s ease;
}

.modal.is-open {
    visibility: visible;
    opacity: 1;
}

.modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(7, 14, 23, .72);
    backdrop-filter: blur(5px);
}

.modal__card {
    position: relative;
    z-index: 1;
    width: min(430px, calc(100vw - 32px));
    padding: 38px;
    border-radius: 5px;
    background: var(--paper);
    box-shadow: 0 25px 70px rgba(0, 0, 0, .3);
    transform: translateY(14px) scale(.98);
    transition: .35s var(--ease);
}

.modal.is-open .modal__card {
    transform: none;
}

.modal__close {
    position: absolute;
    top: 13px;
    right: 16px;
    padding: 5px;
    color: #8d96a2;
    border: 0;
    background: transparent;
    cursor: pointer;
    font-size: 27px;
    line-height: 1;
}

.modal__tag {
    color: var(--accent-dark);
}

.modal h3 {
    margin: 12px 0 8px;
    font-family: Georgia, "Songti SC", serif;
    font-size: 28px;
    font-weight: 400;
}

.modal p {
    margin: 0 0 24px;
    color: var(--muted);
    font-size: 13px;
}

.loading {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1100;
    display: flex;
    visibility: hidden;
    align-items: center;
    gap: 11px;
    padding: 12px 17px;
    color: var(--white);
    border-radius: 4px;
    opacity: 0;
    background: rgba(23, 35, 56, .92);
    transform: translateY(10px);
    transition: .2s ease;
    font-size: 12px;
}

.loading.is-show {
    visibility: visible;
    opacity: 1;
    transform: none;
}

.loading__ring {
    width: 17px;
    height: 17px;
    border: 2px solid rgba(255, 255, 255, .3);
    border-top-color: var(--white);
    border-radius: 50%;
    animation: spin .7s linear infinite;
}

@keyframes reveal {
    from { opacity: 0; transform: translateY(28px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 980px) {
    .login-shell {
        grid-template-columns: minmax(300px, .75fr) minmax(450px, 1.25fr);
    }

    .brand-panel {
        padding: 44px 35px;
    }

    .brand-panel h1 {
        font-size: 45px;
    }
}

@media (max-width: 760px) {
    .login-shell {
        display: block;
        min-height: 100svh;
        background: var(--paper);
    }

    .brand-panel {
        min-height: 250px;
        padding: 35px 26px;
        background-position: 62% 42%;
    }

    .brand-panel__content {
        margin: auto 0 0;
    }

    .brand-panel h1 {
        margin: 18px 0 0;
        font-size: 37px;
    }

    .brand-panel__content p,
    .brand-panel__footer {
        display: none;
    }

    .account-panel {
        min-height: calc(100svh - 250px);
        padding: 28px 24px 22px;
    }

    .edition {
        display: none;
    }

    .form-stage {
        margin: 55px auto;
    }

    .account-panel__footer {
        margin-top: auto;
    }
}

@media (max-width: 480px) {
    .brand-panel {
        min-height: 220px;
    }

    .account-panel {
        min-height: calc(100svh - 220px);
    }

    .form-stage {
        margin: 45px auto;
    }

    .form-header {
        margin-bottom: 30px;
    }

    .form-header h2 {
        font-size: 35px;
    }

    .field-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .form-actions {
        align-items: flex-start;
        flex-direction: column;
    }

    .session-options {
        gap: 7px;
    }

    .session-options label {
        flex: 1 1 calc(50% - 7px);
        justify-content: center;
    }

    .account-panel__footer span:last-child {
        display: none;
    }
}

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