:root {
    --pi-black: #080808;
    --pi-carbon: #151515;
    --pi-graphite: #262626;
    --pi-silver: #a7a9ac;
    --pi-paper: #f3f1ed;
    --pi-white: #ffffff;
    --pi-red: #d5001c;
    --pi-red-dark: #a90016;
}

.loginPage {
    min-width: 0;
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    background: var(--pi-black);
    color: var(--pi-black);
    font-family: 'Pretendard', 'Noto Sans KR', Arial, sans-serif;
    letter-spacing: 0;
}

.loginPage * {
    box-sizing: border-box;
}

.loginPage button,
.loginPage input {
    font: inherit;
}

.loginShell {
    display: grid;
    grid-template-columns: minmax(0, 1.12fr) minmax(430px, .88fr);
    min-height: 100vh;
}

.loginVisual {
    --scene-rotate-x: 0deg;
    --scene-rotate-y: 0deg;
    --scene-shift-x: 0px;
    --scene-shift-y: 0px;
    position: relative;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: clamp(34px, 4vw, 68px);
    overflow: hidden;
    background:
        radial-gradient(circle at 78% 24%, rgba(213, 0, 28, .16), transparent 0 22%, transparent 42%),
        linear-gradient(135deg, #090909 0%, #151515 52%, #080808 100%);
    color: var(--pi-white);
    perspective: 1200px;
    perspective-origin: 58% 42%;
}

.visualDepthScene {
    position: absolute;
    inset: -10%;
    z-index: 0;
    overflow: hidden;
    transform:
        translate3d(var(--scene-shift-x), var(--scene-shift-y), 0)
        rotateX(var(--scene-rotate-x))
        rotateY(var(--scene-rotate-y));
    transform-style: preserve-3d;
    transform-origin: 58% 42%;
    transition: transform .18s cubic-bezier(.22, 1, .36, 1);
    will-change: transform;
    pointer-events: none;
}

.visualDepthDrift {
    position: absolute;
    inset: 0;
    transform-style: preserve-3d;
    animation: visualDepthFloat 9s ease-in-out infinite alternate;
    will-change: transform;
}

.visualDepthRing {
    position: absolute;
    top: -17%;
    right: -33%;
    width: min(76vw, 1020px);
    aspect-ratio: 1;
    border-radius: 50%;
    transform-style: preserve-3d;
}

.depthRingOuter {
    border: 1px solid rgba(255, 255, 255, .055);
    box-shadow: 0 0 0 86px rgba(255, 255, 255, .012);
    transform: translateZ(-180px) scale(1.12);
    animation: depthRingOuterMove 11s ease-in-out infinite alternate;
}

.depthRingMiddle {
    border: 1px solid rgba(255, 255, 255, .075);
    box-shadow: 0 0 0 62px rgba(255, 255, 255, .015);
    transform: translate3d(-4%, 3%, -80px) scale(.96);
    animation: depthRingMiddleMove 8.5s ease-in-out infinite alternate-reverse;
}

.depthRingInner {
    border: 1px solid rgba(255, 255, 255, .115);
    box-shadow:
        inset 0 0 80px rgba(255, 255, 255, .012),
        0 0 0 44px rgba(213, 0, 28, .008);
    transform: translate3d(-9%, 8%, 35px) scale(.79);
    animation: depthRingInnerMove 6.8s ease-in-out infinite alternate;
}

.visualDepthLine {
    position: absolute;
    right: 3%;
    bottom: 15%;
    width: 64%;
    height: 1px;
    background: rgba(255, 255, 255, .075);
    transform-origin: center;
}

.depthLineUpper {
    transform: translate3d(-4%, -92px, -110px) rotate(-28deg);
    animation: depthLineUpperMove 9.5s ease-in-out infinite alternate;
}

.depthLineAccent {
    overflow: visible;
    background: rgba(213, 0, 28, .7);
    box-shadow: 0 0 24px rgba(213, 0, 28, .08);
    transform: translate3d(-10%, 0, 42px) rotate(-28deg);
    animation: visualAccentPulse 3.8s ease-in-out infinite;
}

.depthLineAccent::after {
    content: "";
    position: absolute;
    top: -2px;
    left: -9%;
    width: 46px;
    height: 5px;
    border-radius: 50%;
    background: #ff1836;
    box-shadow:
        0 0 10px rgba(255, 24, 54, .75),
        0 0 26px rgba(213, 0, 28, .42);
    opacity: .88;
    animation: visualSignalRun 4.2s cubic-bezier(.4, 0, .2, 1) infinite;
}

.depthLineLower {
    transform: translate3d(1%, 94px, -24px) rotate(-28deg);
    animation: depthLineLowerMove 7.5s ease-in-out infinite alternate-reverse;
}

@keyframes visualDepthFloat {
    0% {
        transform: translate3d(-2.4%, -1.4%, 0) rotateZ(-.8deg);
    }
    100% {
        transform: translate3d(3.2%, 2.3%, 0) rotateZ(1.1deg);
    }
}

@keyframes depthRingOuterMove {
    0% {
        transform: translate3d(-2%, -1%, -180px) scale(1.1);
    }
    100% {
        transform: translate3d(4%, 3%, -180px) scale(1.16);
    }
}

@keyframes depthRingMiddleMove {
    0% {
        transform: translate3d(-8%, 0, -80px) scale(.93);
    }
    100% {
        transform: translate3d(1%, 7%, -80px) scale(1);
    }
}

@keyframes depthRingInnerMove {
    0% {
        transform: translate3d(-13%, 4%, 35px) scale(.76);
    }
    100% {
        transform: translate3d(-4%, 12%, 35px) scale(.84);
    }
}

@keyframes depthLineUpperMove {
    0% {
        transform: translate3d(-9%, -110px, -110px) rotate(-28deg);
    }
    100% {
        transform: translate3d(4%, -72px, -110px) rotate(-26.5deg);
    }
}

@keyframes depthLineLowerMove {
    0% {
        transform: translate3d(-5%, 76px, -24px) rotate(-29deg);
    }
    100% {
        transform: translate3d(7%, 112px, -24px) rotate(-27deg);
    }
}

@keyframes visualAccentPulse {
    0%,
    100% {
        opacity: .42;
    }
    50% {
        opacity: .9;
    }
}

@keyframes visualSignalRun {
    0% {
        left: -9%;
        opacity: 0;
    }
    12% {
        opacity: .9;
    }
    82% {
        opacity: .9;
    }
    100% {
        left: 102%;
        opacity: 0;
    }
}

.loginVisualHeader,
.loginVisualFooter {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.loginVisualHeader {
    position: relative;
    z-index: 1;
    justify-content: flex-start;
    gap: 16px;
}

.brandMonogram {
    position: relative;
    display: block;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    overflow: hidden;
}

.brandMonogram img {
    position: absolute;
    top: -4px;
    left: -8px;
    display: block;
    width: 60px;
    max-width: none;
    height: auto;
}

.loginBrand {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.loginBrand strong {
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: .34em;
}

.loginBrand span {
    color: var(--pi-silver);
    font-size: 9px;
    font-weight: 500;
    line-height: 1;
    letter-spacing: .52em;
}

.loginVisualCopy {
    position: relative;
    z-index: 1;
    width: min(670px, 88%);
    margin: auto 0;
    padding: 10vh 0 8vh;
}

.visualEyebrow,
.loginEyebrow {
    margin: 0;
    color: var(--pi-red);
    font-family: Arial, sans-serif;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: .32em;
}

.loginVisualCopy h1 {
    margin: 22px 0 28px;
    color: var(--pi-white);
    font-family: Arial, sans-serif;
    font-size: clamp(62px, 6.6vw, 108px);
    font-weight: 400;
    line-height: .96;
    letter-spacing: -.035em;
}

.visualDescription {
    max-width: 480px;
    margin: 0;
    padding-left: 19px;
    border-left: 2px solid var(--pi-red);
    color: #bbbcbf;
    font-size: clamp(13px, 1.1vw, 16px);
    font-weight: 400;
    line-height: 1.75;
    letter-spacing: -.01em;
}

.loginVisualFooter {
    position: relative;
    z-index: 1;
    padding-top: 22px;
    border-top: 1px solid rgba(255, 255, 255, .11);
    color: #808184;
    font-family: Arial, sans-serif;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: .22em;
}

.systemStatus {
    display: inline-flex;
    align-items: center;
    gap: 9px;
}

.systemStatus i {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #5ecf7b;
    box-shadow: 0 0 0 4px rgba(94, 207, 123, .1);
}

.loginCard {
    position: relative;
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: clamp(32px, 5vw, 80px);
    background:
        linear-gradient(rgba(8, 8, 8, .026) 1px, transparent 1px),
        linear-gradient(90deg, rgba(8, 8, 8, .026) 1px, transparent 1px),
        var(--pi-paper);
    background-size: 40px 40px;
}

.loginCard::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 3px;
    background: var(--pi-red);
}

.loginPanelInner {
    width: min(100%, 440px);
}

.mobileBrand {
    display: none;
}

.loginPanelHeader {
    margin-bottom: 38px;
}

.loginPanelHeader h2 {
    margin: 12px 0 10px;
    color: var(--pi-black);
    font-size: clamp(30px, 3vw, 42px);
    font-weight: 650;
    line-height: 1.14;
    letter-spacing: -.05em;
}

.loginPanelHeader > p:last-child {
    margin: 0;
    color: #686868;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.6;
}

.loginForm {
    width: 100%;
}

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

.inputWrap {
    position: relative;
}

.inputMeta {
    position: absolute;
    top: 14px;
    right: 0;
    color: #8d8d8d;
    font-family: Arial, sans-serif;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .2em;
    pointer-events: none;
}

.loginPage .loginForm input[type="email"],
.loginPage .loginForm input[type="text"] {
    float: none;
    width: 100%;
    height: 58px;
    margin: 0;
    padding: 15px 68px 8px 0;
    border: 0;
    border-bottom: 1px solid #a7a5a1;
    border-radius: 0;
    outline: 0;
    background: transparent;
    color: var(--pi-black);
    font-size: 16px;
    font-weight: 500;
    line-height: 34px;
    text-indent: 0;
    letter-spacing: -.01em;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.loginPage .loginForm input::placeholder {
    color: #9c9a96;
    font-weight: 400;
}

.loginPage .loginForm input:focus {
    border-color: var(--pi-red);
    box-shadow: 0 1px 0 var(--pi-red);
}

.loginPage .loginForm input[readonly] {
    color: #777571;
}

.otpPanel {
    display: grid;
    grid-template-rows: 0fr;
    margin-top: 0;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-9px);
    transition:
        grid-template-rows .72s cubic-bezier(.16, 1, .3, 1),
        margin-top .64s cubic-bezier(.16, 1, .3, 1),
        opacity .34s cubic-bezier(.16, 1, .3, 1) .06s,
        transform .72s cubic-bezier(.16, 1, .3, 1),
        visibility 0s linear .72s;
}

.otpPanelInner {
    min-height: 0;
    overflow: hidden;
    transform-origin: top center;
}

.otpPanel.isVisible {
    grid-template-rows: 1fr;
    margin-top: 18px;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
    transition-delay: 0s;
}

.otpPanel.isVisible .otpPanelInner {
    animation: otpContentSettle .72s cubic-bezier(.16, 1, .3, 1) both;
}

@keyframes otpContentSettle {
    0% {
        opacity: 0;
        transform: translateY(-13px) scaleY(.97);
    }
    68% {
        opacity: 1;
        transform: translateY(1.5px) scaleY(1);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scaleY(1);
    }
}

.otpPanel[hidden] {
    display: none;
}

.buttonText {
    display: block;
    width: max-content;
    margin: 10px 0 0 auto;
    padding: 4px 0;
    border: 0;
    background: transparent;
    color: #676767;
    font-size: 11px;
    font-weight: 600;
    text-decoration: none;
    letter-spacing: .02em;
}

.buttonText:hover,
.buttonText:focus-visible {
    color: var(--pi-red);
}

.loginMessage {
    min-height: 22px;
    margin: 13px 0 0;
    color: #696969;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.55;
}

.loginMessage:empty {
    visibility: hidden;
}

.loginMessage.isInfo {
    color: #415f7a;
}

.loginMessage.isWarning,
.loginMessage.isError {
    color: var(--pi-red-dark);
}

.loginOptions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 42px;
    margin-top: 9px;
}

.saveId {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: #444;
    font-size: 12px;
    font-weight: 500;
    line-height: 18px;
}

.saveId input[type="checkbox"] {
    appearance: none;
    width: 16px;
    height: 16px;
    margin: 0;
    border: 1px solid #8e8c88;
    border-radius: 0;
    background: transparent;
}

.saveId input[type="checkbox"]:checked {
    border-color: var(--pi-red);
    background: var(--pi-red);
    box-shadow: inset 0 0 0 3px var(--pi-paper);
}

.saveId input[type="checkbox"]:focus-visible {
    outline: 2px solid rgba(213, 0, 28, .22);
    outline-offset: 3px;
}

.secureAccess {
    color: #85827d;
    font-family: Arial, sans-serif;
    font-size: 8px;
    font-weight: 700;
    letter-spacing: .18em;
}

.buttonLogin {
    display: flex;
    width: 100%;
    height: 54px;
    margin-top: 13px;
    padding: 0 20px 0 22px;
    align-items: center;
    justify-content: space-between;
    border: 1px solid var(--pi-black);
    border-radius: 0;
    background: var(--pi-black);
    color: var(--pi-white);
    font-size: 14px;
    font-weight: 650;
    line-height: 52px;
    text-align: left;
    transition: background .2s ease, border-color .2s ease, transform .2s ease;
}

.buttonLogin i {
    font-family: Arial, sans-serif;
    font-size: 19px;
    font-style: normal;
    font-weight: 400;
    transition: transform .2s ease;
}

.buttonLogin:hover {
    border-color: var(--pi-red);
    background: var(--pi-red);
}

.buttonLogin:hover i {
    transform: translateX(4px);
}

.buttonLogin:focus-visible {
    outline: 3px solid rgba(213, 0, 28, .24);
    outline-offset: 3px;
}

.buttonLogin:active {
    transform: translateY(1px);
}

.buttonLogin:disabled {
    cursor: wait;
    border-color: #777;
    background: #777;
}

.loginLegal,
.loginCopyright {
    margin: 0;
    color: #85827d;
    font-size: 10px;
    font-weight: 400;
    line-height: 1.6;
}

.loginLegal {
    margin-top: 25px;
    padding-top: 18px;
    border-top: 1px solid #d1ceca;
}

.loginCopyright {
    margin-top: 4px;
}

@media (max-width: 980px) {
    .loginShell {
        grid-template-columns: minmax(300px, .8fr) minmax(430px, 1.2fr);
    }

    .loginVisual {
        padding: 36px;
    }

    .loginVisualCopy {
        width: 100%;
    }

    .visualDescription {
        max-width: 350px;
    }

    .loginVisualFooter > span:first-child {
        display: none;
    }
}

@media (max-width: 760px) {
    .loginShell {
        display: block;
        min-height: 100vh;
        background: var(--pi-paper);
    }

    .loginVisual {
        display: none;
    }

    .loginCard {
        min-height: 100vh;
        padding: 30px 24px 36px;
        place-items: center;
    }

    .loginPanelInner {
        width: min(100%, 440px);
    }

    .mobileBrand {
        display: flex;
        align-items: center;
        gap: 12px;
        margin-bottom: 64px;
    }

    .mobileBrand .brandMonogram {
        flex-basis: 38px;
        width: 38px;
        height: 38px;
    }

    .mobileBrand .brandMonogram img {
        top: -4px;
        left: -7px;
        width: 52px;
    }

    .mobileBrand strong {
        color: var(--pi-black);
        font-family: Arial, sans-serif;
        font-size: 10px;
        font-weight: 700;
        letter-spacing: .24em;
    }
}

@media (max-width: 420px) {
    .loginCard {
        padding-right: 20px;
        padding-left: 20px;
    }

    .mobileBrand {
        margin-bottom: 48px;
    }

    .loginPanelHeader {
        margin-bottom: 30px;
    }

    .loginPanelHeader h2 {
        font-size: 30px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .visualDepthScene {
        transform: none !important;
    }

    .visualDepthDrift,
    .visualDepthRing,
    .visualDepthLine,
    .depthLineAccent,
    .depthLineAccent::after,
    .otpPanel.isVisible .otpPanelInner {
        animation: none !important;
    }

    .loginPage *,
    .loginPage *::before,
    .loginPage *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
    }
}
