.auth-container {
    display: flex;
    flex-direction: column;
    background-color: #ffffff;
    position: relative;
    min-height: unset;
    height: 100%;
    overflow: hidden;

    .auth-content-area {
        flex: 1;
        margin: 0 20px;
        display: flex;
        flex-direction: column;

        .auth-logo-section {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 14px;
            min-height: 0;

            .auth-logo-image {
                width: 262px;
                height: auto;
            }

            .auth-tagline {
                font-weight: var(--fontWeight-medium);
                font-size: 20px;
                line-height: 28px;
                color: #616161;
                text-align: center;
            }
        }

        .auth-title {
            font-size: 24px;
            font-weight: var(--fontWeight-medium);
            color: #212121;
            line-height: 1.4;
            margin-top: 38px;
            margin-bottom: 64px;
            overflow: hidden;
            max-height: 120px;
            transition: opacity 0.3s ease-out, transform 0.3s ease-out, max-height 0.3s ease-out, margin 0.3s ease-out;

            &.fade-out-up {
                opacity: 0;
                transform: translateY(-12px);
                max-height: 0;
                margin-top: 0;
                margin-bottom: 0;
            }

            /* 회원가입 완료 메인 콘텐츠 */
            .auth-completed-badge {
                display: block;
                width: fit-content;
                padding: 2px 12px;
                border-radius: 12px;
                background: var(--primary-color);
                color: var(--white-color);
                font-size: 14px;
                font-weight: 700;
                margin-bottom: 12px;
                text-align: center;
                margin-left: auto;
                margin-right: auto;
                line-height: 21px;
            }

            .auth-completed-count {
                color: var(--primary-color);
            }
        }

        .auth-title-desc {
            font-weight: var(--fontWeight-normal);
            font-size: 16px;
            line-height: 1.6;
            color: var(--gray5-color);
            margin-bottom: 44px;
            overflow: hidden;
            max-height: 80px;
            transition: opacity 0.3s ease-out, transform 0.3s ease-out, max-height 0.3s ease-out, margin 0.3s ease-out;

            &.fade-out-up {
                opacity: 0;
                transform: translateY(-12px);
                max-height: 0;
                margin-bottom: 0;
            }
        }

        .auth-title.fade-out-up + form,
        .auth-title.fade-out-up + .auth-input-group,
        .auth-title-desc.fade-out-up + .auth-input-group {
            margin-top: 38px;
        }

        form,
        .auth-title + .auth-input-group,
        .auth-title-desc + .auth-input-group {
            transition: margin-top 0.3s ease-out;
        }

        .auth-input-group {
            margin-bottom: 8px;

            &.auth-password-group {
                max-height: 0;
                opacity: 0;
                overflow: hidden;
                visibility: hidden;
                transform: translateY(-12px);
                transition: max-height 0.3s ease-out, opacity 0.3s ease-out, transform 0.3s ease-out, visibility 0.3s;

                &.visible {
                    max-height: 150px;
                    opacity: 1;
                    visibility: visible;
                    transform: translateY(0);
                }
            }

            .auth-input-label {
                font-size: 14px;
                font-weight: var(--fontWeight-medium);
                color: var(--gray6-color);
                margin-bottom: 8px;
                display: block;
            }

            .auth-input-wrapper {
                position: relative;

                .auth-input {
                    width: 100%;
                    border: none;
                    border-bottom: 2px solid #212121;
                    font-size: 24px;
                    font-weight: var(--fontWeight-medium);
                    color: #212121;
                    background: transparent;
                    outline: none;
                    transition: border-color 0.2s ease;

                    &::placeholder {
                        color: var(--gray2-color);
                    }

                    &:focus {
                        border-bottom-color: var(--primary-color);
                    }

                    &.error {
                        border-bottom-color: var(--red-color);
                    }
                }

                .auth-input-password {
                    padding-right: 40px;
                    ime-mode: disabled;
                    -webkit-ime-mode: disabled;
                    -moz-ime-mode: disabled;
                    -ms-ime-mode: disabled;
                }

                .auth-toggle-password {
                    position: absolute;
                    right: 4px;
                    top: 50%;
                    transform: translateY(-50%);
                    width: 32px;
                    height: 32px;
                    display: flex;
                    align-items: center;
                    justify-content: center;
                    background: white;
                    border: none;
                    cursor: pointer;
                    padding: 0;

                    svg,
                    img {
                        width: 24px;
                        height: 24px;
                    }

                    .auth-icon-eye {
                        filter: brightness(0) saturate(100%) invert(71%) sepia(0%) saturate(0%) hue-rotate(180deg) brightness(92%) contrast(87%);
                        transition: filter 0.15s ease;

                        &.active {
                            filter: brightness(0) saturate(100%) invert(47%) sepia(98%) saturate(1066%) hue-rotate(190deg) brightness(92%) contrast(86%);
                        }
                    }
                }

                .auth-toggle-password-btn {
                    position: absolute;
                    right: 0;
                    bottom: 8px;
                    width: 32px;
                    height: 32px;
                    display: flex;
                    align-items: center;
                    justify-content: center;
                    background: transparent;
                    border: none;
                    cursor: pointer;
                    padding: 0;

                    img {
                        width: 24px;
                        height: 24px;
                    }
                }
            }

            .auth-error-message {
                font-size: 14px;
                color: var(--red-color);
                margin-top: 12px;
                min-height: 21px;
            }
        }

        .auth-timer {
            font-weight: var(--fontWeight-medium);
            font-size: 14px;
            line-height: 1.34;
            color: var(--primary-color);

            &.hidden {
                display: none;
            }

            &.expired {
                color: var(--red-color) !important;
            }
        }

        .auth-timer-loading {
            display: flex;
            align-items: center;
            gap: 8px;
            height: 20px;

            &.hidden {
                display: none;
            }

            .auth-loading-dot {
                width: 5px;
                height: 5px;
                border-radius: 50%;
                background-color: #CDE2F8;
                animation: auth-wave 0.9s ease-in-out infinite;

                &:nth-child(1) {
                    animation-delay: 0s;
                }

                &:nth-child(2) {
                    animation-delay: 0.3s;
                }

                &:nth-child(3) {
                    animation-delay: 0.6s;
                }
            }
        }

        .auth-timer-success {
            display: flex;
            align-items: center;
            gap: 4px;
            color: var(--primary-color);
            font-weight: var(--fontWeight-medium);
            font-size: 14px;
            line-height: 1.34;

            &.hidden {
                display: none;
            }
        }

        .auth-code-input-container {
            display: flex;
            justify-content: space-between;
            margin-top: 12px;
            width: 100%;

            .auth-code-input {
                width: 54px;
                height: 66px;
                border: 2px solid var(--gray3-color);
                border-radius: 8px !important;
                text-align: center;
                font-weight: var(--fontWeight-medium);
                font-size: 26px;
                color: #212121;
                outline: none;
                background: transparent;
                -webkit-appearance: none;
                -moz-appearance: textfield;

                &:focus {
                    border-color: var(--primary-color);
                }

                &::selection {
                    background-color: #fff;
                    color: #212121;
                }

                &::-webkit-outer-spin-button,
                &::-webkit-inner-spin-button {
                    -webkit-appearance: none;
                    margin: 0;
                }

                &.filled {
                    border-color: var(--primary2-color);
                }

                &.error {
                    border-color: var(--red2-color);
                }

                &.expired {
                    border-color: var(--gray3-color);
                    color: var(--gray3-color);
                }

                &.verified {
                    border-color: var(--primary-color);
                }

                &.shake {
                    animation: auth-shake 0.4s ease-in-out;
                }

                @keyframes auth-shake {
                    0%, 100% {
                        transform: translateX(0);
                    }
                    20% {
                        transform: translateX(-6px);
                    }
                    40% {
                        transform: translateX(6px);
                    }
                    60% {
                        transform: translateX(-4px);
                    }
                    80% {
                        transform: translateX(4px);
                    }
                }
            }
        }

        .auth-resend-container {
            display: flex;
            justify-content: flex-end;
            margin-top: 12px;
            width: 100%;

            .auth-btn-resend {
                display: flex;
                align-items: center;
                justify-content: center;
                background-color: var(--gray05-color);
                border-radius: 6px;
                border: none;
                font-weight: var(--fontWeight-medium);
                font-size: 14px;
                line-height: 1.34;
                color: var(--gray6-color);
                cursor: pointer;
                padding: 4px 10px;

                &.active {
                    background-color: var(--primary-color);
                    color: #ffffff;
                }
            }
        }

        .auth-router-accounts {
            display: flex;
            flex-direction: column;
            gap: 12px;

            .auth-router-account {
                display: flex;
                align-items: center;
                gap: 14px;
                height: 84px;
                padding: 10px 18px;
                background-color: #ffffff;
                border: 1px solid var(--gray3-color);
                border-radius: 10px;
                cursor: pointer;
                transition: border-color 0.15s ease, background-color 0.15s ease;

                &:hover {
                    border-color: var(--primary2-color);
                }

                &.selected {
                    border-color: var(--primary-color);
                    background-color: rgba(205, 226, 248, 0.3);
                }

                .auth-router-profile {
                    display: flex;
                    align-items: center;
                    justify-content: center;
                    width: 52px;
                    height: 52px;
                    border-radius: 50%;
                    background-color: var(--gray1-color);
                    flex-shrink: 0;
                    overflow: hidden;

                    img {
                        width: 100%;
                        height: 100%;
                        object-fit: cover;
                    }

                    &.has-image {
                        background-color: transparent;
                    }
                }

                .auth-router-info {
                    display: flex;
                    flex-direction: column;
                    gap: 4px;
                    justify-content: center;
                    flex-shrink: 0;

                    .auth-router-email {
                        font-weight: var(--fontWeight-normal);
                        font-size: 16px;
                        line-height: 1.6;
                        color: var(--gray8-color);
                    }

                    .auth-router-badge {
                        display: inline-flex;
                        align-items: center;
                        justify-content: center;
                        width: fit-content;
                        height: 31px;
                        padding: 5px 12px;
                        background-color: #ffffff;
                        border-radius: 100px;
                        font-weight: var(--fontWeight-bold);
                        font-size: 12px;
                        line-height: 1.34;
                        letter-spacing: 0.36px;
                        color: var(--primary-color);
                        white-space: nowrap;
                    }
                }
            }
        }

        .auth-email-completed-illust {
            display: flex;
            justify-content: center;
            align-items: center;
            margin-top: 40px;

            .auth-email-completed-circle {
                position: relative;
                width: 280px;
                height: 280px;
                border-radius: 50%;
                background-color: #f5f5f5;
                display: flex;
                justify-content: center;
                align-items: center;

                .auth-email-completed-badge {
                    position: absolute;
                    top: -14px;
                    right: -14px;
                    width: 38px;
                    height: 38px;
                    border-radius: 50%;
                    background: var(--primary-color);
                    display: flex;
                    justify-content: center;
                    align-items: center;
                }
            }
        }

        .auth-completed-carousel {
            display: flex;
            flex-direction: column;
            gap: 14px;
            width: 100vw;
            overflow: hidden;

            .auth-completed-slider {
                display: flex;
                width: 100%;
                overflow: hidden;

                .auth-completed-track {
                    display: flex;
                    gap: 32px;
                    width: max-content;
                    will-change: transform;

                    img {
                        height: 276px;
                        width: auto;
                        flex-shrink: 0;
                    }
                }
            }
        }
    }

    .auth-btn-group {
        display: flex;
        flex-direction: column;
        gap: 10px;
        width: 100%;

        .btn {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 100%;
            height: 56px;
            border-radius: 8px;
            font-weight: var(--fontWeight-medium);
            font-size: 16px;
            line-height: 24px;
            text-decoration: none;

            &.primary {
                background-color: var(--primary-color);
                color: #ffffff;
            }

            &.light {
                background-color: var(--gray05-color);
                color: var(--gray6-color);
            }

            &.secondary {
                background-color: var(--gray-color);
                color: var(--white-color);
            }
        }

        .auth-email-completed-footer-text {
            text-align: center;
            font-size: 16px;
            font-weight: var(--fontWeight-medium);
            line-height: 1.6;
            color: var(--gray4-color);
            margin-bottom: 20px;
        }
    }

    .auth-bottom-link {
        text-align: center;
        margin-top: 32px;
        margin-bottom: 36px;
        font-size: 14px;
        line-height: 1.34;
        display: flex;
        flex-direction: column;
        gap: 6px;
        transition: none;

        .text {
            font-weight: var(--fontWeight-normal);
            color: var(--gray5-color);
            text-align: center;
        }

        .link {
            font-size: 14px;
            font-weight: var(--fontWeight-medium);
            color: var(--gray6-color);
            text-decoration: underline;
            text-align: center;
        }

        &.keyboard-up {
            position: fixed;
            left: 0;
            right: 0;
            z-index: 100;
            background: #fff;
            margin: 0;
            padding: 12px 20px 30px 20px;
        }
    }

    .auth-bottom-button {
        display: flex;
        width: 100%;

        button {
            width: 100%;
            height: 52px;
            text-align: center;
            font-size: 16px;
            font-style: normal;
            font-weight: var(--fontWeight-medium);
            line-height: 160%;

            &.primary {
                color: white;
                background-color: var(--primary-color);
            }
        }
    }
}

