@charset "utf-8";
@import url("/css/login/reset.css");
@import url("/css/login/system.css");

body {
    margin: 0;
    min-height: 100vh;
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;

    position: relative;

    /* 프로젝트별 뒷 배경 이미지 */
    &.cm {
        background-image: url(/img/login/background-cm.webp);
    }

    &.sanha {
        background-image: url(/img/login/background-sanha.jpg);
    }

    &::before {
        content: "";
        position: fixed;
        inset: 0;
        background: rgba(17, 17, 17, 0);
        pointer-events: none;
        z-index: 0;
    }

    &.dim::before {
        background: rgba(17, 17, 17, 0.60);
    }

    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 {
        /* display: none; */
        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;

            /* 프로젝트별 로고 이미지 */
            >i {
                &.tdc {
                    background: url(/img/login/logo-pm-tdc.svg) no-repeat center / contain;
                    width: 28.625rem;
                    height: 3.125rem;
                }
                &.cm {
                    background: url(/img/login/logo-pm-cm.svg) no-repeat center / contain;
                    width: 29.8125rem;
                    height: 3.125rem;
                }
                &.sanha {
                    background: url(/img/login/logo-pm-sanha.svg) no-repeat center / contain;
                    width: 29.8125rem;
                    height: 3.125rem;
                }
            }

            /* gsim, rail */
            >:nth-child(2), :nth-child(5) {
                color: #fff;
            }

            >:nth-child(3) {
                padding-top: 1rem;
                font-size: 0.875rem;
                color: #aaa;
            }

            >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;

                h5 {
                    color: var(--color-dahong);
                    text-align: left;
                    width: 100%;
                }

                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);
                        font-size: 0.875rem;
                        font-weight: 300;
                        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: 300;
                            line-height: 1.25rem;
                            letter-spacing: -0.0175rem;
                        }

                        &:hover {
                            background: rgba(255, 255, 255, 0.20);
                        }
                    }

                    label {
                        font-size: 0.875rem;
                        font-weight: 300;
                        line-height: 1.25rem;
                        letter-spacing: -0.0175rem;
                        width: 3rem;
                        color: #fff;
                    }

                    div {
                        border-radius: 1.5rem;
                        border: 0.0625rem solid rgba(255, 255, 255, 0.10);
                        background: rgba(255, 255, 255, 0.10);
                        padding: 0.5rem 1rem;
                        color: #fff;
                        display: flex;
                        align-items: center;
                        gap: 0.25rem;

                        h4 {
                            letter-spacing: 0.0625rem;
                            min-width: 2.375rem;
                        }

                        &:hover {
                            background: rgba(255, 255, 255, 0.18);
                        }

                        &:focus-within {
                            border: 0.0625rem solid rgba(255, 255, 255, 0.60);
                            background: rgba(255, 255, 255, 0.18);
                        }

                        >input[type="tel"] {
                            background: transparent;
                            height: 1.25rem;
                            width: 100%;

                            &:focus {
                                outline: none;
                            }

                            &::placeholder {
                                color: rgba(255, 255, 255, 0.20);
                                font-size: 0.875rem;
                                font-weight: 300;
                                line-height: 1.25rem;
                                letter-spacing: 0.0625rem;
                            }
                        }
                    }
                }

                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: 300;
                    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;
                    }
                }

                >:nth-last-child(1) {
                    color: #aaa;
                    text-decoration-line: underline;
                    cursor: pointer;

                    &:hover {
                        color: #fff;
                    }
                }
            }
        }

        >i {
            width: 22.625rem;
            height: 14rem;

            /* 프로젝트별 엠비언트 이미지 */
            &.cm {
                background: url(/img/login/ambient-cm.svg) no-repeat center / contain;
            }

            &.sanha {
                background: url(/img/login/ambient-sanha.svg) no-repeat center / contain;
            }

            /* &.bridge {
                background: url() no-repeat center / contain;
            } */
        }

        .tel-login {
            /* display: none; */
        }

        .id-login {
            display: none;
        }

        .select-account {
            /* display: none; */
        }

    }

    .introduce {
        width: 58.375rem;
        height: 29.1875rem;
        position: fixed;
        top: 50%;
        left: 20.125rem;
        transform: translateY(-50%);
    }

    .verify {
        display: none;
        background: rgba(17, 17, 17, 0.30);
        position: fixed;
        top: 50%;
        right: 20.125rem;
        transform: translateY(-50%);
        width: 19.5rem;
        height: 15rem;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 2rem;
        gap: 0.5rem;

        h4 {
            color: #fff;
        }

        h1 {
            color: #fff;
            font-size: 2rem;
            line-height: 2.5rem;
            letter-spacing: 0.0625rem;
        }

        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: 300;
            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;
            }
        }

        >:nth-last-child(1) {
            color: #aaa;
            text-decoration-line: underline;
            cursor: pointer;

            &:hover {
                color: #fff;
            }
        }
    }
}


