@charset "utf-8";
@import url("/css/login/reset.css");
@import url("/css/login/system.css");

/* PM_ver5 의 login.css 에서 아이디 · 비밀번호 폼만 남겼다.
   휴대폰 인증 · 소개 슬라이드 · 로그인 유지 · 바론 단추 규칙은 뺐다 (docs/기능/로그인.md 2-6).
   배경 · 로고 · 엠비언트는 PM_ver5 가 배포처별로 theme.css 를 만들어 주던 값이다. 여기는 배포처가 하나라 cm 값을 고정한다 */
:root {
    --login-background: url(/img/login/background-cm.png);
    --login-logo: url(/img/login/logo-pm-statistics.svg);
    --login-logo-width: 20.5rem;
    --login-ambient: url(/img/login/ambient-cm.svg);
}

body {
    margin: 0;
    min-height: 100vh;
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    position: relative;
    background-image: var(--login-background);

    article {
        border-radius: 1rem;
        border: 0.0625rem solid rgba(255, 255, 255, 0.10);
        background: rgba(17, 17, 17, 0.10);
        box-shadow: 0 1rem 2rem 0 rgba(0, 0, 0, 0.20);
        backdrop-filter: blur(1rem);
        display: flex;
        align-items: center;
    }

    .login {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 79.875rem;
        height: 15rem;

        >:nth-child(1) {
            padding-left: 3rem;
            flex-grow: 1;
            gap: 0.25rem;
        }

        >section {
            display: flex;
            flex-direction: column;

            /* 로고 — PM:STATISTICS */
            >i {
                background: var(--login-logo) no-repeat center left / contain;
                width: var(--login-logo-width);
                height: 3.125rem;
            }

            >:nth-child(2) {
                color: #fff;
            }

            >:nth-child(3) {
                padding-top: 1rem;
                font-size: 0.875rem;
                color: #ddd;
            }

            >form {
                display: flex;
                flex-direction: column;
                align-items: center;
                justify-content: center;
                padding: 0 2rem;
                background: rgba(17, 17, 17, 0.20);
                box-shadow: 0 10px 20px 0 rgba(0, 0, 0, 0.20);
                backdrop-filter: blur(1rem);
                height: 15rem;
                border-radius: 0 1rem 1rem 0;
                gap: 0.5rem;
                width: 19.5rem;

                div {
                    display: flex;
                    align-items: center;

                    >input[type="text"],
                    >input[type="password"] {
                        border-radius: 1.5rem;
                        border: 0.0625rem solid rgba(255, 255, 255, 0.10);
                        background: rgba(255, 255, 255, 0.10);
                        color: #fff;
                        font-size: 0.875rem;
                        font-weight: 400;
                        line-height: 1.25rem;
                        letter-spacing: 0.0625rem;
                        padding: 0.375rem 1rem;
                        width: 80%;
                        white-space: nowrap;
                        overflow: hidden;
                        text-overflow: ellipsis;

                        &:focus {
                            outline: 0.0625rem solid rgba(255, 255, 255, 0.60);
                            background: rgba(255, 255, 255, 0.20);
                        }

                        &::placeholder {
                            color: rgba(255, 255, 255, 0.20);
                            font-size: 0.875rem;
                            font-weight: 400;
                            line-height: 1.25rem;
                            letter-spacing: -0.0175rem;
                        }

                        &:hover {
                            background: rgba(255, 255, 255, 0.20);
                        }
                    }

                    label {
                        font-size: 0.875rem;
                        font-weight: 400;
                        line-height: 1.25rem;
                        letter-spacing: -0.0175rem;
                        width: 3rem;
                        color: #fff;
                    }
                }

                button {
                    border-radius: 1.5rem;
                    border: 0.0625rem solid rgba(255, 255, 255, 0.10);
                    background: rgba(17, 17, 17, 0.20);
                    box-shadow: 0 10px 20px 0 rgba(0, 0, 0, 0.20);
                    backdrop-filter: blur(1rem);
                    font-size: 0.875rem;
                    font-weight: 400;
                    line-height: 1.25rem;
                    letter-spacing: -0.0175rem;
                    color: #fff;
                    padding: 0.5rem 1rem;
                    width: 100%;
                    cursor: pointer;
                    transition: all 0.125s;
                    margin-top: 0.25rem;

                    &:hover {
                        background: rgba(17, 17, 17, 0.40);
                        scale: 1.025;
                    }

                    &:active {
                        background: rgba(255, 255, 255, 0.20);
                        scale: 1;
                    }

                    /* 요청을 보내는 동안 login.js 가 끈다 */
                    &:disabled {
                        opacity: 0.4;
                        cursor: not-allowed;
                        scale: 1;
                    }
                }
            }
        }

        /* 엠비언트 이미지 */
        >i {
            width: 22.625rem;
            height: 14rem;
            background: var(--login-ambient) no-repeat center / contain;
        }
    }
}

@media screen and (max-width: 960px) {
    body {
        .login {
            height: fit-content;
        }

        >.login {
            flex-direction: column;
            width: fit-content;

            >i {
                display: none;
            }

            >:first-child {
                padding: 0.5rem;

                >i {
                    width: calc(var(--login-logo-width) / 2);
                }

                h4,
                p {
                    display: none !important;
                }
            }
        }

        form {
            border-radius: 1rem !important;
        }
    }
}

.hidden { display: none !important; }

/* 실패 문구 */
.login-error-box {
    color: var(--color-dahong);
    font-size: 0.75rem;
    font-weight: 400;
    line-height: 1.25rem;
    letter-spacing: -0.0175rem;
    text-align: left;
    width: 100%;
}

/* 브라우저 자동완성의 파란 바탕을 없앤다. 브라우저 규칙이 !important 여서 색을 덮을 수 없어, 바탕을 글자 모양으로 잘라 보이지 않게 한다.
   바탕이 잘리므로 칸의 유리 모양은 inset box-shadow 로 같은 색을 그린다. 글자도 브라우저가 검게 바꾸므로 흰색으로 되돌린다 (PM_ver5 와 같다) */
.login input:autofill {
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: #fff;
    caret-color: #fff;
}

.login input:is([type="text"], [type="password"]):autofill {
    box-shadow: inset 0 0 0 100vmax rgba(255, 255, 255, 0.10);
}

.login input:is([type="text"], [type="password"]):autofill:is(:hover, :focus) {
    box-shadow: inset 0 0 0 100vmax rgba(255, 255, 255, 0.20);
}