.auth-terms-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 50%;
    width: 100%;
    height: 100%;
    z-index: 100;
    transform: translate(-50%, 0%);

    &.active {
        display: block;
    }

    &.closing .auth-terms-modal-content {
        animation: auth-slideDown 0.25s ease-in forwards;
    }

    .auth-terms-item {
        display: flex;
        align-items: center;
        justify-content: space-between;
        cursor: pointer;
        gap: 0;

        &.auth-terms-item-no-arrow {
            justify-content: flex-start;
            gap: 14px;
        }

    }

    .auth-terms-modal-overlay {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        border: none;
        padding: 0;
        margin: 0;
        cursor: pointer;
    }

    .auth-terms-modal-content {
        position: absolute;
        bottom: 0;
        left: 50%;
        transform: translateX(-50%);
        width: 100%;
        max-width: 390px;
        background: #fff;
        border-radius: 20px 20px 0 0;
        padding: 36px 20px;
        animation: auth-slideUp 0.3s ease-out;

        .auth-terms-modal-title {
            font-weight: var(--fontWeight-bold);
            font-size: 18px;
            line-height: 1.34;
            color: #212121;
            margin-bottom: 22px;
        }

        .auth-terms-all-agree {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 18px 18px 18px 24px;
            background: var(--gray0-color);
            border: 1px solid var(--gray1-color);
            border-radius: 12px;
            margin-bottom: 18px;
            cursor: pointer;

            .auth-terms-checkbox {
                display: flex;
                width: 26px;
                height: 26px;
                border-radius: 50%;
                border: none;
                background: var(--gray4-color);
                align-items: center;
                justify-content: center;
                flex-shrink: 0;

                &.checked {
                    background: #358AE3;
                }

                img {
                    width: 13px;
                    height: 9px;
                    display: block;
                    filter: brightness(0) invert(1);
                }
            }

            .auth-terms-all-text {
                font-weight: var(--fontWeight-medium);
                font-size: 14px;
                line-height: 1.34;
                color: #212121;
            }
        }

        .auth-terms-list {
            display: flex;
            flex-direction: column;
            gap: 16px;
            padding: 0 29px;
            margin-bottom: 22px;

            .auth-terms-item {
                .auth-terms-item-left {
                    display: flex;
                    align-items: center;
                    gap: 14px;

                    .auth-terms-hidden-checkbox {
                        position: absolute;
                        opacity: 0;
                        width: 0;
                        height: 0;
                        pointer-events: none;

                        &:checked + .auth-terms-checkbox {
                            background: var(--primary-color);
                        }

                    }

                    .auth-terms-item-check {
                        display: flex;
                        width: 13px;
                        height: 9px;
                        align-items: center;
                        justify-content: center;
                        flex-shrink: 0;

                        &:has(+ .auth-terms-optional-content) {
                            align-self: flex-start;
                            margin-top: 5px;
                        }

                        img {
                            width: 13px;
                            height: 9px;
                        }
                    }

                    .auth-terms-item-text {
                        font-weight: var(--fontWeight-medium);
                        font-size: 14px;
                        line-height: 1.34;
                        color: #212121;
                    }

                    .auth-terms-optional-content {
                        display: flex;
                        flex-direction: column;
                        gap: 2px;
                        flex: 1;

                        .auth-terms-optional-desc {
                            display: block;
                            font-weight: var(--fontWeight-normal);
                            font-size: 12px;
                            line-height: 18px;
                            color: var(--gray-color);
                        }
                    }
                }

                .auth-terms-item-arrow {
                    width: 7px;
                    height: 13px;
                    display: flex;
                    align-items: center;
                    justify-content: center;

                    img {
                        width: 7px;
                        height: 13px;
                        filter: brightness(0) saturate(100%) invert(79%) sepia(0%) saturate(0%) hue-rotate(180deg) brightness(93%) contrast(85%);
                    }
                }
            }
        }

        .auth-terms-submit-btn {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 100%;
            height: 56px;
            background: var(--primary-color);
            border-radius: 12px;
            border: none;
            font-weight: var(--fontWeight-medium);
            font-size: 16px;
            line-height: 24px;
            color: #fff;
            cursor: pointer;

            &:disabled {
                background: var(--gray2-color);
                cursor: not-allowed;
            }
        }
    }

}

