.login-page {
    display: grid;
    place-items: center;
    min-height: 100svh;
    padding: 32px;
    background: #eef1f6;
}

.login-page ::selection {
    background: #ffd596;
    color: var(--navy);
}

.login-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr);
    grid-template-rows: auto 1fr;
    width: min(100%, 1112px);
    min-height: 584px;
    overflow: hidden;
    border-radius: 16px;
    background:
        radial-gradient(ellipse at 48% 100%, var(--navy-2), transparent 58%),
        var(--navy);
    box-shadow: 0 24px 64px -22px rgb(20 33 61 / .28);
}

.login-brand,
.login-story {
    padding-inline: clamp(36px, 5vw, 72px);
    color: var(--paper);
}

.login-brand {
    grid-area: 1 / 1;
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 36px;
    font-size: 16px;
    font-weight: 750;
    letter-spacing: .035em;
}

.login-brand img {
    flex: none;
}

.login-brand__name {
    margin-inline-start: 6px;
    color: #c5cfe0;
    font-size: 13px;
    font-weight: 550;
    letter-spacing: .02em;
}

.login-story {
    grid-area: 2 / 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-block: 36px 64px;
}

.login-story h2 {
    margin: 0;
    font-size: clamp(36px, 4.15vw, 59px);
    line-height: 1.14;
    letter-spacing: -.035em;
}

.login-story p {
    max-width: 27em;
    margin: 22px 0 0;
    color: #bcc9dd;
    font-size: 15px;
    line-height: 1.8;
}

.login-departments {
    position: relative;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: min(100%, 340px);
    margin-top: 56px;
}

.login-departments::before,
.login-departments span::before {
    position: absolute;
    background: #63718a;
    content: "";
}

.login-departments::before {
    inset: 0 calc(100% / 6) auto;
    height: 1px;
}

.login-departments span {
    position: relative;
    padding-top: 17px;
    color: #dbe3f0;
    font-size: 13px;
    text-align: center;
}

.login-departments span::before {
    top: -3px;
    left: 50%;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--orange);
    translate: -50% 0;
}

.login-card {
    grid-area: 1 / 2 / 3;
    display: grid;
    place-items: center;
    min-width: 0;
    padding: 44px clamp(32px, 5vw, 74px);
    background: var(--paper);
}

.login-card__inner {
    width: min(100%, 360px);
}

.login-card__head {
    margin-bottom: 30px;
}

.login-card h1 {
    margin: 0 0 8px;
    font-size: clamp(28px, 3vw, 36px);
    line-height: 1.2;
    letter-spacing: -.03em;
}

.login-card h1 span { display: block; }

.login-card__head p,
.login-help {
    margin: 0;
    color: var(--muted);
}

.login-card .notice {
    margin-bottom: 20px;
}

.login-card .form-stack {
    gap: 8px;
}

.login-card .form-stack label {
    font-size: 14px;
}

.login-card .form-stack input:not([type="hidden"]) {
    height: 50px;
    margin-bottom: 10px;
    border-color: #8c9ab0;
    border-radius: 8px;
    background: #f8f9fc;
    caret-color: var(--navy);
    font-size: 16px;
}

.login-card .form-stack input:focus {
    border-color: #3d60a1;
    background: var(--paper);
}

.login-card :is(input, button):focus-visible {
    outline: 2px solid #3d60a1;
}

.login-card .button--primary {
    min-height: 50px;
    margin-top: 4px;
    border-radius: 8px;
    background: var(--orange);
    color: var(--navy);
    font-size: 15px;
    box-shadow: none;
}

.login-card .button--primary:hover {
    background: #ffb65d;
}

.login-card .button--primary:active {
    transform: none;
    background: #e89a3c;
}

.login-help {
    margin-top: 24px;
    padding-top: 17px;
    border-top: 1px solid var(--line);
    font-size: 13px;
}

.login-motion-field {
    display: none;
}