.introduce {
    display: none;

    .slide-area {
        overflow: hidden;
        border: 0.0625rem solid #444;
        background-color: #111;
    }

    .slide-area>.carousel-slide {
        position: absolute;
        inset: 0;
        opacity: 0;
        transition: opacity 1s ease-in-out;
    }

    .slide-area>.carousel-slide.active {
        opacity: 1;
        z-index: 1;
    }

    .slide-area>.carousel-slide>img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
        border-radius: 1rem;
    }

    .slide-area>.carousel-dots {
        position: absolute;
        bottom: 1rem;
        left: 50%;
        transform: translateX(-50%);
        display: flex;
        gap: 0.5rem;
        z-index: 5;
        width: auto;
    }

    .carousel-dot {
        width: 0.5rem;
        height: 0.5rem;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.4);
        cursor: pointer;
        transition: all 0.3s ease;
    }

    .carousel-dot.active {
        background: #fff;
        transform: scale(1.2);
    }
}

@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 {
                    &.tdc {
                        width: calc(28.625rem / 2);
                    }

                    &.sanha {
                        width: calc(29.8125rem / 2);
                    }

                    &.cm {
                        width: calc(29.8125rem / 2);
                    }
                }

                h4,
                p {
                    display: none !important;
                }
            }
        }

        form {
            border-radius: 1rem !important;
        }

        .introduce {
            display: none !important;
        }

        .verify {
            right: 50%;
            transform: translate(50%, -50%);
        }
    }
}

/* error message ===== ===== ===== ===== ===== */
/* 진동 애니메이션 키프레임 */
@keyframes shake {
    0%, 100% { transform: translate3d(0, 0, 0); }
    20% { transform: translate3d(-2px, 0, 0); }
    40% { transform: translate3d(2px, 0, 0); }
    60% { transform: translate3d(-1px, 0, 0); }
    80% { transform: translate3d(1px, 0, 0); }
}

/* 애니메이션을 적용할 클래스 */
.shake-animation {
    animation: shake 0.4s ease-in-out;;
    transform: translate3d(0, 0, 0); /* 웹킷 브라우저 렌더링 최적화 */
    backface-visibility: hidden;
    perspective: 1000px;
}

.magiclink-error-box, .login-error-box {
    color: var(--color-dahong);
    font-size: 0.75rem;
    font-weight: 400;
    line-height: 1.25rem;
    letter-spacing: -0.0175rem;
    margin-bottom: 0.5rem;
}

/**************************************** auth-stack 화면 보정 */
/* 그쪽 login.js 가 쓰는 요소에만 건다. 위 디자인 규칙은 건드리지 않는다 */

.hidden { display: none !important; }

/* login.js 가 성공·실패에 따라 error 를 토글한다 */
#statusBox { color: #fff; }
#statusBox.error { color: var(--color-dahong); }

/* 안내문. 폼 마지막 자식이라 링크 모양이 붙는 것을 되돌린다 */
#hint {
    color: #aaa;
    font-size: 0.75rem;
    line-height: 1.25rem;
    letter-spacing: -0.0175rem;
    text-decoration: none;
    cursor: default;
}

/* 폼의 마지막 자식이라 링크 모양이 붙는다 */
#oidcButton {
    color: #fff;
    text-decoration: none;
}

/* 입력 전에는 submitButton 이 disabled 로 시작한다 */
#submitButton:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
#submitButton:disabled:hover {
    background: rgba(17, 17, 17, 0.20);
    scale: 1;
}