.auth-terms-detail-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 50%;
    width: 100%;
    height: 100%;
    z-index: 110;
    transform: translate(-50%, 0%);

    &.active {
        display: block;
    }

    &.closing .auth-terms-detail-content {
        animation: auth-detailSlideDown 0.25s ease-out forwards;
    }

    .auth-terms-detail-overlay {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        border: none;
        padding: 0;
        margin: 0;
        cursor: pointer;
    }

    .auth-terms-detail-content {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        height: 85vh;
        max-height: 85vh;
        background: #fff;
        border-radius: 20px 20px 0 0;
        display: flex;
        flex-direction: column;
        animation: auth-detailSlideUp 0.25s ease-out;
        max-width: 390px;
        margin: 0 auto;

        .auth-terms-detail-body {
            flex: 1;
            overflow: hidden;
            border-radius: 20px 20px 0 0;

            iframe {
                width: 100%;
                height: 100%;
                border: none;
            }
        }

        .auth-terms-detail-footer {
            flex-shrink: 0;
            background: white;
            padding: 10px 20px 20px;
            box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.12);

            .auth-terms-detail-confirm-btn {
                width: 100%;
                height: 56px;
                background-color: var(--primary-color) !important;
                color: white;
                border: none;
                border-radius: 12px !important;
                font-size: 16px;
                font-weight: var(--fontWeight-medium);
                line-height: 24px;
                cursor: pointer;
            }
        }
    }

}