@media (min-width: 761px) and (prefers-reduced-motion: no-preference) {
    .login-shell.has-login-motion {
        --login-motion-state: running;
        --login-cycle: 12s;
        --login-ease: cubic-bezier(.23, 1, .32, 1);
    }

    .has-login-motion:is([data-motion-paused], :has(.form-stack input:focus)) {
        --login-motion-state: paused;
    }

    .has-login-motion .login-motion-field {
        grid-area: 1 / 1 / 3 / 2;
        position: relative;
        display: block;
        overflow: hidden;
        pointer-events: none;
    }

    .login-motion-field::before,
    .login-motion-field::after {
        position: absolute;
        content: "";
    }

    .login-motion-field::before {
        inset: 38% -22% -46% 2%;
        background: radial-gradient(ellipse, rgb(103 161 232 / .26), transparent 65%);
        animation: login-light-drift var(--login-cycle) ease-in-out infinite;
    }

    .login-motion-field::after {
        right: -23%;
        bottom: -54%;
        width: min(94%, 510px);
        aspect-ratio: 1;
        border: 1px solid rgb(171 194 234 / .29);
        border-radius: 50%;
        box-shadow:
            0 0 0 24px rgb(171 194 234 / .07),
            0 0 0 52px rgb(171 194 234 / .045),
            0 0 0 84px rgb(171 194 234 / .025);
        animation: login-arc-swell var(--login-cycle) ease-in-out infinite;
    }

    .has-login-motion :is(.login-brand, .login-story) {
        position: relative;
    }

    .has-login-motion .login-departments::after {
        position: absolute;
        z-index: 1;
        top: -1px;
        left: calc(100% / 12);
        width: calc(100% / 6);
        height: 3px;
        border-radius: 2px;
        background: linear-gradient(90deg, transparent, #ffe0ae, transparent);
        content: "";
        animation: login-rail-trace var(--login-cycle) linear infinite;
    }

    .has-login-motion .login-departments span::after {
        position: absolute;
        top: -7px;
        left: calc(50% - 8px);
        width: 16px;
        height: 16px;
        border: 1px solid var(--orange);
        border-radius: 50%;
        content: "";
        animation: login-node-pulse var(--login-cycle) var(--login-ease) infinite backwards;
    }

    .has-login-motion .login-departments span:nth-child(2)::after { animation-delay: 4s; }
    .has-login-motion .login-departments span:nth-child(3)::after { animation-delay: 8s; }

    .has-login-motion .login-motion-field::before,
    .has-login-motion .login-motion-field::after,
    .has-login-motion .login-departments::after,
    .has-login-motion .login-departments span::after {
        animation-play-state: var(--login-motion-state);
    }

    .login-card .form-stack input:not([type="hidden"]) {
        transition: border-color 140ms ease, background-color 140ms ease;
    }
}

@keyframes login-light-drift {
    0%, 100% { transform: translate3d(10%, 7%, 0); opacity: .46; }
    50% { transform: translate3d(-19%, -16%, 0); opacity: 1; }
}

@keyframes login-arc-swell {
    0%, 100% { transform: translate3d(3%, 3%, 0) scale(.96); opacity: .48; }
    58% { transform: translate3d(-10%, -9%, 0) scale(1.12); opacity: .94; }
}

@keyframes login-rail-trace {
    0% { transform: translateX(0); opacity: 0; }
    5% { opacity: 1; }
    66.67% { transform: translateX(400%); opacity: 1; }
    76%, 100% { transform: translateX(400%); opacity: 0; }
}

@keyframes login-node-pulse {
    0% { transform: scale(.94); opacity: 0; }
    3% { opacity: .92; }
    17%, 100% { transform: scale(1.6); opacity: 0; }
}

@media (max-width: 760px) {
    .login-page {
        place-items: start center;
        padding: 24px 16px;
    }

    .login-shell {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        width: min(100%, 460px);
        min-height: 0;
    }

    .login-departments {
        display: none;
    }

    .login-brand,
    .login-card,
    .login-story {
        grid-area: auto;
        padding-inline: 24px;
    }

    .login-brand {
        padding-block: 16px;
    }

    .login-brand img {
        width: 34px;
        height: 34px;
    }

    .login-card {
        padding-block: 28px;
    }

    .login-card__head {
        margin-bottom: 23px;
    }

    .login-help {
        margin-top: 20px;
        padding-top: 15px;
    }

    .login-story {
        padding-block: 19px 22px;
    }

    .login-story h2 {
        font-size: 16px;
        letter-spacing: 0;
    }

    .login-story p {
        margin-top: 7px;
        font-size: 13px;
        line-height: 1.65;
    }
}