.auth-email-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    max-height: 183px;
    background: #ffffff;
    border: 1px solid var(--gray2-color);
    border-radius: 8px;
    box-shadow: 0 4px 10px -6px rgba(0, 0, 0, 0.16);
    margin-top: 8px;
    padding: 0 0 0 16px;
    z-index: 10;
    display: none;

    &.active {
        display: flex;
    }

    .auth-email-dropdown-content {
        flex: 1;
        display: flex;
        flex-direction: column;
        gap: 2px;
        overflow-y: auto;
        scrollbar-width: none !important;
        -ms-overflow-style: none !important;
        padding-right: 10px;

        &::-webkit-scrollbar {
            display: none !important;
        }

        .auth-email-dropdown-item {
            display: flex;
            align-items: center;
            min-height: 36px;
            flex-shrink: 0;
            font-weight: var(--fontWeight-normal);
            font-size: 16px;
            line-height: 1.6;
            letter-spacing: 0.32px;
            color: #212121;
            cursor: pointer;
            transition: background-color 0.15s;
            border-radius: 4px;
            user-select: none;
            -webkit-user-select: none;

            &:first-child {
                margin-top: 10px;
            }

            &:last-child {
                margin-bottom: 10px;
            }

            .email-local {
                color: var(--gray4-color);
            }

            .email-domain {
                color: #212121;
            }
        }
    }

    .auth-email-scrollbar {
        width: 6px;
        margin: 10px 10px 10px 4px;
        position: relative;
        flex-shrink: 0;

        .auth-email-scrollbar-thumb {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            background: var(--gray05-color);
            border-radius: 999px;
            cursor: pointer;
            transition: background-color 0.15s;

            &:hover {
                background: #e0e0e0;
            }

            &.scrolling {
                background: var(--primary1-color);
            }
        }
    }
}

/* 회원가입 완료 스플래시 */
.register-splash {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    background: #fff;
    opacity: 0;
    transition: opacity 0.5s ease;
    max-width: 390px;
    margin: 0 auto;
}

.register-splash.fade-in {
    opacity: 1;
    transition: opacity 1s ease;
}

.register-splash.fade-in .register-splash-logo {
    animation: splash-logo-spin-in 1s cubic-bezier(0.8, 0, 0.2, 1) forwards;
}

.register-splash.fade-in .register-splash-text {
    animation: splash-text-up 0.6s ease-out 0.3s forwards;
}

.register-splash.fade-out {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.register-splash.fade-out .register-splash-logo {
    animation: splash-logo-spin-out 0.5s cubic-bezier(0.8, 0, 0.2, 1) forwards;
}

.register-splash.fade-out .register-splash-text {
    animation: splash-text-fade-out-up 0.5s ease-in forwards;
}

.register-splash-logo {
    width: 171px;
    height: 171px;
}

.register-splash-text {
    font-size: 24px;
    font-weight: 700;
    color: #212121;
    text-align: center;
    line-height: 1.34;
    opacity: 0;
    transform: translateY(20px);
}

.register-main {
    transition: opacity 0.5s ease;
}

@keyframes splash-logo-spin-in {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes splash-logo-spin-out {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes splash-text-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes splash-text-fade-out-up {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

@keyframes auth-wave {
    0%, 100% {
        background-color: #CDE2F8;
    }
    30%, 50% {
        background-color: #358AE3;
    }
}

@keyframes auth-slideUp {
    from {
        transform: translateX(-50%) translateY(100%);
    }
    to {
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes auth-slideDown {
    from {
        transform: translateX(-50%) translateY(0);
    }
    to {
        transform: translateX(-50%) translateY(100%);
    }
}

@keyframes auth-detailSlideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

@keyframes auth-detailSlideDown {
    from {
        transform: translateY(0);
    }
    to {
        transform: translateY(100%);
    }
}
